[HTML5] Old document gets blown away when dynamically added script does document.write

RESOLVED FIXED

Status

()

Core
HTML: Parser
P2
normal
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: Martijn Wargers (dead), Assigned: hsivonen)

Tracking

({regression, testcase})

Trunk
x86
Windows 7
regression, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(5 attachments, 1 obsolete attachment)

(Reporter)

Description

8 years ago
Follow-up from bug 553795.
See testcase, this passes in Mozilla 1.9.1 builds, but fails from 1.9.2 builds on (and also on trunk).
It passes in IE8.

It seems like a bug to me. If not, please resolve the bug as invalid and explain to me why it is invalid.
(Reporter)

Comment 1

8 years ago
Created attachment 440169 [details]
external script file
(Reporter)

Comment 2

8 years ago
Created attachment 440170 [details]
testcase
This is invalid per spec, because script-inserted external scripts don't block the parser or defer EOF processing.
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → INVALID
Created attachment 446165 [details]
external script file that writes a non-empty string
Created attachment 446166 [details]
Test case using non-empty strings
OK. It seems that IE ignores the document.write() in this case.

Might be worth changing the spec. Now the interesting question is what criteria IE uses to decide whether to ignore the call or blow away the document.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Priority: -- → P2
Summary: Old document gets blown away when dynamically added script does document.write → [HTML5] Old document gets blown away when dynamically added script does document.write
Filed as http://www.w3.org/Bugs/Public/show_bug.cgi?id=9767

If you know details about IE behavior, please comment on the w3.org bug.
Created attachment 452257 [details] [diff] [review]
Fix without tests or test adjustments

sicking, does this look worthy of writing and adjusting tests to match?
Assignee: nobody → hsivonen
Status: REOPENED → ASSIGNED
Attachment #452257 - Flags: feedback?(jonas)
Tests that need adjustment:

25085 ERROR TEST-UNEXPECTED-FAIL | /tests/content/base/test/test_bug518104.html | Div wasn't blown away. - 2 should equal 0

297 ERROR TEST-UNEXPECTED-FAIL | /tests/security/ssl/mixedcontent/test_bug329869.html | FAILURE: security broken after document write from unsecure script, expected broken got secure
298 ERROR TEST-UNEXPECTED-FAIL | /tests/security/ssl/mixedcontent/test_bug329869.html | FAILURE: for 'broken' expected  flags [0,1,0], security broken after document write from unsecure script
299 ERROR TEST-UNEXPECTED-FAIL | /tests/security/ssl/mixedcontent/test_bug329869.html | FAILURE: security still broken after navigation, expected broken got secure
300 ERROR TEST-UNEXPECTED-FAIL | /tests/security/ssl/mixedcontent/test_bug329869.html | FAILURE: for 'broken' expected  flags [0,1,0], security still broken after navigation
Created attachment 453122 [details] [diff] [review]
Fix with test adjustments
Attachment #452257 - Attachment is obsolete: true
Attachment #453122 - Flags: review?(jonas)
Attachment #452257 - Flags: feedback?(jonas)
(Reporter)

Comment 11

8 years ago
I guess I'm seeing the same problem on:
http://www.voetbalprimeur.nl/site/nieuws/133916/Blatter_ziet_gevaar_in_technologische_hulpmiddelen.html
(Reporter)

Comment 12

8 years ago
I'm also seeing this when trying to watch an article on http://www.vastgoedjournaal.nl/
Attachment #453122 - Flags: review?(jonas) → review+
http://hg.mozilla.org/mozilla-central/rev/85ce56b223a3
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago8 years ago
Resolution: --- → FIXED
(In reply to comment #11)
> I guess I'm seeing the same problem on:
> http://www.voetbalprimeur.nl/site/nieuws/133916/Blatter_ziet_gevaar_in_technologische_hulpmiddelen.html

(In reply to comment #12)
> I'm also seeing this when trying to watch an article on
> http://www.vastgoedjournaal.nl/

These sites work for me in the latest nightly.
You need to log in before you can comment on or make changes to this bug.