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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/svg/hittest/text-with-text-path.svg
diff --git a/third_party/WebKit/LayoutTests/svg/hittest/text-with-text-path.svg b/third_party/WebKit/LayoutTests/svg/hittest/text-with-text-path.svg
new file mode 100644
index 0000000000000000000000000000000000000000..a58cd3568d12850fda3dacafa42117d36197eae4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/hittest/text-with-text-path.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">
+ <rect id="background" width="100%" height="100%" fill="blue" />
+ <text id="text">
+ <textPath id="textPath" xlink:href="#path">This is text on a path</textPath>
+ </text>
+ <defs>
+ <path id="path"
+ d="M 100 200
+ C 200 100 300 0 400 100
+ C 500 200 600 300 700 200
+ C 800 100 900 100 900 100" />
+ <style type="text/css">
+ <![CDATA[
+ @font-face {
+ font-family: Ahem;
+ src: url(../../resources/Ahem.ttf);
+ }
+ text {
+ font-family: Ahem;
+ font-size: 40px;
+ }
+ ]]>
+ </style>
+ <script type="text/javascript">
+ <![CDATA[
+ function runTest() {
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ // The point at 100,100 is contained within the text's bounding box
+ // but not in a painted part so the element should be the background.
+ // The point at 160,120 is contained within the text path's bounding
+ // box.
+ var text = document.getElementById("text");
+ var background = document.getElementById("background");
+ var textPath = document.getElementById("textPath");
+ if (document.elementFromPoint(160, 120) === textPath && document.elementFromPoint(100, 100) === background)
+ text.textContent = "PASS";
+ else
+ text.textContent = "FAIL";
+ }
+ ]]>
+ </script>
+ </defs>
+</svg>

Powered by Google App Engine
This is Rietveld 408576698