New issue
Advanced search Search tips

Issue 643846 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Document::checkLoadEventSoon() races tasks that stop delaying-the-load-event

Project Member Reported by wolenetz@chromium.org, Sep 2 2016

Issue description

See
1. https://www.w3.org/TR/html51/syntax.html#delay-the-load-event

2. https://codereview.chromium.org/2021573002/diff/40001/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-attach-stops-delaying-load-event.html#newcode32

3. https://github.com/w3c/web-platform-tests/pull/3082#issuecomment-244501252

The sequencing of queueing of tasks by the task that removes the last thing that "delays the load event" versus the queueing of the task that sets the current document readiness to "complete" and conditionally fires a 'load' event at the Document's Window is broken.

In the MSE example:
MSE attachment sequentially in the same task does:
a) sets the delaying-the-load-event-flag false
b) queues 'sourceopen' event

Per spec, if 'load' was still delayed (had not been fired yet) prior to MSE attachment, then 'load' *MUST* be fired *after* 'sourceopen', since the task to do the latter is enqueued first.

But in Chrome, as soon as step (a) in the MSE example is done, the task to conditionally fire the load event is queued immediately and the event sequence is reversed vs spec.

A short-term Chrome MSE hack would be to simply reverse (a) and (b) in the MSE implementation.
A longer-term fix would be to fix the Document 'load' event infra to conform to the spec (and undo any short-term MSE hack).
 
foolip@, I propose to do the short-term MSE fix so that the compliance/interop suite for MSE v1 passes the related test. Who would you suggest to fix the DOM/load event infra?
Cc: mlamouri@chromium.org
Components: Blink>Media
Can you use Document::incrementLoadEventDelayCount() and Document::decreaseLoadEventDelayCount() the same way HTMLMediaElement does?
The way I read the spec is that the sourceopen event should be fired before the window load event, regardless of how the MSE spec were to order the two steps, because the task to fire the window load event is enqueued in between tasks, as soon as nothing is no longer delaying the load event.

Although the shape of the code is very different in Blink, it looks to me like the timing of the load event fired by LocalDOMWindow::dispatchLoadEvent is actually going to be correct, although I didn't verify in a debugger or anything.

Isn't MSE using Document::incrementLoadEventDelayCount() and Document::decreaseLoadEventDelayCount()?
Project Member

Comment 6 by sheriffbot@chromium.org, Sep 11 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: WontFix (was: Untriaged)
this bug has been stale for > 1 year. close it.

Sign in to add a comment