3 <script src=
"../../resources/js-test.js"></script>
6 <p id=
"description"></p>
7 <div id=
"console"></div>
9 description("Test the parsing of the cursor property in quirks mode.");
10 function makeCursorRule(rule
)
12 return "cursor: " + rule
+ ";";
15 function testCursorRule(rule
, expected
)
17 var cssText
= makeCursorRule(rule
);
18 if (typeof expected
== 'undefined')
21 expected
= makeCursorRule(expected
);
22 shouldBeEqualToString('roundtripCssRule("' + cssText
+ '")', expected
);
25 function testInvalidCursorRule(rule
)
27 shouldBeEqualToString('roundtripCssRule("' + makeCursorRule(rule
) + '")', '');
30 function roundtripCssRule(cssText
)
32 var div
= document
.createElement("div");
33 div
.setAttribute("style", cssText
);
34 document
.body
.appendChild(div
);
35 var result
= div
.style
.cssText
;
36 document
.body
.removeChild(div
);
40 debug('Test cursor rules which should accept \'hand\' as an alias of \'pointer\'.');
41 testCursorRule('hand', 'pointer');
42 testCursorRule('url(file:///foo.png), hand', 'url(file:///foo.png), pointer');
45 debug('Test invalid cursor rules which shouldn\'t parse at all.');
46 testInvalidCursorRule('url(file:///foo.png), url(file:///foo2.png)');
48 successfullyParsed
= true;