Changeset 291090 in webkit
- Timestamp:
- Mar 9, 2022 10:12:17 PM (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) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r291068 r291090 1 2022-03-09 Antoine Quint <graouts@webkit.org> 2 3 [web-animations] counter-increment should support discrete animation 4 https://bugs.webkit.org/show_bug.cgi?id=237640 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-09 Antoine Quint <graouts@webkit.org> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt
r291068 r291090 176 176 PASS column-width: "1px" onto "auto" 177 177 PASS column-width: "auto" onto "1px" 178 PASS counter-increment (type: discrete) has testAccumulation function 179 PASS counter-increment: "ident-2 2" onto "ident-1 1" 180 PASS counter-increment: "ident-1 1" onto "ident-2 2" 178 181 PASS cursor (type: discrete) has testAccumulation function 179 182 PASS cursor: "wait" onto "pointer" -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt
r291068 r291090 176 176 PASS column-width: "1px" onto "auto" 177 177 PASS column-width: "auto" onto "1px" 178 PASS counter-increment (type: discrete) has testAddition function 179 PASS counter-increment: "ident-2 2" onto "ident-1 1" 180 PASS counter-increment: "ident-1 1" onto "ident-2 2" 178 181 PASS cursor (type: discrete) has testAddition function 179 182 PASS cursor: "wait" onto "pointer" -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt
r291068 r291090 212 212 PASS column-width uses discrete animation when animating between "auto" and "1px" with effect easing 213 213 PASS column-width uses discrete animation when animating between "auto" and "1px" with keyframe easing 214 PASS counter-increment (type: discrete) has testInterpolation function 215 PASS counter-increment uses discrete animation when animating between "ident-1 1" and "ident-2 2" with linear easing 216 PASS counter-increment uses discrete animation when animating between "ident-1 1" and "ident-2 2" with effect easing 217 PASS counter-increment uses discrete animation when animating between "ident-1 1" and "ident-2 2" with keyframe easing 214 218 PASS cursor (type: discrete) has testInterpolation function 215 219 PASS cursor uses discrete animation when animating between "pointer" and "wait" with linear easing -
trunk/Source/WebCore/ChangeLog
r291085 r291090 1 2022-03-09 Antoine Quint <graouts@webkit.org> 2 3 [web-animations] counter-increment should support discrete animation 4 https://bugs.webkit.org/show_bug.cgi?id=237640 5 6 Reviewed by Antti Koivisto. 7 8 The counter-increment and counter-reset properties are represented via a single data structure 9 held by RenderStyle. This lays up the groundwork for animation support of counter-reset as well 10 but right now we only handle counter-increment to keep this patch focused. 11 12 * animation/CSSPropertyAnimation.cpp: 13 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): 14 1 15 2022-03-09 Andres Gonzalez <andresg_22@apple.com> 2 16 -
trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp
r291068 r291090 44 44 #include "ColorBlending.h" 45 45 #include "ContentData.h" 46 #include "CounterDirectives.h" 46 47 #include "FloatConversion.h" 47 48 #include "FontCascade.h" … … 2512 2513 } 2513 2514 #endif 2515 }; 2516 2517 class CounterIncrementWrapper final : public AnimationPropertyWrapperBase { 2518 WTF_MAKE_FAST_ALLOCATED; 2519 public: 2520 CounterIncrementWrapper() 2521 : AnimationPropertyWrapperBase(CSSPropertyCounterIncrement) 2522 { 2523 } 2524 2525 bool canInterpolate(const RenderStyle&, const RenderStyle&, CompositeOperation) const override { return false; } 2526 2527 bool equals(const RenderStyle& a, const RenderStyle& b) const final 2528 { 2529 auto* aCounterDirectives = a.counterDirectives(); 2530 auto* bCounterDirectives = b.counterDirectives(); 2531 2532 if (!aCounterDirectives && !bCounterDirectives) 2533 return true; 2534 if (aCounterDirectives && bCounterDirectives) { 2535 if (aCounterDirectives->size() != bCounterDirectives->size()) 2536 return false; 2537 for (auto& [key, aDirective] : *aCounterDirectives) { 2538 auto it = bCounterDirectives->find(key); 2539 if (it == bCounterDirectives->end()) 2540 return false; 2541 auto& bDirective = it->value; 2542 if (aDirective.incrementValue != bDirective.incrementValue) 2543 return false; 2544 } 2545 return true; 2546 } 2547 return false; 2548 } 2549 2550 #if !LOG_DISABLED 2551 void logBlend(const RenderStyle&, const RenderStyle&, const RenderStyle&, double progress) const final 2552 { 2553 LOG_WITH_STREAM(Animations, stream << " blending counter-increment at " << TextStream::FormatNumberRespectingIntegers(progress) << "."); 2554 } 2555 #endif 2556 2557 void blend(RenderStyle& destination, const RenderStyle& from, const RenderStyle& to, const CSSPropertyBlendingContext& context) const final 2558 { 2559 ASSERT(context.isDiscrete); 2560 ASSERT(!context.progress || context.progress == 1); 2561 2562 // Clear all existing values in the existing set of directives. 2563 if (destination.counterDirectives()) { 2564 for (auto& [key, directive] : destination.accessCounterDirectives()) 2565 directive.incrementValue = std::nullopt; 2566 } 2567 2568 auto& style = context.progress ? to : from; 2569 if (!style.counterDirectives()) 2570 return; 2571 2572 auto& targetDirectives = destination.accessCounterDirectives(); 2573 for (auto& [key, directive] : *style.counterDirectives()) { 2574 auto updateDirective = [](CounterDirectives& target, const CounterDirectives& source) { 2575 target.incrementValue = source.incrementValue; 2576 }; 2577 auto it = targetDirectives.find(key); 2578 if (it == targetDirectives.end()) 2579 updateDirective(targetDirectives.add(key, CounterDirectives { }).iterator->value, directive); 2580 else 2581 updateDirective(it->value, directive); 2582 } 2583 } 2514 2584 }; 2515 2585 … … 2845 2915 new DiscretePropertyWrapper<WindRule>(CSSPropertyClipRule, &RenderStyle::clipRule, &RenderStyle::setClipRule), 2846 2916 new DiscretePropertyWrapper<ColorInterpolation>(CSSPropertyColorInterpolationFilters, &RenderStyle::colorInterpolationFilters, &RenderStyle::setColorInterpolationFilters), 2847 new DiscretePropertyWrapper<DominantBaseline>(CSSPropertyDominantBaseline, &RenderStyle::dominantBaseline, &RenderStyle::setDominantBaseline) 2917 new DiscretePropertyWrapper<DominantBaseline>(CSSPropertyDominantBaseline, &RenderStyle::dominantBaseline, &RenderStyle::setDominantBaseline), 2918 new CounterIncrementWrapper 2848 2919 }; 2849 2920 const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
Note: See TracChangeset
for help on using the changeset viewer.