[whatwg] should we add beforeload/afterload events to the web platform?
tantek at cs.stanford.edu
Mon Jan 9 21:48:03 PST 2012
WebKit supports a 'beforeload' event  which is supported in
shipping Safari and Chrome
and apparently has (enabled) the real-world use-cases of:
1. Performance. Reducing bandwidth use / HTTP requests, e.g. AdBlock
2. Clientside transformations, e.g. Mobify
As might be expected, there is at least one use-case for a
complementary 'afterload' event:
1. Downloadable fonts - people who want to use custom fonts for
drawing in the canvas element need to know when a font has loaded.
'afterload' seems like a good way to know that, since it happens as a
side effect of actually using it and fonts don't have an explicit load
API like images do.
Safari and Chrome have already shipped 'beforeload', and Mozilla is
strongly considering implementing 'beforeload' and 'afterload'.
Should 'beforeload'/'afterload' be explicitly specified and added to
the web platform?
Rather than attempt to provide a specific detailed design at this
point, I'd prefer to ask for the list's consideration/discussion, and
leave detailed specification of the two events to the editor.
http://tantek.com/ - I made an HTML5 tutorial! http://tantek.com/html5
More information about the whatwg