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

Unified Diff: LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html

Issue 23111004: Re-land "[css3-text] Implement text-decoration property shorthand" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased after Alexis' function name changes in CSSComputedStyleDeclaration.cpp Created 7 years, 4 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: LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html
diff --git a/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html
new file mode 100644
index 0000000000000000000000000000000000000000..cbc436cf70ad79cf2f563b42f7683dba3c4eb211
--- /dev/null
+++ b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="../../../js/resources/js-test-pre.js"></script>
+ </head>
+ <body>
+ <script>
+ function testElementStyle(propertyJS, propertyCSS, value)
+ {
+ shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'");
+ }
+
+ description("Test to make sure text-decoration longhand values are accepted in every possible ordering in shorthand.")
+
+ var testContainer = document.createElement("div");
+ testContainer.contentEditable = true;
+ document.body.appendChild(testContainer);
+
+ testContainer.innerHTML = '<div id="test">hello world</div>';
+
+ var e = document.getElementById('test');
+
+ debug("-line -style -color ordering (underline dashed red):");
+ e.style.textDecoration = 'underline dashed red';
+ testElementStyle("textDecorationLine", "text-decoration-line", "underline");
+ testElementStyle("textDecorationStyle", "text-decoration-style", "dashed");
+ testElementStyle("textDecorationColor", "text-decoration-color", "red");
+ debug("");
+
+ debug("-line -color -style ordering (overline blue dotted):");
+ e.style.textDecoration = 'overline blue dotted';
+ testElementStyle("textDecorationLine", "text-decoration-line", "overline");
+ testElementStyle("textDecorationStyle", "text-decoration-style", "dotted");
+ testElementStyle("textDecorationColor", "text-decoration-color", "blue");
+ debug("");
+
+ debug("-style -line -color ordering (double line-through underline overline green):");
+ e.style.textDecoration = 'double line-through underline overline green';
+ testElementStyle("textDecorationLine", "text-decoration-line", "line-through underline overline");
+ testElementStyle("textDecorationStyle", "text-decoration-style", "double");
+ testElementStyle("textDecorationColor", "text-decoration-color", "green");
+ debug("");
+
+ debug("-style -color -line ordering (wavy yellow line-through):");
+ e.style.textDecoration = 'wavy yellow line-through';
+ testElementStyle("textDecorationLine", "text-decoration-line", "line-through");
+ testElementStyle("textDecorationStyle", "text-decoration-style", "wavy");
+ testElementStyle("textDecorationColor", "text-decoration-color", "yellow");
+ debug("");
+
+ debug("-color -line -style ordering (black underline solid):");
+ e.style.textDecoration = 'black underline solid';
+ testElementStyle("textDecorationLine", "text-decoration-line", "underline");
+ testElementStyle("textDecorationStyle", "text-decoration-style", "solid");
+ testElementStyle("textDecorationColor", "text-decoration-color", "black");
+ debug("");
+
+ debug("-color style -line -style ordering (navy dashed overline):");
+ e.style.textDecoration = 'navy dashed overline';
+ testElementStyle("textDecorationLine", "text-decoration-line", "overline");
+ testElementStyle("textDecorationStyle", "text-decoration-style", "dashed");
+ testElementStyle("textDecorationColor", "text-decoration-color", "navy");
+ debug("");
+
+ document.body.removeChild(testContainer);
+ </script>
+ <script src="../../../js/resources/js-test-post.js"></script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698