W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2013

Re: [whatwg] API to delay the document load event

From: Glenn Maynard <glenn@zewt.org>
Date: Sun, 28 Apr 2013 18:08:03 -0500
Message-ID: <CABirCh8f18Q6Shd=rOzPdYFCwmFECZ_Vk5PE2hzzEn+NEsMYig@mail.gmail.com>
To: David Bruant <bruant.d@gmail.com>
Cc: WHATWG <whatwg@whatwg.org>, Robert O'Callahan <robert@ocallahan.org>
On Sun, Apr 28, 2013 at 5:39 PM, David Bruant <bruant.d@gmail.com> wrote:

> Le 29/04/2013 00:14, Robert O'Callahan a écrit :
>
>  We don't want to require people to do everything in Caja just to support
>> composition of independent scripts.
>>
> There are certainly more lightweight solutions than Caja to achieve the
> same thing.


Which is exactly the problem: you're saying there are multiple solutions,
which means incompatibility.

 If your scripts are that independent, how do you know if one forgets to
> call document.stopDelayingLoadEvent()? This is a footgun.


The approach I've suggested makes tracking misuse easy; just stash a stack
trace when creating the object, and provide a console API to print the
stack trace for delays that haven't been finished, or if an object gets
collected without being finished.

This is also additional surface for web browsers to mess up which they
> already have enough to deal with.
>

The proposal here is trivial as web APIs go, so I don't buy this.


> Give one way to signal that the application is ready. Devs will figure out
> the rest. One way to signal that the application is ready will serve at
> least 80% (maybe 90%) of the needs anyway.
>

I think every proposal so far gives exactly one way to signal, so I don't
know what this means.

In this context, trying to support composition of independent scripts is
> most likely over-engineering. Will ads care to call
> document.delayLoadEvent()? Will social widgets do that? Where is the
> concrete need for independent script composition? Are the rare use cases
> really worth the additional complexity?
>

If I'm making part of a site use this feature, I want it to be
self-contained within the code that's actually using the feature, not
messing about with document-global attributes.  This is equivalent to why
we use addEventListener in modules, rather than event handlers.


On Sun, Apr 28, 2013 at 5:08 PM, Robert O'Callahan <robert@ocallahan.org>wrote:

> On Mon, Apr 29, 2013 at 5:47 AM, Glenn Maynard <glenn@zewt.org> wrote:
>
>> I have to wonder whether authors would really use this, though,
>> regardless of what the API looks like.
>>
>
> We have FirefoxOS app developers who want to use it. This feature request
> came from them.
>

If it's only useful for FirefoxOS, then that's where it should live.  Would
it actually be used by authors on the general Web?

-- 
Glenn Maynard
Received on Sunday, 28 April 2013 23:08:32 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:57 UTC