Index: LayoutTests/fast/css/cursor-parsing-quirks.html |
diff --git a/LayoutTests/fast/css/cursor-parsing-quirks.html b/LayoutTests/fast/css/cursor-parsing-quirks.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c6493dd42434f5dc9c90fe1b53cb432e240d4a2a |
--- /dev/null |
+++ b/LayoutTests/fast/css/cursor-parsing-quirks.html |
@@ -0,0 +1,52 @@ |
+<html> |
+<head> |
+<script src="../js/resources/js-test-pre.js"></script> |
+</head> |
+<body> |
+<p id="description"></p> |
+<div id="console"></div> |
+<script> |
+description("Test the parsing of the cursor property in quirks mode."); |
+function makeCursorRule(rule) |
+{ |
+ return "cursor: " + rule + ";"; |
+} |
+ |
+function testCursorRule(rule, expected) |
+{ |
+ var cssText = makeCursorRule(rule); |
+ if (typeof expected == 'undefined') |
+ expected = cssText; |
+ else |
+ expected = makeCursorRule(expected); |
+ shouldBeEqualToString('roundtripCssRule("' + cssText + '")', expected); |
+} |
+ |
+function testInvalidCursorRule(rule) |
+{ |
+ shouldBeEqualToString('roundtripCssRule("' + makeCursorRule(rule) + '")', ''); |
+} |
+ |
+function roundtripCssRule(cssText) |
+{ |
+ var div = document.createElement("div"); |
+ div.setAttribute("style", cssText); |
+ document.body.appendChild(div); |
+ var result = div.style.cssText; |
+ document.body.removeChild(div); |
+ return result; |
+} |
+ |
+debug('Test cursor rules which should accept \'hand\' as an alias of \'pointer\'.'); |
+testCursorRule('hand', 'pointer'); |
+testCursorRule('url(file:///foo.png), hand', 'url(file:///foo.png), pointer'); |
+ |
+debug(''); |
+debug('Test invalid cursor rules which shouldn\'t parse at all.'); |
+testInvalidCursorRule('url(file:///foo.png), url(file:///foo2.png)'); |
+ |
+successfullyParsed = true; |
+</script> |
+<script src="../js/resources/js-test-post.js"></script> |
+</body> |
+</html> |