Title: [126060] trunk/LayoutTests
Revision
126060
Author
[email protected]
Date
2012-08-20 13:44:36 -0700 (Mon, 20 Aug 2012)

Log Message

[css3-text] Add getComputedStyle tests for -webkit-text-decoration-line
https://bugs.webkit.org/show_bug.cgi?id=94108

Patch by Bruno de Oliveira Abinader <[email protected]> on 2012-08-20
Reviewed by Kenneth Rohde Christiansen.

Changeset r125205 introduced new CSS3 property "-webkit-text-decoration-line",
with included basic getComputedStyle* layout tests for parsing check. This
patch adds a new, more robust getComputedStyle-based layout test for this
property.

* fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line-expected.txt: Added.
* fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line.html: Added.
* fast/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-line.js: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (126059 => 126060)


--- trunk/LayoutTests/ChangeLog	2012-08-20 20:25:03 UTC (rev 126059)
+++ trunk/LayoutTests/ChangeLog	2012-08-20 20:44:36 UTC (rev 126060)
@@ -1,3 +1,19 @@
+2012-08-20  Bruno de Oliveira Abinader  <[email protected]>
+
+        [css3-text] Add getComputedStyle tests for -webkit-text-decoration-line
+        https://bugs.webkit.org/show_bug.cgi?id=94108
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Changeset r125205 introduced new CSS3 property "-webkit-text-decoration-line",
+        with included basic getComputedStyle* layout tests for parsing check. This
+        patch adds a new, more robust getComputedStyle-based layout test for this
+        property.
+
+        * fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line-expected.txt: Added.
+        * fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line.html: Added.
+        * fast/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-line.js: Added.
+
 2012-08-20  John Mellor  <[email protected]>
 
         Text Autosizing: Only take into account block width <= document layout width.

Added: trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line-expected.txt (0 => 126060)


--- trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line-expected.txt	2012-08-20 20:44:36 UTC (rev 126060)
@@ -0,0 +1,93 @@
+Test to make sure -webkit-text-decoration-line property returns values properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Initial value:
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line') is null
+PASS computedStyle.webkitTextDecorationLine is 'none'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'none'
+
+Initial value (explicit):
+PASS e.style.webkitTextDecorationLine is 'initial'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'initial'
+PASS computedStyle.webkitTextDecorationLine is 'none'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'none'
+
+Value 'none':
+PASS e.style.webkitTextDecorationLine is 'initial'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'initial'
+PASS computedStyle.webkitTextDecorationLine is 'none'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'none'
+
+Value 'underline':
+PASS e.style.webkitTextDecorationLine is 'underline'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline'
+PASS computedStyle.webkitTextDecorationLine is 'underline'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline'
+
+Value 'overline':
+PASS e.style.webkitTextDecorationLine is 'overline'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'overline'
+PASS computedStyle.webkitTextDecorationLine is 'overline'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'overline'
+
+Value 'line-through':
+PASS e.style.webkitTextDecorationLine is 'line-through'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'line-through'
+PASS computedStyle.webkitTextDecorationLine is 'line-through'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'line-through'
+
+Value 'underline overline line-through':
+PASS e.style.webkitTextDecorationLine is 'underline overline line-through'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline overline line-through'
+PASS computedStyle.webkitTextDecorationLine is 'underline overline line-through'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline overline line-through'
+
+Value 'blink' (invalid, last valid value is used):
+PASS e.style.webkitTextDecorationLine is 'underline overline line-through'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline overline line-through'
+PASS computedStyle.webkitTextDecorationLine is 'underline overline line-through'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline overline line-through'
+
+Value '':
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line') is null
+PASS computedStyle.webkitTextDecorationLine is 'none'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'none'
+
+Parent gets 'underline' value:
+PASS e.style.webkitTextDecorationLine is 'underline'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline'
+PASS computedStyle.webkitTextDecorationLine is 'underline'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline'
+
+Ancestor should explicitly inherit value from parent when 'inherit' value is used:
+PASS e.style.webkitTextDecorationLine is 'inherit'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'inherit'
+PASS computedStyle.webkitTextDecorationLine is 'underline'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline'
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line.html (0 => 126060)


--- trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line.html	2012-08-20 20:44:36 UTC (rev 126060)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-line.js (0 => 126060)


--- trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-line.js	                        (rev 0)
+++ trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-line.js	2012-08-20 20:44:36 UTC (rev 126060)
@@ -0,0 +1,93 @@
+function testElementStyle(propertyJS, propertyCSS, type, value)
+{
+    if (type != null) {
+        shouldBe("e.style." + propertyJS, "'" + value + "'");
+        shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').toString()", "'" + type + "'");
+        shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'");
+    } else
+        shouldBeNull("e.style.getPropertyCSSValue('" + propertyCSS + "')");
+}
+
+function testComputedStyle(propertyJS, propertyCSS, type, value)
+{
+    computedStyle = window.getComputedStyle(e, null);
+    shouldBe("computedStyle." + propertyJS, "'" + value + "'");
+    shouldBe("computedStyle.getPropertyCSSValue('" + propertyCSS + "').toString()", "'" + type + "'");
+    shouldBe("computedStyle.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'");
+}
+
+description("Test to make sure -webkit-text-decoration-line property returns values properly.")
+
+var testContainer = document.createElement("div");
+testContainer.contentEditable = true;
+document.body.appendChild(testContainer);
+
+testContainer.innerHTML = '<div id="test">hello world</div>';
+debug("Initial value:");
+e = document.getElementById('test');
+testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", null, '');
+testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSPrimitiveValue]", "none");
+debug('');
+
+debug("Initial value (explicit):");
+e.style.webkitTextDecorationLine = 'initial';
+testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValue]", "initial");
+testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSPrimitiveValue]", "none");
+debug('');
+
+debug("Value 'none':");
+e.style.webkitTextDecorationLine = 'none';
+testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValue]", "initial");
+testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSPrimitiveValue]", "none");
+debug('');
+
+debug("Value 'underline':");
+e.style.webkitTextDecorationLine = 'underline';
+testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "underline");
+testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "underline");
+debug('');
+
+debug("Value 'overline':");
+e.style.webkitTextDecorationLine = 'overline';
+testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "overline");
+testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "overline");
+debug('');
+
+debug("Value 'line-through':");
+e.style.webkitTextDecorationLine = 'line-through';
+testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "line-through");
+testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "line-through");
+debug('');
+
+debug("Value 'underline overline line-through':");
+e.style.webkitTextDecorationLine = 'underline overline line-through';
+testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "underline overline line-through");
+testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "underline overline line-through");
+debug('');
+
+debug("Value 'blink' (invalid, last valid value is used):");
+e.style.webkitTextDecorationLine = 'blink';
+testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "underline overline line-through");
+testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "underline overline line-through");
+debug('');
+
+debug("Value '':");
+e.style.webkitTextDecorationLine = '';
+testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", null, '');
+testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSPrimitiveValue]", "none");
+debug('');
+
+testContainer.innerHTML = '<div id="test-parent" style="-webkit-text-decoration-line: underline;">hello <span id="test-ancestor" style="-webkit-text-decoration-line: inherit;">world</span></div>';
+debug("Parent gets 'underline' value:");
+e = document.getElementById('test-parent');
+testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "underline");
+testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "underline");
+debug('');
+
+debug("Ancestor should explicitly inherit value from parent when 'inherit' value is used:");
+e = document.getElementById('test-ancestor');
+testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValue]", "inherit");
+testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "[object CSSValueList]", "underline");
+debug('');
+
+document.body.removeChild(testContainer);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to