Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/svg/css/cursor-hotspot-override-from-css.html |
| diff --git a/third_party/WebKit/LayoutTests/svg/css/cursor-hotspot-override-from-css.html b/third_party/WebKit/LayoutTests/svg/css/cursor-hotspot-override-from-css.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9b0de4cd065a7e9e201121eaeba4c7b148fdf5be |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/svg/css/cursor-hotspot-override-from-css.html |
| @@ -0,0 +1,37 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<svg xmlns="http://www.w3.org/2000/svg" |
| + xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0"> |
| + <rect id="rectWithCursorWithXYOnSVGOnly" style="cursor:url(#cursorWithXY), auto;" x="50" y="50" width="100" height="100" fill="green" /> |
| + <rect id="rectWithCursorWithXYOnSVGAndCSS" style="cursor:url(#cursorWithXY) 30 40, auto;" x="200" y="50" width="100" height="100" fill="green" /> |
| + <rect id="rectWithCursorWithXYInCSSOnly" style="cursor:url(#cursorWithNoXY) 30 40, auto;" x="350" y="50" width="100" height="100" fill="green" /> |
| + <rect id="rectWithCursorWithNoXY" style="cursor:url(#cursorWithNoXY), auto;" x="500" y="50" width="100" height="100" fill="green" /> |
| + <cursor id="cursorWithNoXY" xlink:href="file:///icon1.ico" /> |
| + <cursor id="cursorWithXY" xlink:href="file:///icon1.ico" x="10" y="20" /> |
| +</svg> |
| +<script> |
| +test(function() { |
| + assert_equals(rectWithCursorWithXYOnSVGOnly.style.cursor, 'url("#cursorWithXY"), auto'); |
| + // TODO(sashab): There is currently no way to check whether the correct |
|
Timothy Loh
2016/05/31 05:04:35
All the expectations in the test file should be th
|
| + // hotspot co-ordinates were computed, since getComputedStyle(element).cursor |
| + // doesn't return a string containing the co-ordinates. Update this test |
| + // once the computed style includes the hotspot co-ordinates. |
| + assert_equals(getComputedStyle(rectWithCursorWithXYOnSVGOnly).cursor, 'url("file:///icon1.ico"), auto'); |
| +}, "Setting the hotspot on the SVG and not CSS"); |
| + |
| +test(function() { |
| + assert_equals(rectWithCursorWithXYOnSVGAndCSS.style.cursor, 'url("#cursorWithXY") 30 40, auto'); |
| + assert_equals(getComputedStyle(rectWithCursorWithXYOnSVGAndCSS).cursor, 'url("file:///icon1.ico"), auto'); |
| +}, "Setting the hotspot in both CSS and SVG"); |
| + |
| +test(function() { |
| + assert_equals(rectWithCursorWithXYInCSSOnly.style.cursor, 'url("#cursorWithNoXY") 30 40, auto'); |
| + assert_equals(getComputedStyle(rectWithCursorWithXYInCSSOnly).cursor, 'url("file:///icon1.ico"), auto'); |
| +}, "Setting the hotspot in CSS but not the SVG"); |
| + |
| +test(function() { |
| + assert_equals(rectWithCursorWithNoXY.style.cursor, 'url("#cursorWithNoXY"), auto'); |
| + assert_equals(getComputedStyle(rectWithCursorWithNoXY).cursor, 'url("file:///icon1.ico"), auto'); |
| +}, "Not setting the hotspot"); |
| +</script> |