Open
Bug 1191683
Opened 9 years ago
Updated 2 years ago
Uninitialized document readyState exposed to scripts
Categories
(Core :: DOM: Navigation, defect)
Core
DOM: Navigation
Tracking
()
NEW
People
(Reporter: hsivonen, Unassigned)
References
()
Details
From bug 856295 comment 4:
> Here's a one-liner that gives a script readyState of "uninitialized":
> document.body.innerHTML = '<iframe src="/foo">';
> document.querySelector("iframe").contentDocument.readyState
Comment 1•9 years ago
|
||
One another case when "uninitialized" for readyState is returned:
<script>
alert(new DOMParser().parseFromString("", "text/html").readyState);
</script>
All other variants for parseFromString method (like "text/xml" or "application/xml") in Firefox return "complete".
But, what is worth mentioning, it is very inconsistent beetwen browsers:
Firefox/IE11 - "complete"
Chrome - "interactive"
Opera(Presto) - "loading"
P&S def: http://www.w3.org/TR/DOM-Parsing/#widl-DOMParser-parseFromString-Document-DOMString-str-SupportedType-type
HTML def: https://html.spec.whatwg.org/multipage/dom.html#current-document-readiness
Comment 2•6 years ago
|
||
FWIW Chrome now also returns "complete" for `new DOMParser().parseFromString("", "text/html").readyState`.
This happens when creating and inserting an iframe like this too:
<script>
var testIframe = document.createElement("iframe");
testIframe.name = "testIframe";
testIframe.src = "about:blank";
document.body.appendChild(testIframe);
console.log(testIframe.contentWindow.document.readyState);
</script>
Chrome/Safari work as expected and log "complete".
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•