Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 <svg xmlns="http://www.w3.org/2000/svg" | |
| 5 xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0"> | |
| 6 <rect id="rectWithCursorWithXYOnSVGOnly" style="cursor:url(#cursorWithXY), a uto;" x="50" y="50" width="100" height="100" fill="green" /> | |
| 7 <rect id="rectWithCursorWithXYOnSVGAndCSS" style="cursor:url(#cursorWithXY) 30 40, auto;" x="200" y="50" width="100" height="100" fill="green" /> | |
| 8 <rect id="rectWithCursorWithXYInCSSOnly" style="cursor:url(#cursorWithNoXY) 30 40, auto;" x="350" y="50" width="100" height="100" fill="green" /> | |
| 9 <rect id="rectWithCursorWithNoXY" style="cursor:url(#cursorWithNoXY), auto;" x="500" y="50" width="100" height="100" fill="green" /> | |
| 10 <cursor id="cursorWithNoXY" xlink:href="file:///icon1.ico" /> | |
| 11 <cursor id="cursorWithXY" xlink:href="file:///icon1.ico" x="10" y="20" /> | |
| 12 </svg> | |
| 13 <script> | |
| 14 test(function() { | |
| 15 assert_equals(rectWithCursorWithXYOnSVGOnly.style.cursor, 'url("#cursorWithX Y"), auto'); | |
| 16 // 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
| |
| 17 // hotspot co-ordinates were computed, since getComputedStyle(element).curso r | |
| 18 // doesn't return a string containing the co-ordinates. Update this test | |
| 19 // once the computed style includes the hotspot co-ordinates. | |
| 20 assert_equals(getComputedStyle(rectWithCursorWithXYOnSVGOnly).cursor, 'url(" file:///icon1.ico"), auto'); | |
| 21 }, "Setting the hotspot on the SVG and not CSS"); | |
| 22 | |
| 23 test(function() { | |
| 24 assert_equals(rectWithCursorWithXYOnSVGAndCSS.style.cursor, 'url("#cursorWit hXY") 30 40, auto'); | |
| 25 assert_equals(getComputedStyle(rectWithCursorWithXYOnSVGAndCSS).cursor, 'url ("file:///icon1.ico"), auto'); | |
| 26 }, "Setting the hotspot in both CSS and SVG"); | |
| 27 | |
| 28 test(function() { | |
| 29 assert_equals(rectWithCursorWithXYInCSSOnly.style.cursor, 'url("#cursorWithN oXY") 30 40, auto'); | |
| 30 assert_equals(getComputedStyle(rectWithCursorWithXYInCSSOnly).cursor, 'url(" file:///icon1.ico"), auto'); | |
| 31 }, "Setting the hotspot in CSS but not the SVG"); | |
| 32 | |
| 33 test(function() { | |
| 34 assert_equals(rectWithCursorWithNoXY.style.cursor, 'url("#cursorWithNoXY"), auto'); | |
| 35 assert_equals(getComputedStyle(rectWithCursorWithNoXY).cursor, 'url("file:// /icon1.ico"), auto'); | |
| 36 }, "Not setting the hotspot"); | |
| 37 </script> | |
| OLD | NEW |