Changeset 291099 in webkit
- Timestamp:
- Mar 10, 2022 3:16:02 AM (4 months ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/animation/CSSPropertyAnimation.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r291098 r291099 1 2022-03-10 Antoine Quint <graouts@webkit.org> 2 3 [web-animations] counter-reset should support discrete animation 4 https://bugs.webkit.org/show_bug.cgi?id=237644 5 6 Reviewed by Antti Koivisto. 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 1 12 2022-03-10 Antti Koivisto <antti@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt
r291090 r291099 179 179 PASS counter-increment: "ident-2 2" onto "ident-1 1" 180 180 PASS counter-increment: "ident-1 1" onto "ident-2 2" 181 PASS counter-reset (type: discrete) has testAccumulation function 182 PASS counter-reset: "ident-2 2" onto "ident-1 1" 183 PASS counter-reset: "ident-1 1" onto "ident-2 2" 181 184 PASS cursor (type: discrete) has testAccumulation function 182 185 PASS cursor: "wait" onto "pointer" -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt
r291090 r291099 179 179 PASS counter-increment: "ident-2 2" onto "ident-1 1" 180 180 PASS counter-increment: "ident-1 1" onto "ident-2 2" 181 PASS counter-reset (type: discrete) has testAddition function 182 PASS counter-reset: "ident-2 2" onto "ident-1 1" 183 PASS counter-reset: "ident-1 1" onto "ident-2 2" 181 184 PASS cursor (type: discrete) has testAddition function 182 185 PASS cursor: "wait" onto "pointer" -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt
r291090 r291099 216 216 PASS counter-increment uses discrete animation when animating between "ident-1 1" and "ident-2 2" with effect easing 217 217 PASS counter-increment uses discrete animation when animating between "ident-1 1" and "ident-2 2" with keyframe easing 218 PASS counter-reset (type: discrete) has testInterpolation function 219 PASS counter-reset uses discrete animation when animating between "ident-1 1" and "ident-2 2" with linear easing 220 PASS counter-reset uses discrete animation when animating between "ident-1 1" and "ident-2 2" with effect easing 221 PASS counter-reset uses discrete animation when animating between "ident-1 1" and "ident-2 2" with keyframe easing 218 222 PASS cursor (type: discrete) has testInterpolation function 219 223 PASS cursor uses discrete animation when animating between "pointer" and "wait" with linear easing -
trunk/Source/WebCore/ChangeLog
r291098 r291099 1 2022-03-10 Antoine Quint <graouts@webkit.org> 2 3 [web-animations] counter-reset should support discrete animation 4 https://bugs.webkit.org/show_bug.cgi?id=237644 5 6 Reviewed by Antti Koivisto. 7 8 Generalize the wrapper added for counter-increment to also handle counter-reset. 9 10 * animation/CSSPropertyAnimation.cpp: 11 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): 12 1 13 2022-03-10 Antti Koivisto <antti@apple.com> 2 14 -
trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp
r291090 r291099 2515 2515 }; 2516 2516 2517 class CounterIncrementWrapper final : public AnimationPropertyWrapperBase { 2518 WTF_MAKE_FAST_ALLOCATED; 2519 public: 2520 CounterIncrementWrapper() 2521 : AnimationPropertyWrapperBase(CSSPropertyCounterIncrement) 2522 { 2517 class CounterWrapper final : public AnimationPropertyWrapperBase { 2518 WTF_MAKE_FAST_ALLOCATED; 2519 public: 2520 CounterWrapper(CSSPropertyID property) 2521 : AnimationPropertyWrapperBase(property) 2522 { 2523 ASSERT(property == CSSPropertyCounterIncrement || property == CSSPropertyCounterReset); 2523 2524 } 2524 2525 … … 2540 2541 return false; 2541 2542 auto& bDirective = it->value; 2542 if (aDirective.incrementValue != bDirective.incrementValue) 2543 if ((property() == CSSPropertyCounterIncrement && aDirective.incrementValue != bDirective.incrementValue) 2544 || (property() == CSSPropertyCounterReset && aDirective.resetValue != bDirective.resetValue)) 2543 2545 return false; 2544 2546 } … … 2551 2553 void logBlend(const RenderStyle&, const RenderStyle&, const RenderStyle&, double progress) const final 2552 2554 { 2553 LOG_WITH_STREAM(Animations, stream << " blending counter-incrementat " << TextStream::FormatNumberRespectingIntegers(progress) << ".");2555 LOG_WITH_STREAM(Animations, stream << " blending " << getPropertyName(property()) << " at " << TextStream::FormatNumberRespectingIntegers(progress) << "."); 2554 2556 } 2555 2557 #endif … … 2562 2564 // Clear all existing values in the existing set of directives. 2563 2565 if (destination.counterDirectives()) { 2564 for (auto& [key, directive] : destination.accessCounterDirectives()) 2565 directive.incrementValue = std::nullopt; 2566 for (auto& [key, directive] : destination.accessCounterDirectives()) { 2567 if (property() == CSSPropertyCounterIncrement) 2568 directive.incrementValue = std::nullopt; 2569 else 2570 directive.resetValue = std::nullopt; 2571 } 2566 2572 } 2567 2573 … … 2572 2578 auto& targetDirectives = destination.accessCounterDirectives(); 2573 2579 for (auto& [key, directive] : *style.counterDirectives()) { 2574 auto updateDirective = [](CounterDirectives& target, const CounterDirectives& source) { 2575 target.incrementValue = source.incrementValue; 2580 auto updateDirective = [&](CounterDirectives& target, const CounterDirectives& source) { 2581 if (property() == CSSPropertyCounterIncrement) 2582 target.incrementValue = source.incrementValue; 2583 else 2584 target.resetValue = source.resetValue; 2576 2585 }; 2577 2586 auto it = targetDirectives.find(key); … … 2916 2925 new DiscretePropertyWrapper<ColorInterpolation>(CSSPropertyColorInterpolationFilters, &RenderStyle::colorInterpolationFilters, &RenderStyle::setColorInterpolationFilters), 2917 2926 new DiscretePropertyWrapper<DominantBaseline>(CSSPropertyDominantBaseline, &RenderStyle::dominantBaseline, &RenderStyle::setDominantBaseline), 2918 new CounterIncrementWrapper 2927 new CounterWrapper(CSSPropertyCounterIncrement), 2928 new CounterWrapper(CSSPropertyCounterReset) 2919 2929 }; 2920 2930 const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
Note: See TracChangeset
for help on using the changeset viewer.