Changeset 290895 in webkit


Ignore:
Timestamp:
Mar 7, 2022 9:53:06 AM (4 months ago)
Author:
graouts@webkit.org
Message:

[web-animations] text-emphasis shorthand should be animatable
https://bugs.webkit.org/show_bug.cgi?id=237529

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt:
  • web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:

Source/WebCore:

  • animation/CSSPropertyAnimation.cpp:

(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::valueForTextEmphasisStyle):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r290888 r290895  
     12022-03-07  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] text-emphasis shorthand should be animatable
     4        https://bugs.webkit.org/show_bug.cgi?id=237529
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt:
     9        * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
     10
    1112022-03-07  Antoine Quint  <graouts@webkit.org>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt

    r290888 r290895  
    5050PASS Property word-spacing value '10px' in ::marker
    5151PASS Property text-decoration-skip-ink value 'none' in ::marker
    52 FAIL Property text-emphasis value 'dot rgb(0, 255, 0)' in ::marker assert_equals: expected "dot rgb(0, 255, 0)" but got ""
     52PASS Property text-emphasis value 'dot rgb(0, 255, 0)' in ::marker
    5353PASS Property text-emphasis-color value 'rgb(0, 255, 0)' in ::marker
    5454PASS Property text-emphasis-position value 'under left' in ::marker
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt

    r290888 r290895  
    3535PASS Animation of word-spacing in ::marker
    3636PASS Animation of text-decoration-skip-ink in ::marker
    37 FAIL Animation of text-emphasis in ::marker assert_equals: expected "triangle rgb(50, 100, 100)" but got ""
     37PASS Animation of text-emphasis in ::marker
    3838PASS Animation of text-emphasis-color in ::marker
    3939PASS Animation of text-emphasis-position in ::marker
     
    8282PASS Transition of word-spacing in ::marker
    8383PASS Transition of text-decoration-skip-ink in ::marker
    84 FAIL Transition of text-emphasis in ::marker assert_equals: expected "triangle rgb(50, 100, 100)" but got ""
     84PASS Transition of text-emphasis in ::marker
    8585PASS Transition of text-emphasis-color in ::marker
    8686PASS Transition of text-emphasis-position in ::marker
  • trunk/Source/WebCore/ChangeLog

    r290892 r290895  
     12022-03-07  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] text-emphasis shorthand should be animatable
     4        https://bugs.webkit.org/show_bug.cgi?id=237529
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * animation/CSSPropertyAnimation.cpp:
     9        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     10        * css/CSSComputedStyleDeclaration.cpp:
     11        (WebCore::valueForTextEmphasisStyle):
     12        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
     13
    1142022-03-07  Peng Liu  <peng.liu6@apple.com>
    215
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r290888 r290895  
    28372837        CSSPropertyTransformOrigin,
    28382838        CSSPropertyPerspectiveOrigin,
    2839         CSSPropertyOffset
     2839        CSSPropertyOffset,
     2840        CSSPropertyTextEmphasis
    28402841    };
    28412842    const unsigned animatableShorthandPropertiesCount = WTF_ARRAY_LENGTH(animatableShorthandProperties);
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r290888 r290895  
    19211921        return cssValuePool.createIdentifierValue(CSSValueNone);
    19221922    return list;
     1923}
     1924
     1925static Ref<CSSValue> valueForTextEmphasisStyle(const RenderStyle& style)
     1926{
     1927    auto& cssValuePool = CSSValuePool::singleton();
     1928    switch (style.textEmphasisMark()) {
     1929    case TextEmphasisMark::None:
     1930        return cssValuePool.createIdentifierValue(CSSValueNone);
     1931    case TextEmphasisMark::Custom:
     1932        return cssValuePool.createValue(style.textEmphasisCustomMark(), CSSUnitType::CSS_STRING);
     1933    case TextEmphasisMark::Auto:
     1934        ASSERT_NOT_REACHED();
     1935#if !ASSERT_ENABLED
     1936        FALLTHROUGH;
     1937#endif
     1938    case TextEmphasisMark::Dot:
     1939    case TextEmphasisMark::Circle:
     1940    case TextEmphasisMark::DoubleCircle:
     1941    case TextEmphasisMark::Triangle:
     1942    case TextEmphasisMark::Sesame:
     1943        auto list = CSSValueList::createSpaceSeparated();
     1944        if (style.textEmphasisFill() != TextEmphasisFill::Filled)
     1945            list->append(cssValuePool.createValue(style.textEmphasisFill()));
     1946        list->append(cssValuePool.createValue(style.textEmphasisMark()));
     1947        return list;
     1948    }
     1949    RELEASE_ASSERT_NOT_REACHED();
    19231950}
    19241951
     
    35553582            return renderEmphasisPositionFlagsToCSSValue(style.textEmphasisPosition());
    35563583        case CSSPropertyTextEmphasisStyle:
    3557             switch (style.textEmphasisMark()) {
    3558             case TextEmphasisMark::None:
    3559                 return cssValuePool.createIdentifierValue(CSSValueNone);
    3560             case TextEmphasisMark::Custom:
    3561                 return cssValuePool.createValue(style.textEmphasisCustomMark(), CSSUnitType::CSS_STRING);
    3562             case TextEmphasisMark::Auto:
    3563                 ASSERT_NOT_REACHED();
    3564 #if !ASSERT_ENABLED
    3565                 FALLTHROUGH;
    3566 #endif
    3567             case TextEmphasisMark::Dot:
    3568             case TextEmphasisMark::Circle:
    3569             case TextEmphasisMark::DoubleCircle:
    3570             case TextEmphasisMark::Triangle:
    3571             case TextEmphasisMark::Sesame:
    3572                 auto list = CSSValueList::createSpaceSeparated();
    3573                 if (style.textEmphasisFill() != TextEmphasisFill::Filled)
    3574                     list->append(cssValuePool.createValue(style.textEmphasisFill()));
    3575                 list->append(cssValuePool.createValue(style.textEmphasisMark()));
    3576                 return list;
    3577             }
    3578             RELEASE_ASSERT_NOT_REACHED();
     3584            return valueForTextEmphasisStyle(style);
     3585        case CSSPropertyTextEmphasis: {
     3586            auto list = CSSValueList::createSpaceSeparated();
     3587            list->append(valueForTextEmphasisStyle(style));
     3588            list->append(currentColorOrValidColor(&style, style.textEmphasisColor()));
     3589            return list;
     3590        }
    35793591        case CSSPropertyTextIndent: {
    35803592            auto textIndent = zoomAdjustedPixelValueForLength(style.textIndent(), style);
     
    41804192        /* Unimplemented CSS 3 properties (including CSS3 shorthand properties) */
    41814193        case CSSPropertyAll:
    4182         case CSSPropertyTextEmphasis:
    41834194            break;
    41844195
Note: See TracChangeset for help on using the changeset viewer.