Title: [126054] trunk
Revision
126054
Author
[email protected]
Date
2012-08-20 12:36:03 -0700 (Mon, 20 Aug 2012)

Log Message

[css3-text] Add parsing support for -webkit-text-decoration-style
https://bugs.webkit.org/show_bug.cgi?id=94093

Patch by Bruno de Oliveira Abinader <[email protected]> on 2012-08-20
Reviewed by Julien Chaffraix.

This patch implements the "text-decoration-style" property parsing as specified
in CSS3 working draft, with "-webkit-" prefix. The specification can be found
here: http://dev.w3.org/csswg/css3-text/#text-decoration-style

Additionally, Mozilla implementation details can be found here:
https://developer.mozilla.org/en-US/docs/CSS/text-decoration-style

This is an individual task for bug 90958. Rendering support will be handled on a
different bug.

Source/WebCore:

Test: fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::renderTextDecorationStyleFlagsToCSSValue):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator TextDecorationStyle):
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/StyleBuilder.cpp:
(WebCore::StyleBuilder::StyleBuilder):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRulesForList):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff):
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h: Added non-bitwise TextDecorationStyle enum.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Added m_textDecorationStyle to default and copy constructors.
(WebCore::StyleRareNonInheritedData::operator==): Include m_textDecorationStyle in comparison.
* rendering/style/StyleRareNonInheritedData.h:
(StyleRareNonInheritedData):
Added m_textDecorationStyle here as it won't be used regularly.

LayoutTests:

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

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (126053 => 126054)


--- trunk/LayoutTests/ChangeLog	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/LayoutTests/ChangeLog	2012-08-20 19:36:03 UTC (rev 126054)
@@ -1,3 +1,24 @@
+2012-08-20  Bruno de Oliveira Abinader  <[email protected]>
+
+        [css3-text] Add parsing support for -webkit-text-decoration-style
+        https://bugs.webkit.org/show_bug.cgi?id=94093
+
+        Reviewed by Julien Chaffraix.
+
+        This patch implements the "text-decoration-style" property parsing as specified
+        in CSS3 working draft, with "-webkit-" prefix. The specification can be found
+        here: http://dev.w3.org/csswg/css3-text/#text-decoration-style
+
+        Additionally, Mozilla implementation details can be found here:
+        https://developer.mozilla.org/en-US/docs/CSS/text-decoration-style
+
+        This is an individual task for bug 90958. Rendering support will be handled on a
+        different bug.
+
+        * fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style-expected.txt: Added.
+        * fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style.html: Added.
+        * fast/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-style.js: Added.
+
 2012-08-20  Kenneth Russell  <[email protected]>
 
         Unreviewed Chromium gardening. Fixed invalid test expectation.

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


--- trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style-expected.txt	2012-08-20 19:36:03 UTC (rev 126054)
@@ -0,0 +1,96 @@
+Test to make sure -webkit-text-decoration-style property returns CSSPrimitiveValue properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Ancestor should not inherit 'dashed' value from parent (fallback to initial 'solid' value):
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style') is null
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'solid'
+PASS computedStyle.webkitTextDecorationStyle is 'solid'
+
+Parent should cointain 'dashed':
+PASS e.style.webkitTextDecorationStyle is 'dashed'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dashed'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dashed'
+PASS computedStyle.webkitTextDecorationStyle is 'dashed'
+
+_javascript_ setter tests for valid, initial, invalid and blank values:
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style') is null
+
+Valid value 'solid':
+PASS e.style.webkitTextDecorationStyle is 'solid'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'solid'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'solid'
+PASS computedStyle.webkitTextDecorationStyle is 'solid'
+
+Valid value 'double':
+PASS e.style.webkitTextDecorationStyle is 'double'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'double'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'double'
+PASS computedStyle.webkitTextDecorationStyle is 'double'
+
+Valid value 'dotted':
+PASS e.style.webkitTextDecorationStyle is 'dotted'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dotted'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dotted'
+PASS computedStyle.webkitTextDecorationStyle is 'dotted'
+
+Valid value 'dashed':
+PASS e.style.webkitTextDecorationStyle is 'dashed'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dashed'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dashed'
+PASS computedStyle.webkitTextDecorationStyle is 'dashed'
+
+Valid value 'wavy':
+PASS e.style.webkitTextDecorationStyle is 'wavy'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'wavy'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'wavy'
+PASS computedStyle.webkitTextDecorationStyle is 'wavy'
+
+Initial value:
+PASS e.style.webkitTextDecorationStyle is 'initial'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'initial'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'solid'
+PASS computedStyle.webkitTextDecorationStyle is 'solid'
+
+Invalid value (this property accepts one value at a time only):
+PASS e.style.webkitTextDecorationStyle is 'initial'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'initial'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'solid'
+PASS computedStyle.webkitTextDecorationStyle is 'solid'
+
+Invalid value (ie. 'unknown'):
+PASS e.style.webkitTextDecorationStyle is 'initial'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'initial'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'solid'
+PASS computedStyle.webkitTextDecorationStyle is 'solid'
+
+Empty value (resets the property):
+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style') is null
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'solid'
+PASS computedStyle.webkitTextDecorationStyle is 'solid'
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

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


--- trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style.html	2012-08-20 19:36:03 UTC (rev 126054)
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<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-style.js (0 => 126054)


--- trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-style.js	                        (rev 0)
+++ trunk/LayoutTests/fast/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-style.js	2012-08-20 19:36:03 UTC (rev 126054)
@@ -0,0 +1,75 @@
+function testElementStyle(type, value)
+{
+    if (type != null) {
+        shouldBe("e.style.webkitTextDecorationStyle", "'" + value + "'");
+        shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-style').toString()", "'" + type + "'");
+        shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText", "'" + value + "'");
+    } else
+        shouldBeNull("e.style.getPropertyCSSValue('-webkit-text-decoration-style')");
+}
+
+function testComputedStyleValue(type, value)
+{
+    computedStyle = window.getComputedStyle(e, null);
+    shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString()", "'" + type + "'");
+    shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText", "'" + value + "'");
+    shouldBe("computedStyle.webkitTextDecorationStyle", "'" + value + "'");
+}
+
+function testValue(value, elementValue, elementStyle, computedValue, computedStyle)
+{
+    if (value != null)
+        e.style.webkitTextDecorationStyle = value;
+    testElementStyle(elementStyle, elementValue);
+    testComputedStyleValue(computedStyle, computedValue);
+    debug('');
+}
+
+description("Test to make sure -webkit-text-decoration-style property returns CSSPrimitiveValue properly.")
+
+var testContainer = document.createElement("div");
+testContainer.contentEditable = true;
+document.body.appendChild(testContainer);
+
+testContainer.innerHTML = '<div id="test-parent" style="-webkit-text-decoration-style: dashed !important;">hello <span id="test-ancestor">world</span></div>';
+debug("Ancestor should not inherit 'dashed' value from parent (fallback to initial 'solid' value):")
+e = document.getElementById('test-ancestor');
+testValue(null, "", null, "solid", "[object CSSPrimitiveValue]");
+
+debug("Parent should cointain 'dashed':");
+e = document.getElementById('test-parent');
+testValue(null, "dashed", "[object CSSPrimitiveValue]", "dashed", "[object CSSPrimitiveValue]");
+
+testContainer.innerHTML = '<div id="test-js">test</div>';
+debug("_javascript_ setter tests for valid, initial, invalid and blank values:");
+e = document.getElementById('test-js');
+shouldBeNull("e.style.getPropertyCSSValue('-webkit-text-decoration-style')");
+
+debug("\nValid value 'solid':");
+testValue("solid", "solid", "[object CSSPrimitiveValue]", "solid", "[object CSSPrimitiveValue]");
+
+debug("Valid value 'double':");
+testValue("double", "double", "[object CSSPrimitiveValue]", "double", "[object CSSPrimitiveValue]");
+
+debug("Valid value 'dotted':");
+testValue("dotted", "dotted", "[object CSSPrimitiveValue]", "dotted", "[object CSSPrimitiveValue]");
+
+debug("Valid value 'dashed':");
+testValue("dashed", "dashed", "[object CSSPrimitiveValue]", "dashed", "[object CSSPrimitiveValue]");
+
+debug("Valid value 'wavy':");
+testValue("wavy", "wavy", "[object CSSPrimitiveValue]", "wavy", "[object CSSPrimitiveValue]");
+
+debug("Initial value:");
+testValue("initial", "initial", "[object CSSValue]", "solid", "[object CSSPrimitiveValue]");
+
+debug("Invalid value (this property accepts one value at a time only):");
+testValue("double dotted", "initial", "[object CSSValue]", "solid", "[object CSSPrimitiveValue]");
+
+debug("Invalid value (ie. 'unknown'):");
+testValue("unknown", "initial", "[object CSSValue]", "solid", "[object CSSPrimitiveValue]");
+
+debug("Empty value (resets the property):");
+testValue("", "", null, "solid", "[object CSSPrimitiveValue]");
+
+document.body.removeChild(testContainer);

Modified: trunk/Source/WebCore/ChangeLog (126053 => 126054)


--- trunk/Source/WebCore/ChangeLog	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/ChangeLog	2012-08-20 19:36:03 UTC (rev 126054)
@@ -1,3 +1,48 @@
+2012-08-20  Bruno de Oliveira Abinader  <[email protected]>
+
+        [css3-text] Add parsing support for -webkit-text-decoration-style
+        https://bugs.webkit.org/show_bug.cgi?id=94093
+
+        Reviewed by Julien Chaffraix.
+
+        This patch implements the "text-decoration-style" property parsing as specified
+        in CSS3 working draft, with "-webkit-" prefix. The specification can be found
+        here: http://dev.w3.org/csswg/css3-text/#text-decoration-style
+
+        Additionally, Mozilla implementation details can be found here:
+        https://developer.mozilla.org/en-US/docs/CSS/text-decoration-style
+
+        This is an individual task for bug 90958. Rendering support will be handled on a
+        different bug.
+
+        Test: fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::renderTextDecorationStyleFlagsToCSSValue):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::operator TextDecorationStyle):
+        * css/CSSProperty.cpp:
+        (WebCore::CSSProperty::isInheritedProperty):
+        * css/CSSPropertyNames.in:
+        * css/CSSValueKeywords.in:
+        * css/StyleBuilder.cpp:
+        (WebCore::StyleBuilder::StyleBuilder):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::collectMatchingRulesForList):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::diff):
+        * rendering/style/RenderStyle.h:
+        * rendering/style/RenderStyleConstants.h: Added non-bitwise TextDecorationStyle enum.
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Added m_textDecorationStyle to default and copy constructors.
+        (WebCore::StyleRareNonInheritedData::operator==): Include m_textDecorationStyle in comparison.
+        * rendering/style/StyleRareNonInheritedData.h:
+        (StyleRareNonInheritedData):
+        Added m_textDecorationStyle here as it won't be used regularly.
+
 2012-08-20  Jakob Petsovits  <[email protected]>
 
         [BlackBerry] Persist cookies not from atexit() but the new onThreadFinished()

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (126053 => 126054)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-08-20 19:36:03 UTC (rev 126054)
@@ -179,6 +179,7 @@
     CSSPropertyTextDecoration,
 #if ENABLE(CSS3_TEXT_DECORATION)
     CSSPropertyWebkitTextDecorationLine,
+    CSSPropertyWebkitTextDecorationStyle,
 #endif // CSS3_TEXT_DECORATION
     CSSPropertyTextIndent,
     CSSPropertyTextRendering,
@@ -1217,6 +1218,27 @@
     return list;
 }
 
+#if ENABLE(CSS3_TEXT_DECORATION)
+static PassRefPtr<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorationStyle textDecorationStyle)
+{
+    switch (textDecorationStyle) {
+    case TextDecorationStyleSolid:
+        return cssValuePool().createIdentifierValue(CSSValueSolid);
+    case TextDecorationStyleDouble:
+        return cssValuePool().createIdentifierValue(CSSValueDouble);
+    case TextDecorationStyleDotted:
+        return cssValuePool().createIdentifierValue(CSSValueDotted);
+    case TextDecorationStyleDashed:
+        return cssValuePool().createIdentifierValue(CSSValueDashed);
+    case TextDecorationStyleWavy:
+        return cssValuePool().createIdentifierValue(CSSValueWavy);
+    }
+
+    ASSERT_NOT_REACHED();
+    return cssValuePool().createExplicitInitialValue();
+}
+#endif // CSS3_TEXT_DECORATION
+
 static PassRefPtr<CSSValue> fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepeat yRepeat)
 {
     // For backwards compatibility, if both values are equal, just return one of them. And
@@ -1960,10 +1982,13 @@
         case CSSPropertyTextAlign:
             return cssValuePool().createValue(style->textAlign());
         case CSSPropertyTextDecoration:
+            return renderTextDecorationFlagsToCSSValue(style->textDecoration());
 #if ENABLE(CSS3_TEXT_DECORATION)
         case CSSPropertyWebkitTextDecorationLine:
+            return renderTextDecorationFlagsToCSSValue(style->textDecoration());
+        case CSSPropertyWebkitTextDecorationStyle:
+            return renderTextDecorationStyleFlagsToCSSValue(style->textDecorationStyle());
 #endif // CSS3_TEXT_DECORATION
-            return renderTextDecorationFlagsToCSSValue(style->textDecoration());
         case CSSPropertyWebkitTextDecorationsInEffect:
             return renderTextDecorationFlagsToCSSValue(style->textDecorationsInEffect());
         case CSSPropertyWebkitTextFillColor:

Modified: trunk/Source/WebCore/css/CSSParser.cpp (126053 => 126054)


--- trunk/Source/WebCore/css/CSSParser.cpp	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2012-08-20 19:36:03 UTC (rev 126054)
@@ -2108,6 +2108,12 @@
     case CSSPropertyWebkitTextDecorationLine:
         // none | [ underline || overline || line-through ] | inherit
         return parseTextDecoration(propId, important);
+
+    case CSSPropertyWebkitTextDecorationStyle:
+        // solid | double | dotted | dashed | wavy
+        if (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDotted || id == CSSValueDashed || id == CSSValueWavy)
+            validPrimitive = true;
+        break;
 #endif // CSS3_TEXT_DECORATION
 
     case CSSPropertyZoom:          // normal | reset | document | <number> | <percentage> | inherit

Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (126053 => 126054)


--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2012-08-20 19:36:03 UTC (rev 126054)
@@ -2198,6 +2198,27 @@
     return TDNONE;
 }
 
+#if ENABLE(CSS3_TEXT_DECORATION)
+template<> inline CSSPrimitiveValue::operator TextDecorationStyle() const
+{
+    switch (m_value.ident) {
+    case CSSValueSolid:
+        return TextDecorationStyleSolid;
+    case CSSValueDouble:
+        return TextDecorationStyleDouble;
+    case CSSValueDotted:
+        return TextDecorationStyleDotted;
+    case CSSValueDashed:
+        return TextDecorationStyleDashed;
+    case CSSValueWavy:
+        return TextDecorationStyleWavy;
+    }
+
+    ASSERT_NOT_REACHED();
+    return TextDecorationStyleSolid;
+}
+#endif // CSS3_TEXT_DECORATION
+
 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextSecurity e)
     : CSSValue(PrimitiveClass)
 {

Modified: trunk/Source/WebCore/css/CSSProperty.cpp (126053 => 126054)


--- trunk/Source/WebCore/css/CSSProperty.cpp	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/css/CSSProperty.cpp	2012-08-20 19:36:03 UTC (rev 126054)
@@ -637,6 +637,9 @@
     case CSSPropertyWebkitPerspectiveOrigin:
     case CSSPropertyWebkitPerspectiveOriginX:
     case CSSPropertyWebkitPerspectiveOriginY:
+#if ENABLE(CSS3_TEXT_DECORATION)
+    case CSSPropertyWebkitTextDecorationStyle:
+#endif // CSS3_TEXT_DECORATION
     case CSSPropertyWebkitTransform:
     case CSSPropertyWebkitTransformOrigin:
     case CSSPropertyWebkitTransformOriginX:

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (126053 => 126054)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2012-08-20 19:36:03 UTC (rev 126054)
@@ -353,6 +353,7 @@
 -epub-text-combine = -webkit-text-combine
 #if defined(ENABLE_CSS3_TEXT_DECORATION) && ENABLE_CSS3_TEXT_DECORATION
 -webkit-text-decoration-line
+-webkit-text-decoration-style
 #endif
 -webkit-text-decorations-in-effect
 -webkit-text-emphasis

Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (126053 => 126054)


--- trunk/Source/WebCore/css/CSSValueKeywords.in	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in	2012-08-20 19:36:03 UTC (rev 126054)
@@ -452,6 +452,9 @@
 thick
 thin
 underline
+#if defined(ENABLE_CSS3_TEXT_DECORATION) && ENABLE_CSS3_TEXT_DECORATION
+wavy
+#endif
 -webkit-nowrap
 
 // CSS3 Values

Modified: trunk/Source/WebCore/css/StyleBuilder.cpp (126053 => 126054)


--- trunk/Source/WebCore/css/StyleBuilder.cpp	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/css/StyleBuilder.cpp	2012-08-20 19:36:03 UTC (rev 126054)
@@ -1934,6 +1934,7 @@
     setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
 #if ENABLE(CSS3_TEXT_DECORATION)
     setPropertyHandler(CSSPropertyWebkitTextDecorationLine, ApplyPropertyTextDecoration::createHandler());
+    setPropertyHandler(CSSPropertyWebkitTextDecorationStyle, ApplyPropertyDefault<TextDecorationStyle, &RenderStyle::textDecorationStyle, TextDecorationStyle, &RenderStyle::setTextDecorationStyle, TextDecorationStyle, &RenderStyle::initialTextDecorationStyle>::createHandler());
 #endif // CSS3_TEXT_DECORATION
     setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler());
     setPropertyHandler(CSSPropertyTextOverflow, ApplyPropertyDefault<TextOverflow, &RenderStyle::textOverflow, TextOverflow, &RenderStyle::setTextOverflow, TextOverflow, &RenderStyle::initialTextOverflow>::createHandler());

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (126053 => 126054)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2012-08-20 19:36:03 UTC (rev 126054)
@@ -4415,6 +4415,7 @@
     case CSSPropertyWebkitTextCombine:
 #if ENABLE(CSS3_TEXT_DECORATION)
     case CSSPropertyWebkitTextDecorationLine:
+    case CSSPropertyWebkitTextDecorationStyle:
 #endif // CSS3_TEXT_DECORATION
     case CSSPropertyWebkitTextEmphasisColor:
     case CSSPropertyWebkitTextEmphasisPosition:

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (126053 => 126054)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2012-08-20 19:36:03 UTC (rev 126054)
@@ -650,6 +650,9 @@
         || rareInheritedData->userSelect != other->rareInheritedData->userSelect
         || rareNonInheritedData->userDrag != other->rareNonInheritedData->userDrag
         || rareNonInheritedData->m_borderFit != other->rareNonInheritedData->m_borderFit
+#if ENABLE(CSS3_TEXT_DECORATION)
+        || rareNonInheritedData->m_textDecorationStyle != other->rareNonInheritedData->m_textDecorationStyle
+#endif // CSS3_TEXT_DECORATION
         || rareInheritedData->textFillColor != other->rareInheritedData->textFillColor
         || rareInheritedData->textStrokeColor != other->rareInheritedData->textStrokeColor
         || rareInheritedData->textEmphasisColor != other->rareInheritedData->textEmphasisColor

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (126053 => 126054)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-08-20 19:36:03 UTC (rev 126054)
@@ -610,6 +610,9 @@
     ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
     ETextDecoration textDecorationsInEffect() const { return static_cast<ETextDecoration>(inherited_flags._text_decorations); }
     ETextDecoration textDecoration() const { return static_cast<ETextDecoration>(visual->textDecoration); }
+#if ENABLE(CSS3_TEXT_DECORATION)
+    TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
+#endif // CSS3_TEXT_DECORATION
     int wordSpacing() const;
     int letterSpacing() const;
 
@@ -1127,6 +1130,9 @@
     void addToTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations |= v; }
     void setTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations = v; }
     void setTextDecoration(ETextDecoration v) { SET_VAR(visual, textDecoration, v); }
+#if ENABLE(CSS3_TEXT_DECORATION)
+    void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
+#endif // CSS3_TEXT_DECORATION
     void setDirection(TextDirection v) { inherited_flags._direction = v; }
     void setLineHeight(Length specifiedLineHeight);
     bool setZoom(float);
@@ -1575,6 +1581,9 @@
     static Length initialLineHeight() { return Length(-100.0, Percent); }
     static ETextAlign initialTextAlign() { return TASTART; }
     static ETextDecoration initialTextDecoration() { return TDNONE; }
+#if ENABLE(CSS3_TEXT_DECORATION)
+    static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; }
+#endif // CSS3_TEXT_DECORATION
     static float initialZoom() { return 1.0f; }
     static int initialOutlineOffset() { return 0; }
     static float initialOpacity() { return 1.0f; }

Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (126053 => 126054)


--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2012-08-20 19:36:03 UTC (rev 126054)
@@ -345,6 +345,16 @@
 inline ETextDecoration operator|(ETextDecoration a, ETextDecoration b) { return ETextDecoration(int(a) | int(b)); }
 inline ETextDecoration& operator|=(ETextDecoration& a, ETextDecoration b) { return a = a | b; }
 
+#if ENABLE(CSS3_TEXT_DECORATION)
+enum TextDecorationStyle {
+    TextDecorationStyleSolid,
+    TextDecorationStyleDouble,
+    TextDecorationStyleDotted,
+    TextDecorationStyleDashed,
+    TextDecorationStyleWavy
+};
+#endif // CSS3_TEXT_DECORATION
+
 enum EPageBreak {
     PBAUTO, PBALWAYS, PBAVOID
 };

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (126053 => 126054)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2012-08-20 19:36:03 UTC (rev 126054)
@@ -72,6 +72,9 @@
     , m_appearance(RenderStyle::initialAppearance())
     , m_borderFit(RenderStyle::initialBorderFit())
     , m_textCombine(RenderStyle::initialTextCombine())
+#if ENABLE(CSS3_TEXT_DECORATION)
+    , m_textDecorationStyle(RenderStyle::initialTextDecorationStyle())
+#endif // CSS3_TEXT_DECORATION
     , m_wrapFlow(RenderStyle::initialWrapFlow())
     , m_wrapThrough(RenderStyle::initialWrapThrough())
 #if USE(ACCELERATED_COMPOSITING)
@@ -143,6 +146,9 @@
     , m_appearance(o.m_appearance)
     , m_borderFit(o.m_borderFit)
     , m_textCombine(o.m_textCombine)
+#if ENABLE(CSS3_TEXT_DECORATION)
+    , m_textDecorationStyle(o.m_textDecorationStyle)
+#endif // CSS3_TEXT_DECORATION
     , m_wrapFlow(o.m_wrapFlow)
     , m_wrapThrough(o.m_wrapThrough)
 #if USE(ACCELERATED_COMPOSITING)
@@ -220,6 +226,9 @@
         && m_appearance == o.m_appearance
         && m_borderFit == o.m_borderFit
         && m_textCombine == o.m_textCombine
+#if ENABLE(CSS3_TEXT_DECORATION)
+        && m_textDecorationStyle == o.m_textDecorationStyle
+#endif // CSS3_TEXT_DECORATION
         && m_wrapFlow == o.m_wrapFlow
         && m_wrapThrough == o.m_wrapThrough
 #if USE(ACCELERATED_COMPOSITING)

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (126053 => 126054)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2012-08-20 19:23:40 UTC (rev 126053)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2012-08-20 19:36:03 UTC (rev 126054)
@@ -176,6 +176,9 @@
     unsigned m_borderFit : 1; // EBorderFit
     unsigned m_textCombine : 1; // CSS3 text-combine properties
 
+#if ENABLE(CSS3_TEXT_DECORATION)
+    unsigned m_textDecorationStyle : 3; // TextDecorationStyle
+#endif // CSS3_TEXT_DECORATION
     unsigned m_wrapFlow: 3; // WrapFlow
     unsigned m_wrapThrough: 1; // WrapThrough
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to