Closed Bug 518104 Opened 15 years ago Closed 15 years ago

[HTML5] Implement HTML5 changes to <script defer>

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: hsivonen, Assigned: hsivonen)

References

Details

Attachments

(2 files, 5 obsolete files)

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.
Attached patch WIP (obsolete) — Splinter Review
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+
Assignee: nobody → hsivonen
Attached patch Trunk patch with test tweaks (obsolete) — Splinter Review
Attachment #404070 - Attachment is obsolete: true
Attachment #404228 - Flags: review+
Attached patch Branch patch with test tweaks (obsolete) — Splinter Review
Attachment #404229 - Flags: review+
No longer depends on: 516406
Blocks: 515338
Comment on attachment 404228 [details] [diff] [review]
Trunk patch with test tweaks

r=me on the test changes
Attachment #404228 - Flags: review+
Attached patch Trunk patch with test tweaks, v2 (obsolete) — Splinter Review
Attachment #404228 - Attachment is obsolete: true
Attachment #404264 - Flags: superreview?(mrbkap)
Attachment #404264 - Flags: review+
Attachment #404229 - Attachment is obsolete: true
Attachment #404266 - Flags: superreview?(mrbkap)
Attachment #404266 - Flags: review+
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.
Flags: wanted1.9.2?
Attachment #404264 - Attachment is obsolete: true
Attachment #404280 - Flags: superreview?(mrbkap)
Attachment #404280 - Flags: review+
Attachment #404264 - Flags: superreview?(mrbkap)
Attachment #404266 - Attachment is obsolete: true
Attachment #404281 - Flags: superreview?(mrbkap)
Attachment #404281 - Flags: review+
Attachment #404266 - Flags: superreview?(mrbkap)
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.
Flags: wanted1.9.2?
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.

Attachment

General

Created:
Updated:
Size: