W3C home > Mailing lists > Public > public-webapi@w3.org > March 2006

Re: ISSUE-36: DOMContentLoaded?

From: Maciej Stachowiak <mjs@apple.com>
Date: Mon, 13 Mar 2006 01:36:04 -0800
Message-Id: <B6D09CEA-050B-45F7-9754-1321F716CF77@apple.com>
Cc: "Web APIs WG (public)" <public-webapi@w3.org>
To: Jim Ley <jim@jibbering.com>


On Mar 9, 2006, at 10:03 AM, Jim Ley wrote:

>
> "Jonas Sicking" <jonas@sicking.cc>
>> If we do want scripts to be loaded I think we need to specify it  
>> here, otherwise it's not going to get specified anywhere. And  
>> saying that scripts should be loaded isn't really HTML specific  
>> since scripts appear in many languages.
>
> If we require scripts to be loaded, then I want an event before  
> scripts are loaded please, the use cases on DOMContentLoaded all  
> revolve around the fact the content is rendered to the user and the  
> behaviours are not yet hooked up, not solving this problem with  
> DOMContentLoaded means it fails to meet its use case.

DOMContentLoaded can't be a complete solution for this in any case,  
since content could always be rendered before the DOM is fully built,  
for example very large documents are highly likely to be  
incrementally parsed and rendered. If that's the use case, then  
DOMContentLoaded doesn't solve it very well; users will see content  
without its behavior attached.

Note that the event can't possibly fire before parser-created non- 
defer scripts are loaded in any case, and that's the most commonly  
used type of script.

> Also it's dependant on the host language and not XML agnostic.
>
> If there are other use cases for DOMContentLoaded, please give  
> them, so I can understand the motivation.
>
> Personally I don't think DOMContentLoaded is a good solution to the  
> underlying problem, I would like to see mutation type events fired  
> during load for each subtree as it becomes available to scripting.

That would make page loading a lot slower. I think the right solution  
for binding behaviors is something like XBL. Since it is part of  
style resolution, it can't happen later than content is rendered.

Regards,
Maciej
Received on Monday, 13 March 2006 09:36:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:53 GMT