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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/css/parsing-stroke-linecap.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/parsing-stroke-linecap.html b/third_party/WebKit/LayoutTests/fast/css/parsing-stroke-linecap.html
new file mode 100644
index 0000000000000000000000000000000000000000..18eac0132ad6b3e3d458ee4cc40f459c8171c4c5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/parsing-stroke-linecap.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<title>Tests that all of the input values for stroke-linecap parse correctly</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<body></body>
+<script>
+function assert_stroke_linecap_property_value(value, expected)
+{
+ var div = document.createElement("div");
+ div.setAttribute("style", value);
+ document.body.appendChild(div);
+
+ var result = div.style.getPropertyValue("stroke-linecap");
+ assert_equals(result, expected);
+ document.body.removeChild(div);
+}
+
+function assert_get_computed_style(value, expected)
+{
+ var div = document.createElement("div");
+ div.setAttribute("style", value);
+ document.body.appendChild(div);
+
+ var result = window.getComputedStyle(div).strokeLinecap;
+ assert_equals(result, expected);
+ document.body.removeChild(div);
+}
+
+function assert_get_computed_style_inherited(value, expected)
+{
+ var div = document.createElement("div");
+ div.setAttribute("style", value);
+
+ var div2 = document.createElement("div");
+ div.appendChild(div2);
+
+ document.body.appendChild(div);
+
+ var result = window.getComputedStyle(div2).strokeLinecap;
+ assert_equals(result, expected);
+ document.body.removeChild(div);
+}
+
+test(function(){
+ assert_get_computed_style_inherited("stroke-linecap: butt;", "butt");
+ assert_get_computed_style_inherited("stroke-linecap: round;", "round");
+ assert_get_computed_style_inherited("stroke-linecap: square;", "square");
+
+ assert_get_computed_style(";", "butt");
+ assert_stroke_linecap_property_value("stroke-linecap: butt;", "butt");
+ assert_stroke_linecap_property_value("stroke-linecap: round;", "round");
+ assert_stroke_linecap_property_value("stroke-linecap: square;", "square");
+
+ assert_stroke_linecap_property_value("stroke-linecap: rnd;", "");
+ assert_stroke_linecap_property_value("stroke-linecap: but;", "");
+ assert_stroke_linecap_property_value("stroke-linecap: 10px;", "");
+ assert_stroke_linecap_property_value("stroke-linecap: 10%;", "");
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698