Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text.
[WebKit-https.git] / LayoutTests / fast / css / parsing-stroke-linejoin.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 stroke-linejoin 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("stroke-linejoin");
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).strokeLinejoin;
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).strokeLinejoin;
44                 document.body.removeChild(div);
45                 return result;
46             }
47
48             shouldBe('testComputedStyleInherited("stroke-linejoin: miter;")', '"miter"');
49             shouldBe('testComputedStyleInherited("stroke-linejoin: round;")', '"round"');
50             shouldBe('testComputedStyleInherited("stroke-linejoin: bevel;")', '"bevel"');
51
52             shouldBe('testComputedStyle(";")', '"miter"');
53             shouldBe('test("stroke-linejoin: miter;")', '"miter"');
54             shouldBe('test("stroke-linejoin: round;")', '"round"');
55             shouldBe('test("stroke-linejoin: bevel;")', '"bevel"');
56
57             shouldBeEqualToString('test("stroke-linejoin: mitr;")', '');
58             shouldBeEqualToString('test("stroke-linejoin: bevl;")', '');
59             shouldBeEqualToString('test("stroke-linejoin: 10px;")', '');
60             shouldBeEqualToString('test("stroke-linejoin: 10%;")', '');
61         </script>
62         <script src="../../resources/js-test-post.js"></script>
63     </body>
64 </html>