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

Unified Diff: third_party/WebKit/LayoutTests/svg/hittest/rotated-text.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/hittest/rotated-text-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/svg/hittest/rotated-text.svg
diff --git a/third_party/WebKit/LayoutTests/svg/hittest/rotated-text.svg b/third_party/WebKit/LayoutTests/svg/hittest/rotated-text.svg
new file mode 100644
index 0000000000000000000000000000000000000000..3ad3fcdcafe44f55abdb0aaa58679262dfddf220
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/hittest/rotated-text.svg
@@ -0,0 +1,45 @@
+<svg onload="runTest()" width="500" height="150" viewBox="0 0 500 150" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <script src="../../resources/ahem.js"></script>
+ <rect id="background" width="100%" height="100%" fill="blue" />
+ <text id="upright" x="1em" y="1em">A B</text>
+ <text id="rotated" x="1em" y="3em" rotate="45 -45 -45 0">A B C</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();
+
+ var uprightText = document.getElementById("upright");
+ var rotatedText = document.getElementById("rotated");
+ var background = document.getElementById("background");
+
+ // (135,25) is within a glyph cell of #upright, (165,25) is not.
+ if (document.elementFromPoint(135, 25) === uprightText && document.elementFromPoint(165, 25) === background)
+ uprightText.textContent = "PASS";
+ else
+ uprightText.textContent = "FAIL";
+
+ // (45,100) and (150,110) are both outside the rotated glyph cells of #rotated.
+ // (60,140), (125,110), and (220,110) are all inside the rotated glyph cells of #rotated.
+ if (document.elementFromPoint(45, 100) === background
+ && document.elementFromPoint(150, 110) === background
+ && document.elementFromPoint(60, 140) === rotatedText
+ && document.elementFromPoint(125, 110) === rotatedText
+ && document.elementFromPoint(220, 110) === rotatedText)
+ rotatedText.textContent = "PASS";
+ else
+ rotatedText.textContent = "FAIL";
+ }
+ ]]>
+ </script>
+ </defs>
+</svg>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/hittest/rotated-text-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698