Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upIframe.contentWindow always returns null #5500
Comments
|
Update: this turns out to be because iframe loading is async, apparently However, |
|
Right. It seems that the creation of the frame's document and window is deferred until the content is fetched -- and if no src is ever set, no content is ever fetched. If we set src to blank.html and instead fetch the contentWindow after a timeout, then it works fine. According to https://html.spec.whatwg.org/multipage/embedded-content.html#the-iframe-element , iframes without a src should have the src "about:blank", which is an immediately-available resource that can never asynchronously load. |
|
Yes, sync about:blank is tracked at #5240. |
|
No, we should just implement synchronous about:blank rather than hacking around the lack of it. That's #5240. |
|
That's only for iframes without a src. What about iframes with a src that haven't loaded yet? |
|
Same deal. All iframes start with about:blank and then navigate to the src url. |
Testcase:
On running through
gdbit seems likechildrenhere is an empty vector.This happens to iframes created from source, from
innerHTML, and fromcreateElement()cc @glennw @mbrubeck