# CSS Mobile Text Size Adjustment Module Level 1

## Editor’s Draft, 1 January 1970

Specification Metadata

This version:
  https://drafts.csswg.org/css-size-adjust/
Latest published version:
  https://www.w3.org/TR/css-size-adjust/
Editors:
  L. David Baron (Mozilla)
  Tantek Çelik (Mozilla)
Issue Tracking:
  GitHub Issues
Suggest an Edit for this Spec:
  GitHub Editor

Copyright © 1970 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and permissive document license rules apply.

## Abstract

This module contains features of CSS relating to one possible mechanism for adapting pages designed for desktop computer displays for display on smaller screens such as those of mobile phones. This mechanism involves displaying a scaled down display of the Web page and allowing the user to pan and zoom within that display, but within that scaled down display making certain text and similar elements larger than specified by the page author in order to ensure that when a block of wrapped text is zoomed to the width of the device (so it can be read without side-to-side scrolling for each line), the text is large enough to be readable.

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.

GitHub Issues are preferred for discussion of this specification. When filing an issue, please put the text “css-size-adjust” in the title, preferably like this: “[css-size-adjust] …summary of comment…”. All issues and comments are archived, and there is also a historical archive.

This document was produced by the CSS Working Group.

This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

This document is governed by the 1 March 2019 W3C Process Document.

The following features are at risk:

- the reference to [CSS-TEXT-4]'s text-wrap property

## 1. Introduction

A common mechanism for displaying Web pages that were designed for large desktop displays on much smaller displays such as those of mobile phones involves allowing the user to pan and zoom around within a view of the Web page drawn as though it were drawn into the width of a typical desktop Web browser display. The ability to pan and zoom the page lets the user both see an overview of the page and zoom in to specific parts to read or interact with them.

One common problem with this type of interaction occurs when the user wants to read a large block of text. It might be that a block of text within this desktop-formatted page might be laid out so that when the user zooms in so that the text is large enough to read, each line of text is wider than the display on the small device. This means the user needs to scroll side to side to read each line of text, which is a serious inconvenience to the user.

One way for software that displays Web pages or other CSS-formatted content on a mobile device is to make some of the text larger so that this problem does not occur. The goal of this enlargement is to make the text big enough so that when the block it is in is scaled to the width of the display, the text is large enough to read. At the same time, this needs to be done with minimal disruption to the overall design of the page.

While implementations of CSS are not required to use this technique, this module describes how implementations of CSS that do use this technique must do so. In other words, while implementations of CSS are not required to implement this module, this module nonetheless places requirements on implementations of this module.

This module describes how this size adjustment works and describes a new CSS property that authors of CSS can use to provide hints to the implementation about which text or other elements should or should not be enlarged.

### 1.1. Module interactions

This module adds additional features that are not defined in [CSS21]. These features may lead to a different size being computed than would be computed when following [CSS21] alone.

### 1.2. Values

This specification follows the CSS property definition conventions from [CSS21]. Value types not defined in this specification are defined in CSS Values & Units [CSS-VALUES-3]. Other CSS modules may expand the definitions of these value types.

In addition to the property-specific values listed in their definitions, all properties defined in this specification also accept the CSS-wide keywords keywords as their property value. For readability they have not been repeated explicitly.

## 2. Default size adjustment

This section defines the default size adjustment rules. These rules are then referenced by the definition of the text-size-adjust property in the following section.

All of the subsections of this section need significant refinement: additional detail, verification that the detail already present is correct, etc.

It’s not clear how much this section should define precise behavior versus how much it should allow future room for innovation and improvement.

### 2.1. Types of boxes adjusted

The default size adjustment affects text and form controls, whether those form controls contain text (e.g., text inputs, selects) or do not (e.g., radio buttons, checkboxes).

### 2.2. Conditions that suppress adjustment

A number of conditions suppress the default adjustment because these conditions are associated with layouts for which the user experience would be worsened by size adjustment rather than improved by it. These conditions are:

- when the total amount of text in the block formatting context (see [CSS21]) (excluding text inside descendant block formatting contexts) is approximately smaller than the amount that would require wrapping to more than one or two lines within that context’s width,
- when the objects to be adjusted are inside a block-level or display: inline-block element with a height other than auto (see [CSS21]),
- when the objects to be adjusted are inside a display: inline-block element with a width other than auto (see [CSS21]),
- when the objects to be adjusted have white-space of pre or nowrap (see [CSS21]) or a text-wrap of nowrap (see [CSS-TEXT-4]).

### 2.3. Calculation of default adjustment

The adjustment performed should be based on preferences (of the renderer or the renderer’s user) indicating the desired minimum readable text size. Given this preference, for each containing block of text to be adjusted, there is a minimum block text size: the preference for the minimum readable text size, times the width of the containing block, divided by the width of the device.

The size adjustment involves multiplication of sizes by a ratio determined by the minimum block text size and the computed value of font-size. This ratio must be at least the first divided by the second; however, in order to maintain differentiations between font sizes, it should often be slightly larger. Define this with more detail/precision.

## 3. Size adjustment control: the text-size-adjust property

Name: | text-size-adjust
Value: | auto | none | <percentage>
Initial: | auto
Applies to: | all elements
Inherited: | yes
Percentages: | see below
Computed value: | specfied keyword or percentage
Canonical order: | N/A
Animation type: | by computed value

auto
  Renderers must use the default size adjustment when displaying on a small device.
none
  Renderers must not do size adjustment when displaying on a small device.
<percentage>
  When displaying on a small device, renderers must not do size adjustment but instead the computed value of font-size must be multiplied by this percentage.

  Note: This means that 'text-size-adjust: 100%;' is equivalent to 'text-size-adjust: none;'.

  Negative values are invalid.

"Small device" is not well defined. We should clearly specify when text size adjustment should apply. For example, in practice a large tablet is considered by vendors to be a small device.

## 4. Acknowledgments

The editors would like to thank: .

## 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.

### 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.

### Requirements for Responsible Implementation of CSS

The following sections define several conformance requirements for implementing CSS responsibly, in a way that promotes interoperability in the present and future.

#### 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 property 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.

#### Implementations of CR-level Features

Once a specification reaches the Candidate Recommendation stage, implementers should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec, and should avoid exposing a prefixed variant of that feature.

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.

## Index

### Terms defined by this specification

- auto, in §3
- minimum block text size, in §2.3
- minimum readable text size, in §2.3
- none, in §3
- <percentage>, in §3
- text-size-adjust, in §3

https://drafts.csswg.org/css-display-3/#propdef-display Referenced in:

- 2.2. Conditions that suppress adjustment (2)

https://drafts.csswg.org/css-fonts-3/#propdef-font-size Referenced in:

- 2.3. Calculation of default adjustment
- 3. Size adjustment control: the text-size-adjust property

https://drafts.csswg.org/css-sizing-3/#valdef-width-auto Referenced in:

- 2.2. Conditions that suppress adjustment (2)

https://drafts.csswg.org/css-text-3/#valdef-white-space-nowrap Referenced in:

- 2.2. Conditions that suppress adjustment

https://drafts.csswg.org/css-text-3/#valdef-white-space-pre Referenced in:

- 2.2. Conditions that suppress adjustment

https://drafts.csswg.org/css-text-4/#valdef-text-wrap-nowrap Referenced in:

- 2.2. Conditions that suppress adjustment

https://drafts.csswg.org/css-text-4/#propdef-text-wrap Referenced in:

- Unnumbered Section
- 2.2. Conditions that suppress adjustment

https://drafts.csswg.org/css-text-4/#propdef-white-space Referenced in:

- 2.2. Conditions that suppress adjustment

https://drafts.csswg.org/css-values-3/#percentage-value Referenced in:

- 3. Size adjustment control: the text-size-adjust property

https://drafts.csswg.org/css-values-4/#css-wide-keywords Referenced in:

- 1.2. Values

https://drafts.csswg.org/css-values-4/#comb-one Referenced in:

- 3. Size adjustment control: the text-size-adjust property (2)

https://drafts.csswg.org/css2/visudet.html#propdef-height Referenced in:

- 2.2. Conditions that suppress adjustment

https://drafts.csswg.org/css2/visudet.html#propdef-width Referenced in:

- 2.2. Conditions that suppress adjustment

### Terms defined by reference

- [css-display-3] defines the following terms:
  - display
- [css-fonts-3] defines the following terms:
  - font-size
- [css-sizing-3] defines the following terms:
  - auto
- [css-text-3] defines the following terms:
  - nowrap
  - pre
- [CSS-TEXT-4] defines the following terms:
  - nowrap
  - text-wrap
  - white-space
- [CSS-VALUES-3] defines the following terms:
  - <percentage>
- [css-values-4] defines the following terms:
  - css-wide keywords
  - |
- [CSS21] defines the following terms:
  - height
  - width

## References

### Normative References

[CSS-DISPLAY-3]
  Tab Atkins Jr.; Elika Etemad. CSS Display Module Level 3. 28 August 2018. CR. URL: https://www.w3.org/TR/css-display-3/
[CSS-FONTS-3]
  John Daggett; Myles Maxfield; Chris Lilley. CSS Fonts Module Level 3. 20 September 2018. REC. URL: https://www.w3.org/TR/css-fonts-3/
[CSS-SIZING-3]
  Tab Atkins Jr.; Elika Etemad. CSS Intrinsic & Extrinsic Sizing Module Level 3. 22 May 2019. WD. URL: https://www.w3.org/TR/css-sizing-3/
[CSS-TEXT-3]
  Elika Etemad; Koji Ishii; Florian Rivoal. CSS Text Module Level 3. 12 December 2018. WD. URL: https://www.w3.org/TR/css-text-3/
[CSS-TEXT-4]
  Elika Etemad; Koji Ishii; Alan Stearns. CSS Text Module Level 4. 20 September 2018. WD. URL: https://www.w3.org/TR/css-text-4/
[CSS-VALUES-3]
  Tab Atkins Jr.; Elika Etemad. CSS Values and Units Module Level 3. 31 January 2019. CR. URL: https://www.w3.org/TR/css-values-3/
[CSS-VALUES-4]
  Tab Atkins Jr.; Elika Etemad. CSS Values and Units Module Level 4. 31 January 2019. WD. URL: https://www.w3.org/TR/css-values-4/
[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/CSS2/
[RFC2119]
  S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://tools.ietf.org/html/rfc2119

## Property Index

Name | Value | Initial | Applies to | Inh. | %ages | Animation type | Canonical order | Computed value
--- | --- | --- | --- | --- | --- | --- | --- | ---
text-size-adjust | auto | none | <percentage> | auto | all elements | yes | see below | by computed value | N/A | specfied keyword or percentage

## Issues Index

All of the subsections of this section need significant refinement: additional detail, verification that the detail already present is correct, etc. ↵
It’s not clear how much this section should define precise behavior versus how much it should allow future room for innovation and improvement. ↵
Define this with more detail/precision. ↵
"Small device" is not well defined. We should clearly specify when text size adjustment should apply. For example, in practice a large tablet is considered by vendors to be a small device. ↵
#propdef-text-size-adjust Referenced in:

- 2. Default size adjustment
- 3. Size adjustment control: the text-size-adjust property