Re: ISSUE-36: DOMContentLoaded?

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 UTC