Changeset 291159 in webkit


Ignore:
Timestamp:
Mar 11, 2022 6:05:02 AM (4 months ago)
Author:
graouts@webkit.org
Message:

[web-animations] mask-composite should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237769

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

  • 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:

Refactor FillLayerFillBoxPropertyWrapper to a templatized DiscreteFillLayerPropertyWrapper
which allows us to support other enum types like CompositeOperator.

  • animation/CSSPropertyAnimation.cpp:

(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

Location:
trunk
Files:
6 edited

Legend:

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

    r291158 r291159  
     12022-03-11  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] mask-composite should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237769
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
     9        * web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt:
     10        * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:
     11
    1122022-03-11  Antoine Quint  <graouts@webkit.org>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt

    r291158 r291159  
    3838PASS mask-clip: "border-box" onto "content-box"
    3939PASS mask-clip: "content-box" onto "border-box"
     40PASS mask-composite (type: discrete) has testAccumulation function
     41PASS mask-composite: "subtract" onto "add"
     42PASS mask-composite: "add" onto "subtract"
    4043PASS mask-image (type: discrete) has testAccumulation function
    4144PASS mask-image: "url("http://localhost/test-2")" onto "url("http://localhost/test-1")"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt

    r291158 r291159  
    3838PASS mask-clip: "border-box" onto "content-box"
    3939PASS mask-clip: "content-box" onto "border-box"
     40PASS mask-composite (type: discrete) has testAddition function
     41PASS mask-composite: "subtract" onto "add"
     42PASS mask-composite: "add" onto "subtract"
    4043PASS mask-image (type: discrete) has testAddition function
    4144PASS mask-image: "url("http://localhost/test-2")" onto "url("http://localhost/test-1")"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt

    r291158 r291159  
    4747PASS mask-clip uses discrete animation when animating between "content-box" and "border-box" with effect easing
    4848PASS mask-clip uses discrete animation when animating between "content-box" and "border-box" with keyframe easing
     49PASS mask-composite (type: discrete) has testInterpolation function
     50PASS mask-composite uses discrete animation when animating between "add" and "subtract" with linear easing
     51PASS mask-composite uses discrete animation when animating between "add" and "subtract" with effect easing
     52PASS mask-composite uses discrete animation when animating between "add" and "subtract" with keyframe easing
    4953PASS mask-image (type: discrete) has testInterpolation function
    5054FAIL mask-image uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with linear easing assert_equals: The value should be url("http://localhost/test-1") at 499ms expected "url(\"http://localhost/test-1\")" but got "url(\"http://localhost/test-2\")"
  • trunk/Source/WebCore/ChangeLog

    r291158 r291159  
     12022-03-11  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] mask-composite should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237769
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Refactor FillLayerFillBoxPropertyWrapper to a templatized DiscreteFillLayerPropertyWrapper
     9        which allows us to support other enum types like CompositeOperator.
     10
     11        * animation/CSSPropertyAnimation.cpp:
     12        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     13
    1142022-03-11  Antoine Quint  <graouts@webkit.org>
    215
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r291158 r291159  
    19031903};
    19041904
    1905 class FillLayerFillBoxPropertyWrapper final : public FillLayerAnimationPropertyWrapperBase {
    1906     WTF_MAKE_FAST_ALLOCATED;
    1907 public:
    1908     FillLayerFillBoxPropertyWrapper(CSSPropertyID property, FillBox (FillLayer::*getter)() const, void (FillLayer::*setter)(FillBox))
     1905template <typename T>
     1906class DiscreteFillLayerPropertyWrapper final : public FillLayerAnimationPropertyWrapperBase {
     1907    WTF_MAKE_FAST_ALLOCATED;
     1908public:
     1909    DiscreteFillLayerPropertyWrapper(CSSPropertyID property, T (FillLayer::*getter)() const, void (FillLayer::*setter)(T))
    19091910        : FillLayerAnimationPropertyWrapperBase(property)
    19101911        , m_getter(getter)
     
    19341935    }
    19351936
    1936     FillBox (FillLayer::*m_getter)() const;
    1937     void (FillLayer::*m_setter)(FillBox);
     1937    T (FillLayer::*m_getter)() const;
     1938    void (FillLayer::*m_setter)(T);
    19381939};
    19391940
     
    19681969            break;
    19691970        case CSSPropertyMaskClip:
    1970             m_fillLayerPropertyWrapper = makeUnique<FillLayerFillBoxPropertyWrapper>(property, &FillLayer::clip, &FillLayer::setClip);
     1971            m_fillLayerPropertyWrapper = makeUnique<DiscreteFillLayerPropertyWrapper<FillBox>>(property, &FillLayer::clip, &FillLayer::setClip);
    19711972            break;
    19721973        case CSSPropertyMaskOrigin:
    1973             m_fillLayerPropertyWrapper = makeUnique<FillLayerFillBoxPropertyWrapper>(property, &FillLayer::origin, &FillLayer::setOrigin);
     1974            m_fillLayerPropertyWrapper = makeUnique<DiscreteFillLayerPropertyWrapper<FillBox>>(property, &FillLayer::origin, &FillLayer::setOrigin);
     1975            break;
     1976        case CSSPropertyMaskComposite:
     1977            m_fillLayerPropertyWrapper = makeUnique<DiscreteFillLayerPropertyWrapper<CompositeOperator>>(property, &FillLayer::composite, &FillLayer::setComposite);
    19741978            break;
    19751979        default:
     
    30103014
    30113015        new FillLayersPropertyWrapper(CSSPropertyMaskClip, &RenderStyle::maskLayers, &RenderStyle::ensureMaskLayers),
     3016        new FillLayersPropertyWrapper(CSSPropertyMaskComposite, &RenderStyle::maskLayers, &RenderStyle::ensureMaskLayers),
    30123017        new FillLayersPropertyWrapper(CSSPropertyMaskOrigin, &RenderStyle::maskLayers, &RenderStyle::ensureMaskLayers),
    30133018        new FillLayersPropertyWrapper(CSSPropertyWebkitMaskPositionX, &RenderStyle::maskLayers, &RenderStyle::ensureMaskLayers),
Note: See TracChangeset for help on using the changeset viewer.