Changeset 273003 in webkit
- Timestamp:
- Feb 17, 2021, 9:27:21 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/animation/animation-position-crash-expected.html (added)
-
LayoutTests/fast/animation/animation-position-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/style/StyleAdjuster.cpp (modified) (2 diffs)
-
Source/WebCore/style/StyleAdjuster.h (modified) (1 diff)
-
Source/WebCore/style/StyleTreeResolver.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r273002 r273003 1 2021-02-17 Antti Koivisto <antti@apple.com> 2 3 Animated keyframe style needs to go through full style adjuster 4 https://bugs.webkit.org/show_bug.cgi?id=222036 5 rdar://72421747 6 7 Reviewed by Zalan Bujtas. 8 9 * fast/animation/animation-position-crash-expected.html: Added. 10 * fast/animation/animation-position-crash.html: Added. 11 1 12 2021-02-17 Philippe Normand <pnormand@igalia.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r273001 r273003 1 2021-02-17 Antti Koivisto <antti@apple.com> 2 3 Animated keyframe style needs to go through full style adjuster 4 https://bugs.webkit.org/show_bug.cgi?id=222036 5 rdar://72421747 6 7 Reviewed by Zalan Bujtas. 8 9 We can create unadjusted styles via keyframe animations and those may cause problems in rendering. 10 11 Test: fast/animation/animation-position-crash.html 12 13 * style/StyleAdjuster.cpp: 14 (WebCore::Style::Adjuster::adjustAnimatedStyle): 15 16 Make this a member function and invoke Adjuster::adjust. 17 Simplify the z-index adjustment since it is mostly handled by adjust. 18 19 * style/StyleAdjuster.h: 20 * style/StyleTreeResolver.cpp: 21 22 Always use style adjuster for keyframe animation. 23 24 (WebCore::Style::TreeResolver::createAnimatedElementUpdate): 25 1 26 2021-02-17 Antoine Quint <graouts@webkit.org> 2 27 -
trunk/Source/WebCore/style/StyleAdjuster.cpp
r272977 r273003 575 575 } 576 576 577 void Adjuster::adjustAnimatedStyle(RenderStyle& style, const RenderStyle* parentBoxStyle, OptionSet<AnimationImpact> impact) 578 { 577 void Adjuster::adjustAnimatedStyle(RenderStyle& style, OptionSet<AnimationImpact> impact) const 578 { 579 adjust(style, nullptr); 580 579 581 // Set an explicit used z-index in two cases: 580 582 // 1. When the element respects z-index, and the style has an explicit z-index set (for example, the animation … … 583 585 // It's important to not clobber an existing used z-index, since an earlier animation may have set it, but we 584 586 // may still need to update the used z-index value from the specified value. 585 bool elementRespectsZIndex = style.position() != PositionType::Static || (parentBoxStyle && parentBoxStyle->isDisplayFlexibleOrGridBox()); 586 587 if (elementRespectsZIndex && !style.hasAutoSpecifiedZIndex()) 588 style.setUsedZIndex(style.specifiedZIndex()); 589 else if (impact.contains(AnimationImpact::ForcesStackingContext)) 587 588 if (style.hasAutoUsedZIndex() && impact.contains(AnimationImpact::ForcesStackingContext)) 590 589 style.setUsedZIndex(0); 591 590 } -
trunk/Source/WebCore/style/StyleAdjuster.h
r261820 r273003 47 47 48 48 void adjust(RenderStyle&, const RenderStyle* userAgentAppearanceStyle) const; 49 void adjustAnimatedStyle(RenderStyle&, OptionSet<AnimationImpact>) const; 49 50 50 51 static void adjustSVGElementStyle(RenderStyle&, const SVGElement&); 51 static void adjustAnimatedStyle(RenderStyle&, const RenderStyle* parentBoxStyle, OptionSet<AnimationImpact>);52 53 52 static void adjustEventListenerRegionTypesForRootStyle(RenderStyle&, const Document&); 54 53 -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r272927 r273003 347 347 animationImpact = styleable.applyKeyframeEffects(*animatedStyle, *previousLastStyleChangeEventStyle, &parent().style); 348 348 newStyle = WTFMove(animatedStyle); 349 350 Adjuster adjuster(m_document, parent().style, parentBoxStyle(), styleable.pseudoId == PseudoId::None ? &element : nullptr); 351 adjuster.adjustAnimatedStyle(*newStyle, animationImpact); 349 352 } else 350 353 styleable.setLastStyleChangeEventStyle(nullptr); 351 352 if (animationImpact)353 Adjuster::adjustAnimatedStyle(*newStyle, parentBoxStyle(), animationImpact);354 354 355 355 // Deduplication speeds up equality comparisons as the properties inherit to descendants.
Note:
See TracChangeset
for help on using the changeset viewer.