Skip to content
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 theme_color member (closes #225) #325

Merged
merged 1 commit into from Mar 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
79 changes: 78 additions & 1 deletion index.html
Expand Up @@ -127,7 +127,8 @@ <h3>
"scope": "/racer/",
"start_url": "/racer/start.html",
"display": "fullscreen",
"orientation": "landscape"
"orientation": "landscape",
"theme_color": "aliceblue"
}
</pre>
</section>
Expand Down Expand Up @@ -1422,6 +1423,77 @@ <h3>
</p>
</div>
</section>
<section>
<h3>
<code title="">theme_color</code> member
</h3>
<p>
The <dfn id="member-theme_color"><code>theme_color</code></dfn>
member serves as the <dfn>default theme color</dfn> for an
application context. What constitutes a <dfn>theme color</dfn> is
defined in [[!META-THEME-COLOR]].
</p>
<p>
If the user agent honors the value of the <code>theme_color</code>
member as the <a>default theme color</a>, then that color serves as
the <a>theme color</a> for all browsing contexts to which the
manifest is <a>applied</a>. However, a document may override the
<a>default theme color</a> through the inclusion of a [[!HTML]]
<code>meta</code> element that conforms to [[!META-THEME-COLOR]]. A
user agent MUST return the theme color to the <a>default theme
color</a> when there are no <code>meta</code> elements that conform
to [[!META-THEME-COLOR]] in a document, or the <a>top-level browsing
context</a> is <a>navigated</a> to a URL that is <a>within scope</a>.
</p>
<p class="note">
For all intents and purposes, the <a><code>theme_color</code></a>
member is functionally equivalent to having a <a><code>meta</code>
element</a> whose <a title="name attribute">name</a> attribute is
<a><code>theme_color</code></a> in a [[!HTML]] document. In cases
where no suitable theme can be derived from processing a manifest, a
[[!META-THEME-COLOR]] can serve as a suitable fallback.
</p>
<p>
The <dfn>steps for processing the <code>theme_color</code>
member</dfn> are given by the following algorithm. The algorithm
takes a <var>manifest</var> as an argument. This algorithm returns a
string or <code>undefined</code>.
</p>
<ol>
<li>Let <var>value</var> be the result of calling the
<a>[[\GetOwnProperty]]</a> internal method of <var>manifest</var>
with argument "<code>theme_color</code>".
</li>
<li>If <a>Type</a>(<var>value</var>) is not "string":
<ol>
<li>If <a>Type</a>(<var>value</var>) is not "undefined",
optionally <a>issue a developer warning</a> that the type is not
supported.
</li>
<li>Return <code>undefined</code>.
</li>
</ol>
</li>
<li>Otherwise, let <var>potential color</var> be the result of
running [[!CSS-SYNTAX-3]]'s <a>parse a component value</a> algorithm
with <var>value</var> as input. If parsing returns a syntax error,
return <code>undefined</code>.
</li>
<li>Let <var>color</var> be the result of attempting to parse
<var>potential color</var> as a CSS color, as per [[!CSS-SYNTAX-3]].
If parsing fails:
<ol>
<li>
<a>Issue a developer warning</a>.
</li>
<li>Return <code>undefined</code>.
</li>
</ol>
</li>
<li>Return <var>color</var>.
</li>
</ol>
</section>
</section>
<section>
<h2>
Expand Down Expand Up @@ -1763,6 +1835,11 @@ <h2>
<dfn><code>OrientationLockType</code></dfn></a> enum, are defined in
[[!SCREEN-ORIENTATION]].
</p>
<p>
The algorithm to <a href=
"http://dev.w3.org/csswg/css-syntax/#parse-component-value"><dfn>parse
a component value</dfn></a> is defined in [[!CSS-SYNTAX-3]].
</p>
<p>
The following are defined in [[!HTML]]:
</p>
Expand Down