Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text.
[WebKit-https.git] / LayoutTests / fast / css / parsing-paint-order.html
1 <!DOCTYPE html>
2 <html>
3     <head>
4         <script src="../../resources/js-test-pre.js"></script>
5     </head>
6     <body>
7         <script>
8             description("This tests checks that all of the input values for paint-order parse correctly.");
9
10             function test(value)
11             {
12                 var div = document.createElement("div");
13                 div.setAttribute("style", value);
14                 document.body.appendChild(div);
15
16                 var result = div.style.getPropertyValue("paint-order");
17                 
18                 document.body.removeChild(div);
19                 return result;
20             }
21
22             function testComputedStyle(value)
23             {
24                 var div = document.createElement("div");
25                 div.setAttribute("style", value);
26                 document.body.appendChild(div);
27     
28                 var result = window.getComputedStyle(div).paintOrder;
29                 document.body.removeChild(div);
30                 return result;
31             }
32
33             function testComputedStyleInherited(value)
34             {
35                 var div = document.createElement("div");
36                 div.setAttribute("style", value);
37
38                 var div2 = document.createElement("div");
39                 div.appendChild(div2);
40                 
41                 document.body.appendChild(div);
42
43                 var result = window.getComputedStyle(div2).paintOrder;
44                 document.body.removeChild(div);
45                 return result;
46             }
47
48             shouldBe('testComputedStyleInherited("paint-order: fill;")', '"fill"');
49             shouldBe('testComputedStyleInherited("paint-order: stroke;")', '"stroke"');
50             shouldBe('testComputedStyleInherited("paint-order: markers;")', '"markers"');
51
52             shouldBe('testComputedStyle(";")', '"normal"');
53             shouldBe('test("paint-order: fill;")', '"fill"');
54             shouldBe('test("paint-order: fill stroke;")', '"fill"');
55             shouldBe('test("paint-order: fill markers;")', '"fill markers"');
56             shouldBe('test("paint-order: fill stroke markers;")', '"fill"');
57             shouldBe('test("paint-order: fill markers stroke;")', '"fill markers"');
58             
59             shouldBe('test("paint-order: stroke;")', '"stroke"');
60             shouldBe('test("paint-order: stroke fill;")', '"stroke"');
61             shouldBe('test("paint-order: stroke markers;")', '"stroke markers"');
62             shouldBe('test("paint-order: stroke fill markers;")', '"stroke"');
63             shouldBe('test("paint-order: stroke markers fill;")', '"stroke markers"');
64             
65             shouldBe('test("paint-order: markers;")', '"markers"');
66             shouldBe('test("paint-order: markers fill;")', '"markers"');
67             shouldBe('test("paint-order: markers stroke;")', '"markers stroke"');
68             shouldBe('test("paint-order: markers fill stroke;")', '"markers"');
69             shouldBe('test("paint-order: markers stroke fill;")', '"markers stroke"');
70
71             shouldBeEqualToString('test("paint-order: fil;")', '');
72             shouldBeEqualToString('test("paint-order: fill markrs;")', '');
73             shouldBeEqualToString('test("paint-order: 10px;")', '');
74             shouldBeEqualToString('test("paint-order: 10%;")', '');
75         </script>
76         <script src="../../resources/js-test-post.js"></script>
77     </body>
78 </html>