CSS Mobile Profile 2.0

Editor’s Draft,

More details about this document
This version:
https://drafts.csswg.org/css-mobile/
Latest published version:
https://www.w3.org/TR/css-mobile/
Previous Versions:
Feedback:
CSSWG Issues Repository
Editor:
(W3C)
Suggest an Edit for this Spec:
GitHub Editor
Previous editors:
Svante Schubert, Sun Microsystems Inc.
Robin Berjon, Expway

Abstract

This specification defines in general a subset of CSS 2.1 [CSS21] that is to be considered a baseline for interoperability between implementations of CSS on constrained devices (e.g. mobile phones). Its intent is not to produce a profile of CSS incompatible with the complete specification, but rather to ensure that implementations that due to platform limitations cannot support the entire specification implement a common subset that is interoperable not only amongst constrained implementations but also with complete ones. Additionally, this specification aligns itself as much as possible with the OMA Wireless CSS 1.1 [WCSS11] specification. At the same time, OMA is doing alignment work in OMA Wireless CSS 1.2 [WCSS12]. It is aimed at aligning the mandatory compliance items between CSS Mobile Profile 2.0 and OMA Wireless CSS 1.2 [WCSS12].

This profile is obsolete. Please see the latest CSS Snapshot for the specifications that make up CSS.

CSS is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, etc.

Status of this document

This is a public copy of the editors’ draft. It is provided for discussion only and may change at any moment. Its publication here does not imply endorsement of its contents by W3C. Don’t cite this document other than as work in progress.

Please send feedback by filing issues in GitHub (preferred), including the spec code “css-mobile” in the title, like this: “[css-mobile] …summary of comment…”. All issues and comments are archived. Alternately, feedback can be sent to the (archived) public mailing list www-style@w3.org.

This document is governed by the 2 November 2021 W3C Process Document.

At this time, the CSS Working Group does not envisage further work on this specification and does not plan to propose it as a W3C Recommendation.

1. Introduction

This document specifies a profile of CSS that is in general based on CSS 2.1 [CSS21], but requires as well new features from CSS 3. In addition the document defines an OPTIONAL feature set, that is suggested to be implemented by more advanced user agents.

2. Conformance

The key words of descriptive assertions and RFC 2119 terminology. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].

Since the goal of this specification is to define a baseline interoperability level, user agents MAY accept CSS documents conforming to CSS 2.1 or subsequent revisions of the CSS family of Recommendations.

In order to conform to this specification, user agents, authoring tools, and content MUST conform to the Conformance and Error conditions section of the CSS 2.1 specification [CSS21], with the following modifications.

  1. Only features marked as supported in this specification are REQUIRED. Aside of the REQUIRED feature set, an additional OPTIONAL feature set is given, that may be implemented by more advanced user agents. This feature set is REQUIRED by the CDF as in [WICDMobile10]. Support for a larger set of CSS 2.1 is OPTIONAL.
  2. The requirement concerning which CSS 2.1 media types are supported is tightened so that both the handheld and all media types MUST be accepted and processed. Other media types MAY be accepted and processed as well.
  3. The requirements that user agents MUST make it possible to select an alternate style sheet amongst those linked from the document, as well as provide for a way to turn off author style sheets, are relaxed to be RECOMMENDED behavior, but not REQUIRED.

3. Selectors

Selectors are defined in the Selectors chapter of the CSS 2.1 specification [CSS21]. The following table identifies which selector constructs MUST be supported amongst those defined by CSS 2.1.

Selector type Example Meaning Conformance
Universal selector * Matches any element. REQUIRED
Type selectors E Matches any E element. REQUIRED
Descendant selectors E F Matches any F element that is a descendant of an E element. REQUIRED
Child selectors E > F Matches any F element that is a child of an element E. REQUIRED
The link pseudo-classes E:link Matches element E if E is the source anchor of a hyperlink, unvisited by a user. REQUIRED
The link pseudo-classes E:visited Matches element E if E is the source anchor of a hyperlink, visited by a user. REQUIRED
The dynamic pseudo-classes E:active Matches element E if E is being activated by the user. REQUIRED
The dynamic pseudo-classes E:focus Matches element E if E has the focus (accepts keyboard events or other forms of text input). REQUIRED
Class selectors .warning Language specific. (In (X)HTML, matches elements whose class attribute contains a token with the same name.) REQUIRED
ID selectors #myid Matches any element with an ID equal to "myid". REQUIRED
Grouping E1, E2, E3 { ... } Matches a group of elements, which share the same style declarations. REQUIRED

4. At-rules

At-rules are defined in the at-rules section of the CSS 2.1 specification [CSS21]. The following table identifies which at-rule constructs MUST be supported amongst those defined by CSS by setting the at-rule as REQUIRED in the table’s last column. Only at-rules that are part of the suggested feature set for advanced user agents are listed here as OPTIONAL.

Rule Definition Conformance
@charset Defines character encoding for the style sheet. REQUIRED
@import Imports an external style sheet. REQUIRED
@media Groups a set of style rules to apply only to one or more particular media.
Only the handheld and all media types MUST be accepted and processed. Other media types MAY be accepted and processed as well.
REQUIRED
@namespace For declaring the default namespace and binding namespaces to namespace prefixes. OPTIONAL

5. Properties

Properties are defined in several chapters of the CSS 2.1 specification [CSS21] and in case of marquee properties in the CSS Marquee Module [CSS3MARQUEE]. The following table identifies which properties MUST be supported amongst those defined by CSS by setting the property as REQUIRED in the table’s last column. Only properties that are part of the suggested feature set for advanced user agents are listed here as OPTIONAL. The property syntax is provided (expressed using the same value specifications as CSS 2.1) when it is subsetted from the original. Limitations that apply to a property apply equally to its shorthand alternative.

Property Syntax (if different from CSS) Conformance
background-color REQUIRED
background-image REQUIRED
background-repeat REQUIRED
background-attachment REQUIRED
background-position top | center | bottom | left | right | inherit REQUIRED
background REQUIRED
border-top-width
border-right-width
border-bottom-width
border-left-width
REQUIRED
border-width REQUIRED
border-top-color
border-right-color
border-bottom-color
border-left-color
REQUIRED
border-color REQUIRED
border-top-style
border-right-style
border-bottom-style
border-left-style
none | solid | dashed | dotted | inherit REQUIRED
border-style none | solid | dashed | dotted | inherit REQUIRED
border-top
border-right
border-bottom
border-left
REQUIRED
border REQUIRED
bottom OPTIONAL
clear REQUIRED
color REQUIRED
display inline | block | list-item | none | inherit REQUIRED
float REQUIRED
font-family REQUIRED
font-style REQUIRED
font-variant REQUIRED
font-weight REQUIRED
font-size <absolute-size> | <relative-size> | inherit REQUIRED
font REQUIRED
height REQUIRED
left OPTIONAL
list-style-type disc | circle | square | decimal | lower-roman | upper-roman | lower-alpha | upper-alpha | none | inherit REQUIRED
list-style-image REQUIRED
list-style REQUIRED
margin-top
margin-right
margin-bottom
margin-left
REQUIRED
margin REQUIRED
marquee-direction [CSS3MARQUEE] REQUIRED
marquee-loop [CSS3MARQUEE] REQUIRED
marquee-speed [CSS3MARQUEE] REQUIRED
marquee-style [CSS3MARQUEE] REQUIRED
max-height REQUIRED
max-width REQUIRED
min-height REQUIRED
min-width REQUIRED
outline-color OPTIONAL
outline-style none | solid | dashed | dotted | inherit OPTIONAL
outline-width OPTIONAL
outline OPTIONAL
overflow [CSS21] auto REQUIRED
overflow-style [CSS3MARQUEE] marquee REQUIRED
padding-top
padding-right
padding-bottom
padding-left
REQUIRED
padding REQUIRED
position OPTIONAL
right OPTIONAL
text-indent REQUIRED
text-align REQUIRED
text-decoration none | blink |underline | inherit REQUIRED
text-transform REQUIRED
top OPTIONAL
vertical-align top | middle | bottom | baseline | inherit REQUIRED
visibility REQUIRED
white-space REQUIRED
width REQUIRED
z-index OPTIONAL

Informative Notes

6. Syntax

A user agent MUST support all value types defined in the Values section of the CSS 2.1 specification [CSS21], with the following exceptions:

  1. Support for counter values is OPTIONAL
  2. Support for CSS2 System Colors and User preferences for fonts is OPTIONAL.

Acknowledgments

The editors wish to thank the authors of the previous version of this document, Ted Wugofski (Openwave), Doug Dominiak (Openwave, formerly Motorola), Peter Stark (Ericsson), and Tapas Roy (Openwave), as well as the authors of the OMA Wireless CSS specifications and the CSS 2.1 specification. Furthermore, the editors want to thank the CDF WG for their participation on this specification.

Conformance

Document conventions

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

Examples in this specification are introduced with the words “for example” or are set apart from the normative text with class="example", like this:

This is an example of an informative example.

Informative notes begin with the word “Note” and are set apart from the normative text with class="note", like this:

Note, this is an informative note.

Advisements are normative sections styled to evoke special attention and are set apart from other normative text with <strong class="advisement">, like this: UAs MUST provide an accessible alternative.

Tests

Tests relating to the content of this specification may be documented in “Tests” blocks like this one. Any such block is non-normative.


Conformance classes

Conformance to this specification is defined for three conformance classes:

style sheet
A CSS style sheet.
renderer
A UA that interprets the semantics of a style sheet and renders documents that use them.
authoring tool
A UA that writes a style sheet.

A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module.

A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.)

An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module.

Partial implementations

So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers must treat as invalid (and ignore as appropriate) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents must not selectively ignore unsupported component values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored.

Implementations of Unstable and Proprietary Features

To avoid clashes with future stable CSS features, the CSSWG recommends following best practices for the implementation of unstable features and proprietary extensions to CSS.

Non-experimental implementations

Once a specification reaches the Candidate Recommendation stage, non-experimental implementations are possible, and implementors should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec.

To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group.

Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at http://www.w3.org/Style/CSS/Test/. Questions should be directed to the public-css-testsuite@w3.org mailing list.

References

Normative References

[CSS21]
Bert Bos; et al. Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification. 7 June 2011. REC. URL: https://www.w3.org/TR/CSS21/
[CSS3MARQUEE]
Bert Bos. CSS Marquee Module Level 3. 14 October 2014. NOTE. URL: https://www.w3.org/TR/css3-marquee/
[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119
[WICDMobile10]
Timur Mehrvarz; et al. WICD Mobile 1.0. 19 August 2010. NOTE. URL: https://www.w3.org/TR/WICDMobile/

Informative References

[MOBILE-BP]
Jo Rabin; Charles McCathieNevile. Mobile Web Best Practices 1.0. 29 July 2008. REC. URL: https://www.w3.org/TR/mobile-bp/
[WCAG10-CSS-TECHS]
Wendy Chisholm; Gregg Vanderheiden; Ian Jacobs. CSS Techniques for Web Content Accessibility Guidelines 1.0. 6 November 2000. NOTE. URL: https://www.w3.org/TR/WCAG10-CSS-TECHS/
[WCSS11]
Open Mobile Alliance. Wireless CSS Specification. October 2006. Approved Version 1.1. URL: http://www.openmobilealliance.org/technical/release_program/docs/Browsing/V2_3-20080331-A/OMA-WAP-WCSS-V1_1-20061020-A.pdf
[WCSS12]
Open Mobile Alliance. Wireless CSS Specification Version 1.2. 21 September 2007. (Work in progress.) URL: http://www.openmobilealliance.org/ftp/Public_documents/MCE/MAE/Permanent_documents/OMA-TS-WCSS-V1_2-20070921-D.zip