From 88aac66bdf6709bc26ec2e57cd991b0ad9de75bf Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Wed, 10 Nov 2021 13:30:00 -0800 Subject: [PATCH] Change behavior of window.open w.r.t. windowPreferences and popups See [1] and [2] for more context, but this CL implements new behavior for how window.open() interprets the windowPreferences argument when deciding whether to open the window as a new tab or as a "popup", which is a separate window with minimal UI (toolbars, onmibox, etc.), and also what to return from the BarProp visible properties, e.g. window.toolbar.visible. The existing "trigger" behavior for popups will be retained by this CL, namely that a popup will be opened instead of a tab if: 1. the windowFeatures parameter is *not* empty, and 2. one of the following conditions is true: * both `location` and `toolbar` are false or missing * `menubar` is false or missing * `resizable is false or missing * `scrollbar` is false or missing * `status` is false or missing With this CL, an additional windowFeature called 'popup' is added, so that if 'popup' is present and truthy. Additionally, all BarProp properties (locationbar,menubar, personalbar,scrollbars,statusbar, and toolbar) will always return the same values, either false if a popup was opened, or true if a tab/window was opened. The spec for this behavior is part of the HTML spec: https://html.spec.whatwg.org/multipage/window-object.html#popup-window-is-requested The intent to ship is here: https://groups.google.com/a/chromium.org/g/blink-dev/c/q6ybnmxxvpE [1] https://github.com/whatwg/html/issues/5872 [2] https://github.com/whatwg/html/pull/6530 Fixed: 1192701 Change-Id: I50e745b1000d460c49085edd57d13f420b875ff3 --- .../support/window-open-popup-target.html | 24 +++++++++ .../window-open-popup-behavior.html | 51 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 html/browsers/the-window-object/support/window-open-popup-target.html create mode 100644 html/browsers/the-window-object/window-open-popup-behavior.html diff --git a/html/browsers/the-window-object/support/window-open-popup-target.html b/html/browsers/the-window-object/support/window-open-popup-target.html new file mode 100644 index 00000000000000..a0588de82970af --- /dev/null +++ b/html/browsers/the-window-object/support/window-open-popup-target.html @@ -0,0 +1,24 @@ + + \ No newline at end of file diff --git a/html/browsers/the-window-object/window-open-popup-behavior.html b/html/browsers/the-window-object/window-open-popup-behavior.html new file mode 100644 index 00000000000000..258698d94d9ad2 --- /dev/null +++ b/html/browsers/the-window-object/window-open-popup-behavior.html @@ -0,0 +1,51 @@ + + + +Window.open popup behavior + + + + + +