[webkit-dev] GlobalScript API.
dimich at chromium.org
Wed Sep 2 01:01:42 PDT 2009
On Tue, Sep 1, 2009 at 8:07 PM, Maciej Stachowiak <mjs at apple.com> wrote:
> instead of
> var globalScript = new webkitGlobalScript(name, url, loadHandler,
> to have this:
> <webkit-globalscript name='...', src='url', onload=...
> The first tag with a specific name that provides a src or inline script or
> injected with innerText would effectively supply 'initial script'. The
> later-encountered tags withthe same name would have their initial script
> ignored and simply connected to the same one. The tag's DOM element would be
> EventTarget (for load and error) and have a 'context' property to pull the
> global scope object of the script.
> Why is a tag better for this than a constructor or function?
I'm not saying it's better. The tag idea was brought more then once before
so I think it is worth considered.I think the motivation behind it is to be
able to hook up event handlers before loading ends to be notified when the
context is ready. Constructor with callbacks can do the similar thing, imo.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev