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.

This matches the behavior as implemented in Chrome, as shown by
https://allow-modals-check-zzvyjxgdhg.now.sh.

This also helps the efforts in #1430.
  • Loading branch information
domenic committed Jun 29, 2016
1 parent a57c887 commit f2ff072
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -90341,10 +90341,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 @@ -90372,10 +90371,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 @@ -90402,10 +90400,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 @@ -90476,14 +90473,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 f2ff072

Please sign in to comment.