Changeset 290730 in webkit
- Timestamp:
- Mar 2, 2022 7:27:56 AM (5 months ago)
- Location:
- trunk
- Files:
-
- 15 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-animations/responsive/column-width-001-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context-filling-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/fontSize-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/perspective-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/textIndent-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/to-style-change-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/animation/KeyframeEffect.cpp (modified) (1 diff)
-
Source/WebCore/animation/KeyframeEffect.h (modified) (1 diff)
-
Source/WebCore/animation/KeyframeEffectStack.cpp (modified) (2 diffs)
-
Source/WebCore/animation/KeyframeEffectStack.h (modified) (1 diff)
-
Source/WebCore/style/StyleTreeResolver.cpp (modified) (1 diff)
-
Source/WebCore/style/Styleable.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r290667 r290730 1 2022-03-02 Antoine Quint <graouts@webkit.org> 2 3 [web-animations] changes to font-size should recompute keyframes 4 https://bugs.webkit.org/show_bug.cgi?id=237357 5 6 Reviewed by Antti Koivisto. 7 8 * web-platform-tests/css/css-animations/responsive/column-width-001-expected.txt: 9 * web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context-expected.txt: 10 * web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context-filling-expected.txt: 11 * web-platform-tests/web-animations/responsive/fontSize-expected.txt: 12 * web-platform-tests/web-animations/responsive/perspective-expected.txt: 13 * web-platform-tests/web-animations/responsive/textIndent-expected.txt: 14 * web-platform-tests/web-animations/responsive/to-style-change-expected.txt: 15 1 16 2022-03-01 Martin Robinson <mrobinson@webkit.org> 2 17 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/responsive/column-width-001-expected.txt
r262946 r290730 1 1 2 FAIL column-width responds to font-size changes assert_equals: expected "80px" but got "40px" 3 FAIL column-width clamps to 0px assert_equals: expected "0px" but got " 30px"2 PASS column-width responds to font-size changes 3 FAIL column-width clamps to 0px assert_equals: expected "0px" but got "20px" 4 4 FAIL column-width responds to inherited changes assert_equals: expected "auto" but got "30px" 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context-expected.txt
r267649 r290730 1 1 2 FAIL Effect values reflect changes to font-size on element assert_equals: Effect value after updating font-size expected "300px" but got "150px" 2 PASS Effect values reflect changes to font-size on element 3 3 FAIL Effect values reflect changes to font-size on parent element assert_equals: Effect value after updating font-size on parent element expected "300px" but got "150px" 4 4 PASS Effect values reflect changes to font-size when computed style is not immediately flushed 5 FAIL Effect values reflect changes to font-size from reparenting assert_equals: Effect value after attaching to font-size:20px parent expected "300px" but got "150px" 5 PASS Effect values reflect changes to font-size from reparenting 6 6 PASS Effect values reflect changes to target element 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context-filling-expected.txt
r287549 r290730 1 1 2 FAIL Filling effect values reflect changes to font-size on element assert_equals: Effect value after updating font-size expected "400px" but got "200px" 2 PASS Filling effect values reflect changes to font-size on element 3 3 FAIL Filling effect values reflect changes to font-size on parent element assert_equals: Effect value after updating font-size on parent element expected "400px" but got "200px" 4 4 FAIL Filling effect values reflect changes to variables on element assert_equals: Effect value after updating variable expected "200px" but got "100px" -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/fontSize-expected.txt
r287924 r290730 1 1 2 FAIL Relative font size larger responsive to style changes assert_not_equals: got disallowed value "15.6px" 3 FAIL Relative font size smaller responsive to style changes assert_not_equals: got disallowed value "14.999999px" 4 FAIL Font size medium responsive to style changes assert_not_equals: got disallowed value "16px" 5 FAIL Font size initial responsive to style changes assert_not_equals: got disallowed value "13px" 2 PASS Relative font size larger responsive to style changes 3 PASS Relative font size smaller responsive to style changes 4 PASS Font size medium responsive to style changes 5 PASS Font size initial responsive to style changes 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/perspective-expected.txt
r287924 r290730 1 1 2 2 PASS perspective responsive to style changes 3 FAIL perspective clamped to 0px assert_equals: expected "0px" but got " 60px"3 FAIL perspective clamped to 0px assert_equals: expected "0px" but got "100px" 4 4 FAIL perspective responsive to inherited changes assert_equals: expected "80px" but got "none" 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/textIndent-expected.txt
r287924 r290730 1 1 2 FAIL textIndent responsive to style changes assert_not_equals: got disallowed value "100px hanging" 2 PASS textIndent responsive to style changes 3 3 FAIL textIndent responsive to inherited textIndent changes assert_equals: expected "200px hanging each-line" but got "150px hanging each-line" 4 4 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/to-style-change-expected.txt
r287924 r290730 1 1 2 FAIL Lengths responsive to style changes assert_equals: expected "calc(40% + 150px)" but got "calc(40% + 100px)" 2 PASS Lengths responsive to style changes 3 3 PASS Percentages responsive to width style changes 4 4 PASS Numbers responsive to style changes -
trunk/Source/WebCore/ChangeLog
r290729 r290730 1 2022-03-02 Antoine Quint <graouts@webkit.org> 2 3 [web-animations] changes to font-size should recompute keyframes 4 https://bugs.webkit.org/show_bug.cgi?id=237357 5 6 Reviewed by Antti Koivisto. 7 8 When we compute keyframes, it's possible that some values are specified using "em" units 9 and thus dependent on the current value for font-size. If the font-size changes over time, 10 we must recompute keyframes to ensure that any such value is updated. 11 12 To ensure that we correctly determine when the font-size changed, we pass a pointer to the 13 style seen when we last udpated animations so that we only consider a change in font-size 14 provided we've ever resolved animations. 15 16 * animation/KeyframeEffect.cpp: 17 (WebCore::KeyframeEffect::propertyAffectingKeyframeResolutionDidChange): 18 (WebCore::KeyframeEffect::propertyAffectingLogicalPropertiesDidChange): Deleted. 19 * animation/KeyframeEffect.h: 20 * animation/KeyframeEffectStack.cpp: 21 (WebCore::KeyframeEffectStack::applyKeyframeEffects): 22 * animation/KeyframeEffectStack.h: 23 * style/StyleTreeResolver.cpp: 24 (WebCore::Style::TreeResolver::createAnimatedElementUpdate): 25 * style/Styleable.h: 26 (WebCore::Styleable::applyKeyframeEffects const): 27 1 28 2022-03-02 Oriol Brufau <obrufau@igalia.com> 2 29 -
trunk/Source/WebCore/animation/KeyframeEffect.cpp
r290667 r290730 1683 1683 } 1684 1684 1685 void KeyframeEffect::propertyAffecting LogicalPropertiesDidChange(RenderStyle& unanimatedStyle, const Style::ResolutionContext& resolutionContext)1685 void KeyframeEffect::propertyAffectingKeyframeResolutionDidChange(RenderStyle& unanimatedStyle, const Style::ResolutionContext& resolutionContext) 1686 1686 { 1687 1687 switch (m_blendingKeyframesSource) { -
trunk/Source/WebCore/animation/KeyframeEffect.h
r290667 r290730 127 127 void animationTimingDidChange(); 128 128 void transformRelatedPropertyDidChange(); 129 void propertyAffecting LogicalPropertiesDidChange(RenderStyle&, const Style::ResolutionContext&);129 void propertyAffectingKeyframeResolutionDidChange(RenderStyle&, const Style::ResolutionContext&); 130 130 OptionSet<AcceleratedActionApplicationResult> applyPendingAcceleratedActions(); 131 131 -
trunk/Source/WebCore/animation/KeyframeEffectStack.cpp
r289598 r290730 123 123 } 124 124 125 OptionSet<AnimationImpact> KeyframeEffectStack::applyKeyframeEffects(RenderStyle& targetStyle, const RenderStyle &previousLastStyleChangeEventStyle, const Style::ResolutionContext& resolutionContext)125 OptionSet<AnimationImpact> KeyframeEffectStack::applyKeyframeEffects(RenderStyle& targetStyle, const RenderStyle* previousLastStyleChangeEventStyle, const Style::ResolutionContext& resolutionContext) 126 126 { 127 127 OptionSet<AnimationImpact> impact; 128 128 129 auto& previousStyle = previousLastStyleChangeEventStyle ? *previousLastStyleChangeEventStyle : RenderStyle::defaultStyle(); 130 129 131 auto transformRelatedPropertyChanged = [&]() -> bool { 130 return !arePointingToEqualData(targetStyle.translate(), previous LastStyleChangeEventStyle.translate())131 || !arePointingToEqualData(targetStyle.scale(), previous LastStyleChangeEventStyle.scale())132 || !arePointingToEqualData(targetStyle.rotate(), previous LastStyleChangeEventStyle.rotate())133 || targetStyle.transform() != previous LastStyleChangeEventStyle.transform();132 return !arePointingToEqualData(targetStyle.translate(), previousStyle.translate()) 133 || !arePointingToEqualData(targetStyle.scale(), previousStyle.scale()) 134 || !arePointingToEqualData(targetStyle.rotate(), previousStyle.rotate()) 135 || targetStyle.transform() != previousStyle.transform(); 134 136 }(); 135 137 136 auto propertyAffectingLogicalPropertiesChanged = previousLastStyleChangeEventStyle.direction() != targetStyle.direction()137 || previousLastStyleChangeEventStyle.writingMode() != targetStyle.writingMode();138 auto fontSizeChanged = previousLastStyleChangeEventStyle && previousLastStyleChangeEventStyle->computedFontSize() != targetStyle.computedFontSize(); 139 auto propertyAffectingLogicalPropertiesChanged = previousLastStyleChangeEventStyle && (previousLastStyleChangeEventStyle->direction() != targetStyle.direction() || previousLastStyleChangeEventStyle->writingMode() != targetStyle.writingMode()); 138 140 139 141 auto unanimatedStyle = RenderStyle::clone(targetStyle); … … 142 144 ASSERT(effect->animation()); 143 145 144 if (propertyAffectingLogicalPropertiesChanged )145 effect->propertyAffecting LogicalPropertiesDidChange(unanimatedStyle, resolutionContext);146 if (propertyAffectingLogicalPropertiesChanged || fontSizeChanged) 147 effect->propertyAffectingKeyframeResolutionDidChange(unanimatedStyle, resolutionContext); 146 148 147 149 effect->animation()->resolve(targetStyle, resolutionContext); -
trunk/Source/WebCore/animation/KeyframeEffectStack.h
r289598 r290730 55 55 bool isCurrentlyAffectingProperty(CSSPropertyID) const; 56 56 bool requiresPseudoElement() const; 57 OptionSet<AnimationImpact> applyKeyframeEffects(RenderStyle& targetStyle, const RenderStyle &previousLastStyleChangeEventStyle, const Style::ResolutionContext&);57 OptionSet<AnimationImpact> applyKeyframeEffects(RenderStyle& targetStyle, const RenderStyle* previousLastStyleChangeEventStyle, const Style::ResolutionContext&); 58 58 bool hasEffectWithImplicitKeyframes() const; 59 59 -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r290564 r290730 367 367 // as animations created via the JS API. 368 368 if (styleable.hasKeyframeEffects()) { 369 auto previousLastStyleChangeEventStyle = styleable.lastStyleChangeEventStyle() ? RenderStyle::clonePtr(*styleable.lastStyleChangeEventStyle()) : RenderStyle::createPtr();369 auto previousLastStyleChangeEventStyle = styleable.lastStyleChangeEventStyle() ? RenderStyle::clonePtr(*styleable.lastStyleChangeEventStyle()) : nullptr; 370 370 // Record the style prior to applying animations for this style change event. 371 371 styleable.setLastStyleChangeEventStyle(RenderStyle::clonePtr(*newStyle)); 372 372 // Apply all keyframe effects to the new style. 373 373 auto animatedStyle = RenderStyle::clonePtr(*newStyle); 374 animationImpact = styleable.applyKeyframeEffects(*animatedStyle, *previousLastStyleChangeEventStyle, resolutionContext);374 animationImpact = styleable.applyKeyframeEffects(*animatedStyle, previousLastStyleChangeEventStyle.get(), resolutionContext); 375 375 newStyle = WTFMove(animatedStyle); 376 376 -
trunk/Source/WebCore/style/Styleable.h
r289455 r290730 97 97 } 98 98 99 OptionSet<AnimationImpact> applyKeyframeEffects(RenderStyle& targetStyle, const RenderStyle &previousLastStyleChangeEventStyle, const Style::ResolutionContext& resolutionContext) const99 OptionSet<AnimationImpact> applyKeyframeEffects(RenderStyle& targetStyle, const RenderStyle* previousLastStyleChangeEventStyle, const Style::ResolutionContext& resolutionContext) const 100 100 { 101 101 return element.ensureKeyframeEffectStack(pseudoId).applyKeyframeEffects(targetStyle, previousLastStyleChangeEventStyle, resolutionContext);
Note: See TracChangeset
for help on using the changeset viewer.