Bug 12524 - document.open() twice causes iframe to go blank
Summary: document.open() twice causes iframe to go blank
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: 419.x
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-31 23:29 PST by nrlz
Modified: 2008-11-28 13:27 PST (History)
1 user (show)

See Also:


Attachments
testcase (998 bytes, text/html)
2007-01-31 23:30 PST, nrlz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description nrlz 2007-01-31 23:29:07 PST
While trying to make a rich text editor, I found that calling document.open/write/close twice and writing content which contains a <link type=text/css> tag, will cause the editor to go blank (white). The editor contents will only show if I click on it. If I focus away (to the address bar), it goes blank again. If I change the iframe contents with innerHTML, it goes blank again.

Specifically:

with(frames[0].document) {
  designMode = "on";

  open("text/html");
  write("<html>");
  write("<head><link type='text/css'></head>");
  write("<body bgcolor='#ffc'>editable text</body>");
  write("</html>");
  close();

  open("text/html");
  write("<html>");
  write("<head><link type='text/css'></head>");
  write("<body bgcolor='#ffc'>editable text</body>");
  write("</html>");
  close();
}
Comment 1 nrlz 2007-01-31 23:30:23 PST
Created attachment 12850 [details]
testcase
Comment 2 Alexey Proskuryakov 2007-02-06 11:40:09 PST
Most of the issues in the test case appear to be fixed in current WebKit, but step 1 is still problematic - drawing seems to happen after a significant timeout, or after a mouse move (or maybe just a mouse move, hard to tell).
Comment 3 Justin Garcia 2007-03-06 22:10:08 PST
The fact that designMode is turned on in the subframe doesn't seem to have any effect on the time it takes for its content to appear, so I'm moving this bug to the Forms component.
Comment 4 Alexey Proskuryakov 2008-11-28 13:27:15 PST
This works 100% correctly for me with r38816.