1 description("Test the parsing of the -webkit-image-set function.");
5 function testImageSetRule(description, property, rule, expectedTexts)
8 debug(description + " : " + rule);
10 var div = document.createElement("div");
11 rule = "-webkit-image-set(" + rule + ")";
12 div.style[property] = rule;
13 document.body.appendChild(div);
14 result = div.style[property].replace(/url\([^#]*#/g, "url(#");
15 shouldBeEqualToString("result", rule);
16 document.body.removeChild(div);
19 testImageSetRule("Single value for background-image",
23 testImageSetRule("Multiple values for background-image",
25 "url(#a) 1x, url(#b) 2x");
27 testImageSetRule("Multiple values for background-image, out of order",
29 "url(#c) 3x, url(#b) 2x, url(#a) 1x");
31 testImageSetRule("Single value for content",
35 testImageSetRule("Multiple values for content",
37 "url(#a) 1x, url(#b) 2x");
39 testImageSetRule("Single value for border-image",
40 "-webkit-border-image",
43 testImageSetRule("Multiple values for border-image",
44 "-webkit-border-image",
45 "url(#a) 1x, url(#b) 2x");
47 testImageSetRule("Single value for -webkit-mask-box-image-source",
48 "-webkit-mask-box-image-source",
51 testImageSetRule("Multiple values for -webkit-mask-box-image-source",
52 "-webkit-mask-box-image-source",
53 "url(#a) 1x, url(#b) 2x");
55 successfullyParsed = true;