Changeset 291122 in webkit


Ignore:
Timestamp:
Mar 10, 2022 11:41:47 AM (4 months ago)
Author:
graouts@webkit.org
Message:

[web-animations] grid-template-areas should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237712

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

While we now run the grid-template-areas tests, we have a bug in the way we serialize the value through the
computed style.

  • web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:

Source/WebCore:

  • animation/CSSPropertyAnimation.cpp:

(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

Location:
trunk
Files:
6 edited

Legend:

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

    r291119 r291122  
     12022-03-10  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] grid-template-areas should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237712
     5
     6        Reviewed by Antti Koivisto.
     7
     8        While we now run the grid-template-areas tests, we have a bug in the way we serialize the value through the
     9        computed style.
     10
     11        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
     12        * web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
     13        * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:
     14
    1152022-03-10  Antoine Quint  <graouts@webkit.org>
    216
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt

    r291119 r291122  
    298298PASS grid-row-start: "5" onto "1"
    299299PASS grid-row-start: "1" onto "5"
     300PASS grid-template-areas (type: discrete) has testAccumulation function
     301PASS grid-template-areas: "none" onto "". . a b" ". .a b""
     302FAIL grid-template-areas: "". . a b" ". .a b"" onto "none" assert_equals: The value should be ". . a b" ". .a b" at 0ms expected "\". . a b\" \". .a b\"" but got "\". . a b\" \". . a b\""
    300303PASS image-orientation (type: discrete) has testAccumulation function
    301304PASS image-orientation: "from-image" onto "none"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt

    r291119 r291122  
    298298PASS grid-row-start: "5" onto "1"
    299299PASS grid-row-start: "1" onto "5"
     300PASS grid-template-areas (type: discrete) has testAddition function
     301PASS grid-template-areas: "none" onto "". . a b" ". .a b""
     302FAIL grid-template-areas: "". . a b" ". .a b"" onto "none" assert_equals: The value should be ". . a b" ". .a b" at 0ms expected "\". . a b\" \". .a b\"" but got "\". . a b\" \". . a b\""
    300303PASS image-orientation (type: discrete) has testAddition function
    301304PASS image-orientation: "from-image" onto "none"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt

    r291119 r291122  
    369369PASS grid-row-start uses discrete animation when animating between "1" and "5" with effect easing
    370370PASS grid-row-start uses discrete animation when animating between "1" and "5" with keyframe easing
     371PASS grid-template-areas (type: discrete) has testInterpolation function
     372FAIL grid-template-areas uses discrete animation when animating between "". . a b" ". .a b"" and "none" with linear easing assert_equals: The value should be ". . a b" ". .a b" at 0ms expected "\". . a b\" \". .a b\"" but got "\". . a b\" \". . a b\""
     373FAIL grid-template-areas uses discrete animation when animating between "". . a b" ". .a b"" and "none" with effect easing assert_equals: The value should be ". . a b" ". .a b" at 0ms expected "\". . a b\" \". .a b\"" but got "\". . a b\" \". . a b\""
     374FAIL grid-template-areas uses discrete animation when animating between "". . a b" ". .a b"" and "none" with keyframe easing assert_equals: The value should be ". . a b" ". .a b" at 0ms expected "\". . a b\" \". .a b\"" but got "\". . a b\" \". . a b\""
    371375PASS image-orientation (type: discrete) has testInterpolation function
    372376PASS image-orientation uses discrete animation when animating between "none" and "from-image" with linear easing
  • trunk/Source/WebCore/ChangeLog

    r291119 r291122  
     12022-03-10  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] grid-template-areas should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237712
     5
     6        Reviewed by Antti Koivisto.
     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

    r291119 r291122  
    26752675    }
    26762676#endif
     2677};
     2678
     2679class GridTemplateAreasWrapper final : public AnimationPropertyWrapperBase {
     2680    WTF_MAKE_FAST_ALLOCATED;
     2681public:
     2682    GridTemplateAreasWrapper()
     2683        : AnimationPropertyWrapperBase(CSSPropertyGridTemplateAreas)
     2684    {
     2685    }
     2686
     2687    bool canInterpolate(const RenderStyle&, const RenderStyle&, CompositeOperation) const override { return false; }
     2688
     2689    bool equals(const RenderStyle& a, const RenderStyle& b) const final
     2690    {
     2691        return a.implicitNamedGridColumnLines() == b.implicitNamedGridColumnLines()
     2692            && a.implicitNamedGridRowLines() == b.implicitNamedGridRowLines()
     2693            && a.namedGridArea() == b.namedGridArea()
     2694            && a.namedGridAreaRowCount() == b.namedGridAreaRowCount()
     2695            && a.namedGridAreaColumnCount() == b.namedGridAreaColumnCount();
     2696    }
     2697
     2698#if !LOG_DISABLED
     2699    void logBlend(const RenderStyle&, const RenderStyle&, const RenderStyle&, double progress) const final
     2700    {
     2701        LOG_WITH_STREAM(Animations, stream << " blending " << getPropertyName(property()) << " at " << TextStream::FormatNumberRespectingIntegers(progress) << ".");
     2702    }
     2703#endif
     2704
     2705    void blend(RenderStyle& destination, const RenderStyle& from, const RenderStyle& to, const CSSPropertyBlendingContext& context) const final
     2706    {
     2707        ASSERT(context.isDiscrete);
     2708        ASSERT(!context.progress || context.progress == 1);
     2709
     2710        auto& source = context.progress ? to : from;
     2711        destination.setImplicitNamedGridColumnLines(source.implicitNamedGridColumnLines());
     2712        destination.setImplicitNamedGridRowLines(source.implicitNamedGridRowLines());
     2713        destination.setNamedGridArea(source.namedGridArea());
     2714        destination.setNamedGridAreaRowCount(source.namedGridAreaRowCount());
     2715        destination.setNamedGridAreaColumnCount(source.namedGridAreaColumnCount());
     2716    }
    26772717};
    26782718
     
    30173057        new FontVariantLigaturesWrapper,
    30183058        new DiscretePropertyWrapper<FontVariantPosition>(CSSPropertyFontVariantPosition, &RenderStyle::fontVariantPosition, &RenderStyle::setFontVariantPosition),
    3019         new DiscretePropertyWrapper<FontVariantCaps>(CSSPropertyFontVariantCaps, &RenderStyle::fontVariantCaps, &RenderStyle::setFontVariantCaps)
     3059        new DiscretePropertyWrapper<FontVariantCaps>(CSSPropertyFontVariantCaps, &RenderStyle::fontVariantCaps, &RenderStyle::setFontVariantCaps),
     3060        new GridTemplateAreasWrapper
    30203061    };
    30213062    const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
Note: See TracChangeset for help on using the changeset viewer.