Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / cursor-parsing-image-set.html
blobc74de4d812a202e2b93f76691bdfe26892e1879e
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <p><a href=https://bugs.webkit.org/show_bug.cgi?id=99493>Bug 99493</a></p>
9 <div id="console"></div>
10 <script>
11 description("Test the parsing of the cursor property when used with -webkit-image-set.");
13 function makeCursorRule(rule)
15 return "cursor: " + rule + ";";
18 function testCursorRule(rule)
20 var cssText = makeCursorRule(rule);
21 shouldBeEqualToString('roundtripCssRule("' + cssText + '")', cssText);
24 function roundtripCssRule(cssText)
26 var div = document.createElement("div");
27 div.setAttribute("style", cssText);
28 document.body.appendChild(div);
29 var result = div.style.cssText;
30 document.body.removeChild(div);
31 return result;
34 // Note that any absolute URL will suffice for these tests (can't use relative URLs
35 // since they'll be converted to absolute form in the output). I chose file URLs just
36 // to avoid triggering any network activity.
38 debug('Test a bunch of cursor rules which should round-trip exactly.');
39 testCursorRule('-webkit-image-set(url(file:///foo.png) 1x), auto');
40 testCursorRule('-webkit-image-set(url(file:///foo.png) 1x, url(file:///foo2x.png) 2x), auto');
41 testCursorRule('-webkit-image-set(url(file:///foo.png) 1x, url(file:///foo2x.png) 2x) 2 3, auto');
42 testCursorRule('-webkit-image-set(url(file:///foo03.png) 0.3x, url(file:///foo5x.png) 5x) 6 5, url(file:///foo.png) 12 3, pointer');
44 successfullyParsed = true;
45 </script>
46 </body>
47 </html>