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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/hittest/text-with-text-path.svg

Issue 1454623002: Hit test SVG line boxes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup extra debugging code and minor bugs 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
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 <rect id="background" width="100%" height="100%" fill="blue" />
3 <text id="text">
4 <textPath id="textPath" xlink:href="#path">This is text on a path</textP ath>
5 </text>
6 <defs>
7 <path id="path"
8 d="M 100 200
9 C 200 100 300 0 400 100
10 C 500 200 600 300 700 200
11 C 800 100 900 100 900 100" />
12 <style type="text/css">
13 <![CDATA[
14 @font-face {
15 font-family: Ahem;
16 src: url(../../resources/Ahem.ttf);
17 }
18 text {
19 font-family: Ahem;
20 font-size: 40px;
21 }
22 ]]>
23 </style>
24 <script type="text/javascript">
25 <![CDATA[
26 function runTest() {
27 if (window.testRunner)
28 testRunner.dumpAsText();
29
30 // The point at 100,100 is contained within the text's bounding box
31 // but not in a painted part so the element should be the backgr ound.
32 // The point at 160,120 is contained within the text path's boun ding
33 // box.
34 var text = document.getElementById("text");
35 var background = document.getElementById("background");
36 var textPath = document.getElementById("textPath");
37 if (document.elementFromPoint(160, 120) === textPath && document .elementFromPoint(100, 100) === background)
38 text.textContent = "PASS";
39 else
40 text.textContent = "FAIL";
41 }
42 ]]>
43 </script>
44 </defs>
45 </svg>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698