blob: 14c84ffeace3ceb06af7cca7310a7dcf0ba9790e [file] [log] [blame]
<!DOCTYPE html>
<title>elementFromPoint(...) on &lt;svg:text> with fill=none but fill=black descendants</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/ahem.js"></script>
<style>
body, html {
padding: 0;
margin: 0;
}
</style>
<svg width="400" height="400">
<text x="50" y="50" font-family="Ahem" font-size="50" fill="none">
MM<tspan fill="black">MM</tspan>MM
</text>
</svg>
<script>
test(function() {
let root = document.querySelector('svg');
let tspan = document.querySelector('tspan');
let x = 75;
for (; x < 175; x += 50)
assert_equals(document.elementFromPoint(x, 25), root, `element @ (${x}, 25)`);
for (; x < 275; x += 50)
assert_equals(document.elementFromPoint(x, 25), tspan, `element @ (${x}, 25)`);
for (; x < 375; x += 50)
assert_equals(document.elementFromPoint(x, 25), root, `element @ (${x}, 25)`);
});
</script>