diff options
Diffstat (limited to 'testing/web-platform/tests/svg/struct/scripted/svg-getIntersectionList-006.svg')
-rw-r--r-- | testing/web-platform/tests/svg/struct/scripted/svg-getIntersectionList-006.svg | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/web-platform/tests/svg/struct/scripted/svg-getIntersectionList-006.svg b/testing/web-platform/tests/svg/struct/scripted/svg-getIntersectionList-006.svg new file mode 100644 index 0000000000..a7b9465013 --- /dev/null +++ b/testing/web-platform/tests/svg/struct/scripted/svg-getIntersectionList-006.svg @@ -0,0 +1,29 @@ +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:h="http://www.w3.org/1999/xhtml"> + <title>getIntersectionList() with <use></title> + <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#__svg__SVGSVGElement__getIntersectionList"/> + <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> |