This specification defines a media feature to match the different visual presentation modes that
can be applied to web applications and thereby apply different styling based on these
different modes using CSS Media Queries [[!MEDIAQ]].

Introduction

Web applications, be they widgets or in-browser, can on most platforms
be run in multiple visual modes. At times they may occupy the entire screen, at others they may be
minimized to a specific docking area; at times they may have chrome that matches the operating
system's style while at others they may be providing their own controls in order to provide for
a more immersive experience.

The user is generally in control of at least several aspects of these modalities, and it is
therefore important for authors to be able to react to these in order to provide different
styling to their applications. In order to achieve this, this specification defines a
media feature that allows different CSS style rules to be applied depending on whether
a given media query [[!MEDIAQ]] matches.

Design Goals and Requirements

The design goals and requirements for this specification are documented in the
Requirements for Standardizing Widgets [[WIDGETS-REQS]].

This specification defines conformance criteria that apply to a single product:
user agents that implement the view modes that it contains.

Security considerations

An application could be designed to trick users into performing actions they do not wish to or to capture
data that they did not intend to provide. Examples of situations in which the user could be tricked
include, but are not limited to:

applications that the user cannot see (full-screen invisible widgets or tiny web pages) that can be used
to run services without the user noticing or to intercept the user's interactions with other
applications (such as a PIN-code entry) by layering themselves on top of them;

applications that have no chrome and that could therefore masquerade as some other existing objects on
the screen (for example a lock and key logo indicating that a site a trustworthy).

Implementers are encouraged to take these issues into consideration and to provide limitations to what
a Web application may do in order to ensure that the user is exposed to minimal risk.

Definitions

View mode

The view mode is the manner in which a Web application is presented to a user that corresponds to
the metaphors and functionalities in use on a given platform. This specification defines a number
of view modes that a user agent is expected to match to comparable platform-specific
situations.

Chrome

The chrome comprises the visible parts of the user agent that do not depend on the
content (e.g. window decorations, tool bars, title bars, menus).

Immersive

A user interface is said to be immersive when its controls and components are created to match the
specific style of the application instead of using the chrome and widgets of the platform.

The area of the screen that is generally available for applications, excluding parts that the system
generally keeps to itself (e.g. a bar at the top for menus, time, or context, or at the bottom with
a list of running applications).

Web application

A Web application is an application built and shipped using Web technology that may be running
inside of a browser, as a widget, or in another type of container designed for this
purpose.

A user agent SHOULD make a best-effort attempt at matching the great variety of platform conventions
in which it may be running a Web application to the list of view modes defined in this specification so that the
view-mode media feature may describe common situations in a manner that is useful to authors.
Each view mode is defined to be exclusive of the others.

Describes a Web application providing a more immersive interface, running in a windowed manner but
without chrome, and with the viewport's initial background being transparent such that other system items
(other applications, the display's background...) can be seen through parts of the viewport that are not being
painted to.

fullscreen

Describes a Web application that is occupying the entirety of the display, including the parts normally
excluded from the screen area (e.g. a fullscreen video) and without any chrome.

Describes a Web application docked or otherwise minimized, but with a dynamic graphical representation
being available nevertheless (i.e. the application isn't entirely hidden, or maybe its icon is still shown
and it has control over what it contains). This may correspond for instance to a thumbnail of the
application's content being shown.