Changeset 239965 in webkit
- Timestamp:
- Jan 14, 2019 5:31:48 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r239959 r239965 1 2019-01-14 Simon Fraser <simon.fraser@apple.com> 2 3 Animation and other code is too aggressive about invalidating layer composition 4 https://bugs.webkit.org/show_bug.cgi?id=193343 5 6 Reviewed by Antoine Quint. 7 8 This test was clobbering the 'box' class on the animating element and therefore making it disappear. 9 10 * legacy-animation-engine/compositing/animation/animation-compositing.html: 11 1 12 2019-01-14 Charles Vazac <cvazac@akamai.com> 2 13 -
trunk/LayoutTests/legacy-animation-engine/compositing/animation/animation-compositing.html
r235960 r239965 40 40 } 41 41 }, false); 42 document.getElementById('box').class Name = 'spinning';42 document.getElementById('box').classList.add('spinning'); 43 43 } 44 44 -
trunk/Source/WebCore/ChangeLog
r239960 r239965 1 2019-01-14 Simon Fraser <simon.fraser@apple.com> 2 3 Animation and other code is too aggressive about invalidating layer composition 4 https://bugs.webkit.org/show_bug.cgi?id=193343 5 6 Reviewed by Antoine Quint. 7 8 We used to have the concept of a "SyntheticStyleChange", which was used to trigger 9 style updates for animation, and also to get compositing updated. 10 11 That morphed into a call to Element::invalidateStyleAndLayerComposition(), which causes 12 a style update to result in a "RecompositeLayer" diff, which in turn triggers compositing work, 13 and dirties DOM touch event regions (which can be expensive to update). 14 15 However, not all the callers of Element::invalidateStyleAndLayerComposition() need to trigger 16 compositing, and doing so from animations caused excessive touch event regions on yahoo.com, 17 which has several visibility:hidden elements with background-position animation. 18 19 So fix callers of invalidateStyleAndLayerComposition() which don't care about compositing to instead 20 call just invalidateStyle(). 21 22 Also fix KeyframeAnimation::animate to correctly return true when animation state changes—it failed to 23 do so, because fireAnimationEventsIfNeeded() can run the state machine and change state. 24 25 * animation/KeyframeEffect.cpp: 26 (WebCore::invalidateElement): 27 * page/animation/AnimationBase.cpp: 28 (WebCore::AnimationBase::setNeedsStyleRecalc): 29 * page/animation/CSSAnimationController.cpp: 30 (WebCore::CSSAnimationControllerPrivate::updateAnimations): 31 (WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle): 32 (WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime): 33 (WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime): 34 (WebCore::CSSAnimationController::cancelAnimations): 35 * page/animation/KeyframeAnimation.cpp: 36 (WebCore::KeyframeAnimation::animate): 37 * rendering/RenderImage.cpp: 38 (WebCore::RenderImage::imageChanged): 39 * rendering/RenderLayer.cpp: 40 (WebCore::RenderLayer::calculateClipRects const): 41 * rendering/svg/SVGResourcesCache.cpp: 42 (WebCore::SVGResourcesCache::clientStyleChanged): 43 * style/StyleTreeResolver.cpp: 44 (WebCore::Style::TreeResolver::createAnimatedElementUpdate): 45 * svg/SVGAnimateElementBase.cpp: 46 (WebCore::applyCSSPropertyToTarget): 47 (WebCore::removeCSSPropertyFromTarget): 48 1 49 2019-01-14 Sihui Liu <sihui_liu@apple.com> 2 50 -
trunk/Source/WebCore/animation/KeyframeEffect.cpp
r239820 r239965 61 61 { 62 62 if (element) 63 element->invalidateStyle AndLayerComposition();63 element->invalidateStyle(); 64 64 } 65 65 -
trunk/Source/WebCore/page/animation/AnimationBase.cpp
r239461 r239965 91 91 92 92 ASSERT(element->document().pageCacheState() == Document::NotInPageCache); 93 element->invalidateStyle AndLayerComposition();93 element->invalidateStyle(); 94 94 } 95 95 -
trunk/Source/WebCore/page/animation/CSSAnimationController.cpp
r239461 r239965 144 144 if (callSetChanged != CallSetChanged) 145 145 break; 146 146 147 Element& element = *compositeAnimation.key; 147 148 ASSERT(element.document().pageCacheState() == Document::NotInPageCache); 148 element.invalidateStyle AndLayerComposition();149 element.invalidateStyle(); 149 150 calledSetChanged = true; 150 151 } … … 226 227 227 228 for (auto& change : m_elementChangesToDispatch) 228 change->invalidateStyle AndLayerComposition();229 change->invalidateStyle(); 229 230 230 231 m_elementChangesToDispatch.clear(); … … 413 414 CompositeAnimation& compositeAnimation = ensureCompositeAnimation(element); 414 415 if (compositeAnimation.pauseAnimationAtTime(name, t)) { 415 element.invalidateStyle AndLayerComposition();416 element.invalidateStyle(); 416 417 startUpdateStyleIfNeededDispatcher(); 417 418 return true; … … 425 426 CompositeAnimation& compositeAnimation = ensureCompositeAnimation(element); 426 427 if (compositeAnimation.pauseTransitionAtTime(cssPropertyID(property), t)) { 427 element.invalidateStyle AndLayerComposition();428 element.invalidateStyle(); 428 429 startUpdateStyleIfNeededDispatcher(); 429 430 return true; … … 608 609 return; 609 610 ASSERT(element.document().pageCacheState() == Document::NotInPageCache); 610 element.invalidateStyle AndLayerComposition();611 element.invalidateStyle(); 611 612 } 612 613 -
trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp
r239427 r239965 159 159 bool KeyframeAnimation::animate(CompositeAnimation& compositeAnimation, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& animatedStyle, bool& didBlendStyle) 160 160 { 161 // Fire the start timeout if needed 161 AnimationState oldState = state(); 162 163 // Update state and fire the start timeout if needed (FIXME: this function needs a better name). 162 164 fireAnimationEventsIfNeeded(); 163 165 164 166 // If we have not yet started, we will not have a valid start time, so just start the animation if needed. 165 167 if (isNew()) { … … 191 193 return false; 192 194 } 193 194 // FIXME: the code below never changes the state, so this function always returns false.195 AnimationState oldState = state();196 195 197 196 // Run a cycle of animation. -
trunk/Source/WebCore/rendering/RenderImage.cpp
r239173 r239965 285 285 if (element()) { 286 286 m_needsToSetSizeForAltText = true; 287 element()->invalidateStyle AndLayerComposition();287 element()->invalidateStyle(); 288 288 } 289 289 return; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r239661 r239965 6600 6600 { 6601 6601 // We use the enclosing element so that we recalculate style for the ancestor of an anonymous object. 6602 if (Element* element = enclosingElement()) 6602 if (Element* element = enclosingElement()) { 6603 // FIXME: This really shouldn't have to invalidate layer composition, but tests like css3/filters/effect-reference-delete.html fail if that doesn't happen. 6603 6604 element->invalidateStyleAndLayerComposition(); 6605 } 6604 6606 renderer().repaint(); 6605 6607 } -
trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp
r232018 r239965 117 117 118 118 if (renderer.element() && !renderer.element()->isSVGElement()) 119 renderer.element()->invalidateStyle AndLayerComposition();119 renderer.element()->invalidateStyle(); 120 120 } 121 121 -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r238097 r239965 307 307 308 308 auto animationUpdate = animationController.updateAnimations(element, *newStyle, oldStyle); 309 shouldRecompositeLayer = animationUpdate.stateChanged; 309 shouldRecompositeLayer = animationUpdate.stateChanged; // FIXME: constrain this to just property animations triggering acceleration. 310 310 311 311 if (animationUpdate.style) -
trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp
r239090 r239965 250 250 return; 251 251 252 targetElement.invalidateStyle AndLayerComposition();252 targetElement.invalidateStyle(); 253 253 } 254 254 … … 257 257 ASSERT(!targetElement.m_deletionHasBegun); 258 258 targetElement.ensureAnimatedSMILStyleProperties().removeProperty(id); 259 targetElement.invalidateStyle AndLayerComposition();259 targetElement.invalidateStyle(); 260 260 } 261 261
Note: See TracChangeset
for help on using the changeset viewer.