Skip to content

Commit 47b9152

Browse files
committed
Use the Window's associated Document for allow-modals sandbox checks
This fixes #1206. As noted there, the previous indirections were wacky and unnecessary. This matches the behavior as implemented in Chrome and Firefox Nightly (which are the only browsers which implement sandboxing of modals), as shown by https://allow-modals-check-yucxowumar.now.sh/entry.html. This also helps the efforts in #1430.
1 parent a57c887 commit 47b9152

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

source

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -90341,10 +90341,9 @@ scheduleWork(); // queues a task to do lots of work</pre>
9034190341
<li><p>If the <span>event loop</span>'s <span>termination nesting level</span> is non-zero,
9034290342
optionally abort these steps.</p></li>
9034390343

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

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

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

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

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

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

9047790474
<li>
9047890475

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

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

9048890484
</li>
9048990485

0 commit comments

Comments
 (0)