Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/svg/css/cursor-hotspot-override-from-css.svg |
| diff --git a/third_party/WebKit/LayoutTests/svg/css/cursor-hotspot-override-from-css.svg b/third_party/WebKit/LayoutTests/svg/css/cursor-hotspot-override-from-css.svg |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..550c2c18375f99a8e6b6bc4f127e011905c80e96 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/svg/css/cursor-hotspot-override-from-css.svg |
| @@ -0,0 +1,53 @@ |
| +<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| + <g> |
| + <g> |
| + <rect id="cursorWithXYOnSVGOnly" style="cursor:url(#cursorWithXY), auto" x="50" y="50" width="100" height="100" fill="green" /> |
| + <rect id="cursorWithXYOnSVGAndCSS" style="cursor:url(#cursorWithXY) 30 40, auto" x="200" y="50" width="100" height="100" fill="green" /> |
| + <rect id="cursorWithXYInCSSOnly" style="cursor:url(#cursorWithNoXY) 30 40, auto" x="350" y="50" width="100" height="100" fill="green" /> |
| + <rect id="cursorWithNoXY" style="cursor:url(#cursorWithNoXY), auto" x="500" y="50" width="100" height="100" fill="green" /> |
| + <text id="result1" x="50" y="200">Not run.</text> |
| + <text id="result2" x="50" y="220">Not run.</text> |
| + <text id="result3" x="50" y="220">Not run.</text> |
| + <text id="result4" x="50" y="220">Not run.</text> |
| + </g> |
| + </g> |
| + <cursor id="cursorWithNoXY" xlink:href="file:///icon1.ico" /> |
| + <cursor id="cursorWithXY" xlink:href="file:///icon1.ico" x="10" y="20" /> |
| + <script> |
| + // Setting the hotspot of a cursor element in CSS should override the hotspot |
| + // set in the SVG. However, if no SVG hotspot is specified, it should default |
| + // to 0 0. |
| + |
| + if (window.testRunner) |
| + testRunner.dumpAsText(); |
| + |
| + var cursorWithXYOnSVGOnly = document.getElementById("cursorWithXYOnSVGOnly"); |
| + var cursorWithXYOnSVGAndCSS = document.getElementById("cursorWithXYOnSVGAndCSS"); |
| + var cursorWithXYInCSSOnly = document.getElementById("cursorWithXYInCSSOnly"); |
| + var cursorWithNoXY = document.getElementById("cursorWithNoXY"); |
| + var result1 = document.getElementById("result1").firstChild; |
| + var result2 = document.getElementById("result2").firstChild; |
| + var result3 = document.getElementById("result3").firstChild; |
| + var result4 = document.getElementById("result4").firstChild; |
| + |
| + if (getComputedStyle(cursorWithXYOnSVGOnly).cursor == "url(\"file:///icon1.ico\") 10 20, auto") |
|
Timothy Loh
2016/05/30 01:38:34
probably worthwhile to have a test or two where yo
sashab
2016/05/31 04:22:37
Oops lol I meant to be testing that the whole time
|
| + result1.data = "PASS"; |
| + else |
| + result1.data = "FAIL - " + getComputedStyle(cursorWithXYOnSVGOnly).cursor; |
| + |
| + if (getComputedStyle(cursorWithXYOnSVGAndCSS).cursor == "url(\"file:///icon1.ico\") 30 40, auto") |
| + result2.data = "PASS"; |
| + else |
| + result2.data = "FAIL - " + getComputedStyle(cursorWithXYOnSVGAndCSS).cursor; |
| + |
| + if (getComputedStyle(cursorWithXYInCSSOnly).cursor == "url(\"file:///icon1.ico\") 30 40, auto") |
| + result3.data = "PASS"; |
| + else |
| + result3.data = "FAIL - " + getComputedStyle(cursorWithXYInCSSOnly).cursor; |
| + |
| + if (getComputedStyle(cursorWithNoXY).cursor == "url(\"file:///icon1.ico\") 0 0, auto") |
| + result4.data = "PASS"; |
| + else |
| + result4.data = "FAIL - " + getComputedStyle(cursorWithNoXY).cursor; |
| + </script> |
| +</svg> |