-
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
Add additional feature names to window.open() #2464
Comments
Shouldn't a browser be in a control over what it does with these to a large extent? We can't really dictate a windowing system as that has big UX implications. |
I changed Chrome's behavior to match Firefox: the main UI difference between a popup and a tab is whether or not the toolbar is enabled. So this is now the only window feature we consult before determining how to style the new window. Many of the other window features that Chrome used to check (resizable, menubar, status, scrollbars) are things that aren't configurable anymore: popups are always resizable, with no option of hiding the status bar, Chrome has no menubar, and scrollbars shouldn't affect whether or not the window should be styled as a popup. I do think it'd be useful to specify the other window features; they're essentially a de facto standard, but not actually covered anywhere atm. |
So to be clear, specifying |
Add screenx, screeny, innerwidth, innerheight as aliases for left, top, width, and height, respectively. Part of whatwg/html#2464
PR for aliases at w3c/csswg-drafts#1128 |
This was specified in CSSOM View but the "noopener" feature did not use the same tokenizer as the legacy features. Fixes #2474. Also specify the aliases screenx, screeny, innerwidth, innerheight for left, top, width, and height, respectively. Part of #2464. Closes w3c/csswg-drafts#1128.
The new Chromium behavior introduced in https://codereview.chromium.org/2773573002 will open a new tab rather than a popup if the I tried to analyze the impact of this change in httparchive, see: https://bugs.chromium.org/p/chromium/issues/detail?id=82522#c113 - in some cases it seems unexpected but in other cases it seems like it would improve the user experience. I wonder if other vendors would be willing to adopt the new Chromium behavior and open a new tab rather than a new window if A benefit from doing that is that it is possible to open a new tab or a new window with the |
This was specified in CSSOM View but the "noopener" feature did not use the same tokenizer as the legacy features. Fixes #2474. Also specify the aliases screenx, screeny, innerwidth, innerheight for left, top, width, and height, respectively. Part of #2464. Closes w3c/csswg-drafts#1128. The tokenizer specified here closely follows Chromium and WebKit. Difference from Chromium: U+0000 is not a separator. Difference from WebKit and Chromium: U+000C is a separator.
This was specified in CSSOM View but the "noopener" feature did not use the same tokenizer as the legacy features. Fixes #2474. Also specify the aliases screenx, screeny, innerwidth, innerheight for left, top, width, and height, respectively. Part of #2464. Closes w3c/csswg-drafts#1128. The tokenizer specified here closely follows Edge. Chromium and WebKit are also very similar to Edge. Difference from Edge: U+0000 does not end the string. Difference from Chromium: U+0000 is not a separator. Difference from WebKit/Chromium/Edge: U+000C is a separator. For the input `width toolbar=450, height=450`, Edge tokenizes like `width, toolbar=450, height=450` while WebKit/Chromium like `width=450, height=450`. The Edge behavior seems better. Tests: web-platform-tests/wpt#5306 web-platform-tests/wpt#5390
Sounds a bit hackish, especially the part to use toolbar to overcome limitations of noopener. |
What does Chrome do if you first open a new window (no toolbars) and then open a new window from that with 'toolbar' ? |
Discussion in #whatwg http://logs.glob.uno/?c=freenode%23whatwg&s=12+Apr+2017&e=12+Apr+2017#c1025657
|
It's because Chrome always current prefers to open a new foreground tab when toolbar=1. I think this always prefers to reuse an existing window if one exists. It should be pretty easy to change this to prefer opening a new window when called from a popup, if people feel that is the correct behavior. |
@zetafunction such a new window would then not be a full browser window, but a minimal-chrome popup, correct? |
For the case of following a hyperlink with http://software.hixie.ch/utilities/js/live-dom-viewer/saved/5017 Also, http://software.hixie.ch/utilities/js/live-dom-viewer/saved/5018 @smaug---- do you think Chrome and Firefox should change their behavior for these? |
@zcorpan Why should opening a toolbar=1 window from a popup window imply creating another popup window? This effectively means the toolbar feature has no effect once you're in a popup window, right? |
I'm just trying to get clarified what y'all want to end up with. 😊 I thought maybe there was some reason to avoid opening a new full window... |
The expected behavior should be a new PopUp Window when size dimensions are passed as arguments to window.open (if toolbar is enabled, then add the toolbar to the PopUp window). If no dimensions are indicated just default to opening a new tab (in this case toolbar enabled is the default). Chrome Behavior (Canary 60.0.3079.0)Opens PopUp Window to indicated dimensions Opens New Tab (browsers default minimized size, ignores size dimensions) FF Behaviorw/Size Dimensions Opens PopUp with ToolBar w/o size dimensions |
This was specified in CSSOM View but the "noopener" feature did not use the same tokenizer as the legacy features. Fixes whatwg#2474. Also specify the aliases screenx, screeny, innerwidth, innerheight for left, top, width, and height, respectively. Part of whatwg#2464. Closes w3c/csswg-drafts#1128. The tokenizer specified here closely follows Edge. Chromium and WebKit are also very similar to Edge. Difference from Edge: U+0000 does not end the string. Difference from Chromium: U+0000 is not a separator. Difference from WebKit/Chromium/Edge: U+000C is a separator. For the input `width toolbar=450, height=450`, Edge tokenizes like `width, toolbar=450, height=450` while WebKit/Chromium like `width=450, height=450`. The Edge behavior seems better. Tests: web-platform-tests/wpt#5306 web-platform-tests/wpt#5390
This was specified in CSSOM View but the "noopener" feature did not use the same tokenizer as the legacy features. Fixes whatwg#2474. Also specify the aliases screenx, screeny, innerwidth, innerheight for left, top, width, and height, respectively. Part of whatwg#2464. Closes w3c/csswg-drafts#1128. The tokenizer specified here closely follows Edge. Chromium and WebKit are also very similar to Edge. Difference from Edge: U+0000 does not end the string. Difference from Chromium: U+0000 is not a separator. Difference from WebKit/Chromium/Edge: U+000C is a separator. For the input `width toolbar=450, height=450`, Edge tokenizes like `width, toolbar=450, height=450` while WebKit/Chromium like `width=450, height=450`. The Edge behavior seems better. Tests: web-platform-tests/wpt#5306 web-platform-tests/wpt#5390
This was specified in CSSOM View but the "noopener" feature did not use the same tokenizer as the legacy features. Fixes whatwg#2474. Also specify the aliases screenx, screeny, innerwidth, innerheight for left, top, width, and height, respectively. Part of whatwg#2464. Closes w3c/csswg-drafts#1128. The tokenizer specified here closely follows Edge. Chromium and WebKit are also very similar to Edge. Difference from Edge: U+0000 does not end the string. Difference from Chromium: U+0000 is not a separator. Difference from WebKit/Chromium/Edge: U+000C is a separator. For the input `width toolbar=450, height=450`, Edge tokenizes like `width, toolbar=450, height=450` while WebKit/Chromium like `width=450, height=450`. The Edge behavior seems better. Tests: web-platform-tests/wpt#5306 web-platform-tests/wpt#5390
Now that HTML defines a bunch of normalization, to what extent is this still an HTML issue and not a CSSOM issue? |
This observation from bz at #1902 (comment) is also important:
I filed w3c/csswg-drafts#4432 to figure out how to split these between CSSOM and HTML. Perhaps all of it ought to move here given the |
This was fixed by ab08b9b. |
https://html.spec.whatwg.org/multipage/browsers.html#dom-open
https://drafts.csswg.org/cssom-view/#the-features-argument-to-the-open()-method
Together these define "left", "top", "width", "height" and "noopener". Blink also has:
There is a potential interop issue here, in https://codereview.chromium.org/2773573002/ tests were written for when a new window is opened vs. a new tab, and those tests don't pass everywhere.
@zetafunction
The text was updated successfully, but these errors were encountered: