Changeset 269333 in webkit


Ignore:
Timestamp:
Nov 3, 2020 2:17:14 PM (21 months ago)
Author:
graouts@webkit.org
Message:

align-content should be a discrete animatable property
https://bugs.webkit.org/show_bug.cgi?id=218530

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

  • 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:
  • web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt:

Source/WebCore:

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • animation/CSSPropertyAnimation.cpp:

(WebCore::DiscretePropertyWrapper::DiscretePropertyWrapper):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

  • rendering/style/StyleContentAlignmentData.cpp: Added.

(WebCore::operator<<):

  • rendering/style/StyleContentAlignmentData.h:
Location:
trunk
Files:
1 added
10 edited

Legend:

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

    r269314 r269333  
     12020-11-03  Antoine Quint  <graouts@webkit.org>
     2
     3        align-content should be a discrete animatable property
     4        https://bugs.webkit.org/show_bug.cgi?id=218530
     5
     6        Reviewed by Simon Fraser.
     7
     8        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
     9        * web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
     10        * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:
     11        * web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt:
     12
    1132020-11-03  Commit Queue  <commit-queue@webkit.org>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt

    r268792 r269333  
    11
    22PASS Setup
     3PASS align-content (type: discrete) has testAccumulation function
     4PASS align-content: "flex-end" onto "flex-start"
     5PASS align-content: "flex-start" onto "flex-end"
    36PASS background-color (type: color) has testAccumulation function
    47FAIL background-color supports animating as color of rgb() with overflowed  from and to values assert_equals: The value should be rgb(255, 128, 128) at 0ms expected "rgb(255, 128, 128)" but got "rgb(255, 0, 0)"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt

    r268792 r269333  
    11
    22PASS Setup
     3PASS align-content (type: discrete) has testAddition function
     4PASS align-content: "flex-end" onto "flex-start"
     5PASS align-content: "flex-start" onto "flex-end"
    36PASS background-color (type: color) has testAddition function
    47FAIL background-color supports animating as color of rgb() with overflowed  from and to values assert_equals: The value should be rgb(255, 128, 128) at 0ms expected "rgb(255, 128, 128)" but got "rgb(255, 0, 0)"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt

    r268792 r269333  
    11
    22PASS Setup
     3PASS align-content (type: discrete) has testInterpolation function
     4PASS align-content uses discrete animation when animating between "flex-start" and "flex-end" with linear easing
     5PASS align-content uses discrete animation when animating between "flex-start" and "flex-end" with effect easing
     6PASS align-content uses discrete animation when animating between "flex-start" and "flex-end" with keyframe easing
    37PASS background-color (type: color) has testInterpolation function
    48PASS background-color supports animating as color of rgb()
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt

    r268516 r269333  
    11
    2 FAIL iteration composition of discrete type animation (align-content) assert_equals: Animated align-content style at 50s of the first iteration expected "flex-end" but got "normal"
     2PASS iteration composition of discrete type animation (align-content)
    33FAIL iteration composition of <length> type animation assert_equals: Animated margin-left style at 0s of the third iteration expected "20px" but got "0px"
    44FAIL iteration composition of <percentage> type animation assert_equals: Animated width style at 0s of the third iteration expected "100px" but got "0px"
  • trunk/Source/WebCore/ChangeLog

    r269331 r269333  
     12020-11-03  Antoine Quint  <graouts@webkit.org>
     2
     3        align-content should be a discrete animatable property
     4        https://bugs.webkit.org/show_bug.cgi?id=218530
     5
     6        Reviewed by Simon Fraser.
     7
     8        * Sources.txt:
     9        * WebCore.xcodeproj/project.pbxproj:
     10        * animation/CSSPropertyAnimation.cpp:
     11        (WebCore::DiscretePropertyWrapper::DiscretePropertyWrapper):
     12        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     13        * rendering/style/StyleContentAlignmentData.cpp: Added.
     14        (WebCore::operator<<):
     15        * rendering/style/StyleContentAlignmentData.h:
     16
    1172020-11-03  Rini Patel  <rini_patel@apple.com>
    218
  • trunk/Source/WebCore/Sources.txt

    r269330 r269333  
    22952295rendering/style/StyleBoxData.cpp
    22962296rendering/style/StyleCachedImage.cpp
     2297rendering/style/StyleContentAlignmentData.cpp
    22972298rendering/style/StyleCursorImage.cpp
    22982299rendering/style/StyleDeprecatedFlexibleBoxData.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r269330 r269333  
    98799879                718C7F561DD385C500B733C8 /* status-label.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = "status-label.css"; sourceTree = "<group>"; };
    98809880                718C7F571DD385C500B733C8 /* status-label.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "status-label.js"; sourceTree = "<group>"; };
     9881                7199B94A2551F0E100494A57 /* StyleContentAlignmentData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleContentAlignmentData.cpp; sourceTree = "<group>"; };
    98819882                71A1B6071DEE5A820073BCFB /* en */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = en; path = "en.lproj/modern-media-controls-localized-strings.js"; sourceTree = SOURCE_ROOT; };
    98829883                71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathUtilities.cpp; sourceTree = "<group>"; };
     
    2678926790                                BCEF444C0E674628001C1287 /* StyleCachedImage.h */,
    2679026791                                1C0AA16A21940DC700896829 /* StyleColorScheme.h */,
     26792                                7199B94A2551F0E100494A57 /* StyleContentAlignmentData.cpp */,
    2679126793                                9DAC7C561AF2CB6400437C44 /* StyleContentAlignmentData.h */,
    2679226794                                CA52BAE523D0AF1600DE0B84 /* StyleCursorImage.cpp */,
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r268792 r269333  
    632632
    633633template <typename T>
     634class DiscretePropertyWrapper : public PropertyWrapperGetter<T> {
     635    WTF_MAKE_FAST_ALLOCATED;
     636public:
     637    DiscretePropertyWrapper(CSSPropertyID prop, T (RenderStyle::*getter)() const, void (RenderStyle::*setter)(T))
     638        : PropertyWrapperGetter<T>(prop, getter)
     639        , m_setter(setter)
     640    {
     641    }
     642
     643    void blend(const CSSPropertyBlendingClient*, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
     644    {
     645        // https://drafts.csswg.org/web-animations-1/#discrete
     646        // The property’s values cannot be meaningfully combined, thus it is not additive and
     647        // interpolation swaps from Va to Vb at 50% (p=0.5).
     648        if (progress < 0.5)
     649            (dst->*m_setter)((a->*PropertyWrapperGetter<T>::m_getter)());
     650        else
     651            (dst->*m_setter)((b->*PropertyWrapperGetter<T>::m_getter)());
     652    }
     653
     654protected:
     655    void (RenderStyle::*m_setter)(T);
     656};
     657
     658template <typename T>
    634659class RefCountedPropertyWrapper : public PropertyWrapperGetter<T*> {
    635660    WTF_MAKE_FAST_ALLOCATED;
     
    18751900        new PropertyWrapper<float>(CSSPropertyFlexShrink, &RenderStyle::flexShrink, &RenderStyle::setFlexShrink),
    18761901        new PropertyWrapper<int>(CSSPropertyOrder, &RenderStyle::order, &RenderStyle::setOrder),
     1902
     1903        new DiscretePropertyWrapper<const StyleContentAlignmentData&>(CSSPropertyAlignContent, &RenderStyle::alignContent, &RenderStyle::setAlignContent),
    18771904    };
    18781905    const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
  • trunk/Source/WebCore/rendering/style/StyleContentAlignmentData.h

    r232018 r269333  
    6565};
    6666
     67WTF::TextStream& operator<<(WTF::TextStream&, const StyleContentAlignmentData&);
     68
    6769} // namespace WebCore
Note: See TracChangeset for help on using the changeset viewer.