W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2011

[whatwg] DOMContentLoaded, load and current document readiness

From: Henri Sivonen <hsivonen@iki.fi>
Date: Tue, 31 May 2011 12:02:22 +0300
Message-ID: <1306832542.2453.27.camel@shuttle>
Recently, there was discussion about changing media element state in the
same task that fires the event about the state change so that scripts
that probe the state can make non-racy conclusions about whether a
certain event has fired already.

Currently, there seems to be no correct non-racy way to write code that
probes a document to determine if DOMContentLoaded or load has fired and
runs code immediately if the event of interest has fired or adds a
listener to wait for the event if the event hasn't fired.

Are there compat or other reasons why we couldn't or shouldn't make it
so that the same task that fires DOMContentLoaded changes the readyState
to "interactive" and the same task that fires load changes readyState to
"complete"?

-- 
Henri Sivonen
hsivonen at iki.fi
http://hsivonen.iki.fi/
Received on Tuesday, 31 May 2011 02:02:22 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:06 UTC