WebKit Bugzilla
Attachment 340325 Details for
Bug 182436
: animation-play-state: paused causes very high cpu load because of style invalidation loop
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
animation-paused-style-resolution-loop.patch (text/plain), 5.29 KB, created by
Antti Koivisto
on 2018-05-14 10:01:48 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2018-05-14 10:01:48 PDT
Size:
5.29 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 231759) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,24 @@ >+2018-05-14 Antti Koivisto <antti@apple.com> >+ >+ animation-play-state: paused causes very high cpu load because of style invalidation loop >+ https://bugs.webkit.org/show_bug.cgi?id=182436 >+ <rdar://problem/37182562> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: animations/animation-playstate-paused-style-resolution.html >+ >+ If the style of an element with 'animation-play-state: paused' is recomputed so it stays >+ paused we would enter zero-duration animation timer loop. >+ >+ * page/animation/AnimationBase.cpp: >+ (WebCore::AnimationBase::updateStateMachine): >+ >+ Don't move to AnimationState::PausedWaitResponse unless we get AnimationStateInput::StyleAvailable >+ (matching the comments). Otherwise just stay in the existing paused state. >+ >+ Remove AnimationStateInput::StartAnimation from assertion as the case can't happen. >+ > 2018-05-14 Thibault Saunier <tsaunier@igalia.com> > > [GStreamer] Fix style issue in MediaPlayerPrivateGStreamerBase >Index: Source/WebCore/page/animation/AnimationBase.cpp >=================================================================== >--- Source/WebCore/page/animation/AnimationBase.cpp (revision 231553) >+++ Source/WebCore/page/animation/AnimationBase.cpp (working copy) >@@ -395,7 +395,7 @@ void AnimationBase::updateStateMachine(A > // AnimationState::PausedWaitResponse, we don't yet have a valid startTime, so we send 0 to startAnimation. > // When the AnimationStateInput::StartTimeSet comes in and we were in AnimationState::PausedRun, we will notice > // that we have already set the startTime and will ignore it. >- ASSERT(input == AnimationStateInput::PlayStatePaused || input == AnimationStateInput::PlayStateRunning || input == AnimationStateInput::StartTimeSet || input == AnimationStateInput::StyleAvailable || input == AnimationStateInput::StartAnimation); >+ ASSERT(input == AnimationStateInput::PlayStatePaused || input == AnimationStateInput::PlayStateRunning || input == AnimationStateInput::StartTimeSet || input == AnimationStateInput::StyleAvailable); > ASSERT(paused()); > > if (input == AnimationStateInput::PlayStateRunning) { >@@ -456,6 +456,12 @@ void AnimationBase::updateStateMachine(A > } > > ASSERT(m_animationState == AnimationState::PausedNew || m_animationState == AnimationState::PausedWaitStyleAvailable); >+ >+ if (input == AnimationStateInput::PlayStatePaused) >+ break; >+ >+ ASSERT(input == AnimationStateInput::StyleAvailable); >+ > // We are paused but we got the callback that notifies us that style has been updated. > // We move to the AnimationState::PausedWaitResponse state > LOG(Animations, "%p AnimationState %s -> PausedWaitResponse", this, nameForState(m_animationState)); >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 231553) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,14 @@ >+2018-05-14 Antti Koivisto <antti@apple.com> >+ >+ animation-play-state: paused causes very high cpu load because of style invalidation loop >+ https://bugs.webkit.org/show_bug.cgi?id=182436 >+ <rdar://problem/37182562> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * animations/animation-playstate-paused-style-resolution-expected.txt: Added. >+ * animations/animation-playstate-paused-style-resolution.html: Added. >+ > 2018-05-09 Dominik Infuehr <dinfuehr@igalia.com> > > [ARM] Disable test on Linux due to lack of executable memory >Index: LayoutTests/animations/animation-playstate-paused-style-resolution-expected.txt >=================================================================== >--- LayoutTests/animations/animation-playstate-paused-style-resolution-expected.txt (nonexistent) >+++ LayoutTests/animations/animation-playstate-paused-style-resolution-expected.txt (working copy) >@@ -0,0 +1,2 @@ >+Paused animation >+style recalc count: 1 >Index: LayoutTests/animations/animation-playstate-paused-style-resolution.html >=================================================================== >--- LayoutTests/animations/animation-playstate-paused-style-resolution.html (nonexistent) >+++ LayoutTests/animations/animation-playstate-paused-style-resolution.html (working copy) >@@ -0,0 +1,37 @@ >+<script> >+if (window.testRunner) { >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+} >+</script> >+<style> >+.anim { >+ animation-duration: 20s; >+ animation-name: slidein; >+ animation-play-state: paused; >+} >+@keyframes slidein { >+ from { margin-left: 50%; width: 300%; } >+ to { margin-left: 0%; width: 100%; } >+} >+</style> >+<div class=anim> >+Paused animation >+</div> >+<div id=log></div> >+<script> >+document.body.offsetLeft; >+if (window.testRunner) { >+ internals.startTrackingStyleRecalcs(); >+ setTimeout(() => { >+ document.body.offsetLeft; >+ log.innerHTML = "style recalc count: " + internals.styleRecalcCount(); >+ testRunner.notifyDone(); >+ }, 50); >+} >+</script> >+<style> >+.anim { >+ color: green; >+} >+</style>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 182436
: 340325