From f2ff0727c3255f5d4f58e755ab6a3cd2f2e37134 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 29 Jun 2016 17:08:37 -0400 Subject: [PATCH] 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, as shown by https://allow-modals-check-zzvyjxgdhg.now.sh. This also helps the efforts in #1430. --- source | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/source b/source index 647d455b933..cfa606ff53b 100644 --- a/source +++ b/source @@ -90341,10 +90341,9 @@ scheduleWork(); // queues a task to do lots of work
  • If the event loop's termination nesting level is non-zero, optionally abort these steps.

  • -
  • If the active sandboxing flag set of the active document of - the responsible browsing context specified by the incumbent settings - object has the sandboxed modals flag set, then abort these - steps.

  • +
  • If the active sandboxing flag set of this Window object's associated Document has the sandboxed + modals flag set, then abort these steps.

  • 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 @@ -90372,10 +90371,9 @@ scheduleWork(); // queues a task to do lots of work

  • If the event loop's termination nesting level is non-zero, optionally abort these steps, returning false.

  • -
  • If the active sandboxing flag set of the active document of - the responsible browsing context specified by the incumbent settings - object has the sandboxed modals flag set, then return false and abort these - steps.

  • +
  • If the active sandboxing flag set of this Window object's associated Document has the sandboxed + modals flag set, then abort these steps.

  • 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 @@ -90402,10 +90400,9 @@ scheduleWork(); // queues a task to do lots of work

  • If the event loop's termination nesting level is non-zero, optionally abort these steps, returning null.

  • -
  • If the active sandboxing flag set of the active document of - the responsible browsing context specified by the incumbent settings - object has the sandboxed modals flag set, then return null and abort these - steps.

  • +
  • If the active sandboxing flag set of this Window object's associated Document has the sandboxed + modals flag set, then abort these steps.

  • 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 @@ -90476,14 +90473,13 @@ scheduleWork(); // queues a task to do lots of work

  • -

    If the active sandboxing flag set of the active document of - the responsible browsing context specified by the incumbent settings - object has the sandboxed modals flag set, then abort these - steps.

    +

    If the active sandboxing flag set of this Window object's associated Document has the sandboxed + modals flag set, then abort these steps.

    -

    If the printing dialog is blocked by a Document's sandbox, - then neither the beforeprint nor afterprint events will be fired.

    +

    If the printing dialog is blocked by a Document's sandbox, + then neither the beforeprint nor afterprint events will be fired.