Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: LayoutTests/fast/css/cursor-parsing-quirks.html

Issue 23816008: Drop CSS cursor quirk for missing fallback cursor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added default pointer fallback to cursor rule in http test Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>
« no previous file with comments | « LayoutTests/fast/css/cursor-parsing-expected.txt ('k') | LayoutTests/fast/css/cursor-parsing-quirks-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698