Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define srcdoc documents as matching about:srcdoc URL #9534

Merged
merged 2 commits into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -6988,6 +6988,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<span>tree order</span>.</p></li>
</ol>

<hr>

<p>A <span>URL</span> <dfn>matches <code>about:blank</code></dfn> if its <span
data-x="concept-url-scheme">scheme</span> is "<code data-x="">about</code>", its <span
data-x="concept-url-path">path</span> contains a single string "<code data-x="">blank</code>", its
Expand All @@ -7000,6 +7002,25 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
record</span> created by <span data-x="URL parser">parsing</span> "<code
data-x="">about:blank?foo#bar</code>" <span>matches <code>about:blank</code></span>.</p>

<p>A <span>URL</span> <dfn>matches <code>about:srcdoc</code></dfn> if its <span
data-x="concept-url-scheme">scheme</span> is "<code data-x="">about</code>", its <span
data-x="concept-url-path">path</span> contains a single string "<code data-x="">srcdoc</code>",
its <span data-x="concept-url-query">query</span> is null, its <span
data-x="concept-url-username">username</span> and <span
data-x="concept-url-password">password</span> are the empty string, and its <span
data-x="concept-url-host">host</span> is null.</p>

<p class="note">The reason that <span>matches <code>about:srcdoc</code></span> ensures that the
<span>URL</span>'s <span data-x="concept-url-query">query</span> is null is because it is not
possible to create <span data-x="an iframe srcdoc document">an <code>iframe</code> <code
data-x="attr-iframe-srcdoc">srcdoc</code> document</span> whose <span
data-x="concept-document-url">URL</span> has a non-null <span
data-x="concept-url-query">query</span>, unlike <code>Document</code>s whose <span
data-x="concept-document-url">URL</span> <span>matches <code>about:blank</code></span>. In other
words, the set of all <span>URL</span>s that <span data-x="matches about:srcdoc">match
<code>about:srcdoc</code></span> only vary in their <span
data-x="concept-url-fragment">fragment</span>.</p>


<div w-nodev>

Expand Down Expand Up @@ -32541,8 +32562,10 @@ interface <dfn interface>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {

<p>The <dfn for="iframe" element-attr><code data-x="attr-iframe-srcdoc">srcdoc</code></dfn>
attribute gives the content of the page that the element's <span>content navigable</span> is to
contain. The value of the attribute is the source of <dfn export>an <code>iframe</code> <code
data-x="attr-iframe-srcdoc">srcdoc</code> document</dfn>.</p>
contain. The value of the attribute is used to <span data-x="create navigation params from a
srcdoc resource">construct</span> <dfn export>an <code>iframe</code> <code
data-x="attr-iframe-srcdoc">srcdoc</code> document</dfn>, which is a <code>Document</code> whose
<span data-x="concept-document-url">URL</span> <span>matches <code>about:srcdoc</code></span>.</p>

<p>The <code data-x="attr-iframe-srcdoc">srcdoc</code> attribute, if present, must have a value
using <span>the HTML syntax</span> that consists of the following syntactic components, in the
Expand Down