Closed Bug 1507375 Opened 6 years ago Closed 4 years ago

Can we drop window.open's feature parameter which controls UI parts visibility?

Categories

(Core :: DOM: Core & HTML, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox65 --- wontfix
firefox76 --- fixed

People

(Reporter: arai, Assigned: arai)

References

(Blocks 1 open bug, Regressed 4 open bugs, )

Details

(Keywords: dev-doc-complete, site-compat)

Attachments

(1 file, 2 obsolete files)

Separated from bug 1506655.

window.open's feature parameters which controls UI parts (tabbar, menubar, toolbar, personalbar) is supported only in Firefox and IE [1],
and it causes confusing behavior around UI to control visibility of those parts (bug 1506655), and also causes trouble around sessionrestore (the same bug, bug 1506655)

Given the feature is not supported on other modern browsers, can we drop it?

The other browser's behavior is following:
  * Edge
    * opens a window which has only location bar
    * hitting Ctrl+T does nothing
  * Chrome
    * opens a window which has only location bar
    * hitting Cmd+T opens new tab in other window
  * Safari
    * opens a window which behaves samely as normal window
      (has all UI parts)
    * hitting Cmd+T opens new tab in that window

more behavior related to session store is described in bug 1506655 comment #7.

Then, I think Chrome's behavior is same as Firefox when the feature is only "locationbar".
So I think dropping support for them and open a window only with location bar regardless of those features is the simplest solution.

[1] https://developer.mozilla.org/ja/docs/Web/API/window.open#Window_features
bz, can I have your opinion again?
I think this at least won't cause much web-compat issue.
Flags: needinfo?(bzbarsky)
I'm not quite following the proposal.  What is the actual proposed behavior when the page asks for, say, "locationbar,toolbar,menubar"?  What is the proposed behavior when the page asks for "locationbar,toolbar,menubar,tabbar,personalbar"?  What about other feature combinations?
Flags: needinfo?(bzbarsky)
okay, let me check more about the combinations, and write down the proposal.
hopefully in this weekend
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Priority: -- → P3
(In reply to Tooru Fujisawa [:arai] from comment #0)
> Separated from bug 1506655.
> 
> window.open's feature parameters which controls UI parts (tabbar, menubar,
> toolbar, personalbar) is supported only in Firefox and IE [1],

Do we actually support all of these? I thought we only supported the toolbar feature. More precisely, toolbar=no, as toolbar=yes would be the default...

> Given the feature is not supported on other modern browsers, can we drop it?
> 
> The other browser's behavior is following:
>   * Edge
>     * opens a window which has only location bar
>     * hitting Ctrl+T does nothing
>   * Chrome
>     * opens a window which has only location bar
>     * hitting Cmd+T opens new tab in other window

I'm not sure I'm following. It sounds like Chrome presents popups just like we do, and Edge too except for refusing to open a tab.

Could it be that https://developer.mozilla.org/en-US/docs/Web/API/Window/open is just outdated? It lists Netscape 6, Netscape 7, and Mozilla 1.0 which I don't think any web developer cares about today...
(In reply to Dão Gottwald [::dao] from comment #4)
> (In reply to Tooru Fujisawa [:arai] from comment #0)
> > Separated from bug 1506655.
> > 
> > window.open's feature parameters which controls UI parts (tabbar, menubar,
> > toolbar, personalbar) is supported only in Firefox and IE [1],
> 
> Do we actually support all of these? I thought we only supported the toolbar
> feature. More precisely, toolbar=no, as toolbar=yes would be the default...

yes, window.open can control the visibility of tabbar, toolbar (backward button etc), bookmark toolbar,
in the opened window, and it's saved and restored across restart.
Attached file testcase for combination (obsolete) —
Attached file Chrome, Safari, and Edge's behavior (obsolete) —
so far, here's the behavior of Chrome, Safari, and Edge.
based on observation, I might overlook some other conditions.

features parameter can control what to open (popup, window, tab), but the visibility of UI parts are not controllable (visible UI parts are fixed for each case)

I'll prepare proposal for Firefox.
Comment on attachment 9027089 [details]
Chrome, Safari, and Edge's behavior

After some more tests, it turns out the behavior is a bit more complicated.
here's the latest document:
  https://arai-a.github.io/window-open-features/

and testcase:
  https://arai-a.github.io/window-open-features/test.html
Attachment #9027089 - Attachment is obsolete: true
Attachment #9027065 - Attachment is obsolete: true
Keywords: site-compat
Component: DOM → DOM: Core & HTML

Tested on Edge Canary, and it seems to be the same behavior as Chrome.

Type: enhancement → task

might also have to think about BarProp.visible.
https://html.spec.whatwg.org/multipage/window-object.html#browser-interface-elements

Chrome seems to return false for the case that the bar is visible but features specifies the bar to be hidden.

There are some amount of code that checks if size or position is specified, and this affects where the page is loaded (new window or not)
https://searchfox.org/mozilla-central/search?q=aPositionSpecified&path=

I'm not sure modifying this here is reasonable.

If not modify, the condition for whether to open popup or not depends on whether size or position is specified,
in contrast to, chrome that doesn't check size/position, and Safari that checks only width.

dom.disable_window_open_feature.* prefs doesn't work well with the idea.

those prefs control the effect of each feature separately, but the idea here just uses the set of features to whether to open popup or not,
so there's no controllability for each UI items.
I wonder if we can just remove the pref.

Also, to align with other browsers, the effect of scrollbars should also be removed (except for the condition as whether to open popup or not).
(failing test: https://searchfox.org/mozilla-central/source/dom/html/test/test_bug369370.html )

might also have to think about BarProp.visible.
https://html.spec.whatwg.org/multipage/window-object.html#browser-interface-elements

Chrome seems to return false for the case that the bar is visible but features specifies the bar to be hidden.

IMO it doesn't make much sense to follow Chrome's behavior, because of session restore.
If we don't restore the feature parameter across restart, the property will return different value after the restart,
and if we restore feature parameter, that will cause similar confusion as current behavior.

new try run https://treeherder.mozilla.org/#/jobs?repo=try&revision=98644431f44af769470bd371b67ecda6732980ee
with:

Make the features parameter of window.open just a condition for whether to open
a popup or a new tab.
Also remove dom.disable_window_open_feature.* prefs.

See Also: → 1589299
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/6fe5ce050c0d
Restrict the controllability of UI parts visibility with features parameter of window.open. r=smaug
Flags: needinfo?(arai.unmht)
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/bf0e49a9ceff
Restrict the controllability of UI parts visibility with features parameter of window.open. r=smaug
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76

So far updated the following page to make it up to date, with some note about UI-parts visibility related items
https://wiki.developer.mozilla.org/en-US/docs/Web/API/Window/open

but I haven't described the details of the conditions for whether popup or not, given it's very implementation-dependent.
I guess we can add that section once the condition gets standardized, but I'd leave it to other bug.

also updated
https://wiki.developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/76

Regressions: 1635630
Regressions: 1636229
No longer regressions: 1636229
See Also: → 1636229
Regressions: 1658775
Blocks: 1660524
Regressions: 1712017
See Also: → 1714939
Blocks: 1901549
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: