summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/svg/shapes/scripted/stroke-dashes-hit-at-high-scale.svg
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/svg/shapes/scripted/stroke-dashes-hit-at-high-scale.svg
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/svg/shapes/scripted/stroke-dashes-hit-at-high-scale.svg')
-rw-r--r--testing/web-platform/tests/svg/shapes/scripted/stroke-dashes-hit-at-high-scale.svg27
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/web-platform/tests/svg/shapes/scripted/stroke-dashes-hit-at-high-scale.svg b/testing/web-platform/tests/svg/shapes/scripted/stroke-dashes-hit-at-high-scale.svg
new file mode 100644
index 0000000000..b57a9e0aa7
--- /dev/null
+++ b/testing/web-platform/tests/svg/shapes/scripted/stroke-dashes-hit-at-high-scale.svg
@@ -0,0 +1,27 @@
+<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" viewBox="0 0 36 36" width="600" height="600">
+ <title>Strokes w/dashes are properly hit-tested, even at large scale factors</title>
+ <h:script src="/resources/testharness.js"/>
+ <h:script src="/resources/testharnessreport.js"/>
+ <metadata>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/shapes.html#CircleElement"/>
+ <h:link rel="help" href="https://svgwg.org/svg2-draft/painting.html#StrokeProperties"/>
+ </metadata>
+ <circle id="circle" cx="6" cy="10" r="5" stroke="blue" stroke-width="1" stroke-dasharray="10 21.4159" fill="none"/>
+ <script>
+ <![CDATA[
+ test(function() {
+ let svg = document.getElementById("svg");
+ let circle = document.getElementById("circle");
+ let hitTest = function(x, y) {
+ return document.elementFromPoint(
+ x * svg.width.baseVal.value / svg.viewBox.baseVal.width,
+ y * svg.height.baseVal.value / svg.viewBox.baseVal.height);
+ }
+ assert_equals(hitTest(11, 10), circle, "hit-test the beginning of the dash (t=0)");
+ assert_equals(hitTest(8.70, 14.21), circle, "hit-test the middle of the dash (t=5)");
+ assert_equals(hitTest(4.10, 14.63), circle, "hit-test the end of the dash (t=9.8)");
+ assert_equals(hitTest(3.74, 14.46), svg, "hit-test past the end of the dash (t=10.2)");
+ });
+ ]]>
+ </script>
+</svg>