[whatwg] scripts, defer, document.write and DOMContentLoaded
Boris Zbarsky
bzbarsky at MIT.EDU
Tue Jul 21 06:39:13 PDT 2009
Ian Hickson wrote:
>> It's not clear to me that what you're proposing is any simpler than what
>> Jonas is proposing.
>
> I agree it's no simpler; I'm saying it's more compatible with IE.
And I'm saying it's incompatible with IE in precisely the way that's
unacceptable to me as an implementor, I guess.... I'm also not sure that
the IE compat is important here; we've had no reports of compat issues
with not doing what IE does.
> I don't really understand what your proposal would actually translate to,
> in precise spec terms.
I haven't internalized your parsing algorithm rules, but my intuition
given the one compat requirement I know of here (not blowing away
documents in cases where IE doesn't blow them away) is that deferred
scripts should be treated as if the <script> tags appeared in the HTML
character stream after all the content that is actually there... That
is, immediately before the EOF point.
> One alternative would be to make the scripts that have "src" attributes
> but are deferred be excluded from the innerHTML behaviour, and just have
> them do the old behaviour
I could probably live with that, for what it's worth, but I'm still
wondering why we need this innerHTML behavior at all. innerHTML doesn't
even run scripts it directly inserts; why would it run some other random
script?
That said, if for compat we need this I can see doing it...
> But it's less compatible with IE than I usually try to be (I would have
> specced this innerHTML behaviour long ago if I'd thought to test for it).
Again, what you specced is also incompatible with IE, and the precise
incompatibility is the issue I (and apparently Maciej) have with it.
-Boris
More information about the whatwg
mailing list