Changeset 231794 in webkit


Ignore:
Timestamp:
May 15, 2018, 1:59:53 AM (7 years ago)
Author:
Antti Koivisto
Message:

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 Dean Jackson.

Source/WebCore:

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.

LayoutTests:

  • animations/animation-playstate-paused-style-resolution-expected.txt: Added.
  • animations/animation-playstate-paused-style-resolution.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r231789 r231794  
     12018-05-15  Antti Koivisto  <[email protected]>
     2
     3        animation-play-state: paused causes very high cpu load because of style invalidation loop
     4        https://bugs.webkit.org/show_bug.cgi?id=182436
     5        <rdar://problem/37182562>
     6
     7        Reviewed by Dean Jackson.
     8
     9        * animations/animation-playstate-paused-style-resolution-expected.txt: Added.
     10        * animations/animation-playstate-paused-style-resolution.html: Added.
     11
    1122018-05-14  Youenn Fablet  <[email protected]>
    213
  • trunk/Source/WebCore/ChangeLog

    r231789 r231794  
     12018-05-15  Antti Koivisto  <[email protected]>
     2
     3        animation-play-state: paused causes very high cpu load because of style invalidation loop
     4        https://bugs.webkit.org/show_bug.cgi?id=182436
     5        <rdar://problem/37182562>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Test: animations/animation-playstate-paused-style-resolution.html
     10
     11        If the style of an element with 'animation-play-state: paused' is recomputed so it stays
     12        paused we would enter zero-duration animation timer loop.
     13
     14        * page/animation/AnimationBase.cpp:
     15        (WebCore::AnimationBase::updateStateMachine):
     16
     17        Don't move to AnimationState::PausedWaitResponse unless we get AnimationStateInput::StyleAvailable
     18        (matching the comments). Otherwise just stay in the existing paused state.
     19
     20        Remove AnimationStateInput::StartAnimation from assertion as the case can't happen.
     21
    1222018-05-14  Youenn Fablet  <[email protected]>
    223
  • trunk/Source/WebCore/page/animation/AnimationBase.cpp

    r229209 r231794  
    396396            // When the AnimationStateInput::StartTimeSet comes in and we were in AnimationState::PausedRun, we will notice
    397397            // that we have already set the startTime and will ignore it.
    398             ASSERT(input == AnimationStateInput::PlayStatePaused || input == AnimationStateInput::PlayStateRunning || input == AnimationStateInput::StartTimeSet || input == AnimationStateInput::StyleAvailable || input == AnimationStateInput::StartAnimation);
     398            ASSERT(input == AnimationStateInput::PlayStatePaused || input == AnimationStateInput::PlayStateRunning || input == AnimationStateInput::StartTimeSet || input == AnimationStateInput::StyleAvailable);
    399399            ASSERT(paused());
    400400
     
    457457
    458458            ASSERT(m_animationState == AnimationState::PausedNew || m_animationState == AnimationState::PausedWaitStyleAvailable);
     459
     460            if (input == AnimationStateInput::PlayStatePaused)
     461                break;
     462
     463            ASSERT(input == AnimationStateInput::StyleAvailable);
     464
    459465            // We are paused but we got the callback that notifies us that style has been updated.
    460466            // We move to the AnimationState::PausedWaitResponse state
Note: See TracChangeset for help on using the changeset viewer.