Skip to content

Commit

Permalink
Make BarProp not to expose browser interface visibility
Browse files Browse the repository at this point in the history
Fixes whatwg#4431

Standardize the value of BarProp attributes, while hiding the actual visibility
from the web content for privacy reasons.
  • Loading branch information
arai-a committed Oct 12, 2021
1 parent 4557aff commit 2b6f620
Showing 1 changed file with 59 additions and 42 deletions.
101 changes: 59 additions & 42 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -81471,8 +81471,11 @@ dictionary <dfn dictionary>WindowPostMessageOptions</dfn> : <span>StructuredSeri

<h4>Browser interface elements</h4>

<p>To allow web pages to integrate with web browsers, certain web browser interface elements are
exposed in a limited way to scripts in web pages.</p>
<p>For historical reasons, <code>Window</code> object has some attributes
that represents certain web browser interface elements.</p>

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

<p>Each interface element is represented by a <code>BarProp</code> object:</p>

Expand All @@ -81483,22 +81486,15 @@ interface <dfn interface>BarProp</dfn> {

<dl class="domintro">
<dt><code data-x=""><var>window</var>.<span subdfn data-x="dom-window-locationbar">locationbar</span>.<span subdfn data-x="dom-BarProp-visible">visible</span></code></dt>
<dd><p>Returns true if the location bar is visible; otherwise, returns false.</p></dd>

<dt><code data-x=""><var>window</var>.<span subdfn data-x="dom-window-menubar">menubar</span>.<span data-x="dom-BarProp-visible">visible</span></code></dt>
<dd><p>Returns true if the menu bar is visible; otherwise, returns false.</p></dd>

<dt><code data-x=""><var>window</var>.<span subdfn data-x="dom-window-personalbar">personalbar</span>.<span data-x="dom-BarProp-visible">visible</span></code></dt>
<dd><p>Returns true if the personal bar is visible; otherwise, returns false.</p></dd>

<dt><code data-x=""><var>window</var>.<span subdfn data-x="dom-window-scrollbars">scrollbars</span>.<span data-x="dom-BarProp-visible">visible</span></code></dt>
<dd><p>Returns true if the scrollbars are visible; otherwise, returns false.</p></dd>

<dt><code data-x=""><var>window</var>.<span subdfn data-x="dom-window-statusbar">statusbar</span>.<span data-x="dom-BarProp-visible">visible</span></code></dt>
<dd><p>Returns true if the status bar is visible; otherwise, returns false.</p></dd>

<dt><code data-x=""><var>window</var>.<span subdfn data-x="dom-window-toolbar">toolbar</span>.<span data-x="dom-BarProp-visible">visible</span></code></dt>
<dd><p>Returns true if the toolbar is visible; otherwise, returns false.</p></dd>
<dd>
<p>Returns true if the <span>top-level browsing context</span> is not a
popup; otherwise, returns false.</p>
</dd>
</dl>

<div w-nodev>
Expand All @@ -81507,51 +81503,72 @@ interface <dfn interface>BarProp</dfn> {
must run these steps:</p>

<ol>
<li><p>If this <code>BarProp</code> object's <span>relevant global object</span>'s <span
data-x="window bc">browsing context</span> is null, then return false.</p></li>

<li><p>If the user agent does not have a user interface element that the object represents, as
described below, then return true.</p></li>

<li><p>Return true or a value determined by the user agent to most accurately represent the
visibility state of the user interface element that the object represents, as described
below.</p></li>
<li>
<p>Let <var>browsingContext</var> be <code>BarProp</code> object's
<span>relevant global object</span>'s <span>browsing context</span>.</p>
</li>
<li>
<p>If <var>browsingContext</var> is null, then return true.</p>
</li>
<li>
<p>Return the negation of <var>browsingContext</var>'s
<span>top-level browsing context</span>'s <span>is popup</span>.</p>
</li>
</ol>

<p>The following <code>BarProp</code> objects must exist for each <code>Window</code> object:</p>

<dl>
<dt><dfn>The location bar <code>BarProp</code> object</dfn></dt>
<dd>Represents the user interface element that contains a control that displays the
<span>URL</span> of the <span>active document</span>, or some similar interface concept.</dd>
<dd>
<p class="note">Historically represented the user interface element that
contains a control that displays the <span>URL</span> of the
<span>active document</span>, or some similar interface concept.</p>
</dd>

<dt><dfn>The menu bar <code>BarProp</code> object</dfn></dt>
<dd>Represents the user interface element that contains a list of commands in menu form, or some
similar interface concept.</dd>
<dd>
<p class="note">Historically represented the user interface element that
contains a list of commands in menu form, or some similar interface
concept.</p>
</dd>

<dt><dfn>The personal bar <code>BarProp</code> object</dfn></dt>
<dd>Represents the user interface element that contains links to the user's favorite pages, or
some similar interface concept.</dd>
<dd>
<p class="note">Historically represented the user interface element that
contains links to the user's favorite pages, or some similar interface
concept.</p>
</dd>

<dt><dfn>The scrollbar <code>BarProp</code> object</dfn></dt>
<dd>Represents the user interface element that contains a scrolling mechanism, or some similar
interface concept.</dd>
<dd>
<p class="note">Historically represented the user interface element that
contains a scrolling mechanism, or some similar interface concept.</p>
</dd>

<dt><dfn>The status bar <code>BarProp</code> object</dfn></dt>
<dd>Represents 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 <code
data-x="dom-BarProp-visible">visible</code> attribute may return false).</dd>
<dd>
<p class="note">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 can act as if the corresponding user interface element was absent
(i.e., its <code data-x="dom-BarProp-visible">visible</code> attribute
can return false).</p>
</dd>

<dt><dfn>The toolbar <code>BarProp</code> object</dfn></dt>
<dd>Represents the user interface element found immediately above or before the document, as
appropriate for the user's media, which typically provides <span>session history</span> 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 <code data-x="dom-BarProp-visible">visible</code> attribute may return
false).</dd>
<dd>
<p class="note">Historically represented the user interface element found
immediately above or before the document, as appropriate for the user's
media, which typically provides <span>session history</span> traversal
controls (back and forward buttons, reload buttons, etc.). If the user agent
has no such user interface element, then the object can act as if the
corresponding user interface element was absent (i.e., its
<code data-x="dom-BarProp-visible">visible</code> attribute can return
false).</p>
</dd>
</dl>

<p>The <dfn attribute for="Window"><code data-x="dom-window-locationbar">locationbar</code></dfn>
Expand Down

0 comments on commit 2b6f620

Please sign in to comment.