1 description("This tests checks that the '-webkit-text' and 'text' keywords are \
2 parsed correctly in the 'background-clip' and '-webkit-background-clip' \
3 properties, and that 'background-clip' is parsed correctly in the \
4 'background' shorthand.");
6 function test(declaration, property)
8 var div = document.createElement("div");
9 div.setAttribute("style", declaration);
10 document.body.appendChild(div);
12 var result = div.style.getPropertyValue(property);
13 document.body.removeChild(div);
16 shouldBe('test("background-clip: -webkit-text", "background-clip")', '"-webkit-text"');
17 shouldBeEqualToString('test("background-clip: -webkit-text", "-webkit-background-clip")', '');
19 shouldBe('test("background-clip: content-box", "background-clip")', '"content-box"');
20 shouldBe('test("background-clip: padding-box", "background-clip")', '"padding-box"');
21 shouldBe('test("background-clip: border-box", "background-clip")', '"border-box"');
23 shouldBeEqualToString('test("background-clip: text", "background-clip")', '');
24 shouldBeEqualToString('test("background-clip: text", "-webkit-background-clip")', '');
26 shouldBeEqualToString('test("-webkit-background-clip: -webkit-text", "background-clip")', '');
27 shouldBe('test("-webkit-background-clip: -webkit-text", "-webkit-background-clip")', '"-webkit-text"');
29 shouldBeEqualToString('test("-webkit-background-clip: text", "background-clip")', '');
30 shouldBe('test("-webkit-background-clip: text", "-webkit-background-clip")', '"text"');
31 shouldBeEqualToString('test("background: url() padding-box", "-webkit-background-clip")', '');
33 shouldBeEqualToString('test("-webkit-mask: url() ", "background-clip")', '');
34 shouldBe('test("background: url() ", "background-clip")', '"initial"');
36 shouldBe('test("background: url() padding-box", "background-clip")', '"padding-box"');
37 shouldBe('test("background: url() padding-box border-box", "background-clip")', '"border-box"');
38 shouldBe('test("background: repeat content-box border-box url() ", "background-clip")', '"border-box"');
39 shouldBe('test("background: padding-box blue content-box url() repeat scroll ", "background-clip")', '"content-box"');