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