| 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..896164fd11cd2d0be3db9287f23dfbf7004574da
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/svg/hittest/text-with-multiple-tspans.svg
|
| @@ -0,0 +1,45 @@
|
| +<svg onload="runTest()" xmlns="http://www.w3.org/2000/svg" width="300" height="150" viewBox="0 0 300 150">
|
| + <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[
|
| + @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 170,30 is contained within the text's bounding box
|
| + // but not in a painted part so the element should be the background.
|
| + // The point 50,30 is contained within the first tspan's bounding box.
|
| + // 50,60 and 250,60 are both contained within the second tspan's bounding box.
|
| + 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>
|
|
|