Changeset 276132 in webkit
- Timestamp:
- Apr 16, 2021, 3:32:02 AM (5 years ago)
- Location:
- branches/safari-611-branch
- Files:
-
- 2 deleted
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/animation/pseudo-element-style-adjuster-expected.html (deleted)
-
LayoutTests/fast/animation/pseudo-element-style-adjuster.html (deleted)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/style/StyleTreeResolver.cpp (modified) (6 diffs)
-
Source/WebCore/style/StyleTreeResolver.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-611-branch/LayoutTests/ChangeLog
r276126 r276132 1 2021-04-16 Russell Epstein <repstein@apple.com>2 3 Cherry-pick r275277. rdar://problem/763755044 5 Animated pseudo element style resolved against wrong parent style6 https://bugs.webkit.org/show_bug.cgi?id=2239907 rdar://749973618 9 Reviewed by Antoine Quint.10 Source/WebCore:11 12 In createAnimatedElementUpdate we get the parent and parent box styles from the parent stack.13 This is wrong for pseudo elements. Their parent style should the host style which is not pushed to the stack.14 15 This matters in style adjuster which may apply wrong adjustments as a result.16 17 Test: fast/animation/pseudo-element-style-adjuster.html18 19 * style/StyleTreeResolver.cpp:20 (WebCore::Style::TreeResolver::resolveElement):21 (WebCore::Style::TreeResolver::resolvePseudoStyle):22 (WebCore::Style::TreeResolver::createAnimatedElementUpdate):23 24 Make static and provide the parent and parent box styles as parameters.25 26 * style/StyleTreeResolver.h:27 28 LayoutTests:29 30 * fast/animation/pseudo-element-style-adjuster-expected.html: Added.31 * fast/animation/pseudo-element-style-adjuster.html: Added.32 33 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275277 268f45cc-cd09-0410-ab3c-d52691b4dbfc34 35 2021-03-31 Antti Koivisto <antti@apple.com>36 37 Animated pseudo element style resolved against wrong parent style38 https://bugs.webkit.org/show_bug.cgi?id=22399039 rdar://7499736140 41 Reviewed by Antoine Quint.42 43 * fast/animation/pseudo-element-style-adjuster-expected.html: Added.44 * fast/animation/pseudo-element-style-adjuster.html: Added.45 46 1 2021-04-15 Russell Epstein <repstein@apple.com> 47 2 -
branches/safari-611-branch/Source/WebCore/ChangeLog
r276126 r276132 1 2021-04-16 Russell Epstein <repstein@apple.com>2 3 Cherry-pick r275277. rdar://problem/763755044 5 Animated pseudo element style resolved against wrong parent style6 https://bugs.webkit.org/show_bug.cgi?id=2239907 rdar://749973618 9 Reviewed by Antoine Quint.10 Source/WebCore:11 12 In createAnimatedElementUpdate we get the parent and parent box styles from the parent stack.13 This is wrong for pseudo elements. Their parent style should the host style which is not pushed to the stack.14 15 This matters in style adjuster which may apply wrong adjustments as a result.16 17 Test: fast/animation/pseudo-element-style-adjuster.html18 19 * style/StyleTreeResolver.cpp:20 (WebCore::Style::TreeResolver::resolveElement):21 (WebCore::Style::TreeResolver::resolvePseudoStyle):22 (WebCore::Style::TreeResolver::createAnimatedElementUpdate):23 24 Make static and provide the parent and parent box styles as parameters.25 26 * style/StyleTreeResolver.h:27 28 LayoutTests:29 30 * fast/animation/pseudo-element-style-adjuster-expected.html: Added.31 * fast/animation/pseudo-element-style-adjuster.html: Added.32 33 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275277 268f45cc-cd09-0410-ab3c-d52691b4dbfc34 35 2021-03-31 Antti Koivisto <antti@apple.com>36 37 Animated pseudo element style resolved against wrong parent style38 https://bugs.webkit.org/show_bug.cgi?id=22399039 rdar://7499736140 41 Reviewed by Antoine Quint.42 43 In createAnimatedElementUpdate we get the parent and parent box styles from the parent stack.44 This is wrong for pseudo elements. Their parent style should the host style which is not pushed to the stack.45 46 This matters in style adjuster which may apply wrong adjustments as a result.47 48 Test: fast/animation/pseudo-element-style-adjuster.html49 50 * style/StyleTreeResolver.cpp:51 (WebCore::Style::TreeResolver::resolveElement):52 (WebCore::Style::TreeResolver::resolvePseudoStyle):53 (WebCore::Style::TreeResolver::createAnimatedElementUpdate):54 55 Make static and provide the parent and parent box styles as parameters.56 57 * style/StyleTreeResolver.h:58 59 1 2021-04-15 Russell Epstein <repstein@apple.com> 60 2 -
branches/safari-611-branch/Source/WebCore/style/StyleTreeResolver.cpp
r276126 r276132 222 222 } 223 223 224 auto update = createAnimatedElementUpdate(WTFMove(newStyle), styleable, parent().change , parent().style, parentBoxStyle());224 auto update = createAnimatedElementUpdate(WTFMove(newStyle), styleable, parent().change); 225 225 auto descendantsToResolve = computeDescendantsToResolve(update.change, element.styleValidity(), parent().descendantsToResolve); 226 226 … … 278 278 if (!elementUpdate.style->hasPseudoStyle(pseudoId)) 279 279 return { }; 280 281 auto& parentStyle = *elementUpdate.style; 282 auto* parentBoxStyle = parentBoxStyleForPseudo(elementUpdate); 283 284 auto pseudoStyle = scope().resolver.pseudoStyleForElement(element, { pseudoId }, parentStyle, parentBoxStyle, &scope().selectorFilter); 280 281 auto pseudoStyle = scope().resolver.pseudoStyleForElement(element, { pseudoId }, *elementUpdate.style, parentBoxStyleForPseudo(elementUpdate), &scope().selectorFilter); 285 282 if (!pseudoStyle) 286 283 return { }; … … 290 287 return { }; 291 288 292 return createAnimatedElementUpdate(WTFMove(pseudoStyle), { element, pseudoId }, elementUpdate.change , parentStyle, parentBoxStyle);289 return createAnimatedElementUpdate(WTFMove(pseudoStyle), { element, pseudoId }, elementUpdate.change); 293 290 } 294 291 … … 319 316 } 320 317 321 ElementUpdate TreeResolver::createAnimatedElementUpdate(std::unique_ptr<RenderStyle> newStyle, const Styleable& styleable, Change parentChange , const RenderStyle& parentStyle, const RenderStyle* parentBoxStyle)318 ElementUpdate TreeResolver::createAnimatedElementUpdate(std::unique_ptr<RenderStyle> newStyle, const Styleable& styleable, Change parentChange) 322 319 { 323 320 auto& element = styleable.element; 324 auto& document = element.document();325 321 auto* oldStyle = element.renderOrDisplayContentsStyle(styleable.pseudoId); 326 322 … … 330 326 // on the document timeline. Note that we get timeline() on the Document here because we need a timeline created 331 327 // in case no Web Animations have been created through the JS API. 332 if ( document.backForwardCacheState() == Document::NotInBackForwardCache && !document.renderView()->printing()) {328 if (element.document().backForwardCacheState() == Document::NotInBackForwardCache && !element.document().renderView()->printing()) { 333 329 if (oldStyle && (oldStyle->hasTransitions() || newStyle->hasTransitions())) 334 document.timeline().updateCSSTransitionsForStyleable(styleable, *oldStyle, *newStyle);330 m_document.timeline().updateCSSTransitionsForStyleable(styleable, *oldStyle, *newStyle); 335 331 336 332 // The order in which CSS Transitions and CSS Animations are updated matters since CSS Transitions define the after-change style … … 358 354 newStyle = WTFMove(animatedStyle); 359 355 360 Adjuster adjuster( document, parentStyle, parentBoxStyle, styleable.pseudoId == PseudoId::None ? &element : nullptr);356 Adjuster adjuster(m_document, parent().style, parentBoxStyle(), styleable.pseudoId == PseudoId::None ? &element : nullptr); 361 357 adjuster.adjustAnimatedStyle(*newStyle, animationImpact); 362 358 } else -
branches/safari-611-branch/Source/WebCore/style/StyleTreeResolver.h
r276126 r276132 62 62 ElementUpdates resolveElement(Element&); 63 63 64 static ElementUpdate createAnimatedElementUpdate(std::unique_ptr<RenderStyle>, const Styleable&, Change, const RenderStyle& parentStyle, const RenderStyle* parentBoxStyle);64 ElementUpdate createAnimatedElementUpdate(std::unique_ptr<RenderStyle>, const Styleable&, Change); 65 65 Optional<ElementUpdate> resolvePseudoStyle(Element&, const ElementUpdate&, PseudoId); 66 66
Note:
See TracChangeset
for help on using the changeset viewer.