Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: third_party/WebKit/LayoutTests/svg/hittest/text-with-multiple-tspans.svg

Issue 1454623002: Hit test SVG line boxes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add forgotten test. Sorry, test! Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/svg/hittest/text-with-multiple-tspans.svg
diff --git a/third_party/WebKit/LayoutTests/svg/hittest/text-with-multiple-tspans.svg b/third_party/WebKit/LayoutTests/svg/hittest/text-with-multiple-tspans.svg
new file mode 100644
index 0000000000000000000000000000000000000000..d38fedf523e0235eab335d26ee5238ffefb8bb8c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/hittest/text-with-multiple-tspans.svg
@@ -0,0 +1,40 @@
+<svg onload="runTest()" xmlns="http://www.w3.org/2000/svg" width="300" height="150" viewBox="0 0 300 150">
+ <script src="../../resources/ahem.js"></script>
+ <rect id="background" width="100%" height="100%" fill="blue" />
+ <text id="text">
+ <tspan id="tspan1" x="10" dy="1em">Foo</tspan>
+ <tspan id="tspan2" x="10" dy="1.2em">Foo bar baz</tspan>
+ </text>
+ <defs>
+ <style type="text/css">
+ <![CDATA[
+ text {
+ font-family: Ahem;
+ font-size: 40px;
+ }
+ ]]>
+ </style>
+ <script type="text/javascript">
+ <![CDATA[
+ function runTest() {
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ // (170,30) is within a glyph cell of #tspan1, (170,30) is not.
+ // (50,60) and (250,60) are bothin within a glyph cell of #tspan2.
+ var text = document.getElementById("text");
+ var tspan1 = document.getElementById("tspan1");
+ var tspan2 = document.getElementById("tspan2");
+ var background = document.getElementById("background");
+ if (document.elementFromPoint(50, 30) === tspan1
+ && document.elementFromPoint(170, 30) === background
+ && document.elementFromPoint(50, 60) === tspan2
+ && document.elementFromPoint(250, 60) === tspan2)
+ text.textContent = "PASS";
+ else
+ text.textContent = "FAIL";
+ }
+ ]]>
+ </script>
+ </defs>
+</svg>

Powered by Google App Engine
This is Rietveld 408576698