Proposal for standardizing window.open with features and BarProp

This document proposes how the features parameter of window.open interacts with where the newly created browsing context is opened, and how it interacts with BarProps.

Modify window open steps

Replace "step 12. If new is true, then...", with:

  1. If new is true, then:
    1. If tokenizedFeatures["width"] exists, then:
      1. Let isPopupRequested be true.
    2. Otherwise:
      1. Let isPopupRequested be false.
    3. If tokenizedFeatures["width"] exists, then:
      1. Let isPopupRequested be true.
    4. If the user agent has been configured to override isPopupRequested:
      1. Let isPopup be user-configured value, possibly depending on isPopupRequested.
    5. Otherwise:
      1. Let isPopup be isPopupRequested.
    6. Set the target browsing context's is popup to isPopup.
    7. Set up browsing context features for target browsing context given tokenizedFeatures. [CSSOMVIEW]

Modify top-level browsing context

After "A top-level browsing context has an associated", insert:

A top-level browsing context has an is popup boolean. It is initially false.

User agent can use is popup value to decide what kind of web browser interface to provide for the browsing context.

For example, user agent can provide minimal UI if is popup is true. In the minimal UI, it's recommended not to hide the browser interface element that displays the URL or the domain of the active document.

User agent can use is popup value to decide whether to perform the optional steps in set up browsing context features steps or not.

Replace Browser interface elements

For historical reasons, Window object has some attributes that represents certain web browser interface elements.

For privacy reasons and interoperability, those attributes return same value, regardless of whether the interface element is visible or not.

Each interface element is represented by a BarProp object:

[Exposed=Window]
interface BarProp {
  readonly attribute boolean visible;
};
window . locationbar . visible
window . menubar . visible
window . personalbar . visible
window . scrollbars . visible
window . statusbar . visible
window . toolbar . visible

Returns true if the top-level browsing context is not a popup; otherwise, returns false.

The visible attribute's getter must run these steps:

  1. Let browsingContext be BarProp object's relevant global object's browsing context.
  2. If browsingContext is null, then return true.
  3. Let topLevelBrowsingContext be browsingContext's top-level browsing context.
  4. Let isPopup be topLevelBrowsingContext's is popup.
  5. If isPopup is true, then return false.
  6. Return true.

The following BarProp objects must exist for each Window object:

Technically, those attributes can share single object. If there's no web-compat issue, we can eliminate per-attribute BarProp object.

The location bar BarProp object

Historically represented the user interface element that contains a control that displays the URL of the active document, or some similar interface concept.

The menu bar BarProp object

Historically represented the user interface element that contains a list of commands in menu form, or some similar interface concept.

The personal bar BarProp object

Historically represented the user interface element that contains links to the user's favorite pages, or some similar interface concept.

The scrollbar BarProp object

Historically represented the user interface element that contains a scrolling mechanism, or some similar interface concept.

The status bar BarProp object

Historically represented a user interface element found immediately below or after the document, as appropriate for the user's media, which typically provides information about ongoing network activity or information about elements that the user's pointing device is current indicating. If the user agent has no such user interface element, then the object may act as if the corresponding user interface element was absent (i.e. its visible attribute may return false).

The toolbar BarProp object

Historically represented the user interface element found immediately above or before the document, as appropriate for the user's media, which typically provides session history traversal controls (back and forward buttons, reload buttons, etc). If the user agent has no such user interface element, then the object may act as if the corresponding user interface element was absent (i.e. its visible attribute may return false).

The locationbar attribute must return the location bar BarProp object.

The menubar attribute must return the menu bar BarProp object.

The personalbar attribute must return the personal bar BarProp object.

The scrollbars attribute must return the scrollbar BarProp object.

The statusbar attribute must return the status bar BarProp object.

The toolbar attribute must return the toolbar BarProp object.