Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / script-tests / image-set-setting.js
blob1488e25648559cc080e301dbd93909b16141463a
1 description("Test the setting of the -webkit-image-set function.");
3 function testComputedStyle(property, fullRule)
5     var div = document.createElement("div");
6     document.body.appendChild(div);
7     div.setAttribute("style", property + ": " + fullRule);
8     var computedValue = div.style.backgroundImage;
9     document.body.removeChild(div);
10     return computedValue;
13 function testImageSetRule(description, property, rule, expected)
15     debug("");
16     debug(description + " : " + rule);
18     var fullRule = "-webkit-image-set(" + rule + ")";
19     shouldBeEqualToString('testComputedStyle("' + property + '", "' + fullRule + '")', fullRule);
22 testImageSetRule("Single value for background-image",
23                 "background-image",
24                 "url(http://www.webkit.org/a) 1x");
26 testImageSetRule("Multiple values for background-image",
27                 "background-image",
28                 "url(http://www.webkit.org/a) 1x, url(http://www.webkit.org/b) 2x");
30 testImageSetRule("Multiple values for background-image, out of order",
31                 "background-image",
32                 "url(http://www.webkit.org/c) 3x, url(http://www.webkit.org/b) 2x, url(http://www.webkit.org/a) 1x");
34 testImageSetRule("Duplicate values for background-image",
35                 "background-image",
36                 "url(http://www.webkit.org/c) 1x, url(http://www.webkit.org/b) 2x, url(http://www.webkit.org/a) 1x");
38 testImageSetRule("Fractional values for background-image",
39                 "background-image",
40                 "url(http://www.webkit.org/c) 0.2x, url(http://www.webkit.org/b) 2.3x, url(http://www.webkit.org/a) 12.3456x");
42 // FIXME: We should also be testing the behavior of negative values somewhere, but it's currently
43 // broken.  http://wkb.ug/100132
45 successfullyParsed = true;