-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
In the following feature-policy and permissions-policy tests for autoplay and picture-in-picture features there are high possibility with TIMEOUT results if the media element will be garbage collected and play promise will never resolved or rejected.
In the following tests below the common document structure is:
Top-level frame 0
- `video` 0 (not attached to document)
- `iframe` 1
- - `video` 1 (not attached to document)
- `iframe` 2
- - `video` 2 (not attached to document)
html/semantics/embedded-content/media-elements/autoplay-allowed-by-feature-policy.https.sub.html
feature-policy/picture-in-picture-allowed-by-feature-policy.https.sub.html
It possible because the media element (video) in not attached to document (orphaned) and may be garbage collected that exactly happens if an user agent will be too aggressive in terms of garbage collection.
As example, the Servo engine makes additional GC which happens on iframe document loading (servo/servo#41138) and media elements from loaded top level frame/iframe are GC-ed (unexpectedly for WPT test runner).
I'm guessing that the major browsers pass the tests without TIMEOUT results because they don't use garbage collection as aggressively, or maybe I'm missing something and someone else is referring to pseudo-"orphaned" media elements?
As a possible solution should the media element be attached to document to prevent GC?