Changeset 290756 in webkit


Ignore:
Timestamp:
Mar 2, 2022 2:28:28 PM (5 months ago)
Author:
Oriol Brufau
Message:

[css] Implement 'text-decoration' as a shorthand.
https://bugs.webkit.org/show_bug.cgi?id=237175

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Update tests to take into account that 'text-decoration' is a shorthand.

  • web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
  • web-platform-tests/css/css-variables/variable-presentation-attribute-expected.txt:
  • web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:

Source/WebCore:

The 'text-decoration' property was considered to be a longhand, sharing
a computed value with 'text-decoration-line'.

This patch switches 'text-decoration' into a shorthand of the following
longhands: 'text-decoration-line', 'text-decoration-thickness',
'text-decoration-style' and 'text-decoration-color'. This is according
to https://www.w3.org/TR/css-text-decor-4/#text-decoration-property

For now I'm keeping the grammar as-is, so 'text-decoration' will only
accept values that are valid in 'text-decoration-line', but will set
the other longhands to the initial value. This should probably change
in a follow-up.

I'm also keeping '-webkit-text-decoration' as-is, as a shorthand of
'text-decoration-{line,style,color}', not including thickness for some
obscure reason. '-webkit-text-decoration' should probably be removed
anyways.

There is a bunch of editing code that was getting/setting/removing
'text-decoration' as a longhand, so I'm switching that to:

  • Use 'text-decoration-line' when getting values.
  • Use 'text-decoration' when setting values, and use a string for the value, this parses it and sets each longhand to the correct value.
  • Use 'text-decoration' get removing declarations, effectively removing all longhands.

This preserves the previous behavior as much as possible.

Tests: fast/css/getComputedStyle/computed-style.html

fast/css/getComputedStyle/computed-style-without-renderer.html
fast/css/getComputedStyle/getComputedStyle-text-decoration.html
fast/css/style-enumerate-properties.html
fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html
fast/css3-text/css3-text-decoration/text-decoration-dashed.html
fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html
fast/css3-text/css3-text-decoration/text-decoration-dotted.html
imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.html
imported/w3c/web-platform-tests/css/css-variables/variable-presentation-attribute.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree.html
svg/css/getComputedStyle-basic.xhtml

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

  • css/CSSProperties.json:
  • css/StyleProperties.cpp:

(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::asText const):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):

  • editing/EditingStyle.cpp:

(WebCore::EditingStyle::styleWithResolvedTextDecorations const):
(WebCore::EditingStyle::collapseTextDecorationProperties):
(WebCore::textDecorationValueList):
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
(WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode const):
(WebCore::EditingStyle::mergeStyle):
(WebCore::EditingStyle::removeEquivalentProperties):
(WebCore::reconcileTextDecorationProperties):
(WebCore::StyleChange::StyleChange):
(WebCore::setTextDecorationProperty):
(WebCore::StyleChange::extractTextStyles):
(WebCore::diffTextDecorations):
(WebCore::extractPropertiesNotIn):

  • editing/cocoa/HTMLConverter.mm:

(HTMLConverterCaches::propertyValueForNode):
(HTMLConverter::computedAttributesForElement):

  • editing/markup.cpp:

(WebCore::serializePreservingVisualAppearanceInternal):

  • style/PropertyAllowlist.cpp:

(WebCore::Style::isValidCueStyleProperty):

LayoutTests:

Update tests to take into account that 'text-decoration' is a shorthand.

  • editing/pasteboard/data-transfer-get-data-on-drop-rich-text-expected.txt:
  • fast/css/getComputedStyle/computed-style-expected.txt:
  • fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
  • fast/css/getComputedStyle/getComputedStyle-text-decoration-expected.txt:
  • fast/css/getComputedStyle/getComputedStyle-text-decoration.html:
  • fast/css/getComputedStyle/resources/property-names.js:
  • fast/css/style-enumerate-properties-expected.txt:
  • fast/css/style-enumerate-properties.html:
  • fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-expected.txt:
  • fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html:
  • fast/css3-text/css3-text-decoration/text-decoration-dashed-expected-mismatch.html:
  • fast/css3-text/css3-text-decoration/text-decoration-dashed.html:
  • fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed-expected-mismatch.html:
  • fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html:
  • fast/css3-text/css3-text-decoration/text-decoration-dotted-expected-mismatch.html:
  • fast/css3-text/css3-text-decoration/text-decoration-dotted.html:
  • fast/events/input-events-paste-rich-datatransfer-expected.txt:
  • platform/glib/fast/css/getComputedStyle/computed-style-expected.txt: Removed.
  • platform/glib/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Removed.
  • platform/glib/svg/css/getComputedStyle-basic-expected.txt: Removed.
  • platform/gtk/fast/events/input-events-paste-rich-datatransfer-expected.txt:
  • platform/gtk/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
  • platform/gtk/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
  • platform/ios/fast/css/getComputedStyle/computed-style-expected.txt: Removed.
  • platform/ios/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Removed.
  • platform/ios/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
  • platform/ios/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
  • platform/ios/svg/css/getComputedStyle-basic-expected.txt: Removed.
  • platform/wpe/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
  • svg/css/getComputedStyle-basic-expected.txt:
Location:
trunk
Files:
4 deleted
39 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r290751 r290756  
     12022-03-02  Oriol Brufau  <obrufau@igalia.com>
     2
     3        [css] Implement 'text-decoration' as a shorthand.
     4        https://bugs.webkit.org/show_bug.cgi?id=237175
     5
     6        Reviewed by Darin Adler.
     7
     8        Update tests to take into account that 'text-decoration' is a shorthand.
     9
     10        * editing/pasteboard/data-transfer-get-data-on-drop-rich-text-expected.txt:
     11        * fast/css/getComputedStyle/computed-style-expected.txt:
     12        * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
     13        * fast/css/getComputedStyle/getComputedStyle-text-decoration-expected.txt:
     14        * fast/css/getComputedStyle/getComputedStyle-text-decoration.html:
     15        * fast/css/getComputedStyle/resources/property-names.js:
     16        * fast/css/style-enumerate-properties-expected.txt:
     17        * fast/css/style-enumerate-properties.html:
     18        * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-expected.txt:
     19        * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html:
     20        * fast/css3-text/css3-text-decoration/text-decoration-dashed-expected-mismatch.html:
     21        * fast/css3-text/css3-text-decoration/text-decoration-dashed.html:
     22        * fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed-expected-mismatch.html:
     23        * fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html:
     24        * fast/css3-text/css3-text-decoration/text-decoration-dotted-expected-mismatch.html:
     25        * fast/css3-text/css3-text-decoration/text-decoration-dotted.html:
     26        * fast/events/input-events-paste-rich-datatransfer-expected.txt:
     27        * platform/glib/fast/css/getComputedStyle/computed-style-expected.txt: Removed.
     28        * platform/glib/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Removed.
     29        * platform/glib/svg/css/getComputedStyle-basic-expected.txt: Removed.
     30        * platform/gtk/fast/events/input-events-paste-rich-datatransfer-expected.txt:
     31        * platform/gtk/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
     32        * platform/gtk/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
     33        * platform/ios/fast/css/getComputedStyle/computed-style-expected.txt: Removed.
     34        * platform/ios/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Removed.
     35        * platform/ios/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
     36        * platform/ios/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
     37        * platform/ios/svg/css/getComputedStyle-basic-expected.txt: Removed.
     38        * platform/wpe/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
     39        * platform/wpe/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
     40        * svg/css/getComputedStyle-basic-expected.txt:
     41
    1422022-03-02  J Pascoe  <j_pascoe@apple.com>
    243
  • trunk/LayoutTests/editing/pasteboard/data-transfer-get-data-on-drop-rich-text-expected.txt

    r224649 r290756  
    66    },
    77    "drop": {
    8         "text/html": "<!DOCTYPE html><strong style=\"font-family: -apple-system; font-size: 150px; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: nowrap; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; color: purple;\">Rich text</strong>",
     8        "text/html": "<!DOCTYPE html><strong style=\"font-family: -apple-system; font-size: 150px; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: nowrap; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: purple;\">Rich text</strong>",
    99        "text/plain": "Rich text"
    1010    }
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt

    r287712 r290756  
    174174text-anchor: start;
    175175text-combine-upright: none;
    176 text-decoration: none;
     176text-decoration-color: rgb(0, 0, 0);
     177text-decoration-line: none;
     178text-decoration-style: solid;
     179text-decoration-thickness: auto;
    177180text-emphasis-color: rgb(0, 0, 0);
    178181text-emphasis-position: over right;
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt

    r287712 r290756  
    173173text-anchor: start
    174174text-combine-upright: none
    175 text-decoration: none
     175text-decoration-color: rgb(0, 0, 0)
     176text-decoration-line: none
     177text-decoration-style: solid
     178text-decoration-thickness: auto
    176179text-emphasis-color: rgb(0, 0, 0)
    177180text-emphasis-position: over right
  • trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-text-decoration-expected.txt

    r153891 r290756  
    55
    66Initial value:
    7 PASS e.style.getPropertyCSSValue('text-decoration') is null
    8 PASS computedStyle.textDecoration is 'none'
    9 PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
    10 PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none'
     7PASS e.style.textDecoration is ''
     8PASS e.style.getPropertyValue('text-decoration') is ''
     9PASS e.style.getPropertyCSSValue('text-decoration') is null
     10PASS e.style.textDecorationLine is ''
     11PASS e.style.getPropertyValue('text-decoration-line') is ''
     12PASS e.style.getPropertyCSSValue('text-decoration-line') is null
     13PASS computedStyle.textDecoration is 'none'
     14PASS computedStyle.getPropertyValue('text-decoration') is 'none'
     15PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
     16PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none'
     17PASS computedStyle.textDecorationLine is 'none'
     18PASS computedStyle.getPropertyValue('text-decoration-line') is 'none'
     19PASS computedStyle.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSPrimitiveValue]'
     20PASS computedStyle.getPropertyCSSValue('text-decoration-line').cssText is 'none'
    1121
    1222Initial value (explicit):
    1323PASS e.style.textDecoration is 'initial'
    14 PASS e.style.getPropertyCSSValue('text-decoration').toString() is '[object CSSValue]'
    15 PASS e.style.getPropertyCSSValue('text-decoration').cssText is 'initial'
    16 PASS computedStyle.textDecoration is 'none'
    17 PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
    18 PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none'
     24PASS e.style.getPropertyValue('text-decoration') is 'initial'
     25PASS e.style.getPropertyCSSValue('text-decoration') is null
     26PASS e.style.textDecorationLine is 'initial'
     27PASS e.style.getPropertyValue('text-decoration-line') is 'initial'
     28PASS e.style.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValue]'
     29PASS e.style.getPropertyCSSValue('text-decoration-line').cssText is 'initial'
     30PASS computedStyle.textDecoration is 'none'
     31PASS computedStyle.getPropertyValue('text-decoration') is 'none'
     32PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
     33PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none'
     34PASS computedStyle.textDecorationLine is 'none'
     35PASS computedStyle.getPropertyValue('text-decoration-line') is 'none'
     36PASS computedStyle.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSPrimitiveValue]'
     37PASS computedStyle.getPropertyCSSValue('text-decoration-line').cssText is 'none'
    1938
    2039Value 'none':
    2140PASS e.style.textDecoration is 'none'
    22 PASS e.style.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
    23 PASS e.style.getPropertyCSSValue('text-decoration').cssText is 'none'
    24 PASS computedStyle.textDecoration is 'none'
    25 PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
    26 PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none'
     41PASS e.style.getPropertyValue('text-decoration') is 'none'
     42PASS e.style.getPropertyCSSValue('text-decoration') is null
     43PASS e.style.textDecorationLine is 'none'
     44PASS e.style.getPropertyValue('text-decoration-line') is 'none'
     45PASS e.style.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSPrimitiveValue]'
     46PASS e.style.getPropertyCSSValue('text-decoration-line').cssText is 'none'
     47PASS computedStyle.textDecoration is 'none'
     48PASS computedStyle.getPropertyValue('text-decoration') is 'none'
     49PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
     50PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none'
     51PASS computedStyle.textDecorationLine is 'none'
     52PASS computedStyle.getPropertyValue('text-decoration-line') is 'none'
     53PASS computedStyle.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSPrimitiveValue]'
     54PASS computedStyle.getPropertyCSSValue('text-decoration-line').cssText is 'none'
    2755
    2856Value 'underline':
    2957PASS e.style.textDecoration is 'underline'
    30 PASS e.style.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
    31 PASS e.style.getPropertyCSSValue('text-decoration').cssText is 'underline'
     58PASS e.style.getPropertyValue('text-decoration') is 'underline'
     59PASS e.style.getPropertyCSSValue('text-decoration') is null
     60PASS e.style.textDecorationLine is 'underline'
     61PASS e.style.getPropertyValue('text-decoration-line') is 'underline'
     62PASS e.style.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValueList]'
     63PASS e.style.getPropertyCSSValue('text-decoration-line').cssText is 'underline'
    3264PASS computedStyle.textDecoration is 'underline'
     65PASS computedStyle.getPropertyValue('text-decoration') is 'underline'
    3366PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
    3467PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'underline'
     68PASS computedStyle.textDecorationLine is 'underline'
     69PASS computedStyle.getPropertyValue('text-decoration-line') is 'underline'
     70PASS computedStyle.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValueList]'
     71PASS computedStyle.getPropertyCSSValue('text-decoration-line').cssText is 'underline'
    3572
    3673Value 'overline':
    3774PASS e.style.textDecoration is 'overline'
    38 PASS e.style.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
    39 PASS e.style.getPropertyCSSValue('text-decoration').cssText is 'overline'
     75PASS e.style.getPropertyValue('text-decoration') is 'overline'
     76PASS e.style.getPropertyCSSValue('text-decoration') is null
     77PASS e.style.textDecorationLine is 'overline'
     78PASS e.style.getPropertyValue('text-decoration-line') is 'overline'
     79PASS e.style.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValueList]'
     80PASS e.style.getPropertyCSSValue('text-decoration-line').cssText is 'overline'
    4081PASS computedStyle.textDecoration is 'overline'
     82PASS computedStyle.getPropertyValue('text-decoration') is 'overline'
    4183PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
    4284PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'overline'
     85PASS computedStyle.textDecorationLine is 'overline'
     86PASS computedStyle.getPropertyValue('text-decoration-line') is 'overline'
     87PASS computedStyle.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValueList]'
     88PASS computedStyle.getPropertyCSSValue('text-decoration-line').cssText is 'overline'
    4389
    4490Value 'line-through':
    4591PASS e.style.textDecoration is 'line-through'
    46 PASS e.style.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
    47 PASS e.style.getPropertyCSSValue('text-decoration').cssText is 'line-through'
     92PASS e.style.getPropertyValue('text-decoration') is 'line-through'
     93PASS e.style.getPropertyCSSValue('text-decoration') is null
     94PASS e.style.textDecorationLine is 'line-through'
     95PASS e.style.getPropertyValue('text-decoration-line') is 'line-through'
     96PASS e.style.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValueList]'
     97PASS e.style.getPropertyCSSValue('text-decoration-line').cssText is 'line-through'
    4898PASS computedStyle.textDecoration is 'line-through'
     99PASS computedStyle.getPropertyValue('text-decoration') is 'line-through'
    49100PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
    50101PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'line-through'
     102PASS computedStyle.textDecorationLine is 'line-through'
     103PASS computedStyle.getPropertyValue('text-decoration-line') is 'line-through'
     104PASS computedStyle.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValueList]'
     105PASS computedStyle.getPropertyCSSValue('text-decoration-line').cssText is 'line-through'
    51106
    52107Value 'underline overline line-through':
    53108PASS e.style.textDecoration is 'underline overline line-through'
    54 PASS e.style.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
    55 PASS e.style.getPropertyCSSValue('text-decoration').cssText is 'underline overline line-through'
     109PASS e.style.getPropertyValue('text-decoration') is 'underline overline line-through'
     110PASS e.style.getPropertyCSSValue('text-decoration') is null
     111PASS e.style.textDecorationLine is 'underline overline line-through'
     112PASS e.style.getPropertyValue('text-decoration-line') is 'underline overline line-through'
     113PASS e.style.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValueList]'
     114PASS e.style.getPropertyCSSValue('text-decoration-line').cssText is 'underline overline line-through'
    56115PASS computedStyle.textDecoration is 'underline overline line-through'
     116PASS computedStyle.getPropertyValue('text-decoration') is 'underline overline line-through'
    57117PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
    58118PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'underline overline line-through'
     119PASS computedStyle.textDecorationLine is 'underline overline line-through'
     120PASS computedStyle.getPropertyValue('text-decoration-line') is 'underline overline line-through'
     121PASS computedStyle.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValueList]'
     122PASS computedStyle.getPropertyCSSValue('text-decoration-line').cssText is 'underline overline line-through'
    59123
    60124Value 'blink' (valid but ignored):
    61125PASS e.style.textDecoration is 'blink'
    62 PASS e.style.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
    63 PASS e.style.getPropertyCSSValue('text-decoration').cssText is 'blink'
    64 PASS computedStyle.textDecoration is 'none'
    65 PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
    66 PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none'
     126PASS e.style.getPropertyValue('text-decoration') is 'blink'
     127PASS e.style.getPropertyCSSValue('text-decoration') is null
     128PASS e.style.textDecorationLine is 'blink'
     129PASS e.style.getPropertyValue('text-decoration-line') is 'blink'
     130PASS e.style.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValueList]'
     131PASS e.style.getPropertyCSSValue('text-decoration-line').cssText is 'blink'
     132PASS computedStyle.textDecoration is 'none'
     133PASS computedStyle.getPropertyValue('text-decoration') is 'none'
     134PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
     135PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none'
     136PASS computedStyle.textDecorationLine is 'none'
     137PASS computedStyle.getPropertyValue('text-decoration-line') is 'none'
     138PASS computedStyle.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSPrimitiveValue]'
     139PASS computedStyle.getPropertyCSSValue('text-decoration-line').cssText is 'none'
    67140
    68141Value '':
    69 PASS e.style.getPropertyCSSValue('text-decoration') is null
    70 PASS computedStyle.textDecoration is 'none'
    71 PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
    72 PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none'
     142PASS e.style.textDecoration is ''
     143PASS e.style.getPropertyValue('text-decoration') is ''
     144PASS e.style.getPropertyCSSValue('text-decoration') is null
     145PASS e.style.textDecorationLine is ''
     146PASS e.style.getPropertyValue('text-decoration-line') is ''
     147PASS e.style.getPropertyCSSValue('text-decoration-line') is null
     148PASS computedStyle.textDecoration is 'none'
     149PASS computedStyle.getPropertyValue('text-decoration') is 'none'
     150PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
     151PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none'
     152PASS computedStyle.textDecorationLine is 'none'
     153PASS computedStyle.getPropertyValue('text-decoration-line') is 'none'
     154PASS computedStyle.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSPrimitiveValue]'
     155PASS computedStyle.getPropertyCSSValue('text-decoration-line').cssText is 'none'
    73156
    74157Parent gets 'underline' value:
    75158PASS e.style.textDecoration is 'underline'
    76 PASS e.style.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
    77 PASS e.style.getPropertyCSSValue('text-decoration').cssText is 'underline'
     159PASS e.style.getPropertyValue('text-decoration') is 'underline'
     160PASS e.style.getPropertyCSSValue('text-decoration') is null
     161PASS e.style.textDecorationLine is 'underline'
     162PASS e.style.getPropertyValue('text-decoration-line') is 'underline'
     163PASS e.style.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValueList]'
     164PASS e.style.getPropertyCSSValue('text-decoration-line').cssText is 'underline'
    78165PASS computedStyle.textDecoration is 'underline'
     166PASS computedStyle.getPropertyValue('text-decoration') is 'underline'
    79167PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
    80168PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'underline'
     169PASS computedStyle.textDecorationLine is 'underline'
     170PASS computedStyle.getPropertyValue('text-decoration-line') is 'underline'
     171PASS computedStyle.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValueList]'
     172PASS computedStyle.getPropertyCSSValue('text-decoration-line').cssText is 'underline'
    81173
    82174Ancestor should explicitly inherit value from parent when 'inherit' value is used:
    83175PASS e.style.textDecoration is 'inherit'
    84 PASS e.style.getPropertyCSSValue('text-decoration').toString() is '[object CSSValue]'
    85 PASS e.style.getPropertyCSSValue('text-decoration').cssText is 'inherit'
     176PASS e.style.getPropertyValue('text-decoration') is 'inherit'
     177PASS e.style.getPropertyCSSValue('text-decoration') is null
     178PASS e.style.textDecorationLine is 'inherit'
     179PASS e.style.getPropertyValue('text-decoration-line') is 'inherit'
     180PASS e.style.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValue]'
     181PASS e.style.getPropertyCSSValue('text-decoration-line').cssText is 'inherit'
    86182PASS computedStyle.textDecoration is 'underline'
     183PASS computedStyle.getPropertyValue('text-decoration') is 'underline'
    87184PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
    88185PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'underline'
     186PASS computedStyle.textDecorationLine is 'underline'
     187PASS computedStyle.getPropertyValue('text-decoration-line') is 'underline'
     188PASS computedStyle.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSValueList]'
     189PASS computedStyle.getPropertyCSSValue('text-decoration-line').cssText is 'underline'
    89190
    90191Ancestor should not implicitly inherit value from parent (i.e. when value is void):
    91 PASS e.style.getPropertyCSSValue('text-decoration') is null
    92 PASS computedStyle.textDecoration is 'none'
    93 PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
    94 PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none'
     192PASS e.style.textDecoration is ''
     193PASS e.style.getPropertyValue('text-decoration') is ''
     194PASS e.style.getPropertyCSSValue('text-decoration') is null
     195PASS e.style.textDecorationLine is ''
     196PASS e.style.getPropertyValue('text-decoration-line') is ''
     197PASS e.style.getPropertyCSSValue('text-decoration-line') is null
     198PASS computedStyle.textDecoration is 'none'
     199PASS computedStyle.getPropertyValue('text-decoration') is 'none'
     200PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSPrimitiveValue]'
     201PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none'
     202PASS computedStyle.textDecorationLine is 'none'
     203PASS computedStyle.getPropertyValue('text-decoration-line') is 'none'
     204PASS computedStyle.getPropertyCSSValue('text-decoration-line').toString() is '[object CSSPrimitiveValue]'
     205PASS computedStyle.getPropertyCSSValue('text-decoration-line').cssText is 'none'
    95206
    96207PASS successfullyParsed is true
  • trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-text-decoration.html

    r217390 r290756  
    66<body>
    77<script>
    8 function testElementStyle(propertyJS, propertyCSS, type, value)
     8function testElementStyle(type, value)
    99{
    1010    if (type != null) {
    11         shouldBe("e.style." + propertyJS, "'" + value + "'");
    12         shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').toString()", "'" + type + "'");
    13         shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'");
    14     } else
    15         shouldBeNull("e.style.getPropertyCSSValue('" + propertyCSS + "')");
     11        shouldBe("e.style.textDecoration", "'" + value + "'");
     12        shouldBe("e.style.getPropertyValue('text-decoration')", "'" + value + "'");
     13        shouldBeNull("e.style.getPropertyCSSValue('text-decoration')");
     14
     15        shouldBe("e.style.textDecorationLine", "'" + value + "'");
     16        shouldBe("e.style.getPropertyValue('text-decoration-line')", "'" + value + "'");
     17        shouldBe("e.style.getPropertyCSSValue('text-decoration-line').toString()", "'" + type + "'");
     18        shouldBe("e.style.getPropertyCSSValue('text-decoration-line').cssText", "'" + value + "'");
     19    } else {
     20        shouldBe("e.style.textDecoration", "''");
     21        shouldBe("e.style.getPropertyValue('text-decoration')", "''");
     22        shouldBeNull("e.style.getPropertyCSSValue('text-decoration')");
     23
     24        shouldBe("e.style.textDecorationLine", "''");
     25        shouldBe("e.style.getPropertyValue('text-decoration-line')", "''");
     26        shouldBeNull("e.style.getPropertyCSSValue('text-decoration-line')");
     27    }
    1628}
    1729
    18 function testComputedStyle(propertyJS, propertyCSS, type, value)
     30function testComputedStyle(type, value)
    1931{
    2032    computedStyle = window.getComputedStyle(e, null);
    21     shouldBe("computedStyle." + propertyJS, "'" + value + "'");
    22     shouldBe("computedStyle.getPropertyCSSValue('" + propertyCSS + "').toString()", "'" + type + "'");
    23     shouldBe("computedStyle.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'");
     33
     34    shouldBe("computedStyle.textDecoration", "'" + value + "'");
     35    shouldBe("computedStyle.getPropertyValue('text-decoration')", "'" + value + "'");
     36    shouldBe("computedStyle.getPropertyCSSValue('text-decoration').toString()", "'" + type + "'");
     37    shouldBe("computedStyle.getPropertyCSSValue('text-decoration').cssText", "'" + value + "'");
     38
     39    shouldBe("computedStyle.textDecorationLine", "'" + value + "'");
     40    shouldBe("computedStyle.getPropertyValue('text-decoration-line')", "'" + value + "'");
     41    shouldBe("computedStyle.getPropertyCSSValue('text-decoration-line').toString()", "'" + type + "'");
     42    shouldBe("computedStyle.getPropertyCSSValue('text-decoration-line').cssText", "'" + value + "'");
    2443}
    2544
     
    3352debug("Initial value:");
    3453e = document.getElementById('test');
    35 testElementStyle("textDecoration", "text-decoration", null, '');
    36 testComputedStyle("textDecoration", "text-decoration", "[object CSSPrimitiveValue]", "none");
     54testElementStyle(null, '');
     55testComputedStyle("[object CSSPrimitiveValue]", "none");
    3756debug('');
    3857
    3958debug("Initial value (explicit):");
    4059e.style.textDecoration = 'initial';
    41 testElementStyle("textDecoration", "text-decoration", "[object CSSValue]", "initial");
    42 testComputedStyle("textDecoration", "text-decoration", "[object CSSPrimitiveValue]", "none");
     60testElementStyle("[object CSSValue]", "initial");
     61testComputedStyle("[object CSSPrimitiveValue]", "none");
    4362debug('');
    4463
    4564debug("Value 'none':");
    4665e.style.textDecoration = 'none';
    47 testElementStyle("textDecoration", "text-decoration", "[object CSSPrimitiveValue]", "none");
    48 testComputedStyle("textDecoration", "text-decoration", "[object CSSPrimitiveValue]", "none");
     66testElementStyle("[object CSSPrimitiveValue]", "none");
     67testComputedStyle("[object CSSPrimitiveValue]", "none");
    4968debug('');
    5069
    5170debug("Value 'underline':");
    5271e.style.textDecoration = 'underline';
    53 testElementStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline");
    54 testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline");
     72testElementStyle("[object CSSValueList]", "underline");
     73testComputedStyle("[object CSSValueList]", "underline");
    5574debug('');
    5675
    5776debug("Value 'overline':");
    5877e.style.textDecoration = 'overline';
    59 testElementStyle("textDecoration", "text-decoration", "[object CSSValueList]", "overline");
    60 testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "overline");
     78testElementStyle("[object CSSValueList]", "overline");
     79testComputedStyle("[object CSSValueList]", "overline");
    6180debug('');
    6281
    6382debug("Value 'line-through':");
    6483e.style.textDecoration = 'line-through';
    65 testElementStyle("textDecoration", "text-decoration", "[object CSSValueList]", "line-through");
    66 testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "line-through");
     84testElementStyle("[object CSSValueList]", "line-through");
     85testComputedStyle("[object CSSValueList]", "line-through");
    6786debug('');
    6887
    6988debug("Value 'underline overline line-through':");
    7089e.style.textDecoration = 'underline overline line-through';
    71 testElementStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline overline line-through");
    72 testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline overline line-through");
     90testElementStyle("[object CSSValueList]", "underline overline line-through");
     91testComputedStyle("[object CSSValueList]", "underline overline line-through");
    7392debug('');
    7493
    7594debug("Value 'blink' (valid but ignored):");
    7695e.style.textDecoration = 'blink';
    77 testElementStyle("textDecoration", "text-decoration", "[object CSSValueList]", "blink");
    78 testComputedStyle("textDecoration", "text-decoration", "[object CSSPrimitiveValue]", "none");
     96testElementStyle("[object CSSValueList]", "blink");
     97testComputedStyle("[object CSSPrimitiveValue]", "none");
    7998debug('');
    8099
    81100debug("Value '':");
    82101e.style.textDecoration = '';
    83 testElementStyle("textDecoration", "text-decoration", null, '');
    84 testComputedStyle("textDecoration", "text-decoration", "[object CSSPrimitiveValue]", "none");
     102testElementStyle(null, '');
     103testComputedStyle("[object CSSPrimitiveValue]", "none");
    85104debug('');
    86105
     
    88107debug("Parent gets 'underline' value:");
    89108e = document.getElementById('test-parent');
    90 testElementStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline");
    91 testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline");
     109testElementStyle("[object CSSValueList]", "underline");
     110testComputedStyle("[object CSSValueList]", "underline");
    92111debug('');
    93112
    94113debug("Ancestor should explicitly inherit value from parent when 'inherit' value is used:");
    95114e = document.getElementById('test-ancestor');
    96 testElementStyle("textDecoration", "text-decoration", "[object CSSValue]", "inherit");
    97 testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline");
     115testElementStyle("[object CSSValue]", "inherit");
     116testComputedStyle("[object CSSValueList]", "underline");
    98117debug('');
    99118
    100119debug("Ancestor should not implicitly inherit value from parent (i.e. when value is void):");
    101120e.style.textDecoration = '';
    102 testElementStyle("textDecoration", "text-decoration", null, '');
    103 testComputedStyle("textDecoration", "text-decoration", "[object CSSPrimitiveValue]", "none");
     121testElementStyle(null, '');
     122testComputedStyle("[object CSSPrimitiveValue]", "none");
    104123debug('');
    105124
  • trunk/LayoutTests/fast/css/getComputedStyle/resources/property-names.js

    r287712 r290756  
    258258    "text-align": true,
    259259    "text-anchor": true,
    260     "text-decoration": true,
     260    "text-decoration-color": true,
     261    "text-decoration-line": true,
     262    "text-decoration-style": true,
     263    "text-decoration-thickness": true,
    261264    "text-indent": true,
    262265    "text-overflow": true,
  • trunk/LayoutTests/fast/css/style-enumerate-properties-expected.txt

    r275808 r290756  
    11This test makes sure that CSSStyleDeclaration enumerates JavaScript properties for defined and non-defined CSS properties, indexed properties, and properties defined on the prototype. See Bug 23946.
    2 PASS document.body.style.length is 2
     2PASS document.body.style.length is 5
    33PASS '0' in document.body.style is true
    44PASS '1' in document.body.style is true
     5PASS '2' in document.body.style is true
     6PASS '3' in document.body.style is true
     7PASS '4' in document.body.style is true
     8PASS document.body.style[0] is 'text-decoration-line'
     9PASS document.body.style[1] is 'text-decoration-thickness'
     10PASS document.body.style[2] is 'text-decoration-style'
     11PASS document.body.style[3] is 'text-decoration-color'
     12PASS document.body.style[4] is 'border-top-color'
    513PASS 'textDecoration' in document.body.style is true
    614PASS 'borderTopColor' in document.body.style is true
     
    1725PASS initialIndexOfGroup5 > initialIndexOfGroup4 is true
    1826PASS initialIndexOfGroup6 > initialIndexOfGroup5 is true
    19 PASS group1 is ["0", "1", "cssText", "length", "parentRule", "cssFloat"]
     27PASS group1 is ["0", "1", "2", "3", "4", "cssText", "length", "parentRule", "cssFloat"]
    2028PASS group2 is group2Clone
    2129PASS group2.some(property => property.startsWith("Webkit")) is true
  • trunk/LayoutTests/fast/css/style-enumerate-properties.html

    r275808 r290756  
    99            testRunner.dumpAsText();
    1010
    11         shouldBe("document.body.style.length", "2");
     11        shouldBe("document.body.style.length", "5");
    1212        shouldBeTrue("'0' in document.body.style");
    1313        shouldBeTrue("'1' in document.body.style");
     14        shouldBeTrue("'2' in document.body.style");
     15        shouldBeTrue("'3' in document.body.style");
     16        shouldBeTrue("'4' in document.body.style");
     17        shouldBe("document.body.style[0]", "'text-decoration-line'");
     18        shouldBe("document.body.style[1]", "'text-decoration-thickness'");
     19        shouldBe("document.body.style[2]", "'text-decoration-style'");
     20        shouldBe("document.body.style[3]", "'text-decoration-color'");
     21        shouldBe("document.body.style[4]", "'border-top-color'");
    1422        shouldBeTrue("'textDecoration' in document.body.style");
    1523        shouldBeTrue("'borderTopColor' in document.body.style");
     
    6169
    6270        // Group 1
    63         shouldBe(`group1`, `["0", "1", "cssText", "length", "parentRule", "cssFloat"]`);
     71        shouldBe(`group1`, `["0", "1", "2", "3", "4", "cssText", "length", "parentRule", "cssFloat"]`);
    6472
    6573        // Group 2 - Camel Case
  • trunk/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-expected.txt

    r180441 r290756  
    66Initial values:
    77PASS e.style.getPropertyCSSValue('-webkit-text-decoration') is null
    8 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration').cssText is 'none solid rgb(0, 0, 0)'
    9 PASS checkComputedStyleValue() is true
     8PASS computedStyle.getPropertyValue('-webkit-text-decoration') is 'none solid rgb(0, 0, 0)'
     9PASS checkComputedStyleValue('webkitTextDecoration', '-webkit-text-decoration') is true
    1010
    1111CSS2.1 backwards compatibility ("-webkit-text-decoration: underline overline line-through blink;"):
    12 PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline overline line-through blink'
    13 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline overline line-through'
    14 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration').cssText is 'underline overline line-through solid rgb(0, 0, 0)'
    15 PASS checkComputedStyleValue() is true
     12PASS e.style.getPropertyValue('-webkit-text-decoration-line') is 'underline overline line-through blink'
     13PASS computedStyle.getPropertyValue('-webkit-text-decoration-line') is 'underline overline line-through'
     14PASS computedStyle.getPropertyValue('-webkit-text-decoration') is 'underline overline line-through solid rgb(0, 0, 0)'
     15PASS checkComputedStyleValue('webkitTextDecoration', '-webkit-text-decoration') is true
    1616
    1717CSS3 Shorthand ("-webkit-text-decoration: underline overline line-through blink dashed red;"):
    18 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration').cssText is 'underline overline line-through dashed rgb(255, 0, 0)'
    19 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline overline line-through'
    20 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dashed'
    21 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-color').cssText is 'rgb(255, 0, 0)'
    22 PASS checkComputedStyleValue() is true
     18PASS computedStyle.getPropertyValue('-webkit-text-decoration') is 'underline overline line-through dashed rgb(255, 0, 0)'
     19PASS computedStyle.getPropertyValue('-webkit-text-decoration-line') is 'underline overline line-through'
     20PASS computedStyle.getPropertyValue('-webkit-text-decoration-style') is 'dashed'
     21PASS computedStyle.getPropertyValue('-webkit-text-decoration-color') is 'rgb(255, 0, 0)'
     22PASS checkComputedStyleValue('webkitTextDecoration', '-webkit-text-decoration') is true
    2323
    2424Omitting text decoration line resets to its initial value "none" ("-webkit-text-decoration: navy dotted;"):
    25 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration').cssText is 'none dotted rgb(0, 0, 128)'
    26 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'none'
    27 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dotted'
    28 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-color').cssText is 'rgb(0, 0, 128)'
    29 PASS checkComputedStyleValue() is true
     25PASS computedStyle.getPropertyValue('-webkit-text-decoration') is 'none dotted rgb(0, 0, 128)'
     26PASS computedStyle.getPropertyValue('-webkit-text-decoration-line') is 'none'
     27PASS computedStyle.getPropertyValue('-webkit-text-decoration-style') is 'dotted'
     28PASS computedStyle.getPropertyValue('-webkit-text-decoration-color') is 'rgb(0, 0, 128)'
     29PASS checkComputedStyleValue('webkitTextDecoration', '-webkit-text-decoration') is true
     30
     31CSS2.1 backwards compatibility of non-prefixed shorthand ("text-decoration: underline overline line-through blink;"):
     32PASS e.style.getPropertyValue('text-decoration') is 'underline overline line-through blink'
     33PASS e.style.getPropertyValue('text-decoration-line') is 'underline overline line-through blink'
     34PASS e.style.getPropertyValue('text-decoration-thickness') is 'auto'
     35PASS e.style.getPropertyValue('text-decoration-style') is 'solid'
     36PASS e.style.getPropertyValue('text-decoration-color') is 'currentcolor'
     37PASS computedStyle.getPropertyValue('text-decoration') is 'underline overline line-through'
     38PASS computedStyle.getPropertyValue('text-decoration-line') is 'underline overline line-through'
     39PASS computedStyle.getPropertyValue('text-decoration-thickness') is 'auto'
     40PASS computedStyle.getPropertyValue('text-decoration-style') is 'solid'
     41PASS computedStyle.getPropertyValue('text-decoration-color') is 'rgb(0, 0, 0)'
     42PASS checkComputedStyleValue('textDecoration', 'text-decoration') is true
     43
     44Setting CSS3 longhands to initial values ("text-decoration-line: none; text-decoration-thickness: auto; text-decoration-style: solid; text-decoration-color: currentcolor;"):
     45PASS e.style.getPropertyValue('text-decoration') is 'none'
     46PASS e.style.getPropertyValue('text-decoration-line') is 'none'
     47PASS e.style.getPropertyValue('text-decoration-thickness') is 'auto'
     48PASS e.style.getPropertyValue('text-decoration-style') is 'solid'
     49PASS e.style.getPropertyValue('text-decoration-color') is 'currentcolor'
     50PASS computedStyle.getPropertyValue('text-decoration') is 'none'
     51PASS computedStyle.getPropertyValue('text-decoration-line') is 'none'
     52PASS computedStyle.getPropertyValue('text-decoration-thickness') is 'auto'
     53PASS computedStyle.getPropertyValue('text-decoration-style') is 'solid'
     54PASS computedStyle.getPropertyValue('text-decoration-color') is 'rgb(0, 0, 0)'
     55PASS checkComputedStyleValue('textDecoration', 'text-decoration') is true
     56
     57Setting CSS3 longhands to values backwards compatibile with CSS2.1 ("text-decoration-line: underline overline line-through blink; text-decoration-thickness: auto; text-decoration-style: solid; text-decoration-color: currentcolor;"):
     58PASS e.style.getPropertyValue('text-decoration') is 'underline overline line-through blink'
     59PASS e.style.getPropertyValue('text-decoration-line') is 'underline overline line-through blink'
     60PASS e.style.getPropertyValue('text-decoration-thickness') is 'auto'
     61PASS e.style.getPropertyValue('text-decoration-style') is 'solid'
     62PASS e.style.getPropertyValue('text-decoration-color') is 'currentcolor'
     63PASS computedStyle.getPropertyValue('text-decoration') is 'underline overline line-through'
     64PASS computedStyle.getPropertyValue('text-decoration-line') is 'underline overline line-through'
     65PASS computedStyle.getPropertyValue('text-decoration-thickness') is 'auto'
     66PASS computedStyle.getPropertyValue('text-decoration-style') is 'solid'
     67PASS computedStyle.getPropertyValue('text-decoration-color') is 'rgb(0, 0, 0)'
     68PASS checkComputedStyleValue('textDecoration', 'text-decoration') is true
     69
     70Setting CSS3 longhands to values not backwards compatibile with CSS2.1 ("text-decoration-line: underline overline line-through blink; text-decoration-thickness: 16px; text-decoration-style: dotted; text-decoration-color: blue;"):
     71PASS e.style.getPropertyValue('text-decoration') is ''
     72PASS e.style.getPropertyValue('text-decoration-line') is 'underline overline line-through blink'
     73PASS e.style.getPropertyValue('text-decoration-thickness') is '16px'
     74PASS e.style.getPropertyValue('text-decoration-style') is 'dotted'
     75PASS e.style.getPropertyValue('text-decoration-color') is 'blue'
     76PASS computedStyle.getPropertyValue('text-decoration') is ''
     77PASS computedStyle.getPropertyValue('text-decoration-line') is 'underline overline line-through'
     78PASS computedStyle.getPropertyValue('text-decoration-thickness') is '16px'
     79PASS computedStyle.getPropertyValue('text-decoration-style') is 'dotted'
     80PASS computedStyle.getPropertyValue('text-decoration-color') is 'rgb(0, 0, 255)'
     81PASS checkComputedStyleValue('textDecoration', 'text-decoration') is false
    3082
    3183PASS successfullyParsed is true
  • trunk/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html

    r155263 r290756  
    88            function testElementStyle(propertyJS, propertyCSS, value)
    99            {
    10                 shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'");
     10                shouldBe("e.style.getPropertyValue('" + propertyCSS + "')", "'" + value + "'");
    1111            }
    1212
     
    1414            {
    1515                computedStyle = window.getComputedStyle(e, null);
    16                 shouldBe("computedStyle.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'");
     16                shouldBe("computedStyle.getPropertyValue('" + propertyCSS + "')", "'" + value + "'");
    1717            }
    1818
    19             function checkComputedStyleValue() {
    20                 var before = window.getComputedStyle(e, null).getPropertyValue('-webkit-text-decoration');
    21                 e.style.webkitTextDecoration = 'none';
    22                 e.style.webkitTextDecoration = before;
    23                 return (window.getComputedStyle(e, null).getPropertyValue('-webkit-text-decoration') == before);
     19            function checkComputedStyleValue(propertyJS, propertyCSS) {
     20                var before = window.getComputedStyle(e, null).getPropertyValue(propertyCSS);
     21                e.style[propertyJS] = 'none';
     22                e.style[propertyJS] = before;
     23                return (window.getComputedStyle(e, null).getPropertyValue(propertyCSS) == before);
    2424            }
    2525
     
    3737            shouldBeNull("e.style.getPropertyCSSValue('-webkit-text-decoration')");
    3838            testComputedStyle("webkitTextDecoration", "-webkit-text-decoration", "none solid rgb(0, 0, 0)");
    39             shouldBe("checkComputedStyleValue()", "true");
     39            shouldBe("checkComputedStyleValue('webkitTextDecoration', '-webkit-text-decoration')", "true");
    4040            debug('');
    4141
     
    4545            testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "underline overline line-through");
    4646            testComputedStyle("webkitTextDecoration", "-webkit-text-decoration", "underline overline line-through solid rgb(0, 0, 0)");
    47             shouldBe("checkComputedStyleValue()", "true");
     47            shouldBe("checkComputedStyleValue('webkitTextDecoration', '-webkit-text-decoration')", "true");
    4848            debug('');
    4949
     
    5454            testComputedStyle("webkitTextDecorationStyle", "-webkit-text-decoration-style", "dashed");
    5555            testComputedStyle("webkitTextDecorationColor", "-webkit-text-decoration-color", "rgb(255, 0, 0)");
    56             shouldBe("checkComputedStyleValue()", "true");
     56            shouldBe("checkComputedStyleValue('webkitTextDecoration', '-webkit-text-decoration')", "true");
    5757            debug('');
    5858
     
    6363            testComputedStyle("webkitTextDecorationStyle", "-webkit-text-decoration-style", "dotted");
    6464            testComputedStyle("webkitTextDecorationColor", "-webkit-text-decoration-color", "rgb(0, 0, 128)");
    65             shouldBe("checkComputedStyleValue()", "true");
     65            shouldBe("checkComputedStyleValue('webkitTextDecoration', '-webkit-text-decoration')", "true");
     66            debug('');
     67
     68            debug('CSS2.1 backwards compatibility of non-prefixed shorthand ("text-decoration: underline overline line-through blink;"):');
     69            e.style.cssText = "text-decoration: underline overline line-through blink";
     70            testElementStyle("textDecoration", "text-decoration", "underline overline line-through blink");
     71            testElementStyle("textDecorationLine", "text-decoration-line", "underline overline line-through blink");
     72            testElementStyle("textDecorationThickness", "text-decoration-thickness", "auto");
     73            testElementStyle("textDecorationStyle", "text-decoration-style", "solid");
     74            testElementStyle("textDecorationColor", "text-decoration-color", "currentcolor");
     75            testComputedStyle("textDecoration", "text-decoration", "underline overline line-through");
     76            testComputedStyle("textDecorationLine", "text-decoration-line", "underline overline line-through");
     77            testComputedStyle("textDecorationThickness", "text-decoration-thickness", "auto");
     78            testComputedStyle("textDecorationStyle", "text-decoration-style", "solid");
     79            testComputedStyle("textDecorationColor", "text-decoration-color", "rgb(0, 0, 0)");
     80            shouldBe("checkComputedStyleValue('textDecoration', 'text-decoration')", "true");
     81            debug('');
     82
     83            debug('Setting CSS3 longhands to initial values ("text-decoration-line: none; text-decoration-thickness: auto; text-decoration-style: solid; text-decoration-color: currentcolor;"):');
     84            e.style.cssText = "text-decoration-line: none; text-decoration-thickness: auto; text-decoration-style: solid; text-decoration-color: currentcolor;";
     85            testElementStyle("textDecoration", "text-decoration", "none");
     86            testElementStyle("textDecorationLine", "text-decoration-line", "none");
     87            testElementStyle("textDecorationThickness", "text-decoration-thickness", "auto");
     88            testElementStyle("textDecorationStyle", "text-decoration-style", "solid");
     89            testElementStyle("textDecorationColor", "text-decoration-color", "currentcolor");
     90            testComputedStyle("textDecoration", "text-decoration", "none");
     91            testComputedStyle("textDecorationLine", "text-decoration-line", "none");
     92            testComputedStyle("textDecorationThickness", "text-decoration-thickness", "auto");
     93            testComputedStyle("textDecorationStyle", "text-decoration-style", "solid");
     94            testComputedStyle("textDecorationColor", "text-decoration-color", "rgb(0, 0, 0)");
     95            shouldBe("checkComputedStyleValue('textDecoration', 'text-decoration')", "true");
     96            debug('');
     97
     98            debug('Setting CSS3 longhands to values backwards compatibile with CSS2.1 ("text-decoration-line: underline overline line-through blink; text-decoration-thickness: auto; text-decoration-style: solid; text-decoration-color: currentcolor;"):');
     99            e.style.cssText = "text-decoration-line: underline overline line-through blink; text-decoration-thickness: auto; text-decoration-style: solid; text-decoration-color: currentcolor;";
     100            testElementStyle("textDecoration", "text-decoration", "underline overline line-through blink");
     101            testElementStyle("textDecorationLine", "text-decoration-line", "underline overline line-through blink");
     102            testElementStyle("textDecorationThickness", "text-decoration-thickness", "auto");
     103            testElementStyle("textDecorationStyle", "text-decoration-style", "solid");
     104            testElementStyle("textDecorationColor", "text-decoration-color", "currentcolor");
     105            testComputedStyle("textDecoration", "text-decoration", "underline overline line-through");
     106            testComputedStyle("textDecorationLine", "text-decoration-line", "underline overline line-through");
     107            testComputedStyle("textDecorationThickness", "text-decoration-thickness", "auto");
     108            testComputedStyle("textDecorationStyle", "text-decoration-style", "solid");
     109            testComputedStyle("textDecorationColor", "text-decoration-color", "rgb(0, 0, 0)");
     110            shouldBe("checkComputedStyleValue('textDecoration', 'text-decoration')", "true");
     111            debug('');
     112
     113            debug('Setting CSS3 longhands to values not backwards compatibile with CSS2.1 ("text-decoration-line: underline overline line-through blink; text-decoration-thickness: 16px; text-decoration-style: dotted; text-decoration-color: blue;"):');
     114            e.style.cssText = "text-decoration-line: underline overline line-through blink; text-decoration-thickness: 16px; text-decoration-style: dotted; text-decoration-color: blue;";
     115            testElementStyle("textDecoration", "text-decoration", "");
     116            testElementStyle("textDecorationLine", "text-decoration-line", "underline overline line-through blink");
     117            testElementStyle("textDecorationThickness", "text-decoration-thickness", "16px");
     118            testElementStyle("textDecorationStyle", "text-decoration-style", "dotted");
     119            testElementStyle("textDecorationColor", "text-decoration-color", "blue");
     120            testComputedStyle("textDecoration", "text-decoration", "");
     121            testComputedStyle("textDecorationLine", "text-decoration-line", "underline overline line-through");
     122            testComputedStyle("textDecorationThickness", "text-decoration-thickness", "16px");
     123            testComputedStyle("textDecorationStyle", "text-decoration-style", "dotted");
     124            testComputedStyle("textDecorationColor", "text-decoration-color", "rgb(0, 0, 255)");
     125            shouldBe("checkComputedStyleValue('textDecoration', 'text-decoration')", "false");
    66126            debug('');
    67127
  • trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dashed-expected-mismatch.html

    r201777 r290756  
    44</head>
    55<body>
    6 <div style="font-size: 40px; -webkit-text-decoration-style: solid; text-decoration: underline;">dotyedgdesc</div>
     6<div style="font-size: 40px; -webkit-text-decoration-style: solid; text-decoration-line: underline;">dotyedgdesc</div>
    77</body>
    88</html>
  • trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dashed.html

    r201777 r290756  
    44</head>
    55<body>
    6 <div style="font-size: 40px; -webkit-text-decoration-style: dashed; text-decoration: underline;">dotyedgdesc</div>
     6<div style="font-size: 40px; -webkit-text-decoration-style: dashed; text-decoration-line: underline;">dotyedgdesc</div>
    77</body>
    88</html>
  • trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed-expected-mismatch.html

    r201777 r290756  
    44</head>
    55<body>
    6 <div style="font-size: 40px; -webkit-text-decoration-style: dashed; text-decoration: underline;">dotyedgdesc</div>
     6<div style="font-size: 40px; -webkit-text-decoration-style: dashed; text-decoration-line: underline;">dotyedgdesc</div>
    77</body>
    88</html>
  • trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html

    r201777 r290756  
    44</head>
    55<body>
    6 <div style="font-size: 40px; -webkit-text-decoration-style: dotted; text-decoration: underline;">dotyedgdesc</div>
     6<div style="font-size: 40px; -webkit-text-decoration-style: dotted; text-decoration-line: underline;">dotyedgdesc</div>
    77</body>
    88</html>
  • trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dotted-expected-mismatch.html

    r201777 r290756  
    44</head>
    55<body>
    6 <div style="font-size: 40px; -webkit-text-decoration-style: solid; text-decoration: underline;">dotyedgdesc</div>
     6<div style="font-size: 40px; -webkit-text-decoration-style: solid; text-decoration-line: underline;">dotyedgdesc</div>
    77</body>
    88</html>
  • trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dotted.html

    r201777 r290756  
    44</head>
    55<body>
    6 <div style="font-size: 40px; -webkit-text-decoration-style: dotted; text-decoration: underline;">dotyedgdesc</div>
     6<div style="font-size: 40px; -webkit-text-decoration-style: dotted; text-decoration-line: underline;">dotyedgdesc</div>
    77</body>
    88</html>
  • trunk/LayoutTests/fast/events/input-events-paste-rich-datatransfer-expected.txt

    r224649 r290756  
    33destination after pasting (text/html):
    44| <b>
    5 |   style="caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;"
     5|   style="caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"
    66|   "LayoutTests"
    77|   <i>
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r290741 r290756  
     12022-03-02  Oriol Brufau  <obrufau@igalia.com>
     2
     3        [css] Implement 'text-decoration' as a shorthand.
     4        https://bugs.webkit.org/show_bug.cgi?id=237175
     5
     6        Reviewed by Darin Adler.
     7
     8        Update tests to take into account that 'text-decoration' is a shorthand.
     9
     10        * web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
     11        * web-platform-tests/css/css-variables/variable-presentation-attribute-expected.txt:
     12        * web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
     13
    1142022-03-02  Antoine Quint  <graouts@webkit.org>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt

    r288869 r290756  
    287287PASS text-anchor
    288288PASS text-combine-upright
    289 PASS text-decoration
    290289PASS text-decoration-color
    291290PASS text-decoration-line
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-variables/variable-presentation-attribute-expected.txt

    r287909 r290756  
    4444PASS Testing 'stroke-width'.
    4545PASS Testing 'text-anchor'.
    46 FAIL Testing 'text-decoration'. assert_equals: Value Test. expected "underline" but got "none"
     46PASS Testing 'text-decoration'.
    4747PASS Testing 'visibility'.
    4848PASS Testing 'word-spacing'.
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt

    r288869 r290756  
    11
    22PASS getComputedStyle returns no style for detached element
    3 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 397
    4 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 397
    5 FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 397
    6 FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 397
     3FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 396
     4FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 396
     5FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 396
     6FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 396
    77PASS getComputedStyle returns no style for shadow tree outside of flattened tree
    88
  • trunk/LayoutTests/platform/gtk/fast/events/input-events-paste-rich-datatransfer-expected.txt

    r224874 r290756  
    33destination after pasting (text/html):
    44| <b>
    5 |   style="caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; text-decoration: none;"
     5|   style="caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px;"
    66|   "LayoutTests"
    77|   <i>
  • trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt

    r289758 r290756  
    287287PASS text-anchor
    288288PASS text-combine-upright
    289 PASS text-decoration
    290289PASS text-decoration-color
    291290PASS text-decoration-line
  • trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt

    r289459 r290756  
    11
    22PASS getComputedStyle returns no style for detached element
    3 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 395
    4 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 395
    5 FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 395
    6 FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 395
     3FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 394
     4FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 394
     5FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 394
     6FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 394
    77PASS getComputedStyle returns no style for shadow tree outside of flattened tree
    88
  • trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt

    r288869 r290756  
    257257PASS text-anchor
    258258PASS text-combine-upright
    259 PASS text-decoration
    260259PASS text-decoration-color
    261260PASS text-decoration-line
  • trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt

    r288869 r290756  
    11
    22PASS getComputedStyle returns no style for detached element
    3 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 399
    4 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 399
    5 FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 399
    6 FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 399
     3FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 398
     4FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 398
     5FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 398
     6FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 398
    77PASS getComputedStyle returns no style for shadow tree outside of flattened tree
    88
  • trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt

    r289758 r290756  
    287287PASS text-anchor
    288288PASS text-combine-upright
    289 PASS text-decoration
    290289PASS text-decoration-color
    291290PASS text-decoration-line
  • trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt

    r289459 r290756  
    11
    22PASS getComputedStyle returns no style for detached element
    3 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 394
    4 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 394
    5 FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 394
    6 FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 394
     3FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 393
     4FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 393
     5FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 393
     6FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 393
    77PASS getComputedStyle returns no style for shadow tree outside of flattened tree
    88
  • trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt

    r287712 r290756  
    345345rect: style.getPropertyValue(text-combine-upright) : none
    346346rect: style.getPropertyCSSValue(text-combine-upright) : [object CSSPrimitiveValue]
    347 rect: style.getPropertyValue(text-decoration) : none
    348 rect: style.getPropertyCSSValue(text-decoration) : [object CSSPrimitiveValue]
     347rect: style.getPropertyValue(text-decoration-color) : rgb(0, 0, 0)
     348rect: style.getPropertyCSSValue(text-decoration-color) : [object CSSPrimitiveValue]
     349rect: style.getPropertyValue(text-decoration-line) : none
     350rect: style.getPropertyCSSValue(text-decoration-line) : [object CSSPrimitiveValue]
     351rect: style.getPropertyValue(text-decoration-style) : solid
     352rect: style.getPropertyCSSValue(text-decoration-style) : [object CSSPrimitiveValue]
     353rect: style.getPropertyValue(text-decoration-thickness) : auto
     354rect: style.getPropertyCSSValue(text-decoration-thickness) : [object CSSPrimitiveValue]
    349355rect: style.getPropertyValue(text-emphasis-color) : rgb(0, 0, 0)
    350356rect: style.getPropertyCSSValue(text-emphasis-color) : [object CSSPrimitiveValue]
     
    855861g: style.getPropertyValue(text-combine-upright) : none
    856862g: style.getPropertyCSSValue(text-combine-upright) : [object CSSPrimitiveValue]
    857 g: style.getPropertyValue(text-decoration) : none
    858 g: style.getPropertyCSSValue(text-decoration) : [object CSSPrimitiveValue]
     863g: style.getPropertyValue(text-decoration-color) : rgb(0, 0, 0)
     864g: style.getPropertyCSSValue(text-decoration-color) : [object CSSPrimitiveValue]
     865g: style.getPropertyValue(text-decoration-line) : none
     866g: style.getPropertyCSSValue(text-decoration-line) : [object CSSPrimitiveValue]
     867g: style.getPropertyValue(text-decoration-style) : solid
     868g: style.getPropertyCSSValue(text-decoration-style) : [object CSSPrimitiveValue]
     869g: style.getPropertyValue(text-decoration-thickness) : auto
     870g: style.getPropertyCSSValue(text-decoration-thickness) : [object CSSPrimitiveValue]
    859871g: style.getPropertyValue(text-emphasis-color) : rgb(0, 0, 0)
    860872g: style.getPropertyCSSValue(text-emphasis-color) : [object CSSPrimitiveValue]
  • trunk/Source/WebCore/ChangeLog

    r290746 r290756  
     12022-03-02  Oriol Brufau  <obrufau@igalia.com>
     2
     3        [css] Implement 'text-decoration' as a shorthand.
     4        https://bugs.webkit.org/show_bug.cgi?id=237175
     5
     6        Reviewed by Darin Adler.
     7
     8        The 'text-decoration' property was considered to be a longhand, sharing
     9        a computed value with 'text-decoration-line'.
     10
     11        This patch switches 'text-decoration' into a shorthand of the following
     12        longhands: 'text-decoration-line', 'text-decoration-thickness',
     13        'text-decoration-style' and 'text-decoration-color'. This is according
     14        to https://www.w3.org/TR/css-text-decor-4/#text-decoration-property
     15
     16        For now I'm keeping the grammar as-is, so 'text-decoration' will only
     17        accept values that are valid in 'text-decoration-line', but will set
     18        the other longhands to the initial value. This should probably change
     19        in a follow-up.
     20
     21        I'm also keeping '-webkit-text-decoration' as-is, as a shorthand of
     22        'text-decoration-{line,style,color}', not including thickness for some
     23        obscure reason. '-webkit-text-decoration' should probably be removed
     24        anyways.
     25
     26        There is a bunch of editing code that was getting/setting/removing
     27        'text-decoration' as a longhand, so I'm switching that to:
     28         - Use 'text-decoration-line' when getting values.
     29         - Use 'text-decoration' when setting values, and use a string for the
     30           value, this parses it and sets each longhand to the correct value.
     31         - Use 'text-decoration' get removing declarations, effectively removing
     32           all longhands.
     33        This preserves the previous behavior as much as possible.
     34
     35        Tests: fast/css/getComputedStyle/computed-style.html
     36               fast/css/getComputedStyle/computed-style-without-renderer.html
     37               fast/css/getComputedStyle/getComputedStyle-text-decoration.html
     38               fast/css/style-enumerate-properties.html
     39               fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html
     40               fast/css3-text/css3-text-decoration/text-decoration-dashed.html
     41               fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html
     42               fast/css3-text/css3-text-decoration/text-decoration-dotted.html
     43               imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.html
     44               imported/w3c/web-platform-tests/css/css-variables/variable-presentation-attribute.html
     45               imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree.html
     46               svg/css/getComputedStyle-basic.xhtml
     47
     48        * css/CSSComputedStyleDeclaration.cpp:
     49        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
     50        * css/CSSProperties.json:
     51        * css/StyleProperties.cpp:
     52        (WebCore::StyleProperties::getPropertyValue const):
     53        (WebCore::StyleProperties::asText const):
     54        * css/parser/CSSPropertyParser.cpp:
     55        (WebCore::CSSPropertyParser::parseSingleValue):
     56        (WebCore::CSSPropertyParser::parseShorthand):
     57        * editing/EditingStyle.cpp:
     58        (WebCore::EditingStyle::styleWithResolvedTextDecorations const):
     59        (WebCore::EditingStyle::collapseTextDecorationProperties):
     60        (WebCore::textDecorationValueList):
     61        (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
     62        (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode const):
     63        (WebCore::EditingStyle::mergeStyle):
     64        (WebCore::EditingStyle::removeEquivalentProperties):
     65        (WebCore::reconcileTextDecorationProperties):
     66        (WebCore::StyleChange::StyleChange):
     67        (WebCore::setTextDecorationProperty):
     68        (WebCore::StyleChange::extractTextStyles):
     69        (WebCore::diffTextDecorations):
     70        (WebCore::extractPropertiesNotIn):
     71        * editing/cocoa/HTMLConverter.mm:
     72        (HTMLConverterCaches::propertyValueForNode):
     73        (HTMLConverter::computedAttributesForElement):
     74        * editing/markup.cpp:
     75        (WebCore::serializePreservingVisualAppearanceInternal):
     76        * style/PropertyAllowlist.cpp:
     77        (WebCore::Style::isValidCueStyleProperty):
     78
    1792022-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
    280
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r290422 r290756  
    35213521            return cssValuePool.createValue(style.textAlign());
    35223522        case CSSPropertyTextDecoration:
     3523            if (style.textDecorationThickness() != RenderStyle::initialTextDecorationThickness())
     3524                return nullptr;
     3525            if (style.textDecorationStyle() != RenderStyle::initialTextDecorationStyle())
     3526                return nullptr;
     3527            if (style.textDecorationColor() != RenderStyle::currentColor())
     3528                return nullptr;
    35233529            return renderTextDecorationLineFlagsToCSSValue(style.textDecoration());
    35243530#if ENABLE(CSS3_TEXT)
  • trunk/Source/WebCore/css/CSSProperties.json

    r290422 r290756  
    46164616        },
    46174617        "text-decoration": {
    4618             "values": [
    4619                 "underline",
    4620                 "overline",
    4621                 "line-through",
    4622                 {
    4623                     "value": "blink",
    4624                     "status": "not considering"
    4625                 }
    4626             ],
    4627             "codegen-properties": {
    4628                 "converter": "TextDecoration"
     4618            "codegen-properties": {
     4619                "longhands": [
     4620                    "text-decoration-line",
     4621                    "text-decoration-thickness",
     4622                    "text-decoration-style",
     4623                    "text-decoration-color"
     4624                ]
    46294625            },
    46304626            "specification": {
     
    68556851                ]
    68566852            },
     6853            "values": [
     6854                "underline",
     6855                "overline",
     6856                "line-through",
     6857                {
     6858                    "value": "blink",
     6859                    "status": "not considering"
     6860                }
     6861            ],
    68576862            "specification": {
    68586863                "category": "css-text-decor",
  • trunk/Source/WebCore/css/StyleProperties.cpp

    r290108 r290756  
    276276    case CSSPropertyFontVariant:
    277277        return fontVariantValue();
     278    case CSSPropertyTextDecoration: {
     279        auto line = getPropertyCSSValue(CSSPropertyTextDecorationLine);
     280        if (!line)
     281            return String();
     282        if (line->isCSSWideKeyword()) {
     283            for (CSSPropertyID longhand : textDecorationShorthand()) {
     284                auto value = getPropertyCSSValue(longhand);
     285                if (!value || (value != line && *value != *line))
     286                    return String();
     287            }
     288        } else {
     289            auto thickness = getPropertyCSSValue(CSSPropertyTextDecorationThickness);
     290            if (!thickness || !is<CSSPrimitiveValue>(*thickness) || downcast<CSSPrimitiveValue>(*thickness).valueID() != CSSValueAuto)
     291                return String();
     292            auto style = getPropertyCSSValue(CSSPropertyTextDecorationStyle);
     293            if (!style || !is<CSSPrimitiveValue>(*style) || downcast<CSSPrimitiveValue>(*style).valueID() != CSSValueSolid)
     294                return String();
     295            auto color = getPropertyCSSValue(CSSPropertyTextDecorationColor);
     296            if (!color || !is<CSSPrimitiveValue>(*color) || downcast<CSSPrimitiveValue>(*color).valueID() != CSSValueCurrentcolor)
     297                return String();
     298        }
     299        return line->cssText();
     300    }
     301    case CSSPropertyWebkitTextDecoration:
     302        return getShorthandValue(webkitTextDecorationShorthand());
    278303    case CSSPropertyTextDecorationSkip:
    279304        return textDecorationSkipValue();
     
    14341459                shorthandPropertyID = CSSPropertyScrollPaddingInline;
    14351460                break;
     1461            case CSSPropertyTextDecorationColor:
     1462            case CSSPropertyTextDecorationLine:
     1463            case CSSPropertyTextDecorationStyle:
     1464            case CSSPropertyTextDecorationThickness:
     1465                shorthandPropertyID = CSSPropertyTextDecoration;
     1466                break;
    14361467            case CSSPropertyTransitionProperty:
    14371468            case CSSPropertyTransitionDuration:
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r290422 r290756  
    44744474            return nullptr;
    44754475        return consumeFilter(m_range, m_context, AllowedFilterFunctions::ColorFilters);
    4476     case CSSPropertyTextDecoration:
    44774476    case CSSPropertyWebkitTextDecorationsInEffect:
    44784477    case CSSPropertyTextDecorationLine:
     
    62866285    case CSSPropertyTransition:
    62876286        return consumeAnimationShorthand(transitionShorthandForParsing(), important);
    6288     case CSSPropertyTextDecoration:
     6287    case CSSPropertyTextDecoration: {
     6288        auto line = consumeTextDecorationLine(m_range);
     6289        if (!line || !m_range.atEnd())
     6290            return false;
     6291        auto& valuePool = CSSValuePool::singleton();
     6292        addProperty(CSSPropertyTextDecorationLine, property, line.releaseNonNull(), important);
     6293        addProperty(CSSPropertyTextDecorationThickness, property, valuePool.createIdentifierValue(CSSValueAuto), important);
     6294        addProperty(CSSPropertyTextDecorationStyle, property, valuePool.createIdentifierValue(CSSValueSolid), important);
     6295        addProperty(CSSPropertyTextDecorationColor, property, valuePool.createIdentifierValue(CSSValueCurrentcolor), important);
     6296        return true;
     6297    }
    62896298    case CSSPropertyWebkitTextDecoration:
    62906299        // FIXME-NEWPARSER: We need to unprefix -line/-style/-color ASAP and get rid
  • trunk/Source/WebCore/editing/EditingStyle.cpp

    r288134 r290756  
    5757#include "StyleFontSizeFunctions.h"
    5858#include "StyleProperties.h"
     59#include "StylePropertyShorthand.h"
    5960#include "StyleResolver.h"
    6061#include "StyleRule.h"
     
    9596    // Non-inheritable properties
    9697    CSSPropertyBackgroundColor,
    97     CSSPropertyTextDecoration,
     98    CSSPropertyTextDecorationLine,
     99    CSSPropertyTextDecorationThickness,
     100    CSSPropertyTextDecorationStyle,
     101    CSSPropertyTextDecorationColor,
    98102};
    99103
    100104const unsigned numAllEditingProperties = WTF_ARRAY_LENGTH(editingProperties);
    101 const unsigned numInheritableEditingProperties = numAllEditingProperties - 2;
     105const unsigned numInheritableEditingProperties = numAllEditingProperties - 5;
    102106
    103107enum EditingPropertiesToInclude { OnlyInheritableEditingProperties, AllEditingProperties };
     
    236240        auto& mutableStyle = *style.m_mutableStyle;
    237241        return mutableStyle.getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect)
    238             || mutableStyle.getPropertyCSSValue(CSSPropertyTextDecoration);
     242            || mutableStyle.getPropertyCSSValue(CSSPropertyTextDecorationLine);
    239243    }
    240244
     
    248252        RefPtr<CSSValue> styleValue = style.m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
    249253        if (!styleValue)
    250             styleValue = style.m_mutableStyle->getPropertyCSSValue(CSSPropertyTextDecoration);
     254            styleValue = style.m_mutableStyle->getPropertyCSSValue(CSSPropertyTextDecorationLine);
    251255        return is<CSSValueList>(styleValue) && downcast<CSSValueList>(*styleValue).hasValue(m_primitiveValue.get());
    252256    }
     
    596600
    597601    if (valueList->length())
    598         style->setProperty(CSSPropertyTextDecoration, valueList.ptr());
     602        style->setProperty(CSSPropertyTextDecorationLine, valueList.ptr());
    599603    else
    600         style->setProperty(CSSPropertyTextDecoration, CSSValuePool::singleton().createIdentifierValue(CSSValueNone));
     604        style->setProperty(CSSPropertyTextDecorationLine, CSSValueNone);
     605    style->setProperty(CSSPropertyTextDecorationThickness, CSSValueAuto);
     606    style->setProperty(CSSPropertyTextDecorationStyle, CSSValueSolid);
     607    style->setProperty(CSSPropertyTextDecorationColor, CSSValueCurrentcolor);
    601608
    602609    return style;
     
    780787
    781788    if (textDecorationsInEffect->isValueList())
    782         m_mutableStyle->setProperty(CSSPropertyTextDecoration, textDecorationsInEffect->cssText(), m_mutableStyle->propertyIsImportant(CSSPropertyTextDecoration));
     789        m_mutableStyle->setProperty(CSSPropertyTextDecoration, textDecorationsInEffect->cssText(), m_mutableStyle->propertyIsImportant(CSSPropertyTextDecorationLine));
    783790    else
    784791        m_mutableStyle->removeProperty(CSSPropertyTextDecoration);
     
    788795// CSS properties that create a visual difference only when applied to text.
    789796static const CSSPropertyID textOnlyProperties[] = {
    790     CSSPropertyTextDecoration,
     797    CSSPropertyTextDecorationLine,
    791798    CSSPropertyWebkitTextDecorationsInEffect,
    792799    CSSPropertyFontStyle,
     
    853860static RefPtr<CSSValueList> textDecorationValueList(const StyleProperties& properties)
    854861{
    855     RefPtr<CSSValue> value = properties.getPropertyCSSValue(CSSPropertyTextDecoration);
     862    RefPtr<CSSValue> value = properties.getPropertyCSSValue(CSSPropertyTextDecorationLine);
    856863    if (!is<CSSValueList>(value))
    857864        return nullptr;
     
    896903            if (extractedValueList->length()) {
    897904                conflicts = true;
    898                 if (newValueList->length())
    899                     newInlineStyle->setProperty(CSSPropertyTextDecoration, WTFMove(newValueList));
    900                 else
     905                if (newValueList->length()) {
     906                    newInlineStyle->setProperty(CSSPropertyTextDecorationLine, WTFMove(newValueList));
     907                    newInlineStyle->setProperty(CSSPropertyTextDecorationThickness, CSSValueAuto);
     908                    newInlineStyle->setProperty(CSSPropertyTextDecorationStyle, CSSValueSolid);
     909                    newInlineStyle->setProperty(CSSPropertyTextDecorationColor, CSSValueCurrentcolor);
     910                } else
    901911                    newInlineStyle->removeProperty(CSSPropertyTextDecoration);
    902912
    903913                if (extractedStyle) {
    904                     bool isImportant = inlineStyle->propertyIsImportant(CSSPropertyTextDecoration);
     914                    bool isImportant = inlineStyle->propertyIsImportant(CSSPropertyTextDecorationLine);
    905915                    extractedStyle->setProperty(CSSPropertyTextDecoration, extractedValueList->cssText(), isImportant);
    906916                }
     
    917927            continue;
    918928
    919         if (propertyID == CSSPropertyWebkitTextDecorationsInEffect && inlineStyle->getPropertyCSSValue(CSSPropertyTextDecoration)) {
     929        if (propertyID == CSSPropertyWebkitTextDecorationsInEffect && inlineStyle->getPropertyCSSValue(CSSPropertyTextDecorationLine)) {
    920930            if (!newInlineStyle)
    921931                return true;
     
    923933            newInlineStyle->removeProperty(CSSPropertyTextDecoration);
    924934            if (extractedStyle)
    925                 extractedStyle->setProperty(CSSPropertyTextDecoration, inlineStyle->getPropertyValue(CSSPropertyTextDecoration), inlineStyle->propertyIsImportant(CSSPropertyTextDecoration));
     935                extractedStyle->setProperty(CSSPropertyTextDecoration, inlineStyle->getPropertyValue(CSSPropertyTextDecorationLine), inlineStyle->propertyIsImportant(CSSPropertyTextDecorationLine));
    926936        }
    927937
     
    10501060        bool hasUnderline = false;
    10511061        bool hasLineThrough = false;
    1052         if (RefPtr<CSSValue> value = computedStyle.propertyValue(CSSPropertyTextDecoration)) {
     1062        if (RefPtr<CSSValue> value = computedStyle.propertyValue(CSSPropertyTextDecorationLine)) {
    10531063            if (value->isValueList()) {
    10541064                auto& cssValuePool = CSSValuePool::singleton();
     
    12841294
    12851295        // text decorations never override values.
    1286         if ((property.id() == CSSPropertyTextDecoration || property.id() == CSSPropertyWebkitTextDecorationsInEffect)
     1296        if ((property.id() == CSSPropertyTextDecorationLine || property.id() == CSSPropertyWebkitTextDecorationsInEffect)
    12871297            && is<CSSValueList>(*property.value()) && value) {
    12881298            if (is<CSSValueList>(*value)) {
     
    14641474{
    14651475    Vector<CSSPropertyID> propertiesToRemove;
     1476    HashSet<CSSPropertyID> alreadyHandled;
    14661477    for (auto& property : m_mutableStyle->m_propertyVector) {
    1467         if (style.propertyMatches(property.id(), property.value()))
     1478        CSSPropertyID id = property.id();
     1479        if (alreadyHandled.contains(id))
     1480            continue;
     1481        if (!style.propertyMatches(id, property.value()))
     1482            continue;
     1483        if (!property.isSetFromShorthand()) {
    14681484            propertiesToRemove.append(property.id());
     1485            continue;
     1486        }
     1487        // Do not remove equivalent properties when they share a shorthand with non-equivalent ones, and the removal would prevent them from being serialized with the shorthand.
     1488        CSSPropertyID shorthandID = property.shorthandID();
     1489        if (m_mutableStyle->getPropertyValue(shorthandID).isEmpty()) {
     1490            propertiesToRemove.append(property.id());
     1491            continue;
     1492        }
     1493        auto shorthand = shorthandForProperty(shorthandID);
     1494        bool canRemoveAllLonghands = true;
     1495        for (CSSPropertyID longhandID : shorthand) {
     1496            if (id != longhandID && !style.propertyMatches(longhandID, m_mutableStyle->getPropertyCSSValue(longhandID).get())) {
     1497                canRemoveAllLonghands = false;
     1498                break;
     1499            }
     1500        }
     1501        for (CSSPropertyID longhandID : shorthand) {
     1502            if (canRemoveAllLonghands)
     1503                propertiesToRemove.append(longhandID);
     1504            alreadyHandled.add(longhandID);
     1505        }
    14691506    }
    14701507    // FIXME: This should use mass removal.
     
    16891726{   
    16901727    RefPtr<CSSValue> textDecorationsInEffect = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
    1691     RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(CSSPropertyTextDecoration);
     1728    RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(CSSPropertyTextDecorationLine);
    16921729    // We shouldn't have both text-decoration and -webkit-text-decorations-in-effect because that wouldn't make sense.
    16931730    ASSERT(!textDecorationsInEffect || !textDecoration);
     
    17351772        RefPtr<CSSValue> value = computedStyle.propertyValue(CSSPropertyWebkitTextDecorationsInEffect);
    17361773        if (!is<CSSValueList>(value))
    1737             value = computedStyle.propertyValue(CSSPropertyTextDecoration);
     1774            value = computedStyle.propertyValue(CSSPropertyTextDecorationLine);
    17381775
    17391776        RefPtr<CSSValueList> valueList;
     
    17541791            if (shouldAddStrikeThrough && !hasLineThrough)
    17551792                valueList->append(WTFMove(lineThrough));
    1756             mutableStyle->setProperty(CSSPropertyTextDecoration, valueList.get());
     1793            mutableStyle->setProperty(CSSPropertyTextDecoration, valueList->cssText());
    17571794        } else {
    17581795            m_applyUnderline = shouldAddUnderline && !hasUnderline;
     
    17911828}
    17921829
    1793 static void setTextDecorationProperty(MutableStyleProperties& style, const CSSValueList* newTextDecoration, CSSPropertyID propertyID)
     1830static void setTextDecorationProperty(MutableStyleProperties& style, const CSSValueList* newTextDecoration, CSSPropertyID getID, CSSPropertyID setID)
    17941831{
    17951832    if (newTextDecoration->length())
    1796         style.setProperty(propertyID, newTextDecoration->cssText(), style.propertyIsImportant(propertyID));
     1833        style.setProperty(setID, newTextDecoration->cssText(), style.propertyIsImportant(getID));
    17971834    else {
    17981835        // text-decoration: none is redundant since it does not remove any text decorations.
    1799         style.removeProperty(propertyID);
     1836        style.removeProperty(setID);
    18001837    }
    18011838}
     
    18161853    // Assuming reconcileTextDecorationProperties has been called, there should not be -webkit-text-decorations-in-effect
    18171854    // Furthermore, text-decoration: none has been trimmed so that text-decoration property is always a CSSValueList.
    1818     RefPtr<CSSValue> textDecoration = style.getPropertyCSSValue(CSSPropertyTextDecoration);
     1855    RefPtr<CSSValue> textDecoration = style.getPropertyCSSValue(CSSPropertyTextDecorationLine);
    18191856    if (is<CSSValueList>(textDecoration)) {
    18201857        auto& cssValuePool = CSSValuePool::singleton();
     
    18291866
    18301867        // If trimTextDecorations, delete underline and line-through
    1831         setTextDecorationProperty(style, newTextDecoration.get(), CSSPropertyTextDecoration);
     1868        setTextDecorationProperty(style, newTextDecoration.get(), CSSPropertyTextDecorationLine, CSSPropertyTextDecoration);
    18321869    }
    18331870
     
    18681905}
    18691906
    1870 static void diffTextDecorations(MutableStyleProperties& style, CSSPropertyID propertID, CSSValue* refTextDecoration)
    1871 {
    1872     RefPtr<CSSValue> textDecoration = style.getPropertyCSSValue(propertID);
     1907static void diffTextDecorations(MutableStyleProperties& style, CSSPropertyID getID, CSSPropertyID setID, CSSValue* refTextDecoration)
     1908{
     1909    RefPtr<CSSValue> textDecoration = style.getPropertyCSSValue(getID);
    18731910    if (!is<CSSValueList>(textDecoration) || !is<CSSValueList>(refTextDecoration))
    18741911        return;
     
    18791916        newTextDecoration->removeAll(&value.get());
    18801917
    1881     setTextDecorationProperty(style, newTextDecoration.get(), propertID);
     1918    setTextDecorationProperty(style, newTextDecoration.get(), getID, setID);
    18821919}
    18831920
     
    18981935
    18991936    RefPtr<CSSValue> baseTextDecorationsInEffect = extractPropertyValue(baseStyle, CSSPropertyWebkitTextDecorationsInEffect);
    1900     diffTextDecorations(mutableStyle, CSSPropertyTextDecoration, baseTextDecorationsInEffect.get());
    1901     diffTextDecorations(mutableStyle, CSSPropertyWebkitTextDecorationsInEffect, baseTextDecorationsInEffect.get());
     1937    diffTextDecorations(mutableStyle, CSSPropertyTextDecorationLine, CSSPropertyTextDecoration, baseTextDecorationsInEffect.get());
     1938    diffTextDecorations(mutableStyle, CSSPropertyWebkitTextDecorationsInEffect, CSSPropertyWebkitTextDecorationsInEffect, baseTextDecorationsInEffect.get());
    19021939
    19031940    if (extractPropertyValue(baseStyle, CSSPropertyFontWeight) && fontWeightIsBold(mutableStyle) == fontWeightIsBold(baseStyle))
  • trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm

    r287434 r290756  
    642642        inherit = true;
    643643        break;
    644     case CSSPropertyTextDecoration:
     644    case CSSPropertyTextDecorationLine:
    645645        if (element.hasTagName(uTag) || element.hasTagName(insTag))
    646646            return "underline";
     
    10381038    }
    10391039
    1040     String textDecoration = _caches->propertyValueForNode(element, CSSPropertyTextDecoration);
     1040    String textDecoration = _caches->propertyValueForNode(element, CSSPropertyTextDecorationLine);
    10411041    if (textDecoration.length()) {
    10421042        if (textDecoration.contains("underline"))
  • trunk/Source/WebCore/editing/markup.cpp

    r284857 r290756  
    936936                    // This assertion is caused at least when we select all text of a <body> element whose
    937937                    // 'text-decoration' property is "inherit", and copy it.
    938                     if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->style(), CSSPropertyTextDecoration))
     938                    if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->style(), CSSPropertyTextDecorationLine)) {
    939939                        fullySelectedRootStyle->style()->setProperty(CSSPropertyTextDecoration, CSSValueNone);
     940                        fullySelectedRootStyle->style()->setProperty(CSSPropertyTextDecorationThickness, CSSValueAuto);
     941                        fullySelectedRootStyle->style()->setProperty(CSSPropertyTextDecorationStyle, CSSValueSolid);
     942                        fullySelectedRootStyle->style()->setProperty(CSSPropertyTextDecorationColor, CSSValueCurrentcolor);
     943                    }
    940944                    if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->style(), CSSPropertyWebkitTextDecorationsInEffect))
    941945                        fullySelectedRootStyle->style()->setProperty(CSSPropertyWebkitTextDecorationsInEffect, CSSValueNone);
  • trunk/Source/WebCore/style/PropertyAllowlist.cpp

    r288433 r290756  
    133133    case CSSPropertyVisibility:
    134134    case CSSPropertyWhiteSpace:
    135     case CSSPropertyTextDecoration:
     135    case CSSPropertyTextDecorationLine:
    136136    case CSSPropertyTextShadow:
    137137    case CSSPropertyBorderStyle:
Note: See TracChangeset for help on using the changeset viewer.