Closed Bug 717180 Opened 8 years ago Closed 8 years ago

Re-fix bug 98654 (Make document.write after window.location not blow away the document)

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla14
Tracking Status
firefox11 --- unaffected
firefox12 + verified
firefox13 + verified
firefox14 + verified

People

(Reporter: hsivonen, Assigned: hsivonen)

References

()

Details

Attachments

(1 file, 1 obsolete file)

Bug 98654 has regressed somewhere along the way. Other browsers don't have the same bug, so we should probably re-fix the bug.

See http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-January/034293.html
Potential approach to fixing: Add an "ignore document.open and .write" flag to the document. Set that flag when the document's parser is forcibly terminated (i.e. the parser doesn't end parsing naturally by reaching EOF).
Blocks: 738614
Duplicate of this bug: 738614
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Setting tracking flags based on info in bug 738614 because the lack of this fix breaks a bank site.
Note that bug 98654 had regressed earlier in the sense that the test case there had started failing. The exact cause of that regression is unknown. Bug 738614 shows that fixing bug 715112 regressed bug 98654 even more. The fix here fixes both http://bnc.ca/ and the ancient test case from bug 98654.
Attachment #609689 - Flags: review?(bugs)
Attachment #609689 - Flags: review?(bugs) → review+
Please can you set the target milestone when landing on inbound, along the lines of http://blog.bonardo.net/2012/03/23/how-you-can-help-mozilla-inbound-sheriffs-when-pushing :-)

https://hg.mozilla.org/mozilla-central/rev/e82fc6f3bceb
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
Comment on attachment 609689 [details] [diff] [review]
Add a flag to nsDocument for tracking the situation where we've nulled out mParser due to termination but HTML says we should have an aborted active parser whose insertion point is defined, v2

[Approval Request Comment]
Regression caused by (bug #): Partially regressed by unknown landing and regressed even more by bug 715112
User impact if declined: Pages that set window.location first and then still call document.write won't work. An example is http://bnc.ca/ which is a bank, so the impact is bad for the customers of that bank.
Testing completed (on m-c, etc.): Has baken on m-c for a couple of days.
Risk to taking this patch (and alternatives if risky): Relatively low risk. Aligns us better with IE and WebKit. Very few changed lines of code. In theory could break something else but no breakage has been reported in a couple of days.
String changes made by this patch: None.
Attachment #609689 - Flags: approval-mozilla-beta?
Attachment #609689 - Flags: approval-mozilla-aurora?
Comment on attachment 609689 [details] [diff] [review]
Add a flag to nsDocument for tracking the situation where we've nulled out mParser due to termination but HTML says we should have an aborted active parser whose insertion point is defined, v2

[Triage Comment]
Low-risk fix for a web regression in FF12. Approved for Aurora 13 and Beta 12 - please land asap.
Attachment #609689 - Flags: approval-mozilla-beta?
Attachment #609689 - Flags: approval-mozilla-beta+
Attachment #609689 - Flags: approval-mozilla-aurora?
Attachment #609689 - Flags: approval-mozilla-aurora+
Whiteboard: [qa+]
Verified this fix with the test case from bug 98654:
Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0
Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20100101 Firefox/14.0 BuildID: 20120605113340
Whiteboard: [qa+]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.