Skip to content

Commit

Permalink
incorperate #4318
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Jan 24, 2019
1 parent b65178f commit 532713e
Showing 1 changed file with 88 additions and 74 deletions.
162 changes: 88 additions & 74 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -23692,18 +23692,18 @@ document.body.appendChild(wbr);</code></pre>
<td><em>not allowed</em></td>
<td><span data-x="hyperlink annotation">Annotation</span></td>
<td class="no"> &middot; </td>
<td>Indicates that any <span>browsing context</span> created by following the hyperlink is
<span>disowned</span>.</td>
<td>Creates a <span>top-level browsing context</span> that is not an <span>auxiliary
browsing context</span> if the hyperlink would create either of those to begin with (i.e., has
an appropriate <code data-x="attr-hyperlink-target">target</code> attribute value).</td>
</tr>

<tr>
<td><code data-x="rel-noreferrer">noreferrer</code></td>
<td><em>not allowed</em></td>
<td><span data-x="hyperlink annotation">Annotation</span></td>
<td class="no"> &middot; </td>
<td>Indicates that any <span>browsing context</span> created by following the hyperlink is
<span>disowned</span> and will not get a `<code data-x="http-referer">Referer</code>` (sic)
header.</td>
<td>No `<code data-x="http-referer">Referer</code>` (sic) header will be included.
Additionally, has the same effect as <code data-x="rel-noopener">noopener</code>.</td>
</tr>

<tr>
Expand Down Expand Up @@ -24452,9 +24452,32 @@ document.body.appendChild(wbr);</code></pre>
data-x="hyperlink annotation">annotates</span> any other hyperlinks created by the element (the
implied hyperlink, if no other keywords create one).</p>

<p>The keyword indicates that any newly created <span>browsing context</span> which results from
following the <span>hyperlink</span> will be <span>disowned</span>, which means that its <code
data-x="dom-opener">window.opener</code> attribute will be null.</p>
<p>The keyword indicates that any newly created <span>top-level browsing context</span> which
results from following the <span>hyperlink</span> is not an <span>auxiliary browsing
context</code>. E.g., its <code data-x="dom-opener">window.opener</code> attribute will be
null.</p>

<p class="note">See also the <a href="#noopener">processing model</a> where the branching between
an <span>auxiliary browsing context</span> and a <span>top-level browsing context</span> is
defined.</p>

<div class="example">
<p>This typically creates an <span>auxiliary browsing context</span> (assuming there is no
existing <span>browsing context</span> whose <span>browsing context name</span> is
"<code>example</code>"):</p>

<pre><code class="html" data-x="">&lt;a href=help.html target=example>Help!&lt;/a></code></pre>

<p>This creates a <span>top-level browsing context</span> that is not an <span>auxiliary browsing
context</span> (assuming the same thing):</p>

<pre><code class="html" data-x="">&lt;a href=help.html target=example rel=noopener>Help!&lt;/a></code></pre>

<p>These are equivalent and only navigate the parent browsing context:</p>

<pre><code class="html" data-x="">&lt;a href=index.html target=_parent>Home&lt;/a></code></pre>
<pre><code class="html" data-x="">&lt;a href=index.html target=_parent rel=noopener>Home&lt;/a></code></pre>
</div>


<h5>Link type "<dfn><code data-x="rel-noreferrer">noreferrer</code></dfn>"</h5>
Expand Down Expand Up @@ -76923,6 +76946,11 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {

<p>A <span>browsing context</span> has a corresponding <code>WindowProxy</code> object.</p>

<p>A <span>browsing context</span> has an <dfn data-export="">opener browsing context</dfn>, which
is null or a <span>browsing context</span>. It is initially null.</p>

<p>A <span>browsing context</span> can be <dfn id="disowned-its-opener">disowned</dfn>.</p>

<p>A <span>browsing context</span> has a <span>session history</span>, which lists the
<code>Document</code> objects that the <span>browsing context</span> has presented, is presenting,
or will present. A <span>browsing context</span>'s <dfn data-export="">active document</dfn> is
Expand Down Expand Up @@ -77132,10 +77160,10 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
context">ancestor</span> of <var>B</var>, or if the browsing context <var>A</var> is the
<span>parent browsing context</span> of <var>B</var>.</p>

<p>A <span>browsing context</span> that is not a <span>nested browsing context</span> has no
<span>parent browsing context</span>, and is the <dfn data-export="">top-level browsing
context</dfn> of all the browsing contexts for which it is an <span>ancestor browsing
context</span>.</p>
<p>A <span>browsing context</span> that is not a <span>nested browsing context</span>, has no
<span>parent browsing context</span>, and whose <span>opener browsing context</span> is null, is
the <dfn data-export="">top-level browsing context</dfn> of all the browsing contexts for which it
is an <span>ancestor browsing context</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 @@ -77287,31 +77315,28 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
<h5>Navigating nested browsing contexts in the DOM</h5>

<dl class="domintro">

<dt><var>window</var> . <code subdfn data-x="dom-top">top</code></dt>

<dd>

<p>Returns the <code>WindowProxy</code> for the <span>top-level browsing context</span>.</p>
</dd>

<dt><var>window</var> . <code subdfn data-x="dom-opener">opener</code></dt>
<dd>
<p>Returns the <code>Window</code> for the <span>opener browsing context</span>.</p>

<p>Returns null if there isn't one.</p>
</dd>

<dt><var>window</var> . <code subdfn data-x="dom-parent">parent</code></dt>

<dd>

<p>Returns the <code>WindowProxy</code> for the <span>parent browsing context</span>.</p>

</dd>

<dt><var>window</var> . <code subdfn data-x="dom-frameElement">frameElement</code></dt>

<dd>

<p>Returns the <code>Element</code> for the <span>browsing context container</span>.</p>

<p>Returns null if there isn't one, and in cross-origin situations.</p>

</dd>

</dl>
Expand All @@ -77338,6 +77363,46 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
<span>top-level browsing context</span>'s <code>WindowProxy</code> object.</p></li>
</ol>

<p>The <dfn><code data-x="dom-opener">opener</code></dfn> attribute's getter must run these
steps:</p>

<ol>
<li><p>If the current <span>browsing context</span> is <span>disowned</span>, then return
null.</p></li>

<li><p>If the current <span>browsing context</span> has no <span>opener browsing context</span>,
then return null.</p></li>

<li><p>Return the current <span>browsing context</span>'s <span>opener browsing context</span>'s
<code>WindowProxy</code> object.</p></li>
</ol>

<p>The <code data-x="dom-opener">opener</code> attribute's setter, must run these steps:</p>

<ol>
<li><p>If the given value is null, then <span data-x="disowned">disown</span> the current
<span>browsing context</span> and return.</p></li>

<li><p>Return ? <span>OrdinaryDefineOwnProperty</span>(this <code>Window</code> object, "<code
data-x="">opener</code>", { [[Value]]: the given value, [[Writable]]: true, [[Enumerable]]: true,
[[Configurable]]: true }).</p></li>
</ol>

<div class="note">
<p>If a <span>browsing context</span> is <span>disowned</span>, its <code
data-x="dom-opener">window.opener</code> attribute is null. That prevents scripts in the
<span>browsing context</span> from changing any properties of its <span>opener browsing
context</span>'s <code>Window</code> object (i.e., the <code>Window</code> object from which the
<span>browsing context</span> was created).</p>

<p>Otherwise, if a <span>browsing context</span> is not <span>disowned</span>, then scripts in
that <span>browsing context</span> can use <code data-x="dom-opener">window.opener</code> to
change properties of its <span>opener browsing context</span>'s <code>Window</code> object. For
example, a script running in the <span>browsing context</span> can change the value of <code
data-x="">window.opener.location</code>, causing the <span>opener browsing context</span> to
navigate to a completely different document.</p>
</div>

<p>The <dfn><code data-x="dom-parent">parent</code></dfn> IDL attribute, on getting, must run the
following algorithm:</p>

Expand Down Expand Up @@ -77415,58 +77480,8 @@ console.assert(iframeWindow.frameElement === null);
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" data-lt="top-level browsing context" data-export="">top-level browsing
contexts</span>.</p>

<p>An <span>auxiliary browsing context</span> has an <dfn data-export="">opener browsing
context</dfn>, which is the <span>browsing context</span> from which the <span>auxiliary browsing
context</span> was created.</p>


<h5>Navigating auxiliary browsing contexts in the DOM</h5>

<p>An <span>auxiliary browsing context</span> can be <dfn
id="disowned-its-opener">disowned</dfn>.</p>

<p>The <dfn><code data-x="dom-opener">opener</code></dfn> attribute's getter must run these
steps:</p>

<ol>
<li><p>If the current <span>browsing context</span> is <span>disowned</span>, then return
null.</p></li>

<li><p>If the current <span>browsing context</span> has no <span>opener browsing context</span>,
then return null.</p></li>

<li><p>Return the current <span>browsing context</span>'s <span>opener browsing context</span>'s
<code>WindowProxy</code> object.</p></li>
</ol>

<p>The <code data-x="dom-opener">opener</code> attribute's setter, must run these steps:</p>

<ol>
<li><p>If the given value is null, then <span data-x="disowned">disown</span> the current
<span>browsing context</span> and return.</p></li>

<li><p>Perform <span>OrdinaryDefineOwnProperty</span>(this <code>Window</code> object, "<code
data-x="">opener</code>", { [[Value]]: the given value, [[Writable]]: true, [[Enumerable]]: true,
[[Configurable]]: true }). Rethrow any exceptions.</p></li>
</ol>

<div class="note">
<p>If a <span>browsing context</span> is <span>disowned</span>, its <code
data-x="dom-opener">window.opener</code> attribute is null. That prevents scripts in the
<span>browsing context</span> from changing any properties of its <span>opener browsing
context</span>'s <code>Window</code> object (i.e., the <code>Window</code> object from which the
<span>browsing context</span> was created).</p>
context">top-level browsing contexts</span>.</p>

<p>Otherwise, if a <span>browsing context</span> is not <span>disowned</span>, then scripts in
that <span>browsing context</span> can use <code data-x="dom-opener">window.opener</code> to
change properties of its <span>opener browsing context</span>'s <code>Window</code> object. For
example, a script running in the <span>browsing context</span> can change the value of <code
data-x="">window.opener.location</code>, causing the <span>opener browsing context</span> to
navigate to a completely different document.</p>
</div>



Expand Down Expand Up @@ -78453,8 +78468,7 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>
</ol>
</li>

<li><p>If <var>noopener</var> is true, then <span data-x="disowned">disown</span> <var>target
browsing context</var> and return null.</p></li>
<li><p>If <var>noopener</var> is true, then return null.</p></li>

<li><p>Return <var>target browsing context</var>'s <code>WindowProxy</code> object.</p></li>
</ol>
Expand Down

0 comments on commit 532713e

Please sign in to comment.