Latest Draft | Test suite | Implementation report.
Copyright ©2011 the Contributors to the Splash Screen for Native Web Apps Specification, published by the W3C Native Web Apps Community Group under the W3C Community Contributor License Agreement (CLA). A human-readable summary is available.
This specification is not a W3C Standard nor is it on the W3C Standards Track. Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. Learn more about W3C Community and Business Groups.
This document specifies a number of ways to give an application a splash screen (known also as a "launch image"). A splash screen is an image that appears while a game or application is loading.
splash
element and its attributes
This document is undergoing rapid development and is changing frequently. It is inappropriate to cite this document as anything other than a work in progress.
The following is a list of issues we are still trying to resolve:
This section is non-normative.
Because of the limited processing capabilities of some devices and the amount of time it takes to initialize a Web runtime, there can be a small - yet noticeably perceivable - delay between when the end-user starts an application and the application actually becoming available and interactive to the end-user.
Depending on the complexity of the application and the processing power of the device, this delay can range from a few milliseconds to a couple of seconds. When applications take more than a few seconds to load, it can be disorienting to end-users as nothing is displayed on the screen; leading to a poor user experience. Native applications overcome this issue by allowing developers to use a media file that is displayed the instant the application is launched. Such a file is commonly referred to as a "splash screen" or "launch image".
This document defines two ways for a native web application to include a splash screen:
splash
elements in the configuration document of an application.The following example shows how to use multiple splash
elements.
<widget xmlns="http://www.w3.org/ns/widgets"> <splash src="splash/320x480.png"/> <splash src="splash/640x960.png"/> <splash src="splash/768x1004.png"/> <splash src="splash/1024x748.png"/> </widget>
Might appear as the following in a conforming user agent:
This section is non-normative.
Everything in this specification is normative except sections marked as non-normative, diagrams, examples, and notes.
The key words must, must not, required, should, should not, recommended, may, and optional in this specification are to be interpreted as described in RFC2119.
This specification defines conformance criteria that apply to a single product: a user agent.
A user agent is a software application that implements this specification and the Widget Packaging specification and its dependencies.
A splash screen is a media file, typically an image, that is displayed to the user while the application is being asynchronously loaded in the background. It's purpose is to give an end user immediate feedback that an application is starting and loading in the background.
splash
element and its attributesThe splash element allows an author to declare a splash screen for an application.
widget
element.xml:lang
:src
, width
, height
. src
attributeThe src
attribute is path attribute of the splash
element that allows an author to point to a file within the widget package. This file is then used as the splash screen for an application.
width
attributeA numeric attribute greater than 0 that represents, in CSS pixels, the author's preferred width for the splash screen.
height
attribute A numeric attribute greater than 0 that represents, in CSS pixels, the author's preferred height for the splash screen.
A default splash-screen is a reserved image, either at the root of the widget package or at the root of a locale folder, whose file name case-sensitively matches a file name given in the file name column of the default splash-screen table.
file name | media type |
---|---|
splash.svg | image/svg+xml |
splash.png | image/png |
splash.gif | image/gif |
splash.jpg | image/jpeg |
It is optional for a user agent to support the media types listed in the default splash-screen table.
At the time of writing, there is limited support on devices for displaying SVG as a splash screen. We recommend you include a splash screen in one of more of the other formats listed in the default splash-screen table.
TODO: write how to hook into processing algorithm.
A user agent behaves as if the splash file defaults table had been defined as part of the Table of Configuration Defaults in Step 3 of the Widget Packaging specification.
Variable | Type | Default Value | Overridden in |
---|---|---|---|
splashscreens | List | null |
Step 7 |
The steps to process splash elments is given by the following algorithm:
For each splash
element in tree order:
If the splash
element does not have a src
attribute, then terminate this algorithm.
src
attribute of this splash
element. If path is
not a valid path or is an empty string, then terminate this algorithm. Let file be the result of applying the rule for finding a file within a widget package to path. If file is not a processable file, as determined by applying the rule for identifying the media type of a file, then terminate this algorithm.
If the height
attribute is used, then let height be the result of applying the rule for parsing a non-negative integer to the attribute's value. If the height is not in error and greater than 0, then associate the height with file. Otherwise, the height
attribute is in error and the user agent MUST ignore the height
attribute.
If the width
attribute is used, then let width be the result of applying the rule for parsing a non-negative integer to the attribute's value. If the width is not in error and greater than 0, then associate the width with file. Otherwise, the width
attribute is in error and the user agent MUST ignore the width
attribute.
Add file and any associated width and/or height to the list of splashscreens.
The algorithm to locate the default splash-screen file is given by the following algorithm:
For each file name in the default splash screen table (from top to bottom) that has a media type that is supported by the user agent:
Let potential-splash be the result of applying the rule for finding a file within a widget package to file name.
If the potential-splash is a processable file, determined by the media type given in the media type column of the default splash screen table, then append potential-splash to the splashscreens list and terminate this algorithm.
Otherwise, move onto the next file name in the default splash screen table. If no default splash screen file is found, then terminate this algorithm.
A splash screen will generally cover the entire drawable area of a screen or simply a rectangle near the center of the screen. The splash screens of some applications that expect to be run full-screen usually cover the entire screen.
This article uses material from the Wikipedia article "Splash screen", which is released under the Creative Commons Attribution-Share-Alike License 3.0.