Bug 260240 - Remove Quirk needsAutoplayPlayPauseEvents
Summary: Remove Quirk needsAutoplayPlayPauseEvents
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari 17
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: GoodFirstBug, InRadar
Depends on:
Blocks:
 
Reported: 2023-08-15 19:00 PDT by Karl Dubost
Modified: 2024-08-20 15:52 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Dubost 2023-08-15 19:00:22 PDT
This Quirk needsAutoplayPlayPauseEvents is defined in Quirks.cpp/Quirks.h
and used in WebCore/html/HTMLMediaElement.cpp

See https://github.com/search?q=repo%3AWebKit%2FWebKit%20needsAutoplayPlayPauseEvents&type=code


# Archeology:

In Bug 195610, it was moved and renamed
from:
   needsAutoplayPlayPauseEventsQuirk()
   html/HTMLMediaElement.cpp
to: 
   allowedAutoplayQuirks()
   page/Quirks.cpp

It was initially added by Bug 169235 on Mar 9, 2017
with https://github.com/WebKit/WebKit/commit/404d7b85388a24c2990bae01577013d7486ab475

> Add support for an autoplay play-pause events quirk for sites that assume media starts playing.

The initial patch was targeting yahoo.com


*The day after* another commit was added 
Bug 169390 on March 10, 2017
https://github.com/WebKit/WebKit/commit/2eeb62365b31efdc9b08c65050a62200e06d5548
with the following comment:

> Many sites incorrectly assume media will start off playing and display a pause button from the
> start. We can trick many of these sites into updating their controls by sending a "pause"
> event when we prevent a media element from playing.
> 
> We don't want this to become standard web behavior, however, since ultimately sites should adapt
> to the new behavior. This patch lets clients decide which limited set of sites gets to use auto-play
> quirks.


Specifically the scoping on Yahoo! was removed applying the patch on any sites deferring it to website policies, probably managed on Safari side.
https://github.com/WebKit/WebKit/commit/2eeb62365b31efdc9b08c65050a62200e06d5548#diff-d57d5e5c415e1c8520a5553a39b00ce95a35369bbb3b5a89e979f463b60ea6b6L594-R595


The questions become 
* How to make sure we can safely remove this Quirk through testing?
* What are the steps to reproduce the bug so we can test it?
* What is the list of known sites previously impacted?
Comment 1 Radar WebKit Bug Importer 2023-08-15 19:00:30 PDT
<rdar://problem/113940803>
Comment 2 Karl Dubost 2023-08-15 19:36:49 PDT
Maybe we should rename this bug.
And move the "AutoPlay Quirk" back to HTMLMediaElement.cpp
as it is more a default with exceptions for a certain number of sites.

The website policies list a number of domains where the "AutoPlay Quirk" should NOT be applied.