Changeset 276123 in webkit
- Timestamp:
- Apr 16, 2021, 1:31:44 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) (7 diffs)
-
Source/WebCore/style/StyleTreeResolver.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-611-branch/LayoutTests/ChangeLog
r276089 r276123 61 61 * webrtc/sframe-test-vectors-expected.txt: Added. 62 62 * webrtc/sframe-test-vectors.html: Added. 63 64 2021-04-15 Russell Epstein <repstein@apple.com>65 66 Cherry-pick r275277. rdar://problem/7637550467 68 Animated pseudo element style resolved against wrong parent style69 https://bugs.webkit.org/show_bug.cgi?id=22399070 rdar://7499736171 72 Reviewed by Antoine Quint.73 Source/WebCore:74 75 In createAnimatedElementUpdate we get the parent and parent box styles from the parent stack.76 This is wrong for pseudo elements. Their parent style should the host style which is not pushed to the stack.77 78 This matters in style adjuster which may apply wrong adjustments as a result.79 80 Test: fast/animation/pseudo-element-style-adjuster.html81 82 * style/StyleTreeResolver.cpp:83 (WebCore::Style::TreeResolver::resolveElement):84 (WebCore::Style::TreeResolver::resolvePseudoStyle):85 (WebCore::Style::TreeResolver::createAnimatedElementUpdate):86 87 Make static and provide the parent and parent box styles as parameters.88 89 * style/StyleTreeResolver.h:90 91 LayoutTests:92 93 * fast/animation/pseudo-element-style-adjuster-expected.html: Added.94 * fast/animation/pseudo-element-style-adjuster.html: Added.95 96 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275277 268f45cc-cd09-0410-ab3c-d52691b4dbfc97 98 2021-03-31 Antti Koivisto <antti@apple.com>99 100 Animated pseudo element style resolved against wrong parent style101 https://bugs.webkit.org/show_bug.cgi?id=223990102 rdar://74997361103 104 Reviewed by Antoine Quint.105 106 * fast/animation/pseudo-element-style-adjuster-expected.html: Added.107 * fast/animation/pseudo-element-style-adjuster.html: Added.108 63 109 64 2021-04-15 Russell Epstein <repstein@apple.com> -
branches/safari-611-branch/Source/WebCore/ChangeLog
r276118 r276123 546 546 * rendering/line/BreakingContext.h: 547 547 (WebCore::BreakingContext::handleEndOfLine): 548 549 2021-04-15 Russell Epstein <repstein@apple.com>550 551 Cherry-pick r275277. rdar://problem/76375504552 553 Animated pseudo element style resolved against wrong parent style554 https://bugs.webkit.org/show_bug.cgi?id=223990555 rdar://74997361556 557 Reviewed by Antoine Quint.558 Source/WebCore:559 560 In createAnimatedElementUpdate we get the parent and parent box styles from the parent stack.561 This is wrong for pseudo elements. Their parent style should the host style which is not pushed to the stack.562 563 This matters in style adjuster which may apply wrong adjustments as a result.564 565 Test: fast/animation/pseudo-element-style-adjuster.html566 567 * style/StyleTreeResolver.cpp:568 (WebCore::Style::TreeResolver::resolveElement):569 (WebCore::Style::TreeResolver::resolvePseudoStyle):570 (WebCore::Style::TreeResolver::createAnimatedElementUpdate):571 572 Make static and provide the parent and parent box styles as parameters.573 574 * style/StyleTreeResolver.h:575 576 LayoutTests:577 578 * fast/animation/pseudo-element-style-adjuster-expected.html: Added.579 * fast/animation/pseudo-element-style-adjuster.html: Added.580 581 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275277 268f45cc-cd09-0410-ab3c-d52691b4dbfc582 583 2021-03-31 Antti Koivisto <antti@apple.com>584 585 Animated pseudo element style resolved against wrong parent style586 https://bugs.webkit.org/show_bug.cgi?id=223990587 rdar://74997361588 589 Reviewed by Antoine Quint.590 591 In createAnimatedElementUpdate we get the parent and parent box styles from the parent stack.592 This is wrong for pseudo elements. Their parent style should the host style which is not pushed to the stack.593 594 This matters in style adjuster which may apply wrong adjustments as a result.595 596 Test: fast/animation/pseudo-element-style-adjuster.html597 598 * style/StyleTreeResolver.cpp:599 (WebCore::Style::TreeResolver::resolveElement):600 (WebCore::Style::TreeResolver::resolvePseudoStyle):601 (WebCore::Style::TreeResolver::createAnimatedElementUpdate):602 603 Make static and provide the parent and parent box styles as parameters.604 605 * style/StyleTreeResolver.h:606 548 607 549 2021-04-15 Russell Epstein <repstein@apple.com> -
branches/safari-611-branch/Source/WebCore/style/StyleTreeResolver.cpp
r276080 r276123 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 … … 341 337 scope().resolver.setParentElementStyleForKeyframes(&parent().style); 342 338 343 m_document.timeline().updateCSSAnimationsForStyleable(styleable, oldStyle, *newStyle , &parentStyle);339 m_document.timeline().updateCSSAnimationsForStyleable(styleable, oldStyle, *newStyle); 344 340 345 341 scope().resolver.setParentElementStyleForKeyframes(nullptr); … … 355 351 // Apply all keyframe effects to the new style. 356 352 auto animatedStyle = RenderStyle::clonePtr(*newStyle); 357 animationImpact = styleable.applyKeyframeEffects(*animatedStyle, *previousLastStyleChangeEventStyle , &parentStyle);353 animationImpact = styleable.applyKeyframeEffects(*animatedStyle, *previousLastStyleChangeEventStyle); 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
r276080 r276123 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.