Open Bug 2015556 Opened 5 days ago Updated 5 days ago

Incorrect spec definition `:stalled`

Categories

(Core :: CSS Parsing and Computation, task, P2)

task

Tracking

()

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 1 open bug, )

Details

I think the definition of :stalled might be incorrect. From this test, it appears that this selector is intended to correspond to the media element’s stalled event. However, its definition conflicts with how the stalled event is defined in the HTML spec.

Let me explain it below. First, let see the selector definition.

:buffering
The :buffering pseudo-class must match all media elements whose paused attribute is false, networkState attribute is NETWORK_LOADING, and ready state is HAVE_CURRENT_DATA or less.

:stalled
The :stalled pseudo-class must match all media elements that match the :buffering pseudo-class and whose is currently stalled is true.

So the :stalled selector is required to match :buffering, which means the readyState must be HAVE_CURRENT_DATA or less. However, in the HTML spec, the stalled event is related to downloading only, not related with the ready state.

A media element could already have enough data buffered and then encountering an issue for not being able to download more data, which would trigger stalled. That does not necessarily mean the ready state must be equal to or below HAVE_CURRENT_DATA.

Because of this, I think it is incorrect for :stalled to require matching :buffering. Instead, it should likely only check networkState and paused, but not readyState.

You need to log in before you can comment on or make changes to this bug.