Title: [164115] trunk
Revision
164115
Author
mmaxfi...@apple.com
Date
2014-02-14 12:08:33 -0800 (Fri, 14 Feb 2014)

Log Message

Implement text-decoration-skip: auto
https://bugs.webkit.org/show_bug.cgi?id=128786

Reviewed by Dean Jackson.

http://lists.w3.org/Archives/Public/www-style/2014Feb/0485.html
We are updating the initial value of text-decoration-skip to a new value, "auto".
On Mac + iOS, this will have the same behavior as "skip".

Source/WebCore:

Test: fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::renderTextDecorationSkipFlagsToCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseTextDecorationSkip):
* css/DeprecatedStyleBuilder.cpp:
(WebCore::valueToDecorationSkip):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDecoration):
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h:

LayoutTests:

* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default-expected.txt: Added.
* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt:
* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (164114 => 164115)


--- trunk/LayoutTests/ChangeLog	2014-02-14 19:49:43 UTC (rev 164114)
+++ trunk/LayoutTests/ChangeLog	2014-02-14 20:08:33 UTC (rev 164115)
@@ -1,3 +1,19 @@
+2014-02-14  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Implement text-decoration-skip: auto
+        https://bugs.webkit.org/show_bug.cgi?id=128786
+
+        Reviewed by Dean Jackson.
+
+        http://lists.w3.org/Archives/Public/www-style/2014Feb/0485.html
+        We are updating the initial value of text-decoration-skip to a new value, "auto".
+        On Mac + iOS, this will have the same behavior as "skip".
+
+        * fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default-expected.txt: Added.
+        * fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default.html: Added.
+        * fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt:
+        * fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html:
+
 2014-02-14  Brent Fulgham  <bfulg...@apple.com>
 
         Unreviewed test correction to get bots green.

Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default-expected.txt (0 => 164115)


--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default-expected.txt	2014-02-14 20:08:33 UTC (rev 164115)
@@ -0,0 +1 @@
+auto

Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default.html (0 => 164115)


--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default.html	2014-02-14 20:08:33 UTC (rev 164115)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<div id="a"></div>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+var d = document.getElementById("a");
+var s = window.getComputedStyle(d);
+var p = s.getPropertyValue("-webkit-text-decoration-skip");
+d.innerHTML = p;
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt (164114 => 164115)


--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt	2014-02-14 19:49:43 UTC (rev 164114)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt	2014-02-14 20:08:33 UTC (rev 164115)
@@ -1,11 +1,11 @@
 PASS cssRule.type is cssRule.STYLE_RULE
 PASS declaration.length is 0
 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is null
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects"
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
 PASS cssRule.type is cssRule.STYLE_RULE
 PASS declaration.length is 1
 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "initial"
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects"
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
 PASS cssRule.type is cssRule.STYLE_RULE
 PASS declaration.length is 1
 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "ink"
@@ -16,7 +16,7 @@
 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink"
 PASS cssRule.type is cssRule.STYLE_RULE
 PASS declaration.length is 0
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects"
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
 PASS cssRule.type is cssRule.STYLE_RULE
 PASS declaration.length is 1
 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "ink"
@@ -63,5 +63,5 @@
 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "none"
 PASS cssRule.type is cssRule.STYLE_RULE
 PASS declaration.length is 0
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects"
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
 

Modified: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html (164114 => 164115)


--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html	2014-02-14 19:49:43 UTC (rev 164114)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html	2014-02-14 20:08:33 UTC (rev 164115)
@@ -35,18 +35,18 @@
       shouldBe("declaration.length", "0");
       shouldBe("declaration.getPropertyValue('-webkit-text-decoration-skip')", "null");
       computedStyle = window.getComputedStyle(target, null);
-      shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText", "\"objects\"");
+      shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText", "\"auto\"");
       stylesheet.deleteRule(0);
     }
 
-    function testInitialIsObjects(stylesheet, target) {
+    function testInitialIsAuto(stylesheet, target) {
       cssRule = stylesheet.cssRules.item(0);
       shouldBe("cssRule.type", "cssRule.STYLE_RULE");
       declaration = cssRule.style;
       shouldBe("declaration.length", "1");
       shouldBe("declaration.getPropertyValue('-webkit-text-decoration-skip')",  "\"initial\"");
       computedStyle = window.getComputedStyle(target, null);
-      shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText", "\"objects\"");
+      shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText", "\"auto\"");
       stylesheet.deleteRule(0);
     }
 
@@ -56,7 +56,7 @@
       declaration = cssRule.style;
       shouldBe("declaration.length", "0");
       computedStyle = window.getComputedStyle(target, null);
-      shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText", "\"objects\"");
+      shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText", "\"auto\"");
       stylesheet.deleteRule(0);
     }
 
@@ -80,7 +80,7 @@
     testEmptyIsObjects(stylesheet, target);
 
     stylesheet.insertRule(".p { -webkit-text-decoration-skip: initial; }", 0);
-    testInitialIsObjects(stylesheet, target);
+    testInitialIsAuto(stylesheet, target);
 
     stylesheet.insertRule(".p { -webkit-text-decoration-skip: ink; }", 0);
     testInkIsValid(stylesheet, target);

Modified: trunk/Source/WebCore/ChangeLog (164114 => 164115)


--- trunk/Source/WebCore/ChangeLog	2014-02-14 19:49:43 UTC (rev 164114)
+++ trunk/Source/WebCore/ChangeLog	2014-02-14 20:08:33 UTC (rev 164115)
@@ -1,3 +1,27 @@
+2014-02-14  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Implement text-decoration-skip: auto
+        https://bugs.webkit.org/show_bug.cgi?id=128786
+
+        Reviewed by Dean Jackson.
+
+        http://lists.w3.org/Archives/Public/www-style/2014Feb/0485.html
+        We are updating the initial value of text-decoration-skip to a new value, "auto".
+        On Mac + iOS, this will have the same behavior as "skip".
+
+        Test: fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::renderTextDecorationSkipFlagsToCSSValue):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseTextDecorationSkip):
+        * css/DeprecatedStyleBuilder.cpp:
+        (WebCore::valueToDecorationSkip):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paintDecoration):
+        * rendering/style/RenderStyle.h:
+        * rendering/style/RenderStyleConstants.h:
+
 2014-02-13  Simon Fraser  <simon.fra...@apple.com>
 
         Give ScrollingTree(State)Nodes a reference to another layer, which is used for moving overflow:scroll contents around

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (164114 => 164115)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2014-02-14 19:49:43 UTC (rev 164114)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2014-02-14 20:08:33 UTC (rev 164115)
@@ -1318,6 +1318,8 @@
 static PassRef<CSSValue> renderTextDecorationSkipFlagsToCSSValue(TextDecorationSkip textDecorationSkip)
 {
     switch (textDecorationSkip) {
+    case TextDecorationSkipAuto:
+        return cssValuePool().createIdentifierValue(CSSValueAuto);
     case TextDecorationSkipNone:
         return cssValuePool().createIdentifierValue(CSSValueNone);
     case TextDecorationSkipInk:

Modified: trunk/Source/WebCore/css/CSSParser.cpp (164114 => 164115)


--- trunk/Source/WebCore/css/CSSParser.cpp	2014-02-14 19:49:43 UTC (rev 164114)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2014-02-14 20:08:33 UTC (rev 164115)
@@ -9456,6 +9456,7 @@
     do {
         switch (value->id) {
         case CSSValueNone:
+        case CSSValueAuto:
         case CSSValueInk:
         case CSSValueObjects:
             addProperty(CSSPropertyWebkitTextDecorationSkip, cssValuePool().createIdentifierValue(value->id), important);

Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (164114 => 164115)


--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp	2014-02-14 19:49:43 UTC (rev 164114)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp	2014-02-14 20:08:33 UTC (rev 164115)
@@ -1287,6 +1287,8 @@
     ASSERT(primitiveValue.isValueID());
 
     switch (primitiveValue.getValueID()) {
+    case CSSValueAuto:
+        return TextDecorationSkipAuto;
     case CSSValueNone:
         return TextDecorationSkipNone;
     case CSSValueInk:

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (164114 => 164115)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2014-02-14 19:49:43 UTC (rev 164114)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2014-02-14 20:08:33 UTC (rev 164115)
@@ -1162,7 +1162,7 @@
             }
             default:
 #if ENABLE(CSS3_TEXT_DECORATION_SKIP_INK)
-                if (lineStyle.textDecorationSkip() == TextDecorationSkipInk && isHorizontal()) {
+                if ((lineStyle.textDecorationSkip() == TextDecorationSkipInk || lineStyle.textDecorationSkip() == TextDecorationSkipAuto) && isHorizontal()) {
                     if (!context.paintingDisabled()) {
                         drawSkipInkUnderline(textPainter, context, localOrigin, underlineOffset, width, isPrinting);
 
@@ -1192,7 +1192,7 @@
             }
             default:
 #if ENABLE(CSS3_TEXT_DECORATION_SKIP_INK)
-                if (lineStyle.textDecorationSkip() == TextDecorationSkipInk) {
+                if ((lineStyle.textDecorationSkip() == TextDecorationSkipInk || lineStyle.textDecorationSkip() == TextDecorationSkipAuto) && isHorizontal()) {
                     if (!context.paintingDisabled()) {
                         drawSkipInkUnderline(textPainter, context, localOrigin, 0, width, isPrinting);
 

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (164114 => 164115)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2014-02-14 19:49:43 UTC (rev 164114)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2014-02-14 20:08:33 UTC (rev 164115)
@@ -1671,7 +1671,7 @@
     static TextJustify initialTextJustify() { return TextJustifyAuto; }
 #endif // CSS3_TEXT
     static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; }
-    static TextDecorationSkip initialTextDecorationSkip() { return TextDecorationSkipObjects; }
+    static TextDecorationSkip initialTextDecorationSkip() { return TextDecorationSkipAuto; }
     static TextUnderlinePosition initialTextUnderlinePosition() { return TextUnderlinePositionAuto; }
     static float initialZoom() { return 1.0f; }
     static int initialOutlineOffset() { return 0; }

Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (164114 => 164115)


--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2014-02-14 19:49:43 UTC (rev 164114)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2014-02-14 20:08:33 UTC (rev 164115)
@@ -390,7 +390,8 @@
 enum TextDecorationSkipItems {
     TextDecorationSkipNone = 0,
     TextDecorationSkipInk = 1 << 0,
-    TextDecorationSkipObjects = 1 << 1
+    TextDecorationSkipObjects = 1 << 1,
+    TextDecorationSkipAuto = 1 << 2
 };
 typedef unsigned TextDecorationSkip;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to