Skip to content

Fix lazy media in-viewport tests to check loadeddata instead of loadsstart#58405

Open
scottjehl wants to merge 1 commit intoweb-platform-tests:masterfrom
Squarespace:fix-lazy-media-in-viewport-tests
Open

Fix lazy media in-viewport tests to check loadeddata instead of loadsstart#58405
scottjehl wants to merge 1 commit intoweb-platform-tests:masterfrom
Squarespace:fix-lazy-media-in-viewport-tests

Conversation

@scottjehl
Copy link
Contributor

The loadstart event has no ordering guarantee relative to the window load event. Intersection observer callbacks can fire before or after the load event, and media elements use their own task source, so loadstart may be dispatched before window load.

The trickle(d2) pipe ensures slow media delivery, so checking loadeddata (which fires after enough data arrives to render the first frame) reliably verifies that window onload is not blocked by lazy media elements.

…tart

The loadstart event has no ordering guarantee relative to the window
load event. Intersection observer callbacks can fire before or after
the load event, and media elements use their own task source, so
loadstart may be dispatched before window load.

The trickle(d2) pipe ensures slow media delivery, so checking
loadeddata (which fires after enough data arrives to render the first
frame) reliably verifies that window onload is not blocked by lazy
media elements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants