[webkit-changes] [WebKit/WebKit] 34a5a7: REGRESSION (246057 at main): [ macOS wk1 ] imported/w...

Jer Noble noreply at github.com
Fri Nov 18 11:54:04 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 34a5a7308d8a693a9385424ae2ac040235421586
      https://github.com/WebKit/WebKit/commit/34a5a7308d8a693a9385424ae2ac040235421586
  Author: Jer Noble <jer.noble at apple.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M LayoutTests/platform/mac-wk1/TestExpectations
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/html/HTMLMediaElement.h

  Log Message:
  -----------
  REGRESSION (246057 at main): [ macOS wk1 ] imported/w3c/web-platform-tests/video-rvfc/request-video-frame-callback.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=244736
rdar://99507721

Reviewed by Eric Carlson.

HTMLMediaElement's updateShouldAutoplay() will check, among other things, whether the media element
is currently visible in the viewport. However, when this method is called from within will- and
didAttachRenderers, the renderer either has not yet been created, or layout has not yet occurred.
Similarly, calling this method from within styleDidChange/visibilityDidChange poses a similar
problem, where the element may have been made visible but layout has not yet run.

Add a new method, scheduleUpdateShouldAutoplay(), which will re-check autoplay status on the next
run loop, and use this method instead of updateShouldAutoplay() everywhere.

* LayoutTests/platform/mac-wk1/TestExpectations:
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didAttachRenderers):
(WebCore::HTMLMediaElement::didDetachRenderers):
(WebCore::HTMLMediaElement::visibilityDidChange):
(WebCore::HTMLMediaElement::cancelPendingTasks):
(WebCore::HTMLMediaElement::isVisibleInViewportChanged):
(WebCore::HTMLMediaElement::scheduleUpdateShouldAutoplay):
* Source/WebCore/html/HTMLMediaElement.h:

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




More information about the webkit-changes mailing list