Closed Bug 518104 Opened 12 years ago Closed 12 years ago
[HTML5] Implement HTML5 changes to <script defer>
Need to change <script defer> so that defer is ignored on inline scripts and document.write() for an external defer script blows away the document.
This fixes the code, but we need to also change tests that test of the old behavior. Henri has graciously offered to do that and drive the patch into the tree.
Attachment #404070 - Flags: review?(hsivonen)
Comment on attachment 404070 [details] [diff] [review] WIP Looks good to me, except it seems that the behavior is correct per HTML5 only if another script doesn't go and change the src attribute between the time the parser inserts the node and the time the parser parses the end tag. However, that problem is pre-existing and not introduced by this patch. (Unless I'm missing something about how GetSrc works.)
Attachment #404070 - Flags: review?(hsivonen) → review+
Comment on attachment 404228 [details] [diff] [review] Trunk patch with test tweaks r=me on the test changes
Attachment #404229 - Flags: approval1.9.2+
Per discussion with sicking, getting this on the branch would be good, since the longer Gecko is HTML5-incompliant on this point, the more likely it is that Web content starts depending on Gecko's old behavior.
Try server id f1b91fc7f1b9.
Attachment #404280 - Flags: superreview?(mrbkap) → superreview+
Attachment #404281 - Flags: superreview?(mrbkap) → superreview+
Oh, we probably need to leave the functions in to be compatible with the older branch.
This bug is kinda the opposite of bug 461555, which was blocking1.9.1+ because we were aware of several web sites that it broke. Are those sites broken again? :(
The hope is that they are not. All of the examples that I looked at that broke in that bug was due to inline scripts. Inline scripts are no longer deferred so it should be fine to document.write in them.
The implementation of this change has reopened another bug https://bugzilla.mozilla.org/show_bug.cgi?id=474392
I have put together a demonstration page of this functionality breaking backwards compatibility and a number of test cases which are generally accepted to work in all browsers. http://what.cd/defer-bug.php
What.CD: I don't actually understand what your page is saying, but it's not related to this bug, so please file a separate bug on this. Or better yet, bring it up on the WhatWG mailing list as it appears to me that you are disagreeing with what the spec says rather than you have found a bug in our implementation of the spec.
You need to log in before you can comment on or make changes to this bug.