W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > February 2011

[Bug 11981] There's a race condition with autoplay if the autoplay attribute is removed in e.g. 'loadstart' event listener

From: <bugzilla@jessica.w3.org>
Date: Fri, 04 Feb 2011 15:27:18 +0000
To: public-html-bugzilla@w3.org
Message-Id: <E1PlNZ8-0001MH-0d@jessica.w3.org>

--- Comment #1 from Simon Pieters <simonp@opera.com> 2011-02-04 15:27:17 UTC ---
The resource selection algorithm queues a task to fire 'loadstart' (and
subsequent events are also queued). However, readyState transitions are
immediate and take effect immediately. So if a video is cached or is loaded
locally, you could get to HAVE_ENOUGH_DATA before 'loadstart' is fired, which
means that the video is autoplayed before a script has had a chance to remove
the autoplay attribute.

To fix this I suggest that the readyState transition to HAVE_ENOUGH_DATA should
say something like:

If the autoplaying flag is true, and the paused attribute is true, then queue a
task to run the following steps:
1. If the media element has an autoplay attribute specified, and the media
element's Document's browsing context did not have the sandboxed automatic
features browsing context flag set when the Document was created, then the user
agent may also set the paused attribute to false, fire a simple event named
play, and fire a simple event named playing.

(I have not pondered about what effect this has on the sandboxed automatic
features stuff.)

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Friday, 4 February 2011 15:27:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:01:40 UTC