Skip to content

Commit

Permalink
Editorial: turn "exceptions enabled" into a flag
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed May 2, 2016
1 parent 5c67104 commit 879edbf
Showing 1 changed file with 37 additions and 31 deletions.
68 changes: 37 additions & 31 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -8514,12 +8514,13 @@ interface <dfn>DOMStringMap</dfn> {
a new <span data-x="concept-response">response</span> whose <span
data-x="concept-response-body">body</span> is <var>source</var>, <span
data-x="concept-response-csp-list">CSP list</span> is <var>CSP list</var> and <span
data-x="concept-response-https-state">HTTPS state</span> is <var>HTTPS state</var>, with
<span>replacement enabled</span> and <span>exceptions enabled</span>. The <span>source browsing
context</span> is that given to the <span data-x="an overridden reload">overridden reload</span>
algorithm. When the <span>navigate</span> algorithm creates a <code>Document</code> object for
this purpose, set that <code>Document</code>'s <span>reload override flag</span> and set its
<span>reload override buffer</span> to <var>source</var>.</p>
data-x="concept-response-https-state">HTTPS state</span> is <var>HTTPS state</var>, with the
<var><span>exceptions enabled flag</span></var> set and <span>replacement enabled</span>. The
<span>source browsing context</span> is that given to the <span data-x="an overridden
reload">overridden reload</span> algorithm. When the <span>navigate</span> algorithm creates a
<code>Document</code> object for this purpose, set that <code>Document</code>'s <span>reload
override flag</span> and set its <span>reload override buffer</span> to <var>source</var>.
Rethrow any exceptions.</p>

<p>When it comes time to <span>set the document's address</span> in the <span
data-x="navigate">navigation algorithm</span>, use <var>address</var> as the
Expand Down Expand Up @@ -79328,9 +79329,10 @@ callback <dfn>FrameRequestCallback</dfn> = void (<span>DOMHighResTimeStamp</span
<code>Document</code></span> object.</p>

<p>Otherwise, <span>navigate</span><!--DONAV window.open()--> <var>target browsing context</var>
to <var>resource</var>, with <span>exceptions enabled</span>. If <var>new</var> is true, then
<span data-x="replacement enabled">replacement must be enabled</span> also. The <span>source
browsing context</span> is <var>source browsing context</var>.</p>
to <var>resource</var>, with the <var><span>exceptions enabled flag</span></var> set. If
<var>new</var> is true, then <span data-x="replacement enabled">replacement must be
enabled</span>. The <span>source browsing context</span> is <var>source browsing context</var>.
Rethrow any exceptions.</p>

</li>

Expand Down Expand Up @@ -81766,7 +81768,8 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O

<li>
<p><span>Navigate</span><!--DONAV location--> the <span>browsing context</span> to
<var>url</var>, with <span>exceptions enabled</span>.</p>
<var>url</var>, with the <var><span>exceptions enabled flag</span></var> set. Rethrow any
exceptions.</p>

<p>If the <var>replacement flag</var> is set or the <span>browsing context</span>'s
<span>session history</span> contains only one <code>Document</code>, and that was the
Expand Down Expand Up @@ -82184,16 +82187,17 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
override flag</span> set</dt>

<dd><p>Perform <span>an overridden reload</span>, with the <span>browsing context</span> being
navigated as the <span>responsible browsing context</span>.</p></dd>
navigated as the <span>responsible browsing context</span>. Rethrow any exceptions.</p></dd>
<!-- http://damowmow.com/playground/demos/sandbox/001.html -->

<dt>Otherwise</dt>

<dd><p><span>Navigate</span><!--DONAV location.reload()--> the <span>browsing context</span> to
<span>the document's address</span> with <span>replacement enabled</span> and <span>exceptions
enabled</span>. The <span>source browsing context</span> must be the <span>browsing
context</span> being navigated. This is a <span>reload-triggered navigation</span>.</p></dd> <!--
it appears that document.reload() always uses GET and does not, e.g., re-POST. -->
<span>the document's address</span> with the <var><span>exceptions enabled flag</span></var> set
and <span>replacement enabled</span>. The <span>source browsing context</span> must be the
<span>browsing context</span> being navigated. This is a <span>reload-triggered
navigation</span>. Rethrow any exceptions.</p></dd>
<!-- it appears that document.reload() always uses GET and does not, e.g., re-POST. -->

<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/141 defends the source browsing context claim; submit, eval document.referrer, reload, eval document.referrer. -->

Expand Down Expand Up @@ -82374,29 +82378,31 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
<!-- For places that _call_ this, as opposed to just referring to
it, search for "DONAV" -->
<p>To <dfn>navigate</dfn> a browsing context <var>browsingContext</var> to a resource
<var>resource</var>, the user agent must run these steps:</p>
<var>resource</var>, optionally with an <dfn id="exceptions-enabled"><var>exceptions enabled
flag</var></dfn>, the user agent must run these steps:</p>

<ol>

<li id="sandboxLinks">

<p>If the <span>source browsing context</span> is not <span>allowed to navigate</span>
<var>browsingContext</var>, then abort these steps.</p>

<p>If these steps are aborted here, the user agent may instead offer to open <var>resource</var>
in a new <span>top-level browsing context</span> or in the <span>top-level browsing
context</span> of the <span>source browsing context</span>, at the user's option, in which case
the user agent must <span>navigate</span><!--DONAV sandbox manual load--> that designated
<span>top-level browsing context</span> to <var>resource</var> as if the user had requested it
independently.</p>
<var>browsingContext</var>, then:</p>

<p class="note">Doing so, however, can be dangerous, as it means that the user is overriding the
author's explicit request to sandbox the content.</p>

<p>If the <span>navigate</span> algorithm was invoked with <dfn>exceptions enabled</dfn>, and it
is aborted on this step, then in addition to aborting this algorithm, the user agent must also
throw a <code>SecurityError</code> exception.</p>
<ol>
<li><p>If the <var><span>exceptions enabled flag</span></var> is set, then throw a
<code>SecurityError</code> exception.</p></li>

<li>
<p>Otherwise, the user agent may instead offer to open <var>resource</var> in a new
<span>top-level browsing context</span> or in the <span>top-level browsing context</span> of
the <span>source browsing context</span>, at the user's option, in which case the user agent
must <span>navigate</span><!--DONAV sandbox manual load--> that designated <span>top-level
browsing context</span> to <var>resource</var> as if the user had requested it
independently.</p>

<p class="note">Doing so, however, can be dangerous, as it means that the user is overriding
the author's explicit request to sandbox the content.</p>
</li>
</ol>
</li>

<li><p>If there is a preexisting attempt to navigate <var>browsingContext</var>, and the
Expand Down

0 comments on commit 879edbf

Please sign in to comment.