-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Standardize the condition for opening a popup by window.open, and BarProp values #6530
Conversation
@annevk I've just signed up Birchill as a participant in WHATWG and Arai-san is a member of the birchill GitHub org but I think I need an editor to manually verify the submission and Birchill's participation in order for the Participation check to pass? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d466015
to
273f657
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed some edits; please take a look and make sure they look good to you.
Editorially this LGTM. However I worry that your implementer commitments line is not fully accurate; you seem to link to various comments and commentary on the general project, but not support for the exact proposal you've suggested here.
The best way to figure that out is to probably finish the test suite to make sure it covers all the normative changes (I'll check on that now), and see if all browsers pass them. If so, then we can take that as support. Otherwise, we'll want to get more explicit signoff on the spec text you've written here.
Hmm, web-platform-tests/wpt#28243 doesn't seem to match this PR at all? This PR only consults |
Oh, sorry, I read the tests backward. OK, so it's just a question of whether browsers match them... let's go check the results. |
OK, so no browsers currently match the tests:
So there's definitely some work needed here to gather multi-implementer interest by continuing the discussions in #5872. |
Thank you! And yes, the proposed behavior doesn't match any implementation (it's a mix of Chrome + Safari), and the testcase is supposed to fail on all of them, in the current behavior. |
I thought we would match https://arai-a.github.io/window-open-features/#IsPopup-Safari which suggests Safari does return false if |
the condition to use popup in this PR matches to the current Safari's behavior. Other browsers uses different condition and needs change.
I don't get your point. is it about web-platform-tests/wpt#28243 ?
Chrome doesn't use
here too I don't get your point. |
Per @domenic's link above Safari fails the tests for |
The testcase checks the relation between Then, Safari fails because their This PR uses Chrome's behavior, that returns same value for all Safari's |
Aah thanks, that's what I was missing. |
3f3d744
to
d0fd03b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this still looks great to me. Found a couple nits.
One thing I was wondering about is whether we want type
as an enum or popup
as a boolean feature. A popup
boolean seemed slightly better to me as a) it's also a window and b) it matches the precedent of other recent additions such as noopener
.
Would be good if @mfreed7 could have a look at this too.
An enum would be more extensible and could potentially parallel the Web Applications Manifest's |
To align with display modes,and avoid "window" word, possible options would be "browser" and "minimal-ui", but I'm not sure saying "browser" there makes much sense. |
d0fd03b
to
2b6f620
Compare
I don't think an enum makes much sense here. window.open() is not related to PWA window modes. I agree with @annevk that a boolean seems better. |
2b6f620
to
a557f32
Compare
Okay. changed to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good! Thanks for also updating the proposal doc - that's very helpful.
These changes seem like they are much more likely to be web compatible. I wonder if it would be worthwhile trying to actively deprecate usage of the "old" feature strings, e.g. by emitting console warnings when they're used? That'll likely just end up being console spam, so maybe not.
a557f32
to
f73eca1
Compare
I did understand this difference when we discussed this change at the last triage meeting. So this isn't a surprise to me, and I'm ok with this change. I think the likelihood of compat issues is much less for this change than it was for the change to the "triggers" for a popup. I already have code in Chromium to do this, behind the flag I was using for the prior change. So I can easily enable just this behavior. Sounds like now's the time to do that. Or shortly after the tests and this PR land. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for all the effort here @arai-a! It's great to get interop on this. |
…by window.open, and BarProp values for each case, a=testonly Automatic update from web-platform-tests HTML: test BarProp and window.open() feature interactions For whatwg/html#5872, whatwg/html#4431, and whatwg/html#6530. -- wpt-commits: 29faceaa68f5cb31798cc17fe6868eaf5fa5fb7f wpt-pr: 28243
…by window.open, and BarProp values for each case, a=testonly Automatic update from web-platform-tests HTML: test BarProp and window.open() feature interactions For whatwg/html#5872, whatwg/html#4431, and whatwg/html#6530. -- wpt-commits: 29faceaa68f5cb31798cc17fe6868eaf5fa5fb7f wpt-pr: 28243
…Prop values for whatwg/html#6530 * Added popup feature * Added description about requesting popup * Changed examples not to use the backward-compat-only UI parts features * Updated BarProp.visible to reflect popup request * Moved outerWidth/outerHeight to obsolete features page
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
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}
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}
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}
…ndowPreferences and popups, a=testonly Automatic update from web-platform-tests 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] 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} -- wpt-commits: 3660b77d3cec8138401c12e055bee44d62e9b060 wpt-pr: 29334
…ndowPreferences and popups, a=testonly Automatic update from web-platform-tests 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] 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} -- wpt-commits: 3660b77d3cec8138401c12e055bee44d62e9b060 wpt-pr: 29334
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} NOKEYCHECK=True GitOrigin-RevId: cdad240f282dca85fb85fa3ecc809d7f34862996
For fixing #5872 and #4431
The proposed behavior of the condition for opening popup by
window.open
(open a popup only whenwidth
is specified) is based on current Safari's behavior, that's changed from the current Chrome's behavior, so I expect not so much breakage by standardizing this.The proposed behavior of
BarProp
values is based on current Chrome's behavior, so I expect not so much breakage from this as well./browsers.html ( diff )
/infrastructure.html ( diff )
/window-object.html ( diff )