<!DOCTYPE html>
<title>elementFromPoint(...) on visibility=hidden <svg:text> with visible 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" visibility="hidden">
MM<tspan visibility="visible">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>