Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change behavior of window.open w.r.t. windowPreferences and popups #29334

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jun 10, 2021

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] whatwg/html#5872
[2] whatwg/html#6530

Fixed: 1192701
Change-Id: I50e745b1000d460c49085edd57d13f420b875ff3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2950386
Reviewed-by: Joey Arhar <[email protected]>
Commit-Queue: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#943716}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

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] whatwg/html#5872
[2] whatwg/html#6530

Fixed: 1192701
Change-Id: I50e745b1000d460c49085edd57d13f420b875ff3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2950386
Reviewed-by: Joey Arhar <[email protected]>
Commit-Queue: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#943716}
@foolip
Copy link
Member

foolip commented Nov 23, 2021

This was blocked by #31714, I'll close and reopen in the hope to get the #31715 workaround, which should unblock this.

@foolip foolip closed this Nov 23, 2021
@foolip foolip reopened this Nov 23, 2021
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 3660b77 into master Nov 23, 2021
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-2950386 branch November 23, 2021 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants