blob: 058ecb513bc8a728055ebd133557ed0b17ff632e [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<p>Test passes if you see a single 100px by 100px green box below.</p>
<div id="host" style="width: 100px; height: 100px;"></div>
<svg>
<defs>
<path id="path1" d="M0,30 L100,30 Z">
</defs>
</svg>
<template>
<svg style="width: 100px; height: 100px;" viewbox="0 0 100 100" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<path id="path1" d="M0,50 L100,50 Z" />
<path id="path2" d="M0,-5 L100,-5 Z" />
</defs>
<rect x="0" y="0" width="100" height="100" fill="green"></rect>
<text>
<textPath href="#path1">FAIL</textPath>
</text>
</svg>
</template>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
const shadowRoot = host.attachShadow({mode: 'closed'});
shadowRoot.appendChild(document.querySelector('template').content.cloneNode(true));
window.onload = () => {
requestAnimationFrame(() => {
shadowRoot.querySelector('textPath').setAttribute('href', '#path2');
if (window.testRunner)
requestAnimationFrame(() => testRunner.notifyDone());
});
}
</script>
</body>
</html>