Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/parsing-stroke-linecap.html

Issue 2753013004: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text
Patch Set: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Tests that all of the input values for stroke-linecap parse correctly</ti tle>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <body></body>
6 <script>
7 function assert_stroke_linecap_property_value(value, expected)
8 {
9 var div = document.createElement("div");
10 div.setAttribute("style", value);
11 document.body.appendChild(div);
12
13 var result = div.style.getPropertyValue("stroke-linecap");
14 assert_equals(result, expected);
15 document.body.removeChild(div);
16 }
17
18 function assert_get_computed_style(value, expected)
19 {
20 var div = document.createElement("div");
21 div.setAttribute("style", value);
22 document.body.appendChild(div);
23
24 var result = window.getComputedStyle(div).strokeLinecap;
25 assert_equals(result, expected);
26 document.body.removeChild(div);
27 }
28
29 function assert_get_computed_style_inherited(value, expected)
30 {
31 var div = document.createElement("div");
32 div.setAttribute("style", value);
33
34 var div2 = document.createElement("div");
35 div.appendChild(div2);
36
37 document.body.appendChild(div);
38
39 var result = window.getComputedStyle(div2).strokeLinecap;
40 assert_equals(result, expected);
41 document.body.removeChild(div);
42 }
43
44 test(function(){
45 assert_get_computed_style_inherited("stroke-linecap: butt;", "butt");
46 assert_get_computed_style_inherited("stroke-linecap: round;", "round");
47 assert_get_computed_style_inherited("stroke-linecap: square;", "square");
48
49 assert_get_computed_style(";", "butt");
50 assert_stroke_linecap_property_value("stroke-linecap: butt;", "butt");
51 assert_stroke_linecap_property_value("stroke-linecap: round;", "round");
52 assert_stroke_linecap_property_value("stroke-linecap: square;", "square");
53
54 assert_stroke_linecap_property_value("stroke-linecap: rnd;", "");
55 assert_stroke_linecap_property_value("stroke-linecap: but;", "");
56 assert_stroke_linecap_property_value("stroke-linecap: 10px;", "");
57 assert_stroke_linecap_property_value("stroke-linecap: 10%;", "");
58 });
59 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698