-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Demo: http://jsfiddle.net/int32_t/oztck57e/5/
Bug report from a web author: https://crbug.com/875642
Specification link 1: https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#document-open-steps Step 11.3
Specification link 2: https://html.spec.whatwg.org/multipage/urls-and-fetching.html#fallback-base-url
The demo page has three nested documents,
- Top
- iframe srcdoc
doc1- iframe about:blank
doc2
- iframe about:blank
- iframe srcdoc
According to the specification, doc2's URL will be about:srcdoc by doc2.open(). See specification link 1. After that, fallback base URL computation for doc2 returns about:srcdoc because the document is neither an iframe srcdoc document nor about:blank. See specification link 2.
Chrome currently follows the specification. So relative URLs in doc2 can't be resolved.
Firefox throws an exception on doc2.open(). So doc2's URL is not changed.
Safari's behavior is not understandable. But anyway the base URL of doc2 is the URL of the top document.
Proposal:
I'd like to change the specification so that doc2 has the top document URL as the fallback base URL in this case. For example, changing
- If document's URL is about:blank,
to
- if document's URL is about:blank or about:srcdoc,