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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/parsing-paint-order.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/parsing-stroke-linecap.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/parsing-paint-order.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/parsing-paint-order.html b/third_party/WebKit/LayoutTests/fast/css/parsing-paint-order.html
new file mode 100644
index 0000000000000000000000000000000000000000..9886af645e12b515e5df2a61f997f6bb01a9a9fc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/parsing-paint-order.html
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<title>Tests that all of the input values for paint-order parse correctly</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<body></body>
+<script>
+function assert_paint_order_property_value(value, expected)
+{
+ var div = document.createElement("div");
+ div.setAttribute("style", value);
+ document.body.appendChild(div);
+
+ var result = div.style.getPropertyValue("paint-order");
+ 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).paintOrder;
+ 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).paintOrder;
+ assert_equals(result, expected);
+ document.body.removeChild(div);
+}
+
+test(function(){
+ assert_get_computed_style_inherited("paint-order: fill;", "fill stroke markers");
+ assert_get_computed_style_inherited("paint-order: stroke;", "stroke fill markers");
+ assert_get_computed_style_inherited("paint-order: markers;", "markers fill stroke");
+
+ assert_get_computed_style(";", "fill stroke markers");
+ assert_paint_order_property_value("paint-order: fill;", "fill");
+ assert_paint_order_property_value("paint-order: fill stroke;", "fill");
+ assert_paint_order_property_value("paint-order: fill markers;", "fill markers");
+ assert_paint_order_property_value("paint-order: fill stroke markers;", "fill");
+ assert_paint_order_property_value("paint-order: fill markers stroke;", "fill markers");
+
+ assert_paint_order_property_value("paint-order: stroke;", "stroke");
+ assert_paint_order_property_value("paint-order: stroke fill;", "stroke");
+ assert_paint_order_property_value("paint-order: stroke markers;", "stroke markers");
+ assert_paint_order_property_value("paint-order: stroke fill markers;", "stroke");
+ assert_paint_order_property_value("paint-order: stroke markers fill;", "stroke markers");
+
+ assert_paint_order_property_value("paint-order: markers;", "markers");
+ assert_paint_order_property_value("paint-order: markers fill;", "markers");
+ assert_paint_order_property_value("paint-order: markers stroke;", "markers stroke");
+ assert_paint_order_property_value("paint-order: markers fill stroke;", "markers");
+ assert_paint_order_property_value("paint-order: markers stroke fill;", "markers stroke");
+
+ assert_paint_order_property_value("paint-order: fil;", "");
+ assert_paint_order_property_value("paint-order: fill markrs;", "");
+ assert_paint_order_property_value("paint-order: 10px;", "");
+ assert_paint_order_property_value("paint-order: 10%;", "");
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/parsing-stroke-linecap.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698