Changeset 290888 in webkit


Ignore:
Timestamp:
Mar 7, 2022 6:26:58 AM (5 months ago)
Author:
graouts@webkit.org
Message:

[web-animations] text-emphasis-style should support discrete animations
https://bugs.webkit.org/show_bug.cgi?id=237514

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:
  • web-platform-tests/css/css-text-decor/inheritance-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:

Source/WebCore:

  • animation/CSSPropertyAnimation.cpp:

(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

Location:
trunk
Files:
10 edited

Legend:

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

    r290887 r290888  
     12022-03-07  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] text-emphasis-style should support discrete animations
     4        https://bugs.webkit.org/show_bug.cgi?id=237514
     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        * web-platform-tests/css/css-text-decor/inheritance-expected.txt:
     11        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
     12        * web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt:
     13        * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:
     14
    1152022-03-07  Antoine Quint  <graouts@webkit.org>
    216
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt

    r290884 r290888  
    5353PASS Property text-emphasis-color value 'rgb(0, 255, 0)' in ::marker
    5454PASS Property text-emphasis-position value 'under left' in ::marker
    55 FAIL Property text-emphasis-style value 'dot' in ::marker assert_equals: expected "dot" but got "filled dot"
     55PASS Property text-emphasis-style value 'dot' in ::marker
    5656PASS Property text-shadow value 'rgb(0, 255, 0) 1px 2px 3px' in ::marker
    5757PASS Property display value 'none' in ::marker
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt

    r290887 r290888  
    3838PASS Animation of text-emphasis-color in ::marker
    3939PASS Animation of text-emphasis-position in ::marker
    40 FAIL Animation of text-emphasis-style in ::marker assert_equals: expected "triangle" but got "none"
     40PASS Animation of text-emphasis-style in ::marker
    4141PASS Animation of text-shadow in ::marker
    4242PASS Animation of display in ::marker
     
    8585PASS Transition of text-emphasis-color in ::marker
    8686PASS Transition of text-emphasis-position in ::marker
    87 FAIL Transition of text-emphasis-style in ::marker assert_equals: expected "triangle" but got "filled triangle"
     87PASS Transition of text-emphasis-style in ::marker
    8888PASS Transition of text-shadow in ::marker
    8989PASS Transition of display in ::marker
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/inheritance-expected.txt

    r282397 r290888  
    1111PASS Property text-emphasis-position inherits
    1212PASS Property text-emphasis-style has initial value none
    13 FAIL Property text-emphasis-style inherits assert_equals: expected "triangle" but got "filled triangle"
     13PASS Property text-emphasis-style inherits
    1414PASS Property text-shadow has initial value none
    1515PASS Property text-shadow inherits
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt

    r290887 r290888  
    163163PASS text-emphasis-position: "under left" onto "over"
    164164PASS text-emphasis-position: "over" onto "under left"
     165PASS text-emphasis-style (type: discrete) has testAccumulation function
     166PASS text-emphasis-style: "open dot" onto "circle"
     167PASS text-emphasis-style: "circle" onto "open dot"
    165168PASS text-overflow (type: discrete) has testAccumulation function
    166169PASS text-overflow: "ellipsis" onto "clip"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt

    r290887 r290888  
    163163PASS text-emphasis-position: "under left" onto "over"
    164164PASS text-emphasis-position: "over" onto "under left"
     165PASS text-emphasis-style (type: discrete) has testAddition function
     166PASS text-emphasis-style: "open dot" onto "circle"
     167PASS text-emphasis-style: "circle" onto "open dot"
    165168PASS text-overflow (type: discrete) has testAddition function
    166169PASS text-overflow: "ellipsis" onto "clip"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt

    r290887 r290888  
    190190PASS text-emphasis-position uses discrete animation when animating between "over" and "under left" with effect easing
    191191PASS text-emphasis-position uses discrete animation when animating between "over" and "under left" with keyframe easing
     192PASS text-emphasis-style (type: discrete) has testInterpolation function
     193PASS text-emphasis-style uses discrete animation when animating between "circle" and "open dot" with linear easing
     194PASS text-emphasis-style uses discrete animation when animating between "circle" and "open dot" with effect easing
     195PASS text-emphasis-style uses discrete animation when animating between "circle" and "open dot" with keyframe easing
    192196PASS text-overflow (type: discrete) has testInterpolation function
    193197PASS text-overflow uses discrete animation when animating between "clip" and "ellipsis" with linear easing
  • trunk/Source/WebCore/ChangeLog

    r290887 r290888  
     12022-03-07  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] text-emphasis-style should support discrete animations
     4        https://bugs.webkit.org/show_bug.cgi?id=237514
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * animation/CSSPropertyAnimation.cpp:
     9        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     10        * css/CSSComputedStyleDeclaration.cpp:
     11        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
     12
    1132022-03-07  Antoine Quint  <graouts@webkit.org>
    214
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r290887 r290888  
    729729
    730730template <typename T>
    731 class DiscretePropertyWrapper final : public PropertyWrapperGetter<T> {
     731class DiscretePropertyWrapper : public PropertyWrapperGetter<T> {
    732732    WTF_MAKE_FAST_ALLOCATED;
    733733public:
     
    738738    }
    739739
    740     void blend(RenderStyle& destination, const RenderStyle& from, const RenderStyle& to, const CSSPropertyBlendingContext& context) const final
     740    void blend(RenderStyle& destination, const RenderStyle& from, const RenderStyle& to, const CSSPropertyBlendingContext& context) const override
    741741    {
    742742        ASSERT(!context.progress || context.progress == 1.0);
     
    24632463        else
    24642464            destination.clearContent();
     2465    }
     2466};
     2467
     2468class TextEmphasisStyleWrapper final : public DiscretePropertyWrapper<TextEmphasisMark> {
     2469    WTF_MAKE_FAST_ALLOCATED;
     2470public:
     2471    TextEmphasisStyleWrapper()
     2472        : DiscretePropertyWrapper<TextEmphasisMark>(CSSPropertyTextEmphasisStyle, &RenderStyle::textEmphasisMark, &RenderStyle::setTextEmphasisMark)
     2473    {
     2474    }
     2475
     2476private:
     2477    void blend(RenderStyle& destination, const RenderStyle& from, const RenderStyle& to, const CSSPropertyBlendingContext& context) const final
     2478    {
     2479        destination.setTextEmphasisFill((context.progress > 0.5 ? to : from).textEmphasisFill());
     2480        DiscretePropertyWrapper::blend(destination, from, to, context);
    24652481    }
    24662482};
     
    27642780        new PropertyWrapperVisitedAffectedColor(CSSPropertyTextEmphasisColor, MaybeInvalidColor, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::visitedLinkTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor),
    27652781        new DiscretePropertyWrapper<OptionSet<TextEmphasisPosition>>(CSSPropertyTextEmphasisPosition, &RenderStyle::textEmphasisPosition, &RenderStyle::setTextEmphasisPosition),
     2782        new TextEmphasisStyleWrapper,
    27662783        new DiscretePropertyWrapper<TextOverflow>(CSSPropertyTextOverflow, &RenderStyle::textOverflow, &RenderStyle::setTextOverflow),
    27672784        new DiscretePropertyWrapper<OptionSet<TouchAction>>(CSSPropertyTouchAction, &RenderStyle::touchActions, &RenderStyle::setTouchActions),
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r290772 r290888  
    35713571            case TextEmphasisMark::Sesame:
    35723572                auto list = CSSValueList::createSpaceSeparated();
    3573                 list->append(cssValuePool.createValue(style.textEmphasisFill()));
     3573                if (style.textEmphasisFill() != TextEmphasisFill::Filled)
     3574                    list->append(cssValuePool.createValue(style.textEmphasisFill()));
    35743575                list->append(cssValuePool.createValue(style.textEmphasisMark()));
    35753576                return list;
Note: See TracChangeset for help on using the changeset viewer.