Changeset 291130 in webkit


Ignore:
Timestamp:
Mar 10, 2022 1:50:02 PM (4 months ago)
Author:
graouts@webkit.org
Message:

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

Reviewed by Simon Fraser.

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:

  • animation/CSSPropertyAnimation.cpp:

(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

Location:
trunk
Files:
6 edited

Legend:

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

    r291129 r291130  
     12022-03-10  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] mask-clip should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237725
     5
     6        Reviewed by Simon Fraser.
     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-10  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

    r291129 r291130  
    3535FAIL mask: "url("http://localhost/test-2")" onto "url("http://localhost/test-1")" assert_equals: The value should be url("http://localhost/test-2") at 0ms expected "url(\"http://localhost/test-2\")" but got "url(\"http://localhost/test-2\") 0% 0% / auto repeat border-box border-box add match-source"
    3636FAIL mask: "url("http://localhost/test-1")" onto "url("http://localhost/test-2")" assert_equals: The value should be url("http://localhost/test-1") at 0ms expected "url(\"http://localhost/test-1\")" but got "url(\"http://localhost/test-1\") 0% 0% / auto repeat border-box border-box add match-source"
     37PASS mask-clip (type: discrete) has testAccumulation function
     38PASS mask-clip: "border-box" onto "content-box"
     39PASS mask-clip: "content-box" onto "border-box"
    3740PASS mask-image (type: discrete) has testAccumulation function
    3841PASS 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

    r291129 r291130  
    3535FAIL mask: "url("http://localhost/test-2")" onto "url("http://localhost/test-1")" assert_equals: The value should be url("http://localhost/test-2") at 0ms expected "url(\"http://localhost/test-2\")" but got "url(\"http://localhost/test-2\") 0% 0% / auto repeat border-box border-box add match-source"
    3636FAIL mask: "url("http://localhost/test-1")" onto "url("http://localhost/test-2")" assert_equals: The value should be url("http://localhost/test-1") at 0ms expected "url(\"http://localhost/test-1\")" but got "url(\"http://localhost/test-1\") 0% 0% / auto repeat border-box border-box add match-source"
     37PASS mask-clip (type: discrete) has testAddition function
     38PASS mask-clip: "border-box" onto "content-box"
     39PASS mask-clip: "content-box" onto "border-box"
    3740PASS mask-image (type: discrete) has testAddition function
    3841PASS 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

    r291129 r291130  
    4343FAIL mask uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with effect easing assert_equals: The value should be url("http://localhost/test-1") at 0ms expected "url(\"http://localhost/test-1\")" but got "url(\"http://localhost/test-1\") 0% 0% / auto repeat border-box border-box add match-source"
    4444FAIL mask uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with keyframe easing assert_equals: The value should be url("http://localhost/test-1") at 0ms expected "url(\"http://localhost/test-1\")" but got "url(\"http://localhost/test-1\") 0% 0% / auto repeat border-box border-box add match-source"
     45PASS mask-clip (type: discrete) has testInterpolation function
     46PASS mask-clip uses discrete animation when animating between "content-box" and "border-box" with linear easing
     47PASS mask-clip uses discrete animation when animating between "content-box" and "border-box" with effect easing
     48PASS mask-clip uses discrete animation when animating between "content-box" and "border-box" with keyframe easing
    4549PASS mask-image (type: discrete) has testInterpolation function
    4650FAIL 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

    r291129 r291130  
     12022-03-10  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] mask-clip should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237725
     5
     6        Reviewed by Simon Fraser.
     7
     8        * animation/CSSPropertyAnimation.cpp:
     9        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     10
    1112022-03-10  Antoine Quint  <graouts@webkit.org>
    212
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r291129 r291130  
    19031903};
    19041904
     1905class FillLayerFillBoxPropertyWrapper final : public FillLayerAnimationPropertyWrapperBase {
     1906    WTF_MAKE_FAST_ALLOCATED;
     1907public:
     1908    FillLayerFillBoxPropertyWrapper(CSSPropertyID property, FillBox (FillLayer::*getter)() const, void (FillLayer::*setter)(FillBox))
     1909        : FillLayerAnimationPropertyWrapperBase(property)
     1910        , m_getter(getter)
     1911        , m_setter(setter)
     1912    {
     1913    }
     1914
     1915private:
     1916    bool equals(const FillLayer* a, const FillLayer* b) const final
     1917    {
     1918        return (a->*m_getter)() == (b->*m_getter)();
     1919    }
     1920
     1921    bool canInterpolate(const FillLayer*, const FillLayer*) const final { return false; }
     1922
     1923#if !LOG_DISABLED
     1924    void logBlend(const FillLayer* destination, const FillLayer* from, const FillLayer* to, double progress) const final
     1925    {
     1926        LOG_WITH_STREAM(Animations, stream << "  blending " << getPropertyName(this->property()) << " from " << (from->*m_getter)() << " to " << (to->*m_getter)() << " at " << TextStream::FormatNumberRespectingIntegers(progress) << " -> " << (destination->*m_getter)());
     1927    }
     1928#endif
     1929
     1930    void blend(FillLayer* destination, const FillLayer* from, const FillLayer* to, const CSSPropertyBlendingContext& context) const final
     1931    {
     1932        ASSERT(!context.progress || context.progress == 1.0);
     1933        (destination->*m_setter)(((context.progress ? to : from)->*m_getter)());
     1934    }
     1935
     1936    FillBox (FillLayer::*m_getter)() const;
     1937    void (FillLayer::*m_setter)(FillBox);
     1938};
     1939
    19051940class FillLayersPropertyWrapper final : public AnimationPropertyWrapperBase {
    19061941    WTF_MAKE_FAST_ALLOCATED;
     
    19321967            m_fillLayerPropertyWrapper = makeUnique<FillLayerStyleImagePropertyWrapper>(property, &FillLayer::image, &FillLayer::setImage);
    19331968            break;
     1969        case CSSPropertyMaskClip:
     1970            m_fillLayerPropertyWrapper = makeUnique<FillLayerFillBoxPropertyWrapper>(property, &FillLayer::clip, &FillLayer::setClip);
     1971            break;
    19341972        default:
    19351973            break;
     
    28542892        new FillLayersPropertyWrapper(CSSPropertyWebkitBackgroundSize, &RenderStyle::backgroundLayers, &RenderStyle::ensureBackgroundLayers),
    28552893
     2894        new FillLayersPropertyWrapper(CSSPropertyMaskClip, &RenderStyle::maskLayers, &RenderStyle::ensureMaskLayers),
    28562895        new FillLayersPropertyWrapper(CSSPropertyWebkitMaskPositionX, &RenderStyle::maskLayers, &RenderStyle::ensureMaskLayers),
    28572896        new FillLayersPropertyWrapper(CSSPropertyWebkitMaskPositionY, &RenderStyle::maskLayers, &RenderStyle::ensureMaskLayers),
Note: See TracChangeset for help on using the changeset viewer.