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 // From the CSS3 UI spec: | |
16 // If the values are unspecified, then the intrinsic hotspot defined inside
the image resource itself is used. | |
17 assert_equals(rectWithCursorWithXYOnSVGOnly.style.cursor, 'url("#cursorWithX
Y"), auto'); | |
18 assert_equals(getComputedStyle(rectWithCursorWithXYOnSVGOnly).cursor, 'url("
file:///icon1.ico") 10 20, auto'); | |
19 }, "Setting the hotspot on the SVG and not CSS"); | |
20 | |
21 test(function() { | |
22 assert_equals(rectWithCursorWithXYOnSVGAndCSS.style.cursor, 'url("#cursorWit
hXY") 30 40, auto'); | |
23 assert_equals(getComputedStyle(rectWithCursorWithXYOnSVGAndCSS).cursor, 'url
("file:///icon1.ico") 30 40, auto'); | |
24 }, "Setting the hotspot in both CSS and SVG"); | |
25 | |
26 test(function() { | |
27 assert_equals(rectWithCursorWithXYInCSSOnly.style.cursor, 'url("#cursorWithN
oXY") 30 40, auto'); | |
28 assert_equals(getComputedStyle(rectWithCursorWithXYInCSSOnly).cursor, 'url("
file:///icon1.ico") 30 40, auto'); | |
29 }, "Setting the hotspot in CSS but not the SVG"); | |
30 | |
31 test(function() { | |
32 // From the CSS3 UI spec: | |
33 // If both the values are unspecific and the referenced cursor has no define
d hotspot, the effect is as if a value of "0 0" were specified. | |
34 assert_equals(rectWithCursorWithNoXY.style.cursor, 'url("#cursorWithNoXY"),
auto'); | |
35 assert_equals(getComputedStyle(rectWithCursorWithNoXY).cursor, 'url("file://
/icon1.ico") 0 0, auto'); | |
36 }, "Not setting the hotspot"); | |
37 </script> | |
OLD | NEW |