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 #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 Mar 25, 2021
1 parent 676114b commit d466015
Showing 1 changed file with 68 additions and 52 deletions.
120 changes: 68 additions & 52 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -79828,8 +79828,11 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>

<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 reasons and interoperability, those attributes return 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 @@ -79840,33 +79843,14 @@ interface <dfn>BarProp</dfn> {

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

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

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

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

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

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

Expand All @@ -79876,51 +79860,83 @@ interface <dfn>BarProp</dfn> {
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>Let <var>topLevelBrowsingContext</var> be <var>browsingContext</var>'s
<span>top-level browsing context</span>.</p>
</li>
<li>
<p>Let <var>isPopup</var> be <var>topLevelBrowsingContext</var>'s
<span>is popup</span>.</p>
</li>
<li>
<p>If <var>isPopup</var> is true, then return false.</p>
</li>
<li>
<p>Return true.</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 <!--non-normative-->may act as if the corresponding user interface
element was absent (i.e. its
<code data-x="dom-BarProp-visible">visible</code> attribute
<!--non-normative-->may 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 <!--non-normative-->may
act as if the corresponding user interface element was absent (i.e. its
<code data-x="dom-BarProp-visible">visible</code> attribute
<!--non-normative-->may 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 d466015

Please sign in to comment.