Re: ISSUE-36: DOMContentLoaded?

On Mar 7, 2006, at 1:03 AM, Jonas Sicking wrote:

>
>>> It's also not true for <script> nodes added to the DOM via DOM   
>>> manipulation while the page is loaded.
>> So dropping it would work or perhaps something like:
>>   Language specific requirements can make the
>>   UA to load certain dependencies first. In
>>   HTML all <script> elements in the source
>>   tree without the "defer" attribute set have
>>   to be loaded for example.
>> ... now source tree might need some definition.
>
> As stated in an earlier email, I think it is not immideatly clear  
> to me that firing DOMContentLoaded before all scripts have loaded  
> is a good idea.
>
> First of all, I think the distinction DOM-added vs. in-markup  
> <script>s is something that authors might have a hard time  
> understanding. For example, what does document.write-added scripts  
> count as? What about scripts added using .innerHTML? (the latter  
> happens to not execute in mozilla right now)
>
> Second, since the defer attribute is ignored by most  
> implementations currently (and probably for some time to come)  
> ignore the defer attribute. This could mean that users that use  
> that attribute might start to depend on such scripts being loaded  
> forcing future UAs to have to stall the DOMContentLoaded event  
> until they are loaded anyway.
>
> I would be interested to hear if anyone has any good usecases  
> either way on this.

I think it makes sense to require that all script loads complete.  
It's better for the triggering of this event to be at a well-defined  
time with respect to various delayed script load mechanisms, as  
differing on this could cause compatibility issues.  And "after"  
seems more useful than "before".

Regards,
Maciej

Received on Monday, 13 March 2006 09:26:52 UTC