Bug 40745 - HTML5 Parser: document.write after onload blows away document
Summary: HTML5 Parser: document.write after onload blows away document
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 41865 41979 (view as bug list)
Depends on:
Blocks: 41115 42365
  Show dependency treegraph
 
Reported: 2010-06-16 16:27 PDT by Tony Gentilcore
Modified: 2010-07-15 11:30 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.35 KB, patch)
2010-07-12 17:45 PDT, Adam Barth
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Gentilcore 2010-06-16 16:27:41 PDT
The HTML5 spec changes the behavior of document.write() after onload to clear the current document.

This causes significant web compatibility problems. Here are some sites that appear blank in Minefield and WebKit ToT.

Reliable reproductions:
http://en.search.wordpress.com/
http://www.friendsreunited.co.uk/
(porn) http://zahui.ru/
http://www.radio.uol.com.br/
http://house.focus.cn/news/2010-03-31/893478.html

Flaky reproductions:
http://www.tmf.nl/
http://www.jzstock.net/p/shiyong/
http://hp-consumer.my.aol.com.mx/
http://suddenattack.asiasoft.co.th/
http://www.sa.in.th/
http://cabal.asiasoft.co.th/index.html
Comment 1 sideshowbarker 2010-06-17 11:37:39 PDT
see also http://www.w3.org/Bugs/Public/show_bug.cgi?id=9767 for the HTML5 spec (bug) report related to this
Comment 2 Tony Gentilcore 2010-06-17 11:41:29 PDT
(In reply to comment #1)
> see also http://www.w3.org/Bugs/Public/show_bug.cgi?id=9767 for the HTML5 spec (bug) report related to this

Thanks, I accidentally only cross-linked the bugs in the other direction.

I'm planning to try these sites with the heuristic suggested in the W3 bug and will report my findings.
Comment 4 Adam Barth 2010-07-11 13:48:28 PDT
*** Bug 41865 has been marked as a duplicate of this bug. ***
Comment 5 Adam Barth 2010-07-11 13:49:02 PDT
http://www.nakedcapitalism.com/
Comment 6 Adam Barth 2010-07-12 17:41:09 PDT
*** Bug 41979 has been marked as a duplicate of this bug. ***
Comment 7 Adam Barth 2010-07-12 17:45:38 PDT
Created attachment 61302 [details]
Patch
Comment 8 Eric Seidel (no email) 2010-07-12 17:47:15 PDT
Comment on attachment 61302 [details]
Patch

OK.
Comment 9 WebKit Commit Bot 2010-07-12 20:41:22 PDT
Comment on attachment 61302 [details]
Patch

Clearing flags on attachment: 61302

Committed r63165: <http://trac.webkit.org/changeset/63165>
Comment 10 WebKit Commit Bot 2010-07-12 20:41:28 PDT
All reviewed patches have been landed.  Closing bug.