Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 574fccad44f052870183b8d89b7f2f7df2ecfcb9
https://github.com/WebKit/WebKit/commit/574fccad44f052870183b8d89b7f2f7df2ecfcb9
Author: Ahmad Saleem <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M LayoutTests/TestExpectations
A
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/autoplay-overrides-preload-expected.txt
M Source/WebCore/html/HTMLMediaElement.cpp
Log Message:
-----------
media player preload is not updated when autoplay attribute is set
https://bugs.webkit.org/show_bug.cgi?id=309338
rdar://171883159
Reviewed by Eric Carlson.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
When the autoplay attribute is present on a media element, the preload
value should effectively be treated as "auto", since the element needs
to load enough data to begin playback. Previously, maybeUpdatePlayerPreload()
skipped updating the preload when autoplay was set, which meant
preload="none" or preload="metadata" would prevent the media from loading
enough data to autoplay.
Fix maybeUpdatePlayerPreload() to explicitly set the player preload to
Auto when the autoplay attribute is present, and also call it when the
autoplay attribute changes so that dynamically adding autoplay correctly
overrides the preload setting.
* LayoutTests/TestExpectations: Unskip relevant test (was timing out without
this patch)
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::attributeChanged):
(WebCore::HTMLMediaElement::maybeUpdatePlayerPreload const):
*
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/autoplay-overrides-preload-expected.txt:
Added.
Canonical link: https://commits.webkit.org/308815@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications