Skip to content

Commit

Permalink
Use the Window's associated Document for allow-modals sandbox checks
Browse files Browse the repository at this point in the history
This fixes #1206. As noted there, the previous indirections were wacky
and unnecessary.

Chrome and Firefox nightly implement a slightly different behavior,
choosing the Window's browsing context's active Document, instead of the
Window's associated Document. This can be different in edge cases as
discussed in #1473 (comment).
However, in Firefox they are not distinguishable, due to another
security check that prevents these edge cases from being triggered.
#1548 proposes to add a security check like Firefox's to the spec, which
would obviate the difference in all cases. In the meantime, the choice
of associated Document is more straightforward.
  • Loading branch information
domenic committed Jul 13, 2016
1 parent b5d23a4 commit 29ebd5b
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions source
Expand Up @@ -90421,10 +90421,9 @@ scheduleWork(); // queues a task to do lots of work</pre>
<li><p>If the <span>event loop</span>'s <span>termination nesting level</span> is non-zero,
optionally abort these steps.</p></li>

<li><p>If the <span>active sandboxing flag set</span> of the <span>active document</span> of
the <span>responsible browsing context</span> specified by the <span>incumbent settings
object</span> has the <span>sandboxed modals flag</span> set, then abort these
steps.</p></li>
<li><p>If the <span>active sandboxing flag set</span> of this <code>Window</code> object's <span
data-x="concept-document-window">associated <code>Document</code></span> has the <span>sandboxed
modals flag</span> set, then abort these steps.</p></li>

<li><p>Optionally, abort these steps. (For example, the user agent might give the user the option
to ignore all alerts, and would thus abort at this step whenever the method was
Expand Down Expand Up @@ -90452,10 +90451,9 @@ scheduleWork(); // queues a task to do lots of work</pre>
<li><p>If the <span>event loop</span>'s <span>termination nesting level</span> is non-zero,
optionally abort these steps, returning false.</p></li>

<li><p>If the <span>active sandboxing flag set</span> of the <span>active document</span> of
the <span>responsible browsing context</span> specified by the <span>incumbent settings
object</span> has the <span>sandboxed modals flag</span> set, then return false and abort these
steps.</p></li>
<li><p>If the <span>active sandboxing flag set</span> of this <code>Window</code> object's <span
data-x="concept-document-window">associated <code>Document</code></span> has the <span>sandboxed
modals flag</span> set, then abort these steps.</p></li>

<li><p>Optionally, return false and abort these steps. (For example, the user agent might give
the user the option to ignore all prompts, and would thus abort at this step whenever the method
Expand All @@ -90482,10 +90480,9 @@ scheduleWork(); // queues a task to do lots of work</pre>
<li><p>If the <span>event loop</span>'s <span>termination nesting level</span> is non-zero,
optionally abort these steps, returning null.</p></li>

<li><p>If the <span>active sandboxing flag set</span> of the <span>active document</span> of
the <span>responsible browsing context</span> specified by the <span>incumbent settings
object</span> has the <span>sandboxed modals flag</span> set, then return null and abort these
steps.</p></li>
<li><p>If the <span>active sandboxing flag set</span> of this <code>Window</code> object's <span
data-x="concept-document-window">associated <code>Document</code></span> has the <span>sandboxed
modals flag</span> set, then abort these steps.</p></li>

<li><p>Optionally, return null and abort these steps. (For example, the user agent might give the
user the option to ignore all prompts, and would thus abort at this step whenever the method was
Expand Down Expand Up @@ -90556,14 +90553,13 @@ scheduleWork(); // queues a task to do lots of work</pre>

<li>

<p>If the <span>active sandboxing flag set</span> of the <span>active document</span> of
the <span>responsible browsing context</span> specified by the <span>incumbent settings
object</span> has the <span>sandboxed modals flag</span> set, then abort these
steps.</p>
<p>If the <span>active sandboxing flag set</span> of this <code>Window</code> object's <span
data-x="concept-document-window">associated <code>Document</code></span> has the <span>sandboxed
modals flag</span> set, then abort these steps.</p>

<p class="note">If the printing dialog is blocked by a <code>Document</code>'s sandbox,
then neither the <code data-x="event-beforeprint">beforeprint</code> nor <code
data-x="event-afterprint">afterprint</code> events will be fired.</p>
<p class="note">If the printing dialog is blocked by a <code>Document</code>'s sandbox,
then neither the <code data-x="event-beforeprint">beforeprint</code> nor <code
data-x="event-afterprint">afterprint</code> events will be fired.</p>

</li>

Expand Down

0 comments on commit 29ebd5b

Please sign in to comment.