[webkit-changes] [WebKit/WebKit] 9d10e5: Scrolling away from and back to an individually pl...

Tyler Wilcock noreply at github.com
Mon Feb 6 13:02:16 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9d10e5a45e5caef6c353fb06b218f4ca9961874d
      https://github.com/WebKit/WebKit/commit/9d10e5a45e5caef6c353fb06b218f4ca9961874d
  Author: Tyler Wilcock <tyler_w at apple.com>
  Date:   2023-02-06 (Mon, 06 Feb 2023)

  Changed paths:
    M LayoutTests/fast/images/individual-animation-toggle-expected.txt
    M LayoutTests/fast/images/individual-animation-toggle.html
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/RenderElement.h
    M Source/WebCore/rendering/RenderImage.cpp
    M Source/WebCore/rendering/RenderImage.h

  Log Message:
  -----------
  Scrolling away from and back to an individually playing animation will cause it to be incorrectly paused
https://bugs.webkit.org/show_bug.cgi?id=251759
rdar://105059884

Reviewed by Andres Gonzalez.

Given this sequence:

  1. Pause All Animations on the page
  2. Individually play an animation, notice it is animating correctly.
  3. Scroll away from the animation such that it's off-screen
  4. Scroll back to the animation

Notice the animation is paused when it should be playing (because it's respecting the page-wide pause state over its own play-state).

This happened because RenderElement::repaintForPausedImageAnimationsIfNeeded referenced the Page::imageAnimationEnabled
state rather than RenderElement::allowsAnimation. The former does not respect an individual animation's play-state
(i.e. it could be playing individually while the rest of the animations on the page are forced to be paused.)

* LayoutTests/fast/images/individual-animation-toggle-expected.txt:
* LayoutTests/fast/images/individual-animation-toggle.html:
Add a testcase verifying this bug doesn't happen again.
* Source/WebCore/rendering/RenderElement.h:
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::allowsAnimation const):
(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
* Source/WebCore/rendering/RenderImage.cpp:
(WebCore::RenderImage::allowsAnimation const):
Deleted -- the logic is moved into RenderElement::allowsAnimation.
* Source/WebCore/rendering/RenderImage.h:

Canonical link: https://commits.webkit.org/259910@main




More information about the webkit-changes mailing list