Skip to content

Commit

Permalink
Added splashscreens member (closes #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres committed Apr 27, 2015
1 parent fdf213f commit 57b55de
Showing 1 changed file with 147 additions and 82 deletions.
229 changes: 147 additions & 82 deletions index.html
Expand Up @@ -144,6 +144,17 @@ <h3>
"sizes": "128x128",
"density": 2
}],
"splashscreens": [{

This comment has been minimized.

Copy link
@kenchris

kenchris Apr 28, 2015

Collaborator

we have start_url, what about start_screens ? at least adding a _ would be more consistent

This comment has been minimized.

Copy link
@marcoscaceres

marcoscaceres Apr 28, 2015

Author Member

agree. changed to splash_screens.

"src": "splash/lowres",
"sizes": "320x240"
}, {
"src": "splash/hd_small",
"sizes": "1334x750"
}, {
"src": "splash/hd_hi",
"sizes": "1920x1080",
"density": 3
}],

This comment has been minimized.

Copy link
@laukstein

laukstein Oct 15, 2015

What about adding SVG animatable "any" size image?

{
    "src": "splashscreen.svg",
    "sizes": "any"
}
"scope": "/racer/",
"start_url": "/racer/start.html",
"display": "fullscreen",
Expand Down Expand Up @@ -950,10 +961,15 @@ <h3>
argument.
</li>
<li>Let <var>icons</var> of <var>parsed manifest</var> be the result
of running the <a>steps for processing the <code>icons</code>
member</a> with <var>manifest</var> and <var>manifest URL</var> as
of running the <a>steps for processing an array of images</a> with
<var>manifest</var>, <var>manifest URL</var>, and "icons" as

This comment has been minimized.

Copy link
@kenchris

kenchris Apr 28, 2015

Collaborator

icons?

This comment has been minimized.

Copy link
@marcoscaceres

marcoscaceres Apr 28, 2015

Author Member

copypasta :)

This comment has been minimized.

Copy link
@marcoscaceres

marcoscaceres Apr 28, 2015

Author Member

actually, this one is correct.

arguments.
</li>
<li>Let <var>splashscreens</var> of <var>parsed manifest</var> be the
result of running the <a>steps for processing an array of images</a>
with <var>manifest</var>, <var>manifest URL</var>, and "splashscreen"
as arguments.
</li>
<li>Let <var>scope</var> of <var>parsed manifest</var> be the result
of running the <a>steps for processing the <code>scope</code>
member</a> with <var>manifest</var>, <var>manifest URL</var>,
Expand Down Expand Up @@ -1247,6 +1263,38 @@ <h3>
</li>
</ol>
</section>
<section>
<h3>
<code title="">splashscreens</code> member
</h3>
<p>
The <dfn id="member-splashscreens"><code>splashscreens</code></dfn>

This comment has been minimized.

Copy link
@kenchris

kenchris Apr 28, 2015

Collaborator

can it be dynamic ?

This comment has been minimized.

Copy link
@marcoscaceres

marcoscaceres Apr 28, 2015

Author Member

not sure what you mean by dynamic? like an animated gif or apng? I guess it depends on the UA (and using type to discriminate).

member is an <a title="json-array">array</a> of <a title=
"image object">image objects</a> that can serve as a loading screen
for the web application. A splash screen indicates to the end user
that a loading process is occurring (in effect, that the web
application is being prepared by the user agent in the background).
As the <code>splashscreens</code> member is an array of <a title=
"image object">image objects</a>, developers can use unique image
objects definitions to target minimum screen resolutions and pixel
densities.
</p>

This comment has been minimized.

Copy link
@kenchris

kenchris Apr 28, 2015

Collaborator

I want to be able to control when the splash screen should disappear... like when I actually have something rendered.

This comment has been minimized.

Copy link
@kenchris

kenchris Apr 28, 2015

Collaborator

I would love a DOM API for hiding it. We use that in Crosswalk

This comment has been minimized.

Copy link
@marcoscaceres

marcoscaceres Apr 28, 2015

Author Member

Need to create a new member for this (splash_screens_duration or some such).

This comment has been minimized.

Copy link
@marcoscaceres

marcoscaceres Apr 28, 2015

Author Member

added #372

<p>
This feature is primarily intended for user agents that take a
perceptible amount of time to self-initialize (e.g., take longer than
200ms to be able to render content) - as such, it is OPTIONAL for a
user agent to display a splash screen while the web application is
being loaded. On launching a web application, if displaying a splash
screen, the user agent MUST <a>queue a post-load task</a> on the
<code>Document</code> of the <a>start URL</a> to remove the
splashscreen, or, alternatively can follow platform conventions for
how long a splash screen is displayed (e.g., a minimum of 1 second).
</p>
<p class="note">
The <code>splashscreen</code> member is processed using the <a>steps
for processing an array of images</a>.
</p>
</section>
<section>
<h3>
<code title="">icons</code> member
Expand All @@ -1261,6 +1309,10 @@ <h3>
"operating system">OS</abbr>'s task switcher and/or system
preferences.
</p>
<p class="note">
The <code>splashscreen</code> member is processed using the <a>steps
for processing an array of images</a>.
</p>
<p class="note">
If no icons are listed in the manifest (or none of them are found to
be suitable during processing), it is RECOMMENDED that the user agent
Expand All @@ -1269,86 +1321,6 @@ <h3>
type</a> and/or a <code>favicon.ico</code> can serve as suitable
fallbacks.
</p>
<p>
The <dfn>steps for processing the <code>icons</code> member</dfn> are
given by the following algorithm. The algorithm takes a manifest, and
a <a>URL</a> <var>manifest URL</var>, which is the URL from which the
<var>manifest</var> was fetched. This algorithm will return a list of
icons objects <var>icons</var>, which can be empty.
</p>
<ol>
<li>Let <var>icons</var> be an empty list.
</li>
<li>Let <var>unprocessed icons</var> be the result of calling the <a>
[[\GetOwnProperty]]</a> internal method of <var>manifest</var> with
argument "<code>icons</code>".
</li>
<li>If <var>unprocessed icons</var> is an <a title=
"json-array">array</a>, then:
<ol>
<li>From unprocessed icons, filter out any <var>item</var> where
<a>HasOwnProperty</a>(item,"src") returns <code>false</code>.
</li>
<li>For each <var>potential icon</var> in the array:
<ol>
<li>Let <var>src</var> be the result of running the <a>steps
for processing the <code>src</code> member of an image</a>
with <var>potential icon</var> and <var>manifest URL</var>.
</li>
<li>If <var>src</var> is <code>undefined</code>, move onto
the next item in <var>icons</var> (if any are left).
</li>
<li>Otherwise, let <var>icon</var> be an object with
properties <code>src</code>, <code>type</code>,
<code>sizes</code>, and <code>density</code>. All properties
initially set to <code>undefined</code>.
</li>
<li>Set <var>icon</var>'s <code>src</code> property to be
<var>src</var>.
</li>
<li>Let <var>type</var> be the result of running the <a>steps
for processing the <code>type</code> member of an image</a>
passing <var>potential icon</var>.
</li>
<li>If <var>type</var> is not <code>undefined</code>, set
<var>icon</var>'s <code>type</code> property to be
<var>type</var>.
</li>
<li>Let <var>sizes</var> be the list that result from running
the <a>steps for processing a <code>sizes</code> member of an
image</a> passing <var>potential icon</var>.
</li>
<li>If <var>sizes</var> is not <code>undefined</code>, set
<var>icon</var>'s <code>sizes</code> property to be
<var>sizes</var>.
</li>
<li>Let <var>density</var> be the result from running the <a>
steps for processing a <code>density</code> member of an
image</a> are given by the passing <var>potential
icon</var> .
</li>
<li>If <var>density</var> is not <code>undefined</code>, set
<var>icon</var>'s <code>density</code> property to be
<var>value</var>.
</li>
<li>Append <var>icon</var> to <var>icons</var>.
</li>
</ol>
</li>
</ol>
</li>
<li>Otherwise, if <var>unprocessed icons</var> is not
<code>undefined</code>:
<ol>
<li>
<a>Issue a developer warning</a> that the type is not
supported.
</li>
</ol>
</li>
<li>Return <var>icons</var>.
</li>
</ol>
<p>
If there are multiple equally appropriate icons in <var>icons</var>,
a user agent MUST use the last one declared in order at the time that
Expand Down Expand Up @@ -2063,6 +2035,94 @@ <h3>
</li>
</ol>
</section>
<section>
<h3>
Processing an array of images
</h3>
<p>
The <dfn>steps for processing an array of images</dfn> are given by
the following algorithm. The algorithm takes a manifest, a <a>URL</a>
<var>manifest URL</var>, which is the URL from which the
<var>manifest</var> was fetched, and a string that represents the
<var>member name</var> of the member which contains the array of
<a title="image object">image objects</a>. This algorithm returns a
list of <a title="image object">image objects</a>, which can be
empty.
</p>
<ol>
<li>Let <var>images</var> be an empty list.
</li>
<li>Let <var>unprocessed images</var> be the result of calling the
<a>[[\GetOwnProperty]]</a> internal method of <var>manifest</var>
with <var>member name</var> as the argument.
</li>
<li>If <var>unprocessed images</var> is an <a title=
"json-array">array</a>, then:
<ol>
<li>From unprocessed images, filter out any <var>item</var> where
<a>HasOwnProperty</a>(item,"src") returns <code>false</code>.
</li>
<li>For each <var>potential image</var> in the array:
<ol>
<li>Let <var>src</var> be the result of running the <a>steps
for processing the <code>src</code> member of an image</a>
with <var>potential image</var> and <var>manifest URL</var>.
</li>
<li>If <var>src</var> is <code>undefined</code>, move onto
the next item in <var>images</var> (if any are left).
</li>
<li>Otherwise, let <var>image</var> be an object with
properties <code>src</code>, <code>type</code>,
<code>sizes</code>, and <code>density</code>. All properties
initially set to <code>undefined</code>.
</li>
<li>Set <var>image</var>'s <code>src</code> property to be
<var>src</var>.
</li>
<li>Let <var>type</var> be the result of running the <a>steps
for processing the <code>type</code> member of an image</a>
passing <var>potential image</var>.
</li>
<li>If <var>type</var> is not <code>undefined</code>, set
<var>image</var>'s <code>type</code> property to be
<var>type</var>.
</li>
<li>Let <var>sizes</var> be the list that result from running
the <a>steps for processing a <code>sizes</code> member of an
image</a> passing <var>potential image</var>.
</li>
<li>If <var>sizes</var> is not <code>undefined</code>, set
<var>image</var>'s <code>sizes</code> property to be
<var>sizes</var>.
</li>
<li>Let <var>density</var> be the result from running the <a>
steps for processing a <code>density</code> member of an
image</a> are given by the passing <var>potential
image</var> .
</li>
<li>If <var>density</var> is not <code>undefined</code>, set
<var>image</var>'s <code>density</code> property to be <var>
value</var>.
</li>
<li>Append <var>image</var> to <var>images</var>.
</li>
</ol>
</li>
</ol>
</li>
<li>Otherwise, if <var>unprocessed images</var> is not
<code>undefined</code>:
<ol>
<li>
<a>Issue a developer warning</a> that the type is not
supported.
</li>
</ol>
</li>
<li>Return <var>images</var>.
</li>
</ol>
</section>
</section>
<section>
<h2>
Expand Down Expand Up @@ -2433,6 +2493,11 @@ <h2>
<a href="https://html.spec.whatwg.org/#same-origin"><dfn>same
origin</dfn></a>
</li>
<li>
<a href=
"https://html.spec.whatwg.org/#queue-a-post-load-task"><dfn>queue a
post-load task</dfn></a>
</li>
</ul>
</section>
<section>
Expand Down

0 comments on commit 57b55de

Please sign in to comment.