Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / cursor-parsing-quirks.html
blob1d28ffd5714223e8d81e4637080675bc89829dc2
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 </head>
5 <body>
6 <p id="description"></p>
7 <div id="console"></div>
8 <script>
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')
19 expected = cssText;
20 else
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);
37 return result;
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');
44 debug('');
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;
49 </script>
50 </body>
51 </html>