Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

SVG Preview (Scaled)

Preview of https://hg.mozilla.org/mozilla-central/raw-file/tip/testing/web-platform/tests/svg/struct/scripted/svg-getIntersectionList-006.svg
<title>getIntersectionList() with &lt;use></title>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<defs>
<g id="conn">
<circle cx="0" cy="0" r="20"/>
</g>
</defs>
<circle cx="65" cy="50" r="20" fill="blue"/>
<use href="#conn" x="50" y="50" fill="red"/>
<script>
function getMatchingLocalNames(x, y) {
const svg = document.documentElement;
const rect = Object.assign(svg.createSVGRect(), {x, y, width: 1, height: 1});
const elems = svg.getIntersectionList(rect, null);
return Array.from(elems).map(e => e.localName).sort();
}
test(t => {
assert_array_equals(getMatchingLocalNames(50, 60), ['circle', 'use']);
assert_array_equals(getMatchingLocalNames(0, 0), []);
});
</script>
</svg>