When execute document.open/write/close on iframe several times immediately one by one (without any timeout), in this case it doesn't load css style files for this iframe.

UNCONFIRMED
Unassigned

Status

()

Core
CSS Parsing and Computation
UNCONFIRMED
2 years ago
2 years ago

People

(Reporter: Andrey, Unassigned)

Tracking

38 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36

Steps to reproduce:

1. Create an iframe programmatically, using JavaScript and append it on a page.
2. Write (twice or several times one by one) to created iframe full hierarchy of a standard html page necessarily with included links to css files in a <head>, using document.open/write/close functions.

Reproduction example http://jsbin.com/bitezacoqi/1/edit?html,js,output

Simple JavaScript code example:

var docStr = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html><head><title>Title</title><link rel='stylesheet' type='text/css' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css' /></head><body>Simple text</body></html>";

var iframe = document.createElement("iframe");
document.body.appendChild(iframe);
 
iframe.contentWindow.document.open("text/html", "replace");
iframe.contentWindow.document.write(docStr);
iframe.contentWindow.document.close();

iframe.contentWindow.document.open("text/html", "replace");
iframe.contentWindow.document.write(docStr);
iframe.contentWindow.document.close();


Actual results:

Css styles are not loaded in such case, it can be observed in Network tab of Firebug or another dev tool, so existing on a page <body> tag doesn't have any styles applied.


Expected results:

Css styles are loaded and applied to the tags in the iframe document.
Component: Untriaged → CSS Parsing and Computation
OS: Unspecified → Windows 7
Product: Firefox → Core
Hardware: Unspecified → x86_64
You need to log in before you can comment on or make changes to this bug.