Skip to content

Commit

Permalink
Give browsing contexts an explicit container
Browse files Browse the repository at this point in the history
This is the first step for #5020.
  • Loading branch information
annevk committed Nov 21, 2019
1 parent 3e1874e commit 7a6ae8c
Showing 1 changed file with 77 additions and 75 deletions.
152 changes: 77 additions & 75 deletions source
Expand Up @@ -78565,6 +78565,9 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
<li><p>Set <var>element</var>'s <span>nested browsing context</span> to
<var>browsingContext</var>.</p></li>

<li><p>Set <var>browsingContext</var>'s <span data-x="bc-container">container</span> to
<var>element</var>.</p></li>

<li><p>If <var>element</var> has a <code data-x="">name</code> attribute, then set
<var>browsingContext</var>'s <span data-x="browsing context name">name</span> to the value of
this attribute.</p></li>
Expand All @@ -78581,31 +78584,43 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
context containers</dfn>.</p>

<p>Each <span>browsing context container</span> has a <dfn data-export="">nested browsing
context</dfn>, which is either a <span>browsing context</span> or null.</p>
context</dfn>, which is either a <span>browsing context</span> or null. It is initially null.</p>

<p>Each <span>browsing context</span> has a <dfn data-x="bc-container">container</dfn>, which is
either a <span>browsing context container</span> or null. It is initially null.</p>

<p>Each <span>browsing context</span> <var>bc</var> has a <dfn
data-x="bc-container-document">container document</dfn>, which is the result of running these
steps:</p>

<ol>
<li><p>If <var>bc</var>'s <span data-x="bc-container">container</span> is null, then return
null.</p></li>

<li>
<p>Return <var>bc</var>'s <span data-x="bc-container">container</span>'s <span>node
document</span>.</p>

<p class="note">This is equal to <var>bc</var>'s <span data-x="bc-container">container</span>'s
<span>shadow-including root</span> here.</p>
</li>
</ol>

<p>If a <span>browsing context</span> is the <span>nested browsing context</span> of a
<span>browsing context container</span>, then the browsing context is said to be <dfn
data-x="browsing context nested through" data-export="">nested through</dfn> the <span>browsing
context container</span>'s <span>node document</span>.</p>

<p>A <span>browsing context</span> <var>child</var> is said to be a <dfn data-export="">child
browsing context</dfn> of another <span>browsing context</span> <var>parent</var>, if all of the
following conditions hold:</p>

<ul>
<li><p><var>child</var> is a <span>nested browsing context</span> of a <span>browsing context
container</span> <var>element</var></p></li>

<li><p><var>element</var> is <span>connected</span></p></li>

<li><p><var>element</var>'s <span>shadow-including root</span>'s <span
data-x="concept-document-bc">browsing context</span> is <var>parent</var></p></li>
</ul>

<p>A <span>browsing context</span> <var>child</var> is then a <dfn>document-tree child browsing
context</dfn> of <var>parent</var> if it is a <span>child browsing context</span> and its
<span>browsing context container</span> is not just <span>connected</span>, but also <span>in a
document tree</span>.</p>
browsing context</dfn> of another <span>browsing context</span> <var>parent</var>, if
<var>child</var>'s <span data-x="bc-container-document">container document</span> is non-null and
<var>child</var>'s <span data-x="bc-container-document">container document</span>'s <span
data-x="concept-document-bc">browsing context</span> is <var>parent</var>.</p>

<p>A <span>browsing context</span> <var>child</var> is a <dfn>document-tree child browsing
context</dfn> of <var>parent</var> if <var>child</var> is a <span>child browsing context</span>
and <var>child</var>'s <span data-x="bc-container">container</span> is <span>in a document
tree</span>.</p>

<p>A <span>browsing context</span> <var>child</var> may have a <dfn data-export="">parent browsing
context</dfn>. This is the unique <span>browsing context</span> that has <var>child</var> as a
Expand All @@ -78627,10 +78642,10 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
group">group</dfn> (null or a <span>browsing context group</span>). It is initially null.</p>

<p>It is possible to create new browsing contexts that are related to a <span>top-level browsing
context</span> without being nested through an element. Such browsing contexts are called <dfn
data-x="auxiliary browsing context" data-lt="auxiliary browsing context" data-export="">auxiliary
browsing contexts</dfn>. Auxiliary browsing contexts are always <span data-x="top-level browsing
context">top-level browsing contexts</span>.</p>
context</span> while their <span data-x="bc-container">container</span> is null. Such browsing
contexts are called <dfn data-x="auxiliary browsing context" data-lt="auxiliary browsing context"
data-export="">auxiliary browsing contexts</dfn>. Auxiliary browsing contexts are always <span
data-x="top-level browsing context">top-level browsing contexts</span>.</p>

<p>The transitive closure of <span data-x="parent browsing context">parent browsing contexts</span>
for a <span>browsing context</span> that is a <span>nested browsing context</span> gives the list
Expand Down Expand Up @@ -78663,13 +78678,14 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
<li><p>Return <var>list</var>.</p></li>
</ol>

<p>A <code>Document</code> is said to be <dfn data-export="" data-dfn-for="Document">fully
active</dfn> when its <span data-x="concept-document-bc">browsing context</span> is non-null and
it is the <span>active document</span> of that <span>browsing context</span>, and either its <span
<p>A <code>Document</code> <var>d</var> is said to be <dfn data-export=""
data-dfn-for="Document">fully active</dfn> when <var>d</var>'s <span
data-x="concept-document-bc">browsing context</span> is non-null, <var>d</var>'s <span
data-x="concept-document-bc">browsing context</span>'s <span>active document</span> is
<var>d</var>, and either <var>d</var>'s <span
data-x="concept-document-bc">browsing context</span> is a <span>top-level browsing context</span>,
or it has a <span>parent browsing context</span> and the <code>Document</code> <span
data-x="browsing context nested through">through which</span> it is <span data-x="nested browsing
context">nested</span> is itself <span>fully active</span>.</p>
or <var>d</var>'s <span data-x="bc-container-document">container document</span> is <span>fully
active</span>.</p>

<p>Because they are associated with an element, <span data-x="child browsing context">child
browsing contexts</span> are always tied to a specific <code>Document</code> in their <span>parent
Expand Down Expand Up @@ -78731,23 +78747,10 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
spec=NAVMODEL></p>
</div>

<p>A <span>browsing context</span> that is a <span>nested browsing context</span> can be put into
a <dfn>delaying <code data-x="event-load">load</code> events mode</dfn>. This is used when it is
<span data-x="navigate">navigated</span>, to <span>delay the load event</span> of its
<span>browsing context container</span> before the new <code>Document</code> is created.</p>

<!--(There's no current way for this to happen, since removing an iframe from a document discards its browsing context)
<p class="note">A <span>nested browsing context</span> can in some cases be taken out of its
<span>parent browsing context</span> (e.g. if an <code>iframe</code> element is removed from its
<code>Document</code>). In such a situation, the <span>nested browsing context</span> has no
<span>parent browsing context</span>, but it still has the same <span>browsing context
container</span> and is still <span data-x="browsing context nested through">nested through</span>
that element's <span>node document</span>. Such a <span>nested browsing context</span> is <em>not</em>
a <span>top-level browsing context</span>, and cannot contain <code>Document</code>s that are
<span>fully active</span>. Furthermore, if a <span>browsing context container</span> (such as an
<code>iframe</code>) is moved to another <code>Document</code>, then the <span>parent browsing
context</span> of its <span>nested browsing context</span> will change.</p>
-->
<p>A <span>child browsing context</span> can be put into a <dfn>delaying <code
data-x="event-load">load</code> events mode</dfn>. This is used when it is <span
data-x="navigate">navigated</span>, to <span>delay the load event</span> of its
<span data-x="bc-container">container</span> before the new <code>Document</code> is created.</p>

<p>The <dfn>document family</dfn> of a <span>browsing context</span> consists of the union of all
the <code>Document</code> objects in that <span>browsing context</span>'s <span>session
Expand Down Expand Up @@ -80441,6 +80444,13 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>

<li><p>If <var>browsingContext</var> is a <span>top-level browsing context</span>, then
<span data-x="bcg remove">remove</span> <var>browsingContext</var>.</p></li>

<li>
<p>Set <var>browsingContext</var>'s <span data-x="bc-container">container</span> to null.</p>

<p class="note">This is a no-op if <var>browsingContext</var> is a <span>top-level browsing
context</span>.</p>
</li>
</ol>

<p>User agents may <span data-x="a browsing context is discarded">discard</span> <span
Expand Down Expand Up @@ -91580,18 +91590,18 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
must be met:</p>

<ul>
<li><p>Any <code>Document</code> <var>B</var> that is <span data-x="browsing context nested
through">nested through</span> a <code>Document</code> <var>A</var> must be listed after
<var>A</var> in the list.</p></li>
<li><p>Any <code>Document</code> <var>B</var> whose <span
data-x="concept-document-bc">browsing context</span>'s <span
data-x="bc-container-document">container document</span> is <var>A</var>, must be listed
after <var>A</var> in the list.</p></li>

<li><p>If there are two documents <var>A</var> and <var>B</var> whose <span
data-x="concept-document-bc">browsing contexts</span> are both <span data-x="nested browsing
context">nested browsing contexts</span> and their <span data-x="browsing context
container">browsing context containers</span> are both elements in the same
<code>Document</code> <var>C</var>, then the order of <var>A</var> and <var>B</var> in the
list must match the relative <span>tree order</span> of their respective <span
data-x="browsing context container">browsing context containers</span> in
<var>C</var>.</p></li>
data-x="concept-document-bc">browsing contexts</span> are both <span data-x="child browsing
context">child browsing contexts</span> whose <span data-x="bc-container-document">container
documents</span> are <code>Document</code> <var>C</var>, then the order of <var>A</var> and
<var>B</var> in the list must match the <span>shadow-including tree order</span> of their
respective <span data-x="browsing context container">browsing context containers</span> in
<var>C</var>'s <span>node tree</span>.</p></li>
</ul>

<p>In the steps below that iterate over <var>docs</var>, each <code>Document</code> must be
Expand Down Expand Up @@ -103929,30 +103939,22 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
</li>

<li>

<p>If the <span>HTML parser</span> for which this algorithm is being run is associated with a
<code>Document</code> that is itself in a <span>nested browsing context</span>, run these
substeps:</p>
<code>Document</code> <var>d</var> whose <span data-x="concept-document-bc">browsing
context</span> is non-null and a <span>child browsing context</span>, then:</p>

<ol>

<li><p>Let <var>new document</var> be the <code>Document</code> with which the
<span>HTML parser</span> is associated.</p></li>

<li><p>Let <var>parent document</var> be the <code>Document</code> <span
data-x="browsing context nested through">through which <var>new document</var> is
nested</span> (the <span>active document</span> of the <span>parent browsing context</span> of
<var>new document</var>).</p></li>

<li><p>If <var>parent document</var>'s <span>origin</span> is <span>same origin</span> with
<var>new document</var>'s <span>origin</span>, and <var>parent document</var>'s <span
data-x="document's character encoding">character encoding</span> is an <span>ASCII-compatible
encoding</span>, then return <var>parent document</var>'s <span data-x="document's character
encoding">character encoding</span>, with the <span
data-x="concept-encoding-confidence">confidence</span> <i>tentative</i>.</p></li>

<li><p>Let <var>parentDocument</var> be <var>d</var>'s <span
data-x="concept-document-bc">browsing context</span>'s <span
data-x="bc-container-document">container document</span>.</p></li>

<li><p>If <var>parentDocument</var>'s <span>origin</span> is <span>same origin</span> with
<var>d</var>'s <span>origin</span> and <var>parentDocument</var>'s <span data-x="document's
character encoding">character encoding</span> is an <span>ASCII-compatible encoding</span>,
then return <var>parentDocument</var>'s <span data-x="document's character encoding">character
encoding</span>, with the <span data-x="concept-encoding-confidence">confidence</span>
<i>tentative</i>.</p></li>
</ol>

</li>

<li><p>Otherwise, if the user agent has information on the likely encoding for this page, e.g.
Expand Down

0 comments on commit 7a6ae8c

Please sign in to comment.