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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <svg onload="runTest()" width="500" height="150" viewBox="0 0 500 150" xmlns="ht tp://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
2 <script src="../../resources/ahem.js"></script>
3 <rect id="background" width="100%" height="100%" fill="blue" />
4 <text id="upright" x="1em" y="1em">A B</text>
5 <text id="rotated" x="1em" y="3em" rotate="45 -45 -45 0">A B C</text>
6 <defs>
7 <style type="text/css">
8 <![CDATA[
9 text {
10 font-family: Ahem;
11 font-size: 40px;
12 }
13 ]]>
14 </style>
15 <script type="text/javascript">
16 <![CDATA[
17 function runTest() {
18 if (window.testRunner)
19 testRunner.dumpAsText();
20
21 var uprightText = document.getElementById("upright");
22 var rotatedText = document.getElementById("rotated");
23 var background = document.getElementById("background");
24
25 // (135,25) is within a glyph cell of #upright, (165,25) is not.
26 if (document.elementFromPoint(135, 25) === uprightText && docume nt.elementFromPoint(165, 25) === background)
27 uprightText.textContent = "PASS";
28 else
29 uprightText.textContent = "FAIL";
30
31 // (45,100) and (150,110) are both outside the rotated glyph cel ls of #rotated.
32 // (60,140), (125,110), and (220,110) are all inside the rotated glyph cells of #rotated.
33 if (document.elementFromPoint(45, 100) === background
34 && document.elementFromPoint(150, 110) === background
35 && document.elementFromPoint(60, 140) === rotatedText
36 && document.elementFromPoint(125, 110) === rotatedText
37 && document.elementFromPoint(220, 110) === rotatedText)
38 rotatedText.textContent = "PASS";
39 else
40 rotatedText.textContent = "FAIL";
41 }
42 ]]>
43 </script>
44 </defs>
45 </svg>
OLDNEW
« 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