CSS Text Module Level 4
CSS Text Module Level 4
Editor’s Draft
20 April 2026
More details about this document
This version:
Latest published version:
Previous Versions:
Feedback:
CSSWG Issues Repository
Inline In Spec
Editors:
Elika J. Etemad / fantasai
Apple
Koji Ishii
Invited Expert
Alan Stearns
Adobe Systems
Florian Rivoal
Invited Expert
Suggest an Edit for this Spec:
GitHub Editor
Test Suite:
World Wide Web Consortium
W3C
liability
trademark
and
permissive document license
rules apply.
Abstract
This CSS module defines properties for text manipulation and specifies their processing model. It covers line breaking, justification and alignment, white space handling, and text transformation.
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-text” in the title, like this:
“[css-text]
…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
18 August 2025 W3C Process Document
1.
Introduction
Tests
The test coverage information in this specification
covers
wpt/css/css-text/
and subdirectories,
as well as those tests in
wpt/css/CSS2/
and subdirectories
that relate to this specification.
This module describes the typesetting controls of CSS;
that is, the features of CSS that control the translation of
source text to formatted, line-wrapped text.
Various CSS properties provide control over
case transformation
white space collapsing
text wrapping
line breaking rules
and
hyphenation
alignment and justification
spacing
and
indentation
See
Additions Since Level 3
for additions since
Level 3
Note: Font selection is covered in the
CSS Fonts Module
[CSS-FONTS-3]
Features for decorating text,
such as
underlines
emphasis marks
and
shadows
(previously part of this module)
are covered in the
CSS Text Decoration Module
[CSS-TEXT-DECOR-3]
Bidirectional
and
vertical
text
are addressed in the
CSS Writing Modes Module
[CSS-WRITING-MODES-4]
Further information about the typesetting requirements
of various languages and writing systems around the world
can be found in the
Internationalization Working Group
’s
Language Enablement Index
[TYPOGRAPHY]
Tests
The following tests are crash tests
that relate to general usage
of the features described in this specification
but are not tied to any particular normative statement.
removing-collapsible-crash.html
(live test)
(source)
removing-collapsible-spaces-before-float-crash.html
(live test)
(source)
line-break-float-crash.html
(live test)
(source)
trailing-space-with-cr-crash.html
(live test)
(source)
ellisize-rtl-text-crash.html
(live test)
(source)
altering-dom-crash.html
(live test)
(source)
whitespace-followed-by-cham-symbol-crash.html
(live test)
(source)
append-whitespace-only-node-crash-001.html
(live test)
(source)
rendering-rtl-bidi-override-crash.html
(live test)
(source)
rendering-table-caption-with-list-item-and-svg-crash.html
(live test)
(source)
rendering-table-caption-with-negative-margins-crash.html
(live test)
(source)
white-space-pre-wrap-chash.html
(live test)
(source)
word-spacing-large-value.html
(live test)
(source)
eol-spaces-bidi-min-content-crash.html
(live test)
(source)
overflow-wrap-anywhere-crash.html
(live test)
(source)
text-indent-each-line-crash.html
(live test)
(source)
overflow-wrap-leading-floats-crash.html
(live test)
(source)
text-autospace-shape-cache-crash.html
(live test)
(source)
text-indent-ruby-crash.html
(live test)
(source)
hyphens-auto-wordbreak-breakall-crash.html
(live test)
(source)
1.1.
Module Interactions
Tests
Tests not needed for this section.
This module, together with the
CSS Text Decoration Module
replaces and extends the text-level features defined in
Cascading Style Sheets Level 2
chapter 16
[CSS-TEXT-DECOR-3]
[CSS2]
In addition to the terms defined below,
other terminology and concepts used in this specification are defined
in
Cascading Style Sheets Level 2
and the
CSS Writing Modes Module
[CSS2]
and
[CSS-WRITING-MODES-4]
1.2.
Value Definitions
Tests
Tests not really needed for this section;
could possibly test that css-wide keywords apply to every property.
This specification follows the
CSS property definition conventions
from
[CSS2]
using the
value definition syntax
from
[CSS-VALUES-3]
Value types not defined in this specification are defined in CSS Values & Units
[CSS-VALUES-3]
Combination with 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
as their property value.
For readability they have not been repeated explicitly.
1.3.
Languages and Typesetting
Tests
Tests not needed for this section:
these are definitions,
they get tested through their application,
not by themselves.
Authors should accurately language-tag their content
for the best typographic behavior.
Many typographic effects vary by linguistic context.
Language and writing system conventions can affect
line breaking, hyphenation, justification, glyph selection,
and many other typographic effects.
In CSS, language-specific typographic tailorings
are only applied when the
content language
is known (declared).
Therefore,
higher quality typography requires authors to communicate to the UA
the correct linguistic context of the text in the document.
The
content language
of an element is the (human) language
the element is declared to be in, according to the rules of the
document language
Note that it is possible for the
content language
of an element
to be unknown—e.g. untagged content,
or content in a
document language
that does not have a language-tagging facility,
is considered to have an unknown
content language
Note:
Authors can declare the
content language
using the global
lang
attribute in HTML
or the universal
xml:lang
attribute in XML.
See the
rules for determining the content language of an HTML element
in
HTML
and the
rules for determining the content language of an XML element
in
XML 1.0
[HTML]
[XML10]
The
content language
an element is declared to be in
also identifies the specific written form of that language used in that element,
known as the
content writing system
Depending on the
document language
’s facilities for identifying the
content language
this information can be explicit or implied.
See the normative
Appendix F:
Identifying the Content Writing System
Note:
Some languages have more than one writing system tradition;
in other cases a language can be transliterated into a foreign writing system.
Authors should
subtag
such cases
so that the UA can adapt appropriately.
For example, Korean (
ko
) can be written in
Hangul (
-Hang
),
Hanja (
-Hani
),
or a combination (
-Kore
).
Historical documents written solely in Hanja
do not use word spaces and
are formatted more like modern Chinese than modern Korean.
In other words, for typographic purposes
ko-Hani
behaves more like
zh-Hant
than
ko
ko-Kore
).
As another example Japanese (
ja
) is typically written
in a combination (
-Japn
) of Hiragana (
-Hira
),
Katakana (
-Kana
), and Kanji (
-Hani
).
However, it can also be “romanized” into Latin (
-Latn
for special purposes like language-learning textbooks,
in which case it should be formatted more like English than Japanese.
As a third example contemporary Mongolian is written in two scripts:
Cyrillic (
-Cyrl
, officially used in Mongolia)
and Mongolian (
-Mong
, more common in Inner Mongolia, part of China).
These have very different formatting requirements,
with Cyrillic behaving similar to Latin and Greek,
and Mongolian deriving from both Arabic and Chinese writing conventions.
1.4.
Characters and Letters
Tests
For the most part, tests not really needed for this section:
these are definitions,
they get tested through their applications,
by themselves.
The few testable assertions that are made have coverage.
Possible additions:
* turning the content of example 1 into tests (first, check that it’s not already done).
The basic unit of typesetting is the
character
However, because writing systems are not always as simple as the basic English alphabet,
what a
character
actually is depends on the context in which the term is used.
For example, in Hangul (the Korean writing system),
each square representation of a syllable
(e.g.
Han
can be considered a
character
However, the square symbol is really composed of multiple letters each representing a phoneme
(e.g.
and these also could each be considered a
character
A basic unit of computer text encoding, for any given encoding,
is also called a
character
and depending on the encoding,
a single encoding
character
might correspond
to the entire pre-composed syllabic
character
(e.g.
),
to the individual phonemic
character
(e.g.
),
or to smaller units such as
a base letterform (e.g.
and any combining marks that vary it (e.g. extra strokes that represent aspiration).
In turn, a single encoding
character
can be represented in the data stream as one or more bytes;
and in programming environments one byte is sometimes also called a
character
Therefore the term
character
is fairly ambiguous where technical precision is required.
For text layout, we will refer to the
typographic character unit
as the basic unit of text.
Even within the realm of text layout,
the relevant
character
unit depends on the operation.
For example, line-breaking and letter-spacing will segment
a sequence of Thai characters that include U+0E33 ำ THAI CHARACTER SARA AM differently;
or the behavior of a conjunct consonant in a script such as Devanagari
may depend on the font in use.
So the
typographic character
represents a unit of the writing system—such as a Latin alphabetic letter (including its diacritics),
Hangul syllable,
Chinese ideographic character,
Myanmar syllable cluster—that is indivisible with respect to a particular typographic operation
(line-breaking, first-letter effects, tracking, justification, vertical arrangement, etc.).
Tests
word-break-break-all-007.html
(live test)
(source)
word-break-break-all-008.html
(live test)
(source)
Unicode Standard Annex #29: Text Segmentation
defines a unit called the
grapheme cluster
which approximates the
typographic character
[UAX29]
A UA must use the
extended grapheme cluster
(not
legacy grapheme cluster
), as defined in
UAX29
as the basis for its
typographic character unit
However, the UA should tailor the definitions
as required by typographic tradition
since the default rules are not always appropriate or ideal—and is expected to tailor them differently
depending on the operation as needed.
Tests
line-breaking-013.html
(live test)
(source)
line-breaking-014.html
(live test)
(source)
Note:
The rules for such tailorings are out of scope for CSS.
The following are some examples of
typographic character unit
tailorings
required by standard typesetting practice:
In some scripts such as Myanmar or Devanagari,
the
typographic character unit
for both justification and line-breaking
is an entire syllable,
which can include more than one Unicode
grapheme cluster
[UAX29]
In other scripts such as Thai or Lao,
even though for line-breaking the
typographic character
matches Unicode’s default
grapheme clusters
for letter-spacing the relevant unit
is
less
than a Unicode
grapheme cluster
and may require decomposition or other substitutions
before spacing can be inserted.
[UAX29]
For instance,
to properly letter-space the Thai word คำ (U+0E04 + U+0E33),
the U+0E33 needs to be decomposed into U+0E4D + U+0E32,
and then the extra letter-space inserted before the U+0E32: คํ า.
A slightly more complex example is น้ำ (U+0E19 + U+0E49 + U+0E33).
In this case, normal Thai shaping will first decompose the U+0E33 into U+0E4D + U+0E32
and then swap the U+0E4D with the U+0E49, giving U+0E19 + U+0E4D + U+0E49 + U+0E32.
As before the extra letter-space is then inserted before the U+0E32: นํ้ า.
Vertical typesetting can also require tailoring.
For example, when typesetting
upright
text,
Tibetan tsek and shad marks are kept with the preceding grapheme cluster,
rather than treated as an independent
typographic character unit
[CSS-WRITING-MODES-4]
typographic letter unit
(or
letter
for the purpose of this specification)
is a
typographic character unit
belonging to one of the Letter or Number
general categories
See
Appendix E:
Characters and Properties
for how to determine the Unicode properties of a
typographic character unit
The rendering characteristics of a
typographic character unit
divided
by an element boundary is undefined.
Ideally each component should be rendered
according to the formatting requirements of its respective element’s properties
while maintaining correct shaping and positioning
of the
typographic character unit
as a whole.
However, depending on the nature of the formatting differences between its parts
and the capabilities of the font technology in use,
this is not always possible.
Therefore such a
typographic character unit
may be rendered as belonging to either side of the boundary,
or as some approximation of belonging to both.
Authors are forewarned that dividing
grapheme clusters
or ligatures
by element boundaries may give inconsistent or undesired results.
1.5.
Text Processing
Tests
This section has adequate coverage.
Exhaustive coverage unrealistic,
since this section is effectively a dependency on all of Unicode.
Some tests nonetheless provided for key functionality
(such as the effect of certain control characters on Arabic shaping).
CSS is built on
Unicode
[UNICODE]
UAs that support Unicode must adhere to all normative requirements
of the Unicode Core Standard,
except where explicitly overridden by CSS.
UAs implemented on the basis of a non-Unicode text encoding model are still
expected to fulfill the same text handling requirements
by assuming an appropriate mapping and analogous behavior.
Tests
shaping-join-001.html
(live test)
(source)
shaping-join-002.html
(live test)
(source)
shaping-join-003.html
(live test)
(source)
shaping-no-join-001.html
(live test)
(source)
shaping-no-join-002.html
(live test)
(source)
shaping-no-join-003.html
(live test)
(source)
shaping-tatweel-001.html
(live test)
(source)
shaping-tatweel-002.html
(live test)
(source)
shaping-tatweel-003.html
(live test)
(source)
shaping-arabic-diacritics-001.html
(live test)
(source)
shaping-arabic-diacritics-002.html
(live test)
(source)
full-width-leading-spaces-005.html
(live test)
(source)
object-replacement-1.html
(live test)
(source)
object-replacement-2.html
(live test)
(source)
white-space-vs-joiners-001.html
(live test)
(source)
white-space-vs-joiners-002.html
(live test)
(source)
For the purpose of determining adjacency for text processing
(such as white space processing, text transformation, line-breaking, etc.),
and thus in general within this specification,
intervening
inline box
boundaries and
out-of-flow
elements
must be ignored.
With respect to text shaping, however, see
§ 8.7 Shaping Across Element Boundaries
Tests
line-breaking-002.html
(live test)
(source)
line-breaking-003.html
(live test)
(source)
line-breaking-004.html
(live test)
(source)
line-breaking-005.html
(live test)
(source)
line-breaking-006.html
(live test)
(source)
line-breaking-007.html
(live test)
(source)
line-breaking-008.html
(live test)
(source)
word-break-min-content-002.html
(live test)
(source)
word-break-min-content-003.html
(live test)
(source)
word-break-min-content-004.html
(live test)
(source)
word-break-min-content-005.html
(live test)
(source)
overflow-wrap-anywhere-010.html
(live test)
(source)
white-space-processing-048.xht
(live test)
(source)
white-space-processing-049.xht
(live test)
(source)
2.
Transforming Text
2.1.
Case Transforms: the
text-transform
property
Tests
This section has good test coverage overall,
and very good i18n coverage in particular.
Missing tests:
* no test of Animation type.
* Applies to text
Possible additions:
* An automated test for plain text copy&paste not applying transforms. Not clear such an
automated
test is possible, but it would be nice to have one if it were.
Name:
text-transform
Value:
none
[capitalize
uppercase
lowercase ]
||
full-width
||
full-size-kana
math-auto
Initial:
none
Applies to:
text
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
n/a
Animation type:
discrete
Tests
inheritance.html
(live test)
(source)
text-transform-valid.html
(live test)
(source)
text-transform-invalid.html
(live test)
(source)
text-transform-computed.html
(live test)
(source)
text-transform-multiple-001.html
(live test)
(source)
c545-txttrans-000.xht
(live test)
(source)
text-transform-005.xht
(live test)
(source)
text-transform-applies-to-001.xht
(live test)
(source)
text-transform-applies-to-002.xht
(live test)
(source)
text-transform-applies-to-003.xht
(live test)
(source)
text-transform-applies-to-005.xht
(live test)
(source)
text-transform-applies-to-006.xht
(live test)
(source)
text-transform-applies-to-007.xht
(live test)
(source)
text-transform-applies-to-008.xht
(live test)
(source)
text-transform-applies-to-009.xht
(live test)
(source)
text-transform-applies-to-010.xht
(live test)
(source)
text-transform-applies-to-011.xht
(live test)
(source)
text-transform-applies-to-012.xht
(live test)
(source)
text-transform-applies-to-013.xht
(live test)
(source)
text-transform-applies-to-014.xht
(live test)
(source)
text-transform-applies-to-015.xht
(live test)
(source)
This property transforms text for styling purposes.
It has no effect on the underlying content,
and must not affect the content of a plain text copy & paste operation.
Tests
text-transform-upperlower-105.html
(live test)
(source)
Authors must not rely on
text-transform
for semantic purposes;
rather the correct casing and semantics should be encoded
in the source document text and markup.
Tests
text-transform-copy-paste-001-manual.html (manual test)
(source)
Values have the following meanings:
none
No effects.
Tests
text-transform-none-001.xht
(live test)
(source)
text-transform-004.xht
(live test)
(source)
capitalize
Puts the first
typographic letter unit
of each word, if lowercase, in titlecase;
other characters are unaffected.
Tests
text-transform-capitalize-001.html
(live test)
(source)
text-transform-capitalize-003.html
(live test)
(source)
text-transform-capitalize-005.html
(live test)
(source)
text-transform-capitalize-007.html
(live test)
(source)
text-transform-capitalize-009.html
(live test)
(source)
text-transform-capitalize-010.html
(live test)
(source)
text-transform-capitalize-011.html
(live test)
(source)
text-transform-capitalize-014.html
(live test)
(source)
text-transform-capitalize-016.html
(live test)
(source)
text-transform-capitalize-018.html
(live test)
(source)
text-transform-capitalize-020.html
(live test)
(source)
text-transform-capitalize-022.html
(live test)
(source)
text-transform-capitalize-024.html
(live test)
(source)
text-transform-capitalize-026.html
(live test)
(source)
text-transform-capitalize-028.html
(live test)
(source)
text-transform-capitalize-030.html
(live test)
(source)
text-transform-capitalize-031.html
(live test)
(source)
text-transform-capitalize-032.xht
(live test)
(source)
text-transform-capitalize-034.html
(live test)
(source)
text-transform-capitalize-035.html
(live test)
(source)
text-transform-001.xht
(live test)
(source)
text-transform-cap-001.xht
(live test)
(source)
text-transform-cap-002.xht
(live test)
(source)
text-transform-cap-003.xht
(live test)
(source)
uppercase
Puts all
letters
in uppercase.
Tests
text-transform-uppercase-101.xht
(live test)
(source)
text-transform-upperlower-001.html
(live test)
(source)
text-transform-upperlower-003.html
(live test)
(source)
text-transform-upperlower-005.html
(live test)
(source)
text-transform-upperlower-007.html
(live test)
(source)
text-transform-upperlower-009.html
(live test)
(source)
text-transform-upperlower-011.html
(live test)
(source)
text-transform-upperlower-015.html
(live test)
(source)
text-transform-upperlower-017.html
(live test)
(source)
text-transform-upperlower-019.html
(live test)
(source)
text-transform-upperlower-021.html
(live test)
(source)
text-transform-upperlower-023.html
(live test)
(source)
text-transform-upperlower-025.html
(live test)
(source)
text-transform-upperlower-027.html
(live test)
(source)
text-transform-upperlower-029.html
(live test)
(source)
text-transform-upperlower-031.html
(live test)
(source)
text-transform-upperlower-044.html
(live test)
(source)
text-transform-upperlower-101.html
(live test)
(source)
text-transform-upperlower-103.html
(live test)
(source)
text-transform-upperlower-106.html
(live test)
(source)
text-transform-uppercase-dynamic.html
(live test)
(source)
text-transform-003.xht
(live test)
(source)
text-transform-bicameral-001.xht
(live test)
(source)
text-transform-bicameral-003.xht
(live test)
(source)
text-transform-bicameral-005.xht
(live test)
(source)
text-transform-bicameral-007.xht
(live test)
(source)
text-transform-bicameral-009.xht
(live test)
(source)
text-transform-bicameral-011.xht
(live test)
(source)
text-transform-bicameral-013.xht
(live test)
(source)
text-transform-bicameral-015.xht
(live test)
(source)
text-transform-bicameral-017.xht
(live test)
(source)
text-transform-bicameral-019.xht
(live test)
(source)
text-transform-bicameral-021.xht
(live test)
(source)
text-transform-unicase-001.xht
(live test)
(source)
text-transform-uppercase-001.xht
(live test)
(source)
text-transform-uppercase-002.xht
(live test)
(source)
lowercase
Puts all
letters
in lowercase.
Tests
text-transform-lowercase-101.xht
(live test)
(source)
text-transform-lowercase-102.xht
(live test)
(source)
text-transform-upperlower-002.html
(live test)
(source)
text-transform-upperlower-004.html
(live test)
(source)
text-transform-upperlower-006.html
(live test)
(source)
text-transform-upperlower-008.html
(live test)
(source)
text-transform-upperlower-010.html
(live test)
(source)
text-transform-upperlower-012.html
(live test)
(source)
text-transform-upperlower-014.html
(live test)
(source)
text-transform-upperlower-016.html
(live test)
(source)
text-transform-upperlower-018.html
(live test)
(source)
text-transform-upperlower-020.html
(live test)
(source)
text-transform-upperlower-022.html
(live test)
(source)
text-transform-upperlower-024.html
(live test)
(source)
text-transform-upperlower-026.html
(live test)
(source)
text-transform-upperlower-028.html
(live test)
(source)
text-transform-upperlower-030.html
(live test)
(source)
text-transform-upperlower-102.html
(live test)
(source)
text-transform-upperlower-104.html
(live test)
(source)
text-transform-002.xht
(live test)
(source)
text-transform-bicameral-002.xht
(live test)
(source)
text-transform-bicameral-004.xht
(live test)
(source)
text-transform-bicameral-006.xht
(live test)
(source)
text-transform-bicameral-008.xht
(live test)
(source)
text-transform-bicameral-010.xht
(live test)
(source)
text-transform-bicameral-012.xht
(live test)
(source)
text-transform-bicameral-014.xht
(live test)
(source)
text-transform-bicameral-016.xht
(live test)
(source)
text-transform-bicameral-018.xht
(live test)
(source)
text-transform-bicameral-020.xht
(live test)
(source)
text-transform-bicameral-022.xht
(live test)
(source)
text-transform-lowercase-001.xht
(live test)
(source)
full-width
Puts all
typographic character units
in
full-width
form.
If a character does not have a corresponding
full-width
form,
it is left as is.
This value is typically used to typeset Latin letters and digits
as if they were ideographic characters.
Tests
text-transform-fullwidth-001.xht
(live test)
(source)
text-transform-fullwidth-002.xht
(live test)
(source)
text-transform-fullwidth-004.xht
(live test)
(source)
text-transform-fullwidth-005.xht
(live test)
(source)
full-size-kana
Converts all
small Kana
characters to the equivalent
full-size Kana
This value is typically used for ruby annotation text,
where authors may want all small Kana to be drawn as large Kana
to compensate for legibility issues at the small font sizes typically used in ruby.
Tests
text-transform-full-size-kana-001.html
(live test)
(source)
text-transform-full-size-kana-002.html
(live test)
(source)
text-transform-full-size-kana-003.html
(live test)
(source)
text-transform-full-size-kana-004.html
(live test)
(source)
text-transform-full-size-kana-005.html
(live test)
(source)
text-transform-full-size-kana-006.html
(live test)
(source)
text-transform-full-size-kana-007.html
(live test)
(source)
text-transform-full-size-kana-008.html
(live test)
(source)
math-auto
See
MathML Core
§ 4.2 The math-auto transform
Tests
text-transform-math-auto-001.html
(live test)
(source)
text-transform-math-auto-002.html
(live test)
(source)
text-transform-math-auto-003.html
(live test)
(source)
The following example converts the ASCII characters
used in abbreviations in Japanese text to their full-width variants
so that they lay out and line break like ideographs:
abbr
lang
ja
text-transform
full-width
Note:
The purpose of
text-transform
is
to allow for presentational casing transformations
without affecting the semantics of the document.
Note in particular that
text-transform
casing operations are lossy,
and can distort the meaning of a text.
While accessibility interfaces may wish to convey
the apparent casing of the rendered text to the user,
the transformed text cannot be relied on to accurately represent
the underlying meaning of the document.
In this example,
the first line of text is capitalized as a visual effect.
section > p:first-of-type::first-line
text-transform
uppercase
This effect cannot be written into the source document
because the position of the line break depends on layout.
But also, the capitalization is not reflecting a semantic distinction
and is not intended to affect the paragraph’s reading;
therefore it belongs in the presentation layer.
In this example,
the
ruby
annotations,
which are half the size of the main paragraph text,
are transformed to use regular-size kana
in place of
small kana
rt
font-size
50
text-transform
full-size-kana
:is
h1
h2
h3
h4
rt
text-transform
none
/* unset for large text*/
Note that while this makes such letters easier to see at small type sizes,
the transformation distorts the text:
the reader needs to mentally substitute
small kana
in the appropriate places—not unlike reading a Latin inscription
where all “U”s look like “V”s.
For example, if
text-transform: full-size-kana
were applied to the following source,
the annotation would read “じゆう” (jiyū), which means “liberty”,
instead of “じゅう” (jū), which means “ten”,
the correct reading and meaning for the annotated “十”.
ruby
rt
じゅう
ruby
2.1.1.
Mapping Rules
Tests
This section has adequate test coverage.
For
capitalize
, what constitutes a “word“ is UA-dependent;
[UAX29]
is suggested (but not required)
for determining such word boundaries.
Out-of-flow elements and inline element boundaries
must not introduce a
text-transform
word boundary
and must be ignored when determining such word boundaries.
Tests
text-transform-capitalize-033.html
(live test)
(source)
text-transform-capitalize-034.html
(live test)
(source)
text-transform-capitalize-035.html
(live test)
(source)
Note:
Authors cannot depend on
capitalize
to follow
language-specific titlecasing conventions
(such as skipping articles in English).
The UA must use the full case mappings for Unicode characters,
including any conditional casing rules,
as defined in the
Default Case Algorithms
section of
The Unicode Standard
[UNICODE]
If (and only if) the
content language
of the element is,
according to the rules of the
document language
known,
then any appropriate language-specific rules must be applied as well.
These minimally include,
but are not limited to,
the language-specific rules in Unicode’s
SpecialCasing.txt
Tests
writing-system-text-transform-001.html
(live test)
(source)
text-transform-tailoring-001.html
(live test)
(source)
text-transform-tailoring-002.html
(live test)
(source)
text-transform-tailoring-002a.html
(live test)
(source)
text-transform-tailoring-003.html
(live test)
(source)
text-transform-tailoring-004.html
(live test)
(source)
text-transform-tailoring-005.html
(live test)
(source)
text-transform-upperlower-032.html
(live test)
(source)
text-transform-upperlower-033.html
(live test)
(source)
text-transform-upperlower-034.html
(live test)
(source)
text-transform-upperlower-035.html
(live test)
(source)
text-transform-upperlower-038.html
(live test)
(source)
text-transform-upperlower-039.html
(live test)
(source)
text-transform-upperlower-040.html
(live test)
(source)
text-transform-upperlower-041.html
(live test)
(source)
text-transform-upperlower-042.html
(live test)
(source)
text-transform-upperlower-043.html
(live test)
(source)
For example, in Turkish there are two “i”s,
one with a dot—“İ” and “i”—and one without—“I” and “ı”.
Thus the usual case mappings between “I” and “i”
are replaced with a different set of mappings
to their respective dotless/dotted counterparts,
which do not exist in English.
This mapping must only take effect
if the
content language
is Turkish
written in its modern Latin-based
writing system
(or another Turkic language that uses Turkish casing rules);
in other languages,
the usual mapping of “I” and “i” is required.
This rule is thus conditionally defined in Unicode’s SpecialCasing.txt file.
Tests
text-transform-bicameral-005.xht
(live test)
(source)
text-transform-bicameral-006.xht
(live test)
(source)
The definition of
full-width
and
half-width
forms
can be found in
Unicode Standard Annex #11: East Asian Width
[UAX11]
The mapping to
full-width
form is defined
by taking code points with the
or the
tag
in their
Decomposition_Mapping
in
Unicode Standard Annex #44: Unicode Character Database
[UAX44]
For the
tag,
the mapping is from the code point to the decomposition
(minus
tag),
and for the
tag,
the mapping is from the decomposition
(minus the
tag)
back to the original code point.
Tests
text-transform-fullwidth-001.xht
(live test)
(source)
text-transform-fullwidth-002.xht
(live test)
(source)
text-transform-fullwidth-004.xht
(live test)
(source)
text-transform-fullwidth-005.xht
(live test)
(source)
text-transform-fullwidth-006.html
(live test)
(source)
text-transform-fullwidth-007.html
(live test)
(source)
The mappings for
small Kana
to
full-size Kana
are defined in
Appendix G:
Small Kana Mappings
2.2.
Expanding Between Words: the
word-space-transform
property
Tests
This section has generally good coverage.
Missing tests:
* no test of Animation type
Name:
word-space-transform
Value:
none
[ space
ideographic-space ]
&&
auto-phrase
Initial:
none
Applies to:
text
Inherited:
yes
Percentages:
N/A
Computed value:
as specified
Canonical order:
per grammar
Animation type:
discrete
Tests
word-space-transform-computed.html
(live test)
(source)
word-space-transform-invalid.html
(live test)
(source)
word-space-transform-valid.html
(live test)
(source)
word-space-transform-003.html
(live test)
(source)
word-space-transform-004.html
(live test)
(source)
word-space-transform-005.html
(live test)
(source)
word-space-transform-006.html
(live test)
(source)
Some languages and writing systems have alternative ways
of delimiting words,
either using different separating characters,
or sometimes no visible character at all.
This property allows authors to change the rendering
from one style to another
without needing to change the markup.
none
This property has no effect.
Tests
word-space-transform-004.html
(live test)
(source)
word-space-transform-005.html
(live test)
(source)
space
Expandable separators
within the child
text
of this element
are replaced by U+0020 SPACE.
Tests
word-space-transform-002.html
(live test)
(source)
word-space-transform-004.html
(live test)
(source)
word-space-transform-005.html
(live test)
(source)
word-space-transform-006.html
(live test)
(source)
word-space-transform-007.html
(live test)
(source)
word-space-transform-008.html
(live test)
(source)
word-space-transform-009.html
(live test)
(source)
word-space-transform-014.html
(live test)
(source)
word-space-transform-015-manual.html (manual test)
(source)
word-space-transform-017.html
(live test)
(source)
word-space-transform-018.html
(live test)
(source)
ideographic-space
Expandable separators
within the child
text
of this element
are replaced by U+3000 IDEOGRAPHIC SPACE.
Tests
word-space-transform-001.html
(live test)
(source)
word-space-transform-003.html
(live test)
(source)
word-space-transform-010.html
(live test)
(source)
word-space-transform-011.html
(live test)
(source)
word-space-transform-012.html
(live test)
(source)
word-space-transform-013.html
(live test)
(source)
word-space-transform-016.html
(live test)
(source)
word-space-transform-019.html
(live test)
(source)
word-space-transform-020.html
(live test)
(source)
word-space-transform-021.html
(live test)
(source)
word-space-transform-022.html
(live test)
(source)
word-space-transform-023.html
(live test)
(source)
word-space-transform-024.html
(live test)
(source)
word-space-transform-025.html
(live test)
(source)
word-space-transform-026.html
(live test)
(source)
auto-phrase
If the
content language
is known
and the user agent supports linguistic analysis for this language,
the user agent must
detect phrase boundaries
If a
word-separator character
other space separator
or U+200B ZERO WIDTH SPACE character
does not already occur at that boundary,
then the UA must insert a
virtual expandable separator
Tests
word-space-transform-016.html
(live test)
(source)
word-space-transform-017.html
(live test)
(source)
word-space-transform-018.html
(live test)
(source)
word-space-transform-019.html
(live test)
(source)
word-space-transform-020.html
(live test)
(source)
word-space-transform-021.html
(live test)
(source)
word-space-transform-022.html
(live test)
(source)
word-space-transform-023.html
(live test)
(source)
word-space-transform-024.html
(live test)
(source)
word-space-transform-025.html
(live test)
(source)
word-space-transform-026.html
(live test)
(source)
If this value is omitted,
or if the
content language
is unknown,
or if the user agent does not support
detecting phrase boundaries
for that language,
there are no
virtual expandable separator
Tests
word-space-transform-027.html
(live test)
(source)
word-space-transform-028.html
(live test)
(source)
word-space-transform-029.html
(live test)
(source)
For the purpose of this property,
expandable separators
are any of:
U+200B ZERO WIDTH SPACE characters
Tests
word-space-transform-001.html
(live test)
(source)
word-space-transform-002.html
(live test)
(source)
word-space-transform-003.html
(live test)
(source)
word-space-transform-004.html
(live test)
(source)
word-space-transform-005.html
(live test)
(source)
word-space-transform-006.html
(live test)
(source)
word-space-transform-007.html
(live test)
(source)
word-space-transform-008.html
(live test)
(source)
word-space-transform-009.html
(live test)
(source)
word-space-transform-010.html
(live test)
(source)
word-space-transform-011.html
(live test)
(source)
word-space-transform-012.html
(live test)
(source)
word-space-transform-015-manual.html (manual test)
(source)
wbr
elements
Tests
word-space-transform-001.html
(live test)
(source)
word-space-transform-002.html
(live test)
(source)
word-space-transform-003.html
(live test)
(source)
word-space-transform-004.html
(live test)
(source)
word-space-transform-006.html
(live test)
(source)
word-space-transform-007.html
(live test)
(source)
word-space-transform-008.html
(live test)
(source)
word-space-transform-009.html
(live test)
(source)
word-space-transform-010.html
(live test)
(source)
word-space-transform-011.html
(live test)
(source)
word-space-transform-012.html
(live test)
(source)
word-space-transform-013.html
(live test)
(source)
word-space-transform-014.html
(live test)
(source)
word-space-transform-015-manual.html (manual test)
(source)
virtual expandable separators
Tests
word-space-transform-016.html
(live test)
(source)
word-space-transform-017.html
(live test)
(source)
word-space-transform-018.html
(live test)
(source)
word-space-transform-019.html
(live test)
(source)
word-space-transform-020.html
(live test)
(source)
virtual expandable separator
is
a UA-detected syntactic boundary in the text
that represents an
expandable separator
not otherwise occuring in the source document.
It has no effect other than for this property.
The user agent must not replace
expandable separators
immediately preceding or following
forced line break
(ignoring any intervening inline box boundaries,
and associated
margin
border
padding
).
Tests
word-space-transform-010.html
(live test)
(source)
word-space-transform-011.html
(live test)
(source)
word-space-transform-012.html
(live test)
(source)
Note:
Because
virtual expandable separators
are placed in the outermost element that participates in an inline box boundary
if one would coincide with boundary of an inline box
whose parent box has a
used value
of
word-space-transform: none
that particular
virtual expandable separator
is not expanded,
since it would be placed in the parent box.
Tests
word-space-transform-020.html
(live test)
(source)
Like
text-transform
, this property transforms text for styling purposes only.
It has no effect on the underlying content,
and must not affect the content of a plain text copy & paste operation.
Tests
word-space-transform-015-manual.html (manual test)
(source)
Unlike books for adults, Japanese books for young children often feature spaces between sentence segments,
to facilitate reading.
People with dyslexia also tend to find this style easier to read.
Absent any particular styling, the following sentence would be rendered as depicted below.
むかしむかし、
wbr
あるところに、
wbr
おじいさんと
wbr
おばあさんが
wbr
すんでいました。
むかしむかし、あるところに、おじいさんとおばあさんがすんでいました。
Phrase-based spacing can be achieved with the following css:
word-space-transform
ideographic-space
むかしむかし、 あるところに、 おじいさんと おばあさんが すんでいました。
Another common variant additionally restricts the allowable line breaks to these phrase boundaries.
Using the same markup, this is easily achieved with the following css:
word-break
keep-all
word-space-transform
ideographic-space
むかしむかし、
Tests
word-space-transform-013.html
(live test)
(source)
word-space-transform-014.html
(live test)
(source)
In addition to making the source code more readable,
using
wbr
rather than U+200B in the markup
also allow authors to classify the delimiters into different groups.
In the following example,
wbr
elements are either
unmarked when they delimit a word,
or marked with class
when they also delimit a phrase.
らいしゅう
wbr
wbr
じゅぎょう
wbr
wbr
class
たいこ
wbr
wbr
ばち
wbr
wbr
class
もって
wbr
きて
wbr
ください。
Using this, it is possible not only to enable the rather common phrase-based spacing,
but also word-by-word spacing
that is likely to be preferred
by people with dyslexia to reduce ambiguities,
or other variants
such as a combination of phrase-based spacing and of word-based wrapping.
Usual rendering
らいしゅう
Phrase spacing
p wbr.p
word-space-transform
ideographic-space
らいしゅう
Word spacing
p wbr
word-space-transform
ideographic-space
らいしゅう
Phrase spacing, word wrapping
word-break
keep-all
p wbr.p
word-space-transform
ideographic-space
らいしゅう
Word spacing and wrapping
word-break
keep-all
p wbr
word-space-transform
ideographic-space
らいしゅう
2.3.
Order of Operations
Tests
This section has adequate test coverage.
When multiple transformations need to be applied,
they are applied in the following order:
word-space-transform
capitalize
uppercase
, and
lowercase
full-width
full-size-kana
Tests
text-transform-multiple-001.html
(live test)
(source)
Word space transformation and
text transformation happen after
§ 4.3.1 Phase I: Collapsing and Transformation
but before
§ 4.3.2 Phase II: Trimming and Positioning
This means for instance that
full-width
only transforms
spaces (U+0020) to U+3000 IDEOGRAPHIC SPACE within
preserved
white space
Tests
text-transform-fullwidth-006.html
(live test)
(source)
text-transform-fullwidth-007.html
(live test)
(source)
text-transform-fullwidth-008.html
(live test)
(source)
text-transform-fullwidth-009.html
(live test)
(source)
word-space-transform-007.html
(live test)
(source)
word-space-transform-008.html
(live test)
(source)
word-space-transform-009.html
(live test)
(source)
Note:
As defined in
Appendix A:
Text Processing Order of Operations
transforming affects line-breaking and other formatting operations.
Tests
word-space-transform-030.html
(live test)
(source)
3.
White Space and Wrapping: the
white-space
property
Tests
This section has good overall test coverage,
particularly through tests for [[#white-space-processing]] and subsections,
and longhand properties.
Missing tests:
* No test of Animation type
* Intrinsic (min and max) sizing tests for normal and nowrap.
* shorthand to longhand expansion involving white-space-trim values and preserve-spaces
Name:
white-space
Value:
normal
pre
pre-wrap
pre-line
<'white-space-collapse'>
||
<'text-wrap-mode'>
||
<'white-space-trim'>
Initial:
normal
Applies to:
text
Inherited:
see individual properties
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
n/a
Animation type:
discrete
Tests
inheritance.html
(live test)
(source)
white-space-valid.html
(live test)
(source)
white-space-invalid.html
(live test)
(source)
white-space-computed.html
(live test)
(source)
white-space-shorthand.html
(live test)
(source)
ws-break-spaces-applies-to-001.html
(live test)
(source)
ws-break-spaces-applies-to-002.html
(live test)
(source)
ws-break-spaces-applies-to-003.html
(live test)
(source)
ws-break-spaces-applies-to-005.html
(live test)
(source)
ws-break-spaces-applies-to-006.html
(live test)
(source)
ws-break-spaces-applies-to-007.html
(live test)
(source)
ws-break-spaces-applies-to-008.html
(live test)
(source)
ws-break-spaces-applies-to-009.html
(live test)
(source)
ws-break-spaces-applies-to-010.html
(live test)
(source)
ws-break-spaces-applies-to-011.html
(live test)
(source)
ws-break-spaces-applies-to-012.html
(live test)
(source)
ws-break-spaces-applies-to-013.html
(live test)
(source)
ws-break-spaces-applies-to-014.html
(live test)
(source)
ws-break-spaces-applies-to-015.html
(live test)
(source)
white-space-applies-to-text-001.html
(live test)
(source)
white-space-pre-031.html
(live test)
(source)
white-space-pre-032.html
(live test)
(source)
white-space-pre-034.html
(live test)
(source)
white-space-pre-035.html
(live test)
(source)
c562-white-sp-000.xht
(live test)
(source)
white-space-006.xht
(live test)
(source)
white-space-007.xht
(live test)
(source)
white-space-applies-to-001.xht
(live test)
(source)
white-space-applies-to-002.xht
(live test)
(source)
white-space-applies-to-002.xht
(live test)
(source)
white-space-applies-to-003.xht
(live test)
(source)
white-space-applies-to-005.xht
(live test)
(source)
white-space-applies-to-006.xht
(live test)
(source)
white-space-applies-to-007.xht
(live test)
(source)
white-space-applies-to-008.xht
(live test)
(source)
white-space-applies-to-009.xht
(live test)
(source)
white-space-applies-to-010.xht
(live test)
(source)
white-space-applies-to-011.xht
(live test)
(source)
white-space-applies-to-012.xht
(live test)
(source)
white-space-applies-to-013.xht
(live test)
(source)
white-space-applies-to-014.xht
(live test)
(source)
white-space-applies-to-015.xht
(live test)
(source)
white-space-mixed-001.xht
(live test)
(source)
white-space-mixed-002.xht
(live test)
(source)
white-space-mixed-003.xht
(live test)
(source)
white-space-mixed-004.xht (manual test)
(source)
This property is a shorthand for
white-space-collapse
text-wrap-mode
, and
white-space-trim
It specifies two things:
whether and how
white space
is collapsed;
see
White Space Processing
whether lines may
wrap
at unforced
soft wrap opportunities
see
§ 5 Text Wrapping
and
Line Breaking
Note:
This shorthand combines both inheritable and non-inheritable properties.
If this is a problem, please inform the CSSWG.
Unless otherwise specified, any omitted
longhand
is set to its
initial value
The following table gives the normative mapping
of the values of the
shorthand
’s special keywords
to their equivalent
longhand
values.
white-space
white-space-collapse
text-wrap-mode
white-space-trim
normal
collapse
wrap
none
pre
preserve
nowrap
none
pre-wrap
preserve
wrap
none
pre-line
preserve-breaks
wrap
none
Note:
In some cases,
preserved white space
and
other space separators
can
hang
when at the end of the line;
this can affect whether they are measured for
intrinsic sizing
The following informative table summarizes the behavior
of various
white-space
values:
New Lines
Spaces and Tabs
Text Wrapping
End-of-line
spaces
End-of-line
other space separators
normal
Collapse
Collapse
Wrap
Remove
Hang
pre
Preserve
Preserve
No wrap
Preserve
No wrap
nowrap
Collapse
Collapse
No wrap
Remove
Hang
pre-wrap
Preserve
Preserve
Wrap
Hang
Hang
break-spaces
Preserve
Preserve
Wrap
Wrap
Wrap
pre-line
Preserve
Collapse
Wrap
Remove
Hang
4.
White Space Processing & Control Characters
Tests
This section has reasonably good test coverage.
Missing tests:
* “As required by Unicode, unsupported Default_ignorable characters must be ignored for text rendering”
The source text of a document often contains formatting
that is not relevant to the final rendering:
for example,
breaking the source into segments
(lines) for ease of editing
or adding
white space characters
such as
tabs
and
spaces
to indent the source code.
CSS white space processing allows the author
to control interpretation of such formatting:
to preserve or collapse it away when rendering the document.
White space processing in CSS
(which is controlled with the
white-space-collapse
and
white-space-trim
properties)
interprets
white space characters
only for rendering:
it has no effect on the underlying document data.
Note:
Depending on the document language,
segments can be separated by a particular newline sequence
(such as a line feed or CRLF pair),
or delimited by some other mechanism,
such as the SGML
RECORD-START
and
RECORD-END
tokens.
For CSS processing,
each document language–defined “segment break” or “newline sequence”—or if none are defined, each line feed (U+000A)—in the text is treated as a
segment break
which is then interpreted for rendering as specified by the
white-space
property.
In the case of HTML,
newlines
are
normalized
to line feed characters (U+000A)
for representation in the DOM,
so when an HTML document is represented as a DOM tree
each line feed (U+000A)
is treated as a
segment break
[HTML]
[DOM]
Note:
In most common CSS implementations,
HTML does not get styled directly.
Instead, it is processed into a DOM tree,
which is then styled.
Unlike HTML,
the DOM does not give any particular meaning to carriage returns (U+000D),
so they are not treated as
segment breaks
If carriage returns (U+000D) are inserted into the DOM
by means other than HTML parsing,
they then get treated as defined below.
Tests
white-space-processing-005.xht
(live test)
(source)
white-space-processing-006.xht
(live test)
(source)
white-space-processing-007.xht
(live test)
(source)
Note:
A document parser might
not only normalize any
segment breaks
but also collapse other space characters or
otherwise process white space according to markup rules.
Because CSS processing occurs
after
the parsing stage,
it is not possible to restore these characters for styling.
Therefore, some of the behavior specified below
can be affected by these limitations and
may be user agent dependent.
Note:
Anonymous blocks consisting entirely of
collapsible
white space
are removed from the rendering tree.
Thus any such
white space
surrounding a block-level element is collapsed away.
See
CSS 2
§ 9.2.2.1 Anonymous inline boxes
[CSS2]
Control characters (
Unicode category
Cc
)—other than tabs (U+0009),
line feeds (U+000A),
carriage returns (U+000D)
and sequences that form a
segment break
—must be rendered as a visible glyph
which the UA must synthesize if the glyphs found in the font are not visible,
and must be otherwise treated as any other character
of the Other Symbols (
So
general category
and Common
script
The UA may use a glyph provided by a font specifically for the control character,
substitute the glyphs provided for the corresponding symbol in the Control Pictures block,
generate a visual representation of its code point value,
or use some other method to provide an appropriate visible glyph.
As required by Unicode,
unsupported
Default_ignorable
characters
must be ignored for text rendering.
[UNICODE]
Tests
control-chars-000.html
(live test)
(source)
control-chars-001.html
(live test)
(source)
control-chars-002.html
(live test)
(source)
control-chars-003.html
(live test)
(source)
control-chars-004.html
(live test)
(source)
control-chars-005.html
(live test)
(source)
control-chars-006.html
(live test)
(source)
control-chars-007.html
(live test)
(source)
control-chars-008.html
(live test)
(source)
control-chars-00B.html
(live test)
(source)
control-chars-00C.html
(live test)
(source)
control-chars-00D.html
(live test)
(source)
control-chars-00E.html
(live test)
(source)
control-chars-00F.html
(live test)
(source)
control-chars-010.html
(live test)
(source)
control-chars-011.html
(live test)
(source)
control-chars-012.html
(live test)
(source)
control-chars-013.html
(live test)
(source)
control-chars-014.html
(live test)
(source)
control-chars-015.html
(live test)
(source)
control-chars-016.html
(live test)
(source)
control-chars-017.html
(live test)
(source)
control-chars-018.html
(live test)
(source)
control-chars-019.html
(live test)
(source)
control-chars-01A.html
(live test)
(source)
control-chars-01B.html
(live test)
(source)
control-chars-01C.html
(live test)
(source)
control-chars-01D.html
(live test)
(source)
control-chars-01E.html
(live test)
(source)
control-chars-01F.html
(live test)
(source)
control-chars-07F.html
(live test)
(source)
control-chars-080.html
(live test)
(source)
control-chars-081.html
(live test)
(source)
control-chars-082.html
(live test)
(source)
control-chars-083.html
(live test)
(source)
control-chars-084.html
(live test)
(source)
control-chars-085.html
(live test)
(source)
control-chars-086.html
(live test)
(source)
control-chars-087.html
(live test)
(source)
control-chars-088.html
(live test)
(source)
control-chars-089.html
(live test)
(source)
control-chars-08A.html
(live test)
(source)
control-chars-08B.html
(live test)
(source)
control-chars-08C.html
(live test)
(source)
control-chars-08D.html
(live test)
(source)
control-chars-08E.html
(live test)
(source)
control-chars-08F.html
(live test)
(source)
control-chars-090.html
(live test)
(source)
control-chars-091.html
(live test)
(source)
control-chars-092.html
(live test)
(source)
control-chars-093.html
(live test)
(source)
control-chars-094.html
(live test)
(source)
control-chars-095.html
(live test)
(source)
control-chars-096.html
(live test)
(source)
control-chars-097.html
(live test)
(source)
control-chars-098.html
(live test)
(source)
control-chars-099.html
(live test)
(source)
control-chars-09A.html
(live test)
(source)
control-chars-09B.html
(live test)
(source)
control-chars-09C.html
(live test)
(source)
control-chars-09D.html
(live test)
(source)
control-chars-09E.html
(live test)
(source)
control-chars-09F.html
(live test)
(source)
control-characters-001.html (visual test)
(source)
control-characters-002.xht (visual test)
(source)
white-space-control-characters-001.xht (visual test)
(source)
Carriage returns (U+000D) are treated identically to spaces (U+0020) in all respects.
Tests
control-chars-00D.html
(live test)
(source)
white-space-processing-005.xht
(live test)
(source)
white-space-processing-006.xht
(live test)
(source)
white-space-processing-007.xht
(live test)
(source)
Note:
For HTML documents,
carriage returns present in the source code
are converted to line feeds at the parsing stage
(see
HTML
§ 13.2.3.5 Preprocessing the input stream
and the definition of
normalize newlines
in
Infra
and therefore do no appear as U+000D CARRIAGE RETURN to CSS.
[HTML]
[INFRA]
However, the character
is
preserved—and the above rule observable—when encoded using an escape sequence (
).
4.1.
White Space Collapsing: the
white-space-collapse
property
Tests
This section has limited direct coverage,
but extensive coverage through the 'white-space' shorthand.
Missing tests:
* any direct tests as a longhand (other than syntax and inheritance)
* tests of the preserve-spaces value (direct or indirect)
* tests of the discard value (direct or indirect)
This section is still under discussion and may change in future drafts.
Name:
white-space-collapse
Value:
collapse
discard
preserve
preserve-breaks
preserve-spaces
break-spaces
Initial:
collapse
Applies to:
text
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
per grammar
Animation type:
discrete
Tests
inheritance.html
(live test)
(source)
white-space-collapse-valid.html
(live test)
(source)
white-space-collapse-computed.html
(live test)
(source)
white-space-collapse-invalid.html
(live test)
(source)
This property specifies whether and how
white space
is collapsed.
Values have the following meanings,
which must be interpreted according to
the
White Space Processing Rules
collapse
This value directs user agents to collapse sequences of
white space
into a single character
(or
in some cases
, no character).
Tests
Direct tests as a longhand:
CSS 2 indirect tests via 'white-space: normal':
white-space-normal-002.xht
(live test)
(source)
white-space-normal-003.xht
(live test)
(source)
white-space-normal-004.xht
(live test)
(source)
white-space-normal-005.xht
(live test)
(source)
white-space-normal-006.xht
(live test)
(source)
white-space-normal-007.xht
(live test)
(source)
white-space-normal-008.xht
(live test)
(source)
white-space-normal-009.xht
(live test)
(source)
white-space-p-element-001.xht
(live test)
(source)
CSS 2 indirect tests via 'white-space: nowrap':
white-space-nowrap-001.xht
(live test)
(source)
white-space-nowrap-005.xht
(live test)
(source)
white-space-nowrap-006.xht
(live test)
(source)
text-align-white-space-004.xht
(live test)
(source)
text-align-white-space-008.xht
(live test)
(source)
white-space-nowrap-attribute-001.xht
(live test)
(source)
white-space-processing-006.xht
(live test)
(source)
Indirect tests via 'white-space: normal':
hyphens-auto-003.html
(live test)
(source)
line-break-anywhere-and-white-space-004.html
(live test)
(source)
line-break-anywhere-and-white-space-005.html
(live test)
(source)
line-breaking-001.html
(live test)
(source)
line-breaking-002.html
(live test)
(source)
line-breaking-003.html
(live test)
(source)
line-breaking-004.html
(live test)
(source)
line-breaking-005.html
(live test)
(source)
line-breaking-006.html
(live test)
(source)
line-breaking-007.html
(live test)
(source)
line-breaking-008.html
(live test)
(source)
line-breaking-009.html
(live test)
(source)
line-breaking-010.html
(live test)
(source)
line-breaking-011.html
(live test)
(source)
line-breaking-ic-001.html
(live test)
(source)
line-breaking-ic-002.html
(live test)
(source)
line-breaking-ic-003.html
(live test)
(source)
overflow-wrap-anywhere-011.html
(live test)
(source)
overflow-wrap-break-word-white-space-crash.html
(live test)
(source)
trailing-ideographic-space-005.html
(live test)
(source)
trailing-ideographic-space-006.html
(live test)
(source)
trailing-space-and-text-alignment-001.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-001.html
(live test)
(source)
white-space-applies-to-text-001.html
(live test)
(source)
white-space-normal-011.html
(live test)
(source)
white-space-nowrap-011.html
(live test)
(source)
white-space-pre-031.html
(live test)
(source)
white-space-wrap-after-nowrap-001.html
(live test)
(source)
break-boundary-2-chars-001.html
(live test)
(source)
word-break-break-all-062.html
(live test)
(source)
word-break-keep-all-063.html
(live test)
(source)
white-space-intrinsic-size-021.html
(live test)
(source)
Indirect tests via 'white-space: nowrap':
hanging-punctuation-allow-end-001.xht
(live test)
(source)
hanging-punctuation-first-001.xht
(live test)
(source)
hanging-punctuation-force-end-001.xht
(live test)
(source)
hanging-punctuation-last-001.xht
(live test)
(source)
letter-spacing-206.html
(live test)
(source)
line-break-anywhere-and-white-space-002.html
(live test)
(source)
line-breaking-012.html
(live test)
(source)
line-breaking-atomic-nowrap-001.html
(live test)
(source)
overflow-wrap-002.html
(live test)
(source)
overflow-wrap-anywhere-008.html
(live test)
(source)
overflow-wrap-break-word-white-space-crash-002.html
(live test)
(source)
word-wrap-002.html
(live test)
(source)
text-transform-capitalize-001.html
(live test)
(source)
text-transform-capitalize-003.html
(live test)
(source)
text-transform-capitalize-005.html
(live test)
(source)
text-transform-capitalize-007.html
(live test)
(source)
text-transform-capitalize-009.html
(live test)
(source)
text-transform-capitalize-010.html
(live test)
(source)
text-transform-capitalize-011.html
(live test)
(source)
text-transform-capitalize-014.html
(live test)
(source)
text-transform-capitalize-016.html
(live test)
(source)
text-transform-capitalize-018.html
(live test)
(source)
text-transform-capitalize-020.html
(live test)
(source)
text-transform-capitalize-022.html
(live test)
(source)
text-transform-capitalize-024.html
(live test)
(source)
text-transform-capitalize-026.html
(live test)
(source)
text-transform-capitalize-028.html
(live test)
(source)
text-transform-capitalize-030.html
(live test)
(source)
text-transform-full-size-kana-005.html
(live test)
(source)
text-transform-full-size-kana-006.html
(live test)
(source)
text-transform-full-size-kana-007.html
(live test)
(source)
text-transform-fullwidth-001.xht
(live test)
(source)
text-transform-upperlower-001.html
(live test)
(source)
text-transform-upperlower-002.html
(live test)
(source)
text-transform-upperlower-003.html
(live test)
(source)
text-transform-upperlower-004.html
(live test)
(source)
text-transform-upperlower-005.html
(live test)
(source)
text-transform-upperlower-006.html
(live test)
(source)
text-transform-upperlower-007.html
(live test)
(source)
text-transform-upperlower-008.html
(live test)
(source)
text-transform-upperlower-009.html
(live test)
(source)
text-transform-upperlower-010.html
(live test)
(source)
text-transform-upperlower-011.html
(live test)
(source)
text-transform-upperlower-012.html
(live test)
(source)
text-transform-upperlower-014.html
(live test)
(source)
text-transform-upperlower-015.html
(live test)
(source)
text-transform-upperlower-016.html
(live test)
(source)
text-transform-upperlower-017.html
(live test)
(source)
text-transform-upperlower-018.html
(live test)
(source)
text-transform-upperlower-019.html
(live test)
(source)
text-transform-upperlower-020.html
(live test)
(source)
text-transform-upperlower-021.html
(live test)
(source)
text-transform-upperlower-022.html
(live test)
(source)
text-transform-upperlower-023.html
(live test)
(source)
text-transform-upperlower-024.html
(live test)
(source)
text-transform-upperlower-025.html
(live test)
(source)
text-transform-upperlower-026.html
(live test)
(source)
text-transform-upperlower-027.html
(live test)
(source)
text-transform-upperlower-028.html
(live test)
(source)
text-transform-upperlower-029.html
(live test)
(source)
text-transform-upperlower-030.html
(live test)
(source)
text-transform-upperlower-031.html
(live test)
(source)
text-transform-upperlower-032.html
(live test)
(source)
text-transform-upperlower-033.html
(live test)
(source)
text-transform-upperlower-034.html
(live test)
(source)
text-transform-upperlower-035.html
(live test)
(source)
text-transform-upperlower-039.html
(live test)
(source)
text-transform-upperlower-040.html
(live test)
(source)
text-transform-upperlower-041.html
(live test)
(source)
text-transform-upperlower-042.html
(live test)
(source)
text-transform-upperlower-043.html
(live test)
(source)
text-transform-upperlower-044.html
(live test)
(source)
text-transform-upperlower-101.html
(live test)
(source)
text-transform-upperlower-102.html
(live test)
(source)
text-transform-upperlower-103.html
(live test)
(source)
text-transform-upperlower-104.html
(live test)
(source)
control-chars-00D.html
(live test)
(source)
nowrap-wbr-and-space-crash.html
(live test)
(source)
trailing-ideographic-space-007.html
(live test)
(source)
trailing-ideographic-space-009.html
(live test)
(source)
trailing-ogham-003.html
(live test)
(source)
trailing-other-space-separators-004.html
(live test)
(source)
white-space-applies-to-text-001.html
(live test)
(source)
white-space-nowrap-011.html
(live test)
(source)
white-space-wrap-after-nowrap-001.html
(live test)
(source)
word-break-auto-phrase-wbr-nobr-002.html
(live test)
(source)
break-boundary-2-chars-002.html
(live test)
(source)
word-break-break-word-crash-001.html
(live test)
(source)
white-space-intrinsic-size-021.html
(live test)
(source)
preserve
This value prevents user agents from collapsing sequences of
white space
Segment breaks
such as line feeds
are preserved as
forced line breaks
Tests
Direct tests as a longhand:
CSS 2 indirect tests via 'white-space: pre':
white-space-pre-001.xht
(live test)
(source)
white-space-pre-002.xht
(live test)
(source)
white-space-pre-005.xht
(live test)
(source)
white-space-pre-006.xht
(live test)
(source)
white-space-pre-007.xht (visual test)
(source)
white-space-pre-element-001.xht
(live test)
(source)
Indirect tests via 'white-space: pre':
white-space-zero-fontsize-001.html
(live test)
(source)
white-space-zero-fontsize-002.html
(live test)
(source)
bidi-lines-001.html
(live test)
(source)
bidi-tab-001.html
(live test)
(source)
letter-spacing-206.html
(live test)
(source)
letter-spacing-bidi-003.xht
(live test)
(source)
letter-spacing-bidi-004.xht
(live test)
(source)
letter-spacing-bidi-005.xht
(live test)
(source)
letter-spacing-nesting-003.xht
(live test)
(source)
line-break-anywhere-005.html
(live test)
(source)
line-break-anywhere-and-white-space-001.html
(live test)
(source)
line-break-anywhere-and-white-space-003.html
(live test)
(source)
line-breaking-009.html
(live test)
(source)
line-breaking-010.html
(live test)
(source)
line-breaking-011.html
(live test)
(source)
line-breaking-023.html
(live test)
(source)
line-breaking-024.html
(live test)
(source)
line-breaking-025.html
(live test)
(source)
line-breaking-026.html
(live test)
(source)
line-breaking-027.html
(live test)
(source)
line-breaking-ic-001.html
(live test)
(source)
line-breaking-ic-002.html
(live test)
(source)
line-breaking-ic-003.html
(live test)
(source)
line-breaking-replaced-006.html
(live test)
(source)
overflow-wrap-break-word-007.html
(live test)
(source)
overflow-wrap-break-word-008.html
(live test)
(source)
overflow-wrap-break-word-white-space-crash.html
(live test)
(source)
tab-size-block-ancestor.html
(live test)
(source)
tab-size-inheritance-001.html
(live test)
(source)
tab-size-inline-001.html
(live test)
(source)
tab-size-inline-002.html
(live test)
(source)
tab-size-integer-004.html
(live test)
(source)
tab-size-spacing-001.html
(live test)
(source)
tab-size-spacing-002.html
(live test)
(source)
tab-size-spacing-003.html
(live test)
(source)
text-indent-length-002.html
(live test)
(source)
text-indent-tab-positions-001.html
(live test)
(source)
text-justify-006.html
(live test)
(source)
text-transform-capitalize-035.html
(live test)
(source)
text-transform-fullwidth-008.html
(live test)
(source)
text-transform-fullwidth-009.html
(live test)
(source)
break-spaces-009.html
(live test)
(source)
break-spaces-newline-011.html
(live test)
(source)
break-spaces-newline-012.html
(live test)
(source)
break-spaces-newline-013.html
(live test)
(source)
break-spaces-newline-014.html
(live test)
(source)
break-spaces-newline-015.html
(live test)
(source)
break-spaces-newline-016.html
(live test)
(source)
break-spaces-tab-005.html
(live test)
(source)
break-spaces-tab-006.html
(live test)
(source)
break-spaces-with-ideographic-space-009.html
(live test)
(source)
break-spaces-with-overflow-wrap-009.html
(live test)
(source)
break-spaces-with-overflow-wrap-010.html
(live test)
(source)
control-chars-00D.html
(live test)
(source)
eol-spaces-bidi-001.html
(live test)
(source)
eol-spaces-bidi-002.html
(live test)
(source)
pre-float-001.html
(live test)
(source)
pre-with-whitespace-crash.html
(live test)
(source)
pre-wrap-008.html
(live test)
(source)
pre-wrap-009.html
(live test)
(source)
pre-wrap-010.html
(live test)
(source)
pre-wrap-016.html
(live test)
(source)
pre-wrap-018.html
(live test)
(source)
pre-wrap-019.html
(live test)
(source)
pre-wrap-020.html
(live test)
(source)
tab-bidi-001.html
(live test)
(source)
tab-stop-threshold-001.html
(live test)
(source)
tab-stop-threshold-002.html
(live test)
(source)
trailing-other-space-separators-001.html
(live test)
(source)
trailing-other-space-separators-003.html
(live test)
(source)
trailing-other-space-separators-004.html
(live test)
(source)
trailing-other-space-separators-break-spaces-001.html
(live test)
(source)
trailing-other-space-separators-break-spaces-002.html
(live test)
(source)
trailing-other-space-separators-break-spaces-003.html
(live test)
(source)
trailing-other-space-separators-break-spaces-004.html
(live test)
(source)
trailing-other-space-separators-break-spaces-005.html
(live test)
(source)
trailing-other-space-separators-break-spaces-006.html
(live test)
(source)
trailing-other-space-separators-break-spaces-007.html
(live test)
(source)
trailing-other-space-separators-break-spaces-008.html
(live test)
(source)
trailing-other-space-separators-break-spaces-009.html
(live test)
(source)
trailing-other-space-separators-break-spaces-010.html
(live test)
(source)
trailing-other-space-separators-break-spaces-011.html
(live test)
(source)
trailing-other-space-separators-break-spaces-012.html
(live test)
(source)
trailing-other-space-separators-break-spaces-013.html
(live test)
(source)
trailing-other-space-separators-break-spaces-014.html
(live test)
(source)
trailing-other-space-separators-break-spaces-015.html
(live test)
(source)
trailing-space-align-start.tentative.html
(live test)
(source)
trailing-space-and-text-alignment-002.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-002.html
(live test)
(source)
white-space-applies-to-text-001.html
(live test)
(source)
white-space-intrinsic-size-015.html
(live test)
(source)
white-space-intrinsic-size-016.html
(live test)
(source)
white-space-intrinsic-size-018.html
(live test)
(source)
white-space-intrinsic-size-021.html
(live test)
(source)
white-space-letter-spacing-001.html
(live test)
(source)
white-space-normal-011.html
(live test)
(source)
white-space-pre-011.html
(live test)
(source)
white-space-pre-031.html
(live test)
(source)
white-space-pre-032.html
(live test)
(source)
white-space-pre-034.html
(live test)
(source)
white-space-pre-035.html
(live test)
(source)
white-space-pre-051.html
(live test)
(source)
white-space-pre-052.html
(live test)
(source)
ws-break-spaces-applies-to-001.html
(live test)
(source)
ws-break-spaces-applies-to-002.html
(live test)
(source)
ws-break-spaces-applies-to-003.html
(live test)
(source)
ws-break-spaces-applies-to-005.html
(live test)
(source)
ws-break-spaces-applies-to-006.html
(live test)
(source)
ws-break-spaces-applies-to-007.html
(live test)
(source)
ws-break-spaces-applies-to-008.html
(live test)
(source)
ws-break-spaces-applies-to-009.html
(live test)
(source)
ws-break-spaces-applies-to-010.html
(live test)
(source)
ws-break-spaces-applies-to-011.html
(live test)
(source)
ws-break-spaces-applies-to-014.html
(live test)
(source)
ws-break-spaces-applies-to-015.html
(live test)
(source)
break-boundary-2-chars-001.html
(live test)
(source)
break-boundary-2-chars-002.html
(live test)
(source)
word-break-break-all-010.html
(live test)
(source)
word-break-break-all-011.html
(live test)
(source)
word-break-break-all-012.html
(live test)
(source)
word-break-break-all-013.html
(live test)
(source)
word-break-break-all-015.html
(live test)
(source)
word-break-break-all-017.html
(live test)
(source)
word-break-break-all-ethiopic.html
(live test)
(source)
word-break-normal-ethiopic.html
(live test)
(source)
word-space-transform-008.html
(live test)
(source)
word-space-transform-011.html
(live test)
(source)
Indirect tests via 'white-space: pre-wrap':
trailing-space-with-cr-crash.html
(live test)
(source)
white-space-pre-wrap-chash.html
(live test)
(source)
hyphens-auto-002.html
(live test)
(source)
css3-text-line-break-baspglwj-001.html
(live test)
(source)
css3-text-line-break-baspglwj-002.html
(live test)
(source)
css3-text-line-break-baspglwj-003.html
(live test)
(source)
css3-text-line-break-baspglwj-004.html
(live test)
(source)
css3-text-line-break-baspglwj-005.html
(live test)
(source)
css3-text-line-break-baspglwj-006.html
(live test)
(source)
css3-text-line-break-baspglwj-007.html
(live test)
(source)
css3-text-line-break-baspglwj-008.html
(live test)
(source)
css3-text-line-break-baspglwj-009.html
(live test)
(source)
css3-text-line-break-baspglwj-010.html
(live test)
(source)
css3-text-line-break-baspglwj-011.html
(live test)
(source)
css3-text-line-break-baspglwj-012.html
(live test)
(source)
css3-text-line-break-baspglwj-014.html
(live test)
(source)
css3-text-line-break-baspglwj-015.html
(live test)
(source)
css3-text-line-break-baspglwj-016.html
(live test)
(source)
css3-text-line-break-baspglwj-017.html
(live test)
(source)
css3-text-line-break-baspglwj-018.html
(live test)
(source)
css3-text-line-break-baspglwj-019.html
(live test)
(source)
css3-text-line-break-baspglwj-020.html
(live test)
(source)
css3-text-line-break-baspglwj-021.html
(live test)
(source)
css3-text-line-break-baspglwj-022.html
(live test)
(source)
css3-text-line-break-baspglwj-023.html
(live test)
(source)
css3-text-line-break-baspglwj-024.html
(live test)
(source)
css3-text-line-break-baspglwj-025.html
(live test)
(source)
css3-text-line-break-baspglwj-026.html
(live test)
(source)
css3-text-line-break-baspglwj-030.html
(live test)
(source)
css3-text-line-break-baspglwj-031.html
(live test)
(source)
css3-text-line-break-baspglwj-032.html
(live test)
(source)
css3-text-line-break-baspglwj-033.html
(live test)
(source)
css3-text-line-break-baspglwj-034.html
(live test)
(source)
css3-text-line-break-baspglwj-035.html
(live test)
(source)
css3-text-line-break-baspglwj-036.html
(live test)
(source)
css3-text-line-break-baspglwj-037.html
(live test)
(source)
css3-text-line-break-baspglwj-038.html
(live test)
(source)
css3-text-line-break-baspglwj-039.html
(live test)
(source)
css3-text-line-break-baspglwj-040.html
(live test)
(source)
css3-text-line-break-baspglwj-041.html
(live test)
(source)
css3-text-line-break-baspglwj-042.html
(live test)
(source)
css3-text-line-break-baspglwj-043.html
(live test)
(source)
css3-text-line-break-baspglwj-044.html
(live test)
(source)
css3-text-line-break-baspglwj-045.html
(live test)
(source)
css3-text-line-break-baspglwj-046.html
(live test)
(source)
css3-text-line-break-baspglwj-047.html
(live test)
(source)
css3-text-line-break-baspglwj-048.html
(live test)
(source)
css3-text-line-break-baspglwj-049.html
(live test)
(source)
css3-text-line-break-baspglwj-050.html
(live test)
(source)
css3-text-line-break-baspglwj-051.html
(live test)
(source)
css3-text-line-break-baspglwj-052.html
(live test)
(source)
css3-text-line-break-baspglwj-060.html
(live test)
(source)
css3-text-line-break-baspglwj-061.html
(live test)
(source)
css3-text-line-break-baspglwj-062.html
(live test)
(source)
css3-text-line-break-baspglwj-063.html
(live test)
(source)
css3-text-line-break-baspglwj-064.html
(live test)
(source)
css3-text-line-break-baspglwj-065.html
(live test)
(source)
css3-text-line-break-baspglwj-066.html
(live test)
(source)
css3-text-line-break-baspglwj-067.html
(live test)
(source)
css3-text-line-break-baspglwj-068.html
(live test)
(source)
css3-text-line-break-baspglwj-069.html
(live test)
(source)
css3-text-line-break-baspglwj-070.html
(live test)
(source)
css3-text-line-break-baspglwj-071.html
(live test)
(source)
css3-text-line-break-baspglwj-072.html
(live test)
(source)
css3-text-line-break-baspglwj-073.html
(live test)
(source)
css3-text-line-break-baspglwj-074.html
(live test)
(source)
css3-text-line-break-baspglwj-075.html
(live test)
(source)
css3-text-line-break-baspglwj-076.html
(live test)
(source)
css3-text-line-break-baspglwj-077.html
(live test)
(source)
css3-text-line-break-baspglwj-078.html
(live test)
(source)
css3-text-line-break-baspglwj-080.html
(live test)
(source)
css3-text-line-break-baspglwj-081.html
(live test)
(source)
css3-text-line-break-baspglwj-082.html
(live test)
(source)
css3-text-line-break-baspglwj-083.html
(live test)
(source)
css3-text-line-break-baspglwj-084.html
(live test)
(source)
css3-text-line-break-baspglwj-085.html
(live test)
(source)
css3-text-line-break-baspglwj-086.html
(live test)
(source)
css3-text-line-break-baspglwj-090.html
(live test)
(source)
css3-text-line-break-baspglwj-091.html
(live test)
(source)
css3-text-line-break-baspglwj-092.html
(live test)
(source)
css3-text-line-break-baspglwj-093.html
(live test)
(source)
css3-text-line-break-baspglwj-095.html
(live test)
(source)
css3-text-line-break-baspglwj-096.html
(live test)
(source)
css3-text-line-break-baspglwj-097.html
(live test)
(source)
css3-text-line-break-baspglwj-098.html
(live test)
(source)
css3-text-line-break-baspglwj-099.html
(live test)
(source)
css3-text-line-break-baspglwj-100.html
(live test)
(source)
css3-text-line-break-baspglwj-101.html
(live test)
(source)
css3-text-line-break-baspglwj-102.html
(live test)
(source)
css3-text-line-break-baspglwj-103.html
(live test)
(source)
css3-text-line-break-baspglwj-104.html
(live test)
(source)
css3-text-line-break-baspglwj-105.html
(live test)
(source)
css3-text-line-break-baspglwj-106.html
(live test)
(source)
css3-text-line-break-baspglwj-107.html
(live test)
(source)
css3-text-line-break-baspglwj-108.html
(live test)
(source)
css3-text-line-break-baspglwj-109.html
(live test)
(source)
css3-text-line-break-baspglwj-110.html
(live test)
(source)
css3-text-line-break-baspglwj-111.html
(live test)
(source)
css3-text-line-break-baspglwj-112.html
(live test)
(source)
css3-text-line-break-baspglwj-113.html
(live test)
(source)
css3-text-line-break-baspglwj-114.html
(live test)
(source)
css3-text-line-break-baspglwj-115.html
(live test)
(source)
css3-text-line-break-baspglwj-116.html
(live test)
(source)
css3-text-line-break-baspglwj-117.html
(live test)
(source)
css3-text-line-break-baspglwj-118.html
(live test)
(source)
css3-text-line-break-baspglwj-120.html
(live test)
(source)
css3-text-line-break-baspglwj-121.html
(live test)
(source)
css3-text-line-break-baspglwj-122.html
(live test)
(source)
css3-text-line-break-baspglwj-123.html
(live test)
(source)
css3-text-line-break-baspglwj-124.html
(live test)
(source)
css3-text-line-break-baspglwj-125.html
(live test)
(source)
css3-text-line-break-baspglwj-126.html
(live test)
(source)
css3-text-line-break-baspglwj-127.html
(live test)
(source)
css3-text-line-break-baspglwj-128.html
(live test)
(source)
css3-text-line-break-baspglwj-130.html
(live test)
(source)
css3-text-line-break-baspglwj-131.html
(live test)
(source)
letter-spacing-200.html
(live test)
(source)
letter-spacing-201.html
(live test)
(source)
letter-spacing-203.html
(live test)
(source)
letter-spacing-204.html
(live test)
(source)
letter-spacing-205.html
(live test)
(source)
letter-spacing-211.html
(live test)
(source)
letter-spacing-212.html
(live test)
(source)
line-break-anywhere-008.html
(live test)
(source)
line-break-anywhere-010.html
(live test)
(source)
line-break-anywhere-and-white-space-006.html
(live test)
(source)
line-break-anywhere-and-white-space-007.html
(live test)
(source)
overflow-wrap-anywhere-004.html
(live test)
(source)
overflow-wrap-anywhere-005.html
(live test)
(source)
overflow-wrap-break-word-004.html
(live test)
(source)
overflow-wrap-break-word-005.html
(live test)
(source)
overflow-wrap-break-word-007.html
(live test)
(source)
overflow-wrap-break-word-white-space-crash-002.html
(live test)
(source)
overflow-wrap-min-content-size-009.html
(live test)
(source)
text-justify-and-trailing-spaces-001.html
(live test)
(source)
text-justify-and-trailing-spaces-002.html
(live test)
(source)
text-justify-and-trailing-spaces-003.html
(live test)
(source)
text-justify-and-trailing-spaces-004.html
(live test)
(source)
text-justify-and-trailing-spaces-005.html
(live test)
(source)
text-justify-and-trailing-spaces-006.html
(live test)
(source)
text-transform-fullwidth-007.html
(live test)
(source)
text-transform-fullwidth-009.html
(live test)
(source)
break-spaces-newline-011.html
(live test)
(source)
break-spaces-newline-012.html
(live test)
(source)
break-spaces-newline-013.html
(live test)
(source)
break-spaces-newline-014.html
(live test)
(source)
break-spaces-newline-015.html
(live test)
(source)
break-spaces-newline-016.html
(live test)
(source)
control-chars-00D.html
(live test)
(source)
eol-spaces-bidi-002.html
(live test)
(source)
eol-spaces-bidi-003.html
(live test)
(source)
pre-wrap-001.html
(live test)
(source)
pre-wrap-002.html
(live test)
(source)
pre-wrap-003.html
(live test)
(source)
pre-wrap-004.html
(live test)
(source)
pre-wrap-005.html
(live test)
(source)
pre-wrap-006.html
(live test)
(source)
pre-wrap-007.html
(live test)
(source)
pre-wrap-008.html
(live test)
(source)
pre-wrap-009.html
(live test)
(source)
pre-wrap-010.html
(live test)
(source)
pre-wrap-011.html
(live test)
(source)
pre-wrap-012.html
(live test)
(source)
pre-wrap-013.html
(live test)
(source)
pre-wrap-014.html
(live test)
(source)
pre-wrap-015.html
(live test)
(source)
pre-wrap-016.html
(live test)
(source)
pre-wrap-017.html
(live test)
(source)
pre-wrap-018.html
(live test)
(source)
pre-wrap-019.html
(live test)
(source)
pre-wrap-020.html
(live test)
(source)
pre-wrap-051.html
(live test)
(source)
pre-wrap-052.html
(live test)
(source)
pre-wrap-align-center-001.html
(live test)
(source)
pre-wrap-align-center-002.html
(live test)
(source)
pre-wrap-align-center-003.html
(live test)
(source)
pre-wrap-align-end-001.html
(live test)
(source)
pre-wrap-align-end-002.html
(live test)
(source)
pre-wrap-align-end-003.html
(live test)
(source)
pre-wrap-align-left-001.html
(live test)
(source)
pre-wrap-align-left-002.html
(live test)
(source)
pre-wrap-align-left-003.html
(live test)
(source)
pre-wrap-align-right-001.html
(live test)
(source)
pre-wrap-align-right-002.html
(live test)
(source)
pre-wrap-align-right-003.html
(live test)
(source)
pre-wrap-align-start-001.html
(live test)
(source)
pre-wrap-align-start-002.html
(live test)
(source)
pre-wrap-align-start-003.html
(live test)
(source)
pre-wrap-float-001.html
(live test)
(source)
pre-wrap-leading-spaces-001.html
(live test)
(source)
pre-wrap-leading-spaces-002.html
(live test)
(source)
pre-wrap-leading-spaces-003.html
(live test)
(source)
pre-wrap-leading-spaces-004.html
(live test)
(source)
pre-wrap-leading-spaces-005.html
(live test)
(source)
pre-wrap-leading-spaces-006.html
(live test)
(source)
pre-wrap-leading-spaces-007.html
(live test)
(source)
pre-wrap-leading-spaces-008.html
(live test)
(source)
pre-wrap-leading-spaces-009.html
(live test)
(source)
pre-wrap-leading-spaces-010.html
(live test)
(source)
pre-wrap-leading-spaces-011.html
(live test)
(source)
pre-wrap-leading-spaces-012.html
(live test)
(source)
pre-wrap-leading-spaces-013.html
(live test)
(source)
pre-wrap-leading-spaces-014.html
(live test)
(source)
pre-wrap-leading-spaces-015.html
(live test)
(source)
pre-wrap-leading-spaces-016.html
(live test)
(source)
pre-wrap-leading-spaces-017.html
(live test)
(source)
pre-wrap-tab-001.html
(live test)
(source)
pre-wrap-tab-002.html
(live test)
(source)
pre-wrap-tab-003.html
(live test)
(source)
pre-wrap-tab-004.html
(live test)
(source)
pre-wrap-tab-005.html
(live test)
(source)
pre-wrap-tab-006.html
(live test)
(source)
tab-stop-threshold-003.html
(live test)
(source)
tab-stop-threshold-004.html
(live test)
(source)
textarea-pre-wrap-001.html
(live test)
(source)
textarea-pre-wrap-002.html
(live test)
(source)
textarea-pre-wrap-003.html
(live test)
(source)
textarea-pre-wrap-004.html
(live test)
(source)
textarea-pre-wrap-005.html
(live test)
(source)
textarea-pre-wrap-006.html
(live test)
(source)
textarea-pre-wrap-007.html
(live test)
(source)
textarea-pre-wrap-011.html
(live test)
(source)
textarea-pre-wrap-012.html
(live test)
(source)
textarea-pre-wrap-013.html
(live test)
(source)
textarea-pre-wrap-014.html
(live test)
(source)
trailing-ideographic-space-003.html
(live test)
(source)
trailing-ideographic-space-004.html
(live test)
(source)
trailing-other-space-separators-002.html
(live test)
(source)
trailing-space-align-start.tentative.html
(live test)
(source)
trailing-space-and-text-alignment-003.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-003.html
(live test)
(source)
trailing-space-in-inline-box.html
(live test)
(source)
trailing-space-position-001.html
(live test)
(source)
trailing-space-rtl-001.html
(live test)
(source)
white-space-applies-to-text-001.html
(live test)
(source)
white-space-intrinsic-size-003.html
(live test)
(source)
white-space-intrinsic-size-004.html
(live test)
(source)
white-space-intrinsic-size-005.html
(live test)
(source)
white-space-intrinsic-size-006.html
(live test)
(source)
white-space-intrinsic-size-013.html
(live test)
(source)
white-space-intrinsic-size-014.html
(live test)
(source)
white-space-intrinsic-size-017.html
(live test)
(source)
white-space-intrinsic-size-021.html
(live test)
(source)
white-space-letter-spacing-001.html
(live test)
(source)
white-space-pre-032.html
(live test)
(source)
white-space-pre-wrap-justify-001.html
(live test)
(source)
white-space-pre-wrap-justify-002.html
(live test)
(source)
white-space-pre-wrap-justify-003.html
(live test)
(source)
white-space-pre-wrap-justify-004.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-001.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-002.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-003.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-004.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-005.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-006.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-007.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-008.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-010.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-011.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-012.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-013.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-014.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-015.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-021.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-022.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-023.html
(live test)
(source)
break-boundary-2-chars-001.html
(live test)
(source)
word-break-break-all-010.html
(live test)
(source)
word-break-break-all-011.html
(live test)
(source)
word-break-break-all-015.html
(live test)
(source)
word-break-break-all-019.html
(live test)
(source)
word-break-break-all-021.html
(live test)
(source)
word-break-break-all-062.html
(live test)
(source)
word-break-keep-all-007.html
(live test)
(source)
word-break-keep-all-063.html
(live test)
(source)
word-break-min-content-007.html
(live test)
(source)
preserve-breaks
Like
collapse
this value collapses consecutive
white space characters
but preserves
segment breaks
in the source as
forced line breaks
Tests
Direct tests as a longhand:
white-space-collapse-preserve-breaks-001.xht
(live test)
(source)
CSS 2 indirect tests via 'white-space: pre-line':
white-space-005.xht
(live test)
(source)
white-space-generated-content-before-001.xht
(live test)
(source)
white-space-processing-004.xht
(live test)
(source)
white-space-processing-007.xht
(live test)
(source)
white-space-processing-010.xht
(live test)
(source)
white-space-processing-021.xht
(live test)
(source)
white-space-processing-024.xht
(live test)
(source)
white-space-processing-027.xht
(live test)
(source)
white-space-processing-028.xht
(live test)
(source)
white-space-processing-029.xht
(live test)
(source)
white-space-processing-030.xht
(live test)
(source)
white-space-processing-035.xht
(live test)
(source)
white-space-processing-036.xht
(live test)
(source)
white-space-processing-045.xht
(live test)
(source)
white-space-processing-053.xht
(live test)
(source)
text-align-white-space-002.xht
(live test)
(source)
text-align-white-space-006.xht
(live test)
(source)
Indirect tests via 'white-space: pre-line':
css3-text-line-break-baspglwj-001.html
(live test)
(source)
css3-text-line-break-baspglwj-002.html
(live test)
(source)
css3-text-line-break-baspglwj-003.html
(live test)
(source)
css3-text-line-break-baspglwj-004.html
(live test)
(source)
css3-text-line-break-baspglwj-005.html
(live test)
(source)
css3-text-line-break-baspglwj-006.html
(live test)
(source)
css3-text-line-break-baspglwj-007.html
(live test)
(source)
css3-text-line-break-baspglwj-008.html
(live test)
(source)
css3-text-line-break-baspglwj-009.html
(live test)
(source)
css3-text-line-break-baspglwj-010.html
(live test)
(source)
css3-text-line-break-baspglwj-011.html
(live test)
(source)
css3-text-line-break-baspglwj-012.html
(live test)
(source)
css3-text-line-break-baspglwj-014.html
(live test)
(source)
css3-text-line-break-baspglwj-015.html
(live test)
(source)
css3-text-line-break-baspglwj-016.html
(live test)
(source)
css3-text-line-break-baspglwj-017.html
(live test)
(source)
css3-text-line-break-baspglwj-018.html
(live test)
(source)
css3-text-line-break-baspglwj-019.html
(live test)
(source)
css3-text-line-break-baspglwj-020.html
(live test)
(source)
css3-text-line-break-baspglwj-021.html
(live test)
(source)
css3-text-line-break-baspglwj-022.html
(live test)
(source)
css3-text-line-break-baspglwj-023.html
(live test)
(source)
css3-text-line-break-baspglwj-024.html
(live test)
(source)
css3-text-line-break-baspglwj-025.html
(live test)
(source)
css3-text-line-break-baspglwj-026.html
(live test)
(source)
css3-text-line-break-baspglwj-030.html
(live test)
(source)
css3-text-line-break-baspglwj-031.html
(live test)
(source)
css3-text-line-break-baspglwj-032.html
(live test)
(source)
css3-text-line-break-baspglwj-033.html
(live test)
(source)
css3-text-line-break-baspglwj-034.html
(live test)
(source)
css3-text-line-break-baspglwj-035.html
(live test)
(source)
css3-text-line-break-baspglwj-036.html
(live test)
(source)
css3-text-line-break-baspglwj-037.html
(live test)
(source)
css3-text-line-break-baspglwj-038.html
(live test)
(source)
css3-text-line-break-baspglwj-039.html
(live test)
(source)
css3-text-line-break-baspglwj-040.html
(live test)
(source)
css3-text-line-break-baspglwj-041.html
(live test)
(source)
css3-text-line-break-baspglwj-042.html
(live test)
(source)
css3-text-line-break-baspglwj-043.html
(live test)
(source)
css3-text-line-break-baspglwj-044.html
(live test)
(source)
css3-text-line-break-baspglwj-045.html
(live test)
(source)
css3-text-line-break-baspglwj-046.html
(live test)
(source)
css3-text-line-break-baspglwj-047.html
(live test)
(source)
css3-text-line-break-baspglwj-048.html
(live test)
(source)
css3-text-line-break-baspglwj-049.html
(live test)
(source)
css3-text-line-break-baspglwj-050.html
(live test)
(source)
css3-text-line-break-baspglwj-051.html
(live test)
(source)
css3-text-line-break-baspglwj-052.html
(live test)
(source)
css3-text-line-break-baspglwj-060.html
(live test)
(source)
css3-text-line-break-baspglwj-061.html
(live test)
(source)
css3-text-line-break-baspglwj-062.html
(live test)
(source)
css3-text-line-break-baspglwj-063.html
(live test)
(source)
css3-text-line-break-baspglwj-064.html
(live test)
(source)
css3-text-line-break-baspglwj-065.html
(live test)
(source)
css3-text-line-break-baspglwj-066.html
(live test)
(source)
css3-text-line-break-baspglwj-067.html
(live test)
(source)
css3-text-line-break-baspglwj-068.html
(live test)
(source)
css3-text-line-break-baspglwj-069.html
(live test)
(source)
css3-text-line-break-baspglwj-070.html
(live test)
(source)
css3-text-line-break-baspglwj-071.html
(live test)
(source)
css3-text-line-break-baspglwj-072.html
(live test)
(source)
css3-text-line-break-baspglwj-073.html
(live test)
(source)
css3-text-line-break-baspglwj-074.html
(live test)
(source)
css3-text-line-break-baspglwj-075.html
(live test)
(source)
css3-text-line-break-baspglwj-076.html
(live test)
(source)
css3-text-line-break-baspglwj-077.html
(live test)
(source)
css3-text-line-break-baspglwj-078.html
(live test)
(source)
css3-text-line-break-baspglwj-080.html
(live test)
(source)
css3-text-line-break-baspglwj-081.html
(live test)
(source)
css3-text-line-break-baspglwj-082.html
(live test)
(source)
css3-text-line-break-baspglwj-083.html
(live test)
(source)
css3-text-line-break-baspglwj-084.html
(live test)
(source)
css3-text-line-break-baspglwj-085.html
(live test)
(source)
css3-text-line-break-baspglwj-086.html
(live test)
(source)
css3-text-line-break-baspglwj-090.html
(live test)
(source)
css3-text-line-break-baspglwj-091.html
(live test)
(source)
css3-text-line-break-baspglwj-092.html
(live test)
(source)
css3-text-line-break-baspglwj-093.html
(live test)
(source)
css3-text-line-break-baspglwj-095.html
(live test)
(source)
css3-text-line-break-baspglwj-096.html
(live test)
(source)
css3-text-line-break-baspglwj-097.html
(live test)
(source)
css3-text-line-break-baspglwj-098.html
(live test)
(source)
css3-text-line-break-baspglwj-099.html
(live test)
(source)
css3-text-line-break-baspglwj-100.html
(live test)
(source)
css3-text-line-break-baspglwj-101.html
(live test)
(source)
css3-text-line-break-baspglwj-102.html
(live test)
(source)
css3-text-line-break-baspglwj-103.html
(live test)
(source)
css3-text-line-break-baspglwj-104.html
(live test)
(source)
css3-text-line-break-baspglwj-105.html
(live test)
(source)
css3-text-line-break-baspglwj-106.html
(live test)
(source)
css3-text-line-break-baspglwj-107.html
(live test)
(source)
css3-text-line-break-baspglwj-108.html
(live test)
(source)
css3-text-line-break-baspglwj-109.html
(live test)
(source)
css3-text-line-break-baspglwj-110.html
(live test)
(source)
css3-text-line-break-baspglwj-111.html
(live test)
(source)
css3-text-line-break-baspglwj-112.html
(live test)
(source)
css3-text-line-break-baspglwj-113.html
(live test)
(source)
css3-text-line-break-baspglwj-114.html
(live test)
(source)
css3-text-line-break-baspglwj-115.html
(live test)
(source)
css3-text-line-break-baspglwj-116.html
(live test)
(source)
css3-text-line-break-baspglwj-117.html
(live test)
(source)
css3-text-line-break-baspglwj-118.html
(live test)
(source)
css3-text-line-break-baspglwj-120.html
(live test)
(source)
css3-text-line-break-baspglwj-121.html
(live test)
(source)
css3-text-line-break-baspglwj-122.html
(live test)
(source)
css3-text-line-break-baspglwj-123.html
(live test)
(source)
css3-text-line-break-baspglwj-124.html
(live test)
(source)
css3-text-line-break-baspglwj-125.html
(live test)
(source)
css3-text-line-break-baspglwj-126.html
(live test)
(source)
css3-text-line-break-baspglwj-127.html
(live test)
(source)
css3-text-line-break-baspglwj-128.html
(live test)
(source)
css3-text-line-break-baspglwj-130.html
(live test)
(source)
css3-text-line-break-baspglwj-131.html
(live test)
(source)
control-chars-00D.html
(live test)
(source)
pre-line-051.html
(live test)
(source)
pre-line-052.html
(live test)
(source)
pre-line-br-with-whitespace-child-crash.html
(live test)
(source)
pre-line-with-space-and-newline.html
(live test)
(source)
trailing-ideographic-space-008.html
(live test)
(source)
trailing-ideographic-space-010.html
(live test)
(source)
trailing-ogham-002.html
(live test)
(source)
trailing-other-space-separators-003.html
(live test)
(source)
trailing-space-and-text-alignment-005.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-005.html
(live test)
(source)
white-space-applies-to-text-001.html
(live test)
(source)
white-space-intrinsic-size-019.html
(live test)
(source)
white-space-intrinsic-size-020.html
(live test)
(source)
white-space-intrinsic-size-021.html
(live test)
(source)
white-space-letter-spacing-001.html
(live test)
(source)
white-space-pre-035.html
(live test)
(source)
break-boundary-2-chars-001.html
(live test)
(source)
word-break-break-all-062.html
(live test)
(source)
word-break-keep-all-063.html
(live test)
(source)
preserve-spaces
This value prevents user agents
from collapsing sequences of
white space
and converts
tabs
and
segment breaks
to
spaces
(This value is intended to represent the behavior
of
xml:space="preserve"
in SVG.)
break-spaces
The behavior is identical to that of
preserve
except that:
Any sequence of
preserved
white space
or
other space separators
always takes up space,
including at the end of the line.
Tests
white-space-intrinsic-size-001.html
(live test)
(source)
white-space-intrinsic-size-002.html
(live test)
(source)
white-space-intrinsic-size-021.html
(live test)
(source)
soft wrap opportunity
exists
after every
preserved
white space
character
and after every
other space separator
(including between adjacent spaces).
Tests
overflow-wrap-break-word-002.html
(live test)
(source)
overflow-wrap-anywhere-002.html
(live test)
(source)
break-spaces-001.html
(live test)
(source)
break-spaces-002.html
(live test)
(source)
break-spaces-003.html
(live test)
(source)
break-spaces-004.html
(live test)
(source)
break-spaces-005.html
(live test)
(source)
break-spaces-006.html
(live test)
(source)
break-spaces-007.html
(live test)
(source)
break-spaces-008.html
(live test)
(source)
break-spaces-009.html
(live test)
(source)
break-spaces-010.html
(live test)
(source)
break-spaces-051.html
(live test)
(source)
break-spaces-052.html
(live test)
(source)
break-spaces-with-word-break-001.html
(live test)
(source)
white-space-pre-034.html
(live test)
(source)
textarea-break-spaces-001.html
(live test)
(source)
textarea-break-spaces-002.html
(live test)
(source)
break-spaces-before-first-char-001.html
(live test)
(source)
break-spaces-before-first-char-002.html
(live test)
(source)
break-spaces-before-first-char-003.html
(live test)
(source)
break-spaces-before-first-char-004.html
(live test)
(source)
break-spaces-before-first-char-005.html
(live test)
(source)
break-spaces-before-first-char-006.html
(live test)
(source)
break-spaces-before-first-char-007.html
(live test)
(source)
break-spaces-before-first-char-008.html
(live test)
(source)
break-spaces-before-first-char-009.html
(live test)
(source)
break-spaces-before-first-char-010.html
(live test)
(source)
break-spaces-before-first-char-011.html
(live test)
(source)
break-spaces-before-first-char-012.html
(live test)
(source)
break-spaces-before-first-char-013.html
(live test)
(source)
break-spaces-before-first-char-014.html
(live test)
(source)
break-spaces-before-first-char-015.html
(live test)
(source)
break-spaces-before-first-char-016.html
(live test)
(source)
break-spaces-before-first-char-017.html
(live test)
(source)
break-spaces-before-first-char-018.html
(live test)
(source)
break-spaces-before-first-ideographic-char-001.html
(live test)
(source)
break-spaces-before-first-ideographic-char-002.html
(live test)
(source)
break-spaces-before-first-ideographic-char-003.html
(live test)
(source)
break-spaces-before-first-ideographic-char-004.html
(live test)
(source)
break-spaces-before-first-ideographic-char-005.html
(live test)
(source)
break-spaces-before-first-ideographic-char-006.html
(live test)
(source)
break-spaces-before-first-ideographic-char-007.html
(live test)
(source)
break-spaces-before-first-ideographic-char-008.html
(live test)
(source)
break-spaces-before-first-ideographic-char-009.html
(live test)
(source)
break-spaces-before-first-ideographic-char-010.html
(live test)
(source)
break-spaces-before-first-ideographic-char-011.html
(live test)
(source)
break-spaces-before-first-ideographic-char-012.html
(live test)
(source)
break-spaces-before-first-ideographic-char-013.html
(live test)
(source)
break-spaces-before-first-ideographic-char-014.html
(live test)
(source)
break-spaces-before-first-ideographic-char-015.html
(live test)
(source)
break-spaces-before-first-ideographic-char-016.html
(live test)
(source)
break-spaces-before-first-ideographic-char-017.html
(live test)
(source)
break-spaces-before-first-ideographic-char-018.html
(live test)
(source)
tab-stop-threshold-005.html
(live test)
(source)
tab-stop-threshold-006.html
(live test)
(source)
word-break-break-all-017.html
(live test)
(source)
break-spaces-tab-001.html
(live test)
(source)
break-spaces-tab-002.html
(live test)
(source)
break-spaces-tab-003.html
(live test)
(source)
break-spaces-tab-004.html
(live test)
(source)
break-spaces-tab-005.html
(live test)
(source)
break-spaces-tab-006.html
(live test)
(source)
break-spaces-with-overflow-wrap-001.html
(live test)
(source)
break-spaces-with-overflow-wrap-002.html
(live test)
(source)
break-spaces-with-overflow-wrap-003.html
(live test)
(source)
break-spaces-with-overflow-wrap-004.html
(live test)
(source)
break-spaces-with-overflow-wrap-005.html
(live test)
(source)
break-spaces-with-overflow-wrap-006.html
(live test)
(source)
break-spaces-with-overflow-wrap-007.html
(live test)
(source)
break-spaces-with-overflow-wrap-008.html
(live test)
(source)
break-spaces-with-overflow-wrap-009.html
(live test)
(source)
break-spaces-with-overflow-wrap-010.html
(live test)
(source)
break-spaces-with-ideographic-space-001.html
(live test)
(source)
break-spaces-with-ideographic-space-002.html
(live test)
(source)
break-spaces-with-ideographic-space-003.html
(live test)
(source)
break-spaces-with-ideographic-space-004.html
(live test)
(source)
break-spaces-with-ideographic-space-005.html
(live test)
(source)
break-spaces-with-ideographic-space-006.html
(live test)
(source)
break-spaces-with-ideographic-space-007.html
(live test)
(source)
break-spaces-with-ideographic-space-008.html
(live test)
(source)
break-spaces-with-ideographic-space-009.html
(live test)
(source)
break-spaces-with-ideographic-space-010.html
(live test)
(source)
line-break-anywhere-and-white-space-008.html
(live test)
(source)
line-break-anywhere-and-white-space-009.html
(live test)
(source)
ws-break-spaces-applies-to-001.html
(live test)
(source)
ws-break-spaces-applies-to-002.html
(live test)
(source)
ws-break-spaces-applies-to-003.html
(live test)
(source)
ws-break-spaces-applies-to-005.html
(live test)
(source)
ws-break-spaces-applies-to-006.html
(live test)
(source)
ws-break-spaces-applies-to-007.html
(live test)
(source)
ws-break-spaces-applies-to-008.html
(live test)
(source)
ws-break-spaces-applies-to-009.html
(live test)
(source)
ws-break-spaces-applies-to-010.html
(live test)
(source)
ws-break-spaces-applies-to-011.html
(live test)
(source)
ws-break-spaces-applies-to-012.html
(live test)
(source)
ws-break-spaces-applies-to-013.html
(live test)
(source)
ws-break-spaces-applies-to-014.html
(live test)
(source)
ws-break-spaces-applies-to-015.html
(live test)
(source)
break-spaces-newline-011.html
(live test)
(source)
break-spaces-newline-012.html
(live test)
(source)
break-spaces-newline-013.html
(live test)
(source)
break-spaces-newline-014.html
(live test)
(source)
break-spaces-newline-015.html
(live test)
(source)
break-spaces-newline-016.html
(live test)
(source)
trailing-ideographic-space-break-spaces-001.html
(live test)
(source)
trailing-ideographic-space-break-spaces-002.html
(live test)
(source)
trailing-ideographic-space-break-spaces-003.html
(live test)
(source)
trailing-ideographic-space-break-spaces-004.html
(live test)
(source)
trailing-ideographic-space-break-spaces-005.html
(live test)
(source)
trailing-ideographic-space-break-spaces-006.html
(live test)
(source)
trailing-ideographic-space-break-spaces-007.html
(live test)
(source)
trailing-ideographic-space-break-spaces-008.html
(live test)
(source)
Note:
This value does not guarantee
that there will never be any overflow due to white space:
for example, if the line length is so short
that even a single white space character does not fit,
overflow is unavoidable.
discard
This value directs user agents to “discard”
all white space in the element.
Tests
white-space-collapse-discard-001.xht
(live test)
(source)
Does this preserve line break opportunities or no? Do we need a distinct "hide" value?
If it preserves line break opportunities,
maybe it should be replaced with a
word-space-transform
value?
White space
that was not removed or collapsed due to white space processing
is called
preserved white space
The following style rules implement MathML’s white space processing:
@namespace m "http://www.w3.org/1998/Math/MathML";
m|* {
white-space-collapse: discard;
m|mi, m|mn, m|mo, m|ms, m|mtext {
white-space-trim: discard-inner;
4.2.
White Space Trimming: the
white-space-trim
property
Tests
This section mostly lacks tests
Name:
white-space-trim
Value:
none
discard-before
||
discard-after
||
discard-inner
Initial:
none
Applies to:
inline boxes
and
block containers
Inherited:
no
Percentages:
n/a
Computed value:
specified keyword(s)
Canonical order:
per grammar
Animation type:
discrete
This property allows authors to specify trimming behavior
at the beginning and end of a box.
Values have the following meanings:
discard-before
This value directs the UA to collapse all collapsible whitespace
immediately before the start of the element.
discard-after
This value directs the UA to collapse all collapsible whitespace
immediately after the end of the element.
discard-inner
For block containers this value directs UAs to discard
all whitespace at the beginning of the element up to and including
the last
segment break
before the first non-white-space character in the element
as well as to discard all white space at the end of the element
starting with the first
segment break
after the last non-white-space character in the element.
For other elements this value directs UAs to discard
all whitespace at the beginning and end of the element.
Tests
white-space-trim-discard-inner-001.xht
(live test)
(source)
Note:
Discarding
document white space
using
white-space-trim
can change where
soft wrap opportunities
occur in the text.
The following style rules render DT elements as a comma-separated list,
even if they are coded on separate lines of the source document:
dt { display: inline; }
dt + dt:before { content: ", "; white-space-trim: discard-before; }
The following style rule removes source-formatting white space
adjacent to the opening/closing tags of a preformatted block,
but not any indentation or interleaved white space
applied to the actual contents of the element:
pre { white-space: pre; white-space-trim: discard-inner; }
This results in the following two source-code snippets:
pre
some
preformatted
text
pre
pre
some
preformatted
text
pre
rendering identically as:
some
preformatted
text
If instead we apply it to an inline element:
span { white-space: normal; white-space-trim: discard-inner; }
start[
span
some
inline
text
span
]end
start[
span
some
inline
text
span
]end
this directs the UA to discard
all
of the leading/trailing white space
before the actual contents of the element:
start[some inline text]end
White space processing for
white-space-trim
takes place before
§ 4.3.1 Phase I: Collapsing and Transformation
4.3.
The White Space Processing Rules
Tests
This section has good test coverage.
Most tests to be found in subsections.
Except where specified otherwise,
white space processing in CSS affects only
the
document white space characters
spaces
(U+0020),
tabs
(U+0009), and
segment breaks
Tests
white-space-normal-003.xht
(live test)
(source)
white-space-normal-004.xht
(live test)
(source)
white-space-normal-005.xht
(live test)
(source)
white-space-normal-006.xht
(live test)
(source)
white-space-normal-007.xht
(live test)
(source)
white-space-normal-008.xht
(live test)
(source)
white-space-nowrap-005.xht
(live test)
(source)
white-space-nowrap-006.xht
(live test)
(source)
white-space-pre-005.xht
(live test)
(source)
white-space-pre-006.xht
(live test)
(source)
white-space-processing-054.xht
(live test)
(source)
white-space-processing-055.xht
(live test)
(source)
white-space-processing-056.xht
(live test)
(source)
display-contents-remove-whitespace-change.html
(live test)
(source)
remove-slotted-with-whitespace-sibling.html
(live test)
(source)
Note:
The set of characters considered
document white space
(part of the document content)
and those considered syntactic white space
(part of the CSS syntax)
are not necessarily identical.
However, since both include spaces (U+0020), tabs (U+0009), and line feeds (U+000A)
most authors won’t notice any differences.
Besides space (U+0020)
and no-break space (U+00A0),
Unicode defines a number of additional space separator characters.
[UNICODE]
In this specification
all characters in the Unicode
general category
Zs
except space (U+0020)
and no-break space (U+00A0)
are collectively referred to as
other space separators
Tests
trailing-other-space-separators-001.html
(live test)
(source)
trailing-other-space-separators-002.html
(live test)
(source)
trailing-other-space-separators-003.html
(live test)
(source)
trailing-other-space-separators-004.html
(live test)
(source)
trailing-other-space-separators-break-spaces-001.html
(live test)
(source)
trailing-other-space-separators-break-spaces-002.html
(live test)
(source)
trailing-other-space-separators-break-spaces-003.html
(live test)
(source)
trailing-other-space-separators-break-spaces-004.html
(live test)
(source)
trailing-other-space-separators-break-spaces-005.html
(live test)
(source)
trailing-other-space-separators-break-spaces-006.html
(live test)
(source)
trailing-other-space-separators-break-spaces-007.html
(live test)
(source)
trailing-other-space-separators-break-spaces-008.html
(live test)
(source)
trailing-other-space-separators-break-spaces-009.html
(live test)
(source)
trailing-other-space-separators-break-spaces-010.html
(live test)
(source)
trailing-other-space-separators-break-spaces-011.html
(live test)
(source)
trailing-other-space-separators-break-spaces-012.html
(live test)
(source)
trailing-other-space-separators-break-spaces-013.html
(live test)
(source)
trailing-other-space-separators-break-spaces-014.html
(live test)
(source)
trailing-other-space-separators-break-spaces-015.html
(live test)
(source)
4.3.1.
Phase I: Collapsing and Transformation
Tests
This section has good test coverage,
most parts are well exercised.
Missing tests:
* If white-space-collapse is set to preserve-spaces, each tab and segment break is converted to a space.
Note:
white-space-trim
is taken into account prior to this phase.
For each inline
(including anonymous inlines;
see
CSS 2
§ 9.2.2.1 Anonymous inline boxes
[CSS2]
within an
inline formatting context
white space characters
are processed as follows
prior to
line breaking
and
bidi reordering
ignoring
bidi formatting characters
(characters with the
Bidi_Control
property
[UAX9]
as if they were not there:
Tests
white-space-collapse-002.html
(live test)
(source)
white-space-normal-011.html
(live test)
(source)
white-space-nowrap-011.html
(live test)
(source)
If
white-space-collapse
is set to
collapse
or
preserve-breaks
white space characters
are considered
collapsible
and are processed by performing the following steps:
Any sequence of collapsible
spaces
and
tabs
immediately preceding or following a
segment break
is removed.
Tests
white-space-normal-011.html
(live test)
(source)
white-space-nowrap-011.html
(live test)
(source)
segment-break-transformation-unremovable-3.html
(live test)
(source)
segment-break-transformation-unremovable-4.html
(live test)
(source)
white-space-processing-002.xht
(live test)
(source)
white-space-processing-003.xht
(live test)
(source)
white-space-processing-004.xht
(live test)
(source)
white-space-processing-008.xht
(live test)
(source)
white-space-processing-009.xht
(live test)
(source)
white-space-processing-010.xht
(live test)
(source)
white-space-processing-005.xht
(live test)
(source)
white-space-processing-006.xht
(live test)
(source)
white-space-processing-007.xht
(live test)
(source)
Collapsible
segment breaks
are transformed for rendering
according to the
segment break transformation rules
Every
collapsible
tab
is converted to a collapsible space (U+0020).
Tests
white-space-collapse-000.html
(live test)
(source)
white-space-normal-011.html
(live test)
(source)
white-space-nowrap-011.html
(live test)
(source)
white-space-processing-019.xht
(live test)
(source)
white-space-processing-020.xht
(live test)
(source)
white-space-processing-021.xht
(live test)
(source)
Any
collapsible
space
immediately following another
collapsible
space
—even one outside the boundary of the inline containing that
space
provided both
spaces
are within the same inline formatting context—is collapsed to have zero advance width.
(It is invisible,
but retains its
soft wrap opportunity
if any.)
Tests
white-space-collapse-001.html
(live test)
(source)
white-space-empty-text-sibling.html
(live test)
(source)
white-space-normal-011.html
(live test)
(source)
white-space-nowrap-011.html
(live test)
(source)
white-space-001.xht
(live test)
(source)
white-space-003.xht
(live test)
(source)
white-space-005.xht
(live test)
(source)
white-space-collapsing-001.xht
(live test)
(source)
white-space-collapsing-002.xht
(live test)
(source)
white-space-collapsing-004.xht
(live test)
(source)
white-space-collapsing-005.xht
(live test)
(source)
white-space-collapsing-breaks-001.xht
(live test)
(source)
white-space-mixed-001.xht
(live test)
(source)
white-space-mixed-002.xht
(live test)
(source)
white-space-normal-001.xht
(live test)
(source)
white-space-processing-001.xht
(live test)
(source)
white-space-processing-022.xht
(live test)
(source)
white-space-processing-023.xht
(live test)
(source)
white-space-processing-024.xht
(live test)
(source)
white-space-processing-025.xht
(live test)
(source)
white-space-processing-026.xht
(live test)
(source)
white-space-processing-027.xht
(live test)
(source)
white-space-processing-028.xht
(live test)
(source)
white-space-processing-029.xht
(live test)
(source)
white-space-processing-030.xht
(live test)
(source)
white-space-processing-031.xht
(live test)
(source)
white-space-processing-032.xht
(live test)
(source)
white-space-processing-033.xht
(live test)
(source)
white-space-processing-034.xht
(live test)
(source)
white-space-processing-035.xht
(live test)
(source)
white-space-processing-036.xht
(live test)
(source)
white-space-processing-050.xht
(live test)
(source)
white-space-processing-051.xht
(live test)
(source)
white-space-processing-053.xht
(live test)
(source)
If
white-space-collapse
is set to
preserve-spaces
each
tab
and
segment break
is converted to a
space
If
white-space-collapse
is set to
preserve
or
preserve-spaces
any sequence of spaces is treated as a sequence of non-breaking spaces
except that
soft wrap opportunity
exists at the end of each maximal sequence of
spaces
and/or
tabs
For
break-spaces
soft wrap opportunity
exists after every
space
and every
tab
Tests
white-space-pre-011.html
(live test)
(source)
overflow-wrap-break-word-004.html
(live test)
(source)
overflow-wrap-break-word-005.html
(live test)
(source)
overflow-wrap-break-word-006.html
(live test)
(source)
overflow-wrap-break-word-007.html
(live test)
(source)
overflow-wrap-anywhere-004.html
(live test)
(source)
overflow-wrap-anywhere-005.html
(live test)
(source)
word-break-break-all-011.html
(live test)
(source)
word-break-break-all-012.html
(live test)
(source)
word-break-break-all-013.html
(live test)
(source)
word-break-break-all-015.html
(live test)
(source)
break-spaces-006.html
(live test)
(source)
break-spaces-007.html
(live test)
(source)
break-spaces-008.html
(live test)
(source)
break-spaces-009.html
(live test)
(source)
break-spaces-010.html
(live test)
(source)
break-spaces-before-first-char-001.html
(live test)
(source)
break-spaces-before-first-char-002.html
(live test)
(source)
break-spaces-before-first-char-003.html
(live test)
(source)
break-spaces-before-first-char-004.html
(live test)
(source)
break-spaces-before-first-char-005.html
(live test)
(source)
break-spaces-before-first-char-006.html
(live test)
(source)
break-spaces-before-first-char-011.html
(live test)
(source)
break-spaces-before-first-ideographic-char-001.html
(live test)
(source)
break-spaces-before-first-ideographic-char-002.html
(live test)
(source)
break-spaces-before-first-ideographic-char-003.html
(live test)
(source)
break-spaces-before-first-ideographic-char-004.html
(live test)
(source)
break-spaces-before-first-ideographic-char-005.html
(live test)
(source)
break-spaces-before-first-ideographic-char-006.html
(live test)
(source)
break-spaces-before-first-ideographic-char-011.html
(live test)
(source)
pre-wrap-008.html
(live test)
(source)
pre-wrap-015.html
(live test)
(source)
pre-wrap-016.html
(live test)
(source)
pre-wrap-leading-spaces-001.html
(live test)
(source)
pre-wrap-leading-spaces-002.html
(live test)
(source)
pre-wrap-leading-spaces-003.html
(live test)
(source)
pre-wrap-leading-spaces-004.html
(live test)
(source)
pre-wrap-leading-spaces-005.html
(live test)
(source)
pre-wrap-leading-spaces-006.html
(live test)
(source)
pre-wrap-leading-spaces-007.html
(live test)
(source)
pre-wrap-leading-spaces-008.html
(live test)
(source)
pre-wrap-leading-spaces-009.html
(live test)
(source)
pre-wrap-leading-spaces-010.html
(live test)
(source)
pre-wrap-leading-spaces-011.html
(live test)
(source)
pre-wrap-leading-spaces-012.html
(live test)
(source)
pre-wrap-leading-spaces-013.html
(live test)
(source)
pre-wrap-leading-spaces-014.html
(live test)
(source)
break-spaces-tab-001.html
(live test)
(source)
break-spaces-tab-002.html
(live test)
(source)
break-spaces-tab-003.html
(live test)
(source)
break-spaces-tab-004.html
(live test)
(source)
pre-wrap-tab-001.html
(live test)
(source)
pre-wrap-tab-002.html
(live test)
(source)
pre-wrap-tab-003.html
(live test)
(source)
pre-wrap-tab-004.html
(live test)
(source)
white-space-002.xht
(live test)
(source)
white-space-004.xht
(live test)
(source)
white-space-processing-011.xht
(live test)
(source)
white-space-processing-012.xht
(live test)
(source)
white-space-processing-013.xht
(live test)
(source)
white-space-processing-052.xht
(live test)
(source)
Tests
bidi-002.xht
(live test)
(source)
bidi-004.xht
(live test)
(source)
line-breaking-bidi-001.xht
(live test)
(source)
line-breaking-bidi-002.xht
(live test)
(source)
line-breaking-bidi-003.xht
(live test)
(source)
white-space-collapsing-bidi-001.xht
(live test)
(source)
white-space-collapsing-bidi-002.xht
(live test)
(source)
The following example illustrates
the interaction of white-space collapsing and bidirectionality.
Consider the following markup fragment, taking special note of
spaces
(with varied backgrounds and borders for emphasis and identification):
C
where the
element represents a left-to-right embedding
and the
element represents a right-to-left embedding.
If the
white-space
property is set to
normal
the white-space processing model will result in the following:
The
space
before the B (
will collapse with the
space
after the A (
).
The
space
before the C (
will collapse with the
space
after the B (
).
This will leave two
spaces
one after the A in the left-to-right embedding level,
and one after the B in the right-to-left embedding level.
The text will then be ordered according to the Unicode bidirectional algorithm,
with the end result being:
BC
Note that there will be two
spaces
between A and B,
and none between B and C.
This is best avoided by putting
spaces
outside the element
instead of just inside the opening and closing tags
and, where practical,
by relying on implicit bidirectionality instead of explicit embedding levels.
Tests
white-space-bidirectionality-001.xht
(live test)
(source)
4.3.2.
Phase II: Trimming and Positioning
Tests
This section has good test coverage,
all parts are well exercised.
Then, the entire block is rendered.
Inlines are laid out,
taking
bidi reordering
into account,
and
wrapping
as specified by the
text-wrap-mode
and
text-wrap-style
property.
As each line is laid out,
A sequence of
collapsible
spaces
at the beginning of a line
is removed.
Tests
line-edge-white-space-collapse-002.html
(live test)
(source)
break-spaces-051.html
(live test)
(source)
break-spaces-052.html
(live test)
(source)
pre-line-051.html
(live test)
(source)
pre-line-052.html
(live test)
(source)
pre-wrap-051.html
(live test)
(source)
pre-wrap-052.html
(live test)
(source)
white-space-pre-051.html
(live test)
(source)
white-space-pre-052.html
(live test)
(source)
full-width-leading-spaces-001.html
(live test)
(source)
full-width-leading-spaces-002.html
(live test)
(source)
full-width-leading-spaces-003.html
(live test)
(source)
white-space-collapsing-003.xht
(live test)
(source)
white-space-collapsing-bidi-003.xht
(live test)
(source)
white-space-normal-001.xht
(live test)
(source)
white-space-normal-002.xht
(live test)
(source)
white-space-processing-037.xht
(live test)
(source)
white-space-processing-038.xht
(live test)
(source)
white-space-processing-039.xht
(live test)
(source)
white-space-processing-040.xht
(live test)
(source)
white-space-processing-041.xht
(live test)
(source)
If the
tab size
is zero,
preserved
tabs
are not rendered.
Otherwise, each
preserved
tab
is rendered
as a horizontal shift that lines up
the start edge of the next glyph with the next
tab stop
If this distance is less than
0.5ch
then the subsequent
tab stop
is used instead.
Tab stops
occur at points
that are multiples of the
tab size
from the starting content edge
of the
preserved
tab
’s nearest
block container
ancestor.
The
tab size
is given by the
tab-size
property.
Tests
tab-stop-threshold-001.html
(live test)
(source)
tab-stop-threshold-002.html
(live test)
(source)
tab-stop-threshold-003.html
(live test)
(source)
tab-stop-threshold-004.html
(live test)
(source)
tab-stop-threshold-005.html
(live test)
(source)
tab-stop-threshold-006.html
(live test)
(source)
white-space-pre-011.html
(live test)
(source)
tab-min-rendered-width-1.html
(live test)
(source)
tab-size-integer-003.html
(live test)
(source)
text-indent-tab-positions-001.html
(live test)
(source)
tab-size-inline-002.html
(live test)
(source)
white-space-zero-fontsize-002.html
(live test)
(source)
white-space-processing-042.xht
(live test)
(source)
Note:
See the Unicode
rules on how tabulation (U+0009) interacts with bidi
[UAX9]
Tests
bidi-tab-001.html
(live test)
(source)
tab-bidi-001.html
(live test)
(source)
A sequence of
collapsible
spaces
at the end of a line is removed,
as well as any trailing U+1680 OGHAM SPACE MARK
whose
white-space-collapse
property is
collapse
or
preserve-breaks
Tests
line-edge-white-space-collapse-001.html
(live test)
(source)
pre-float-001.html
(live test)
(source)
pre-wrap-float-001.html
(live test)
(source)
trailing-space-before-br-001.html
(live test)
(source)
trailing-ogham-001.html
(live test)
(source)
trailing-ogham-002.html
(live test)
(source)
trailing-ogham-003.html
(live test)
(source)
overflow-wrap-anywhere-011.html
(live test)
(source)
white-space-collapsing-003.xht
(live test)
(source)
white-space-collapsing-bidi-003.xht
(live test)
(source)
white-space-normal-001.xht
(live test)
(source)
white-space-normal-002.xht
(live test)
(source)
white-space-processing-005.xht
(live test)
(source)
white-space-processing-043.xht
(live test)
(source)
white-space-processing-044.xht
(live test)
(source)
white-space-processing-045.xht
(live test)
(source)
white-space-processing-046.xht
(live test)
(source)
white-space-processing-047.xht
(live test)
(source)
Note:
Due to
Unicode Bidirectional Algorithm
rule
L1
a sequence of
collapsible
spaces
located at the end of the line
prior to
bidi reordering
will also be at the end of the line after reordering.
[UAX9]
[CSS-WRITING-MODES-4]
Tests
eol-spaces-bidi-001.html
(live test)
(source)
eol-spaces-bidi-003.html
(live test)
(source)
trailing-space-rtl-001.html
(live test)
(source)
If there remains any sequence of
white space
other space separators
and/or
preserved
tabs
at the end of a line
(after
bidi reordering
[CSS-WRITING-MODES-4]
):
If
white-space-collapse
is
collapse
or
preserve-breaks
the UA must
hang
this sequence (unconditionally).
Tests
trailing-ideographic-space-001.html
(live test)
(source)
trailing-ideographic-space-002.html
(live test)
(source)
trailing-ideographic-space-005.html
(live test)
(source)
trailing-ideographic-space-006.html
(live test)
(source)
trailing-ideographic-space-007.html
(live test)
(source)
trailing-ideographic-space-008.html
(live test)
(source)
trailing-ideographic-space-009.html
(live test)
(source)
trailing-ideographic-space-010.html
(live test)
(source)
trailing-ideographic-space-011.html
(live test)
(source)
trailing-ideographic-space-012.html
(live test)
(source)
trailing-ideographic-space-013.html
(live test)
(source)
trailing-ideographic-space-014.html
(live test)
(source)
trailing-ideographic-space-015.html
(live test)
(source)
trailing-ideographic-space-016.html
(live test)
(source)
trailing-ideographic-space-017.html
(live test)
(source)
trailing-ideographic-space-018.html
(live test)
(source)
trailing-ideographic-space-019.html
(live test)
(source)
trailing-ideographic-space-020.html
(live test)
(source)
trailing-ideographic-space-021.html
(live test)
(source)
trailing-ideographic-space-022.html
(live test)
(source)
trailing-ideographic-space-023.html
(live test)
(source)
trailing-ideographic-space-024.html
(live test)
(source)
trailing-ideographic-space-025.html
(live test)
(source)
trailing-other-space-separators-001.html
(live test)
(source)
trailing-other-space-separators-003.html
(live test)
(source)
trailing-other-space-separators-004.html
(live test)
(source)
text-transform-fullwidth-008.html
(live test)
(source)
white-space-intrinsic-size-019.html
(live test)
(source)
white-space-intrinsic-size-020.html
(live test)
(source)
trailing-space-and-text-alignment-001.html
(live test)
(source)
trailing-space-and-text-alignment-005.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-001.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-005.html
(live test)
(source)
If
white-space-collapse
is
preserve
and
text-wrap-mode
is not
nowrap
the UA must (unconditionally)
hang
this sequence,
unless the sequence is followed by a
forced line break
in which case it must
conditionally hang
the sequence instead.
It may also visually collapse the character advance widths
of any that would otherwise overflow.
Tests
pre-wrap-001.html
(live test)
(source)
pre-wrap-002.html
(live test)
(source)
pre-wrap-003.html
(live test)
(source)
pre-wrap-004.html
(live test)
(source)
pre-wrap-005.html
(live test)
(source)
pre-wrap-006.html
(live test)
(source)
pre-wrap-007.html
(live test)
(source)
pre-wrap-011.html
(live test)
(source)
pre-wrap-012.html
(live test)
(source)
pre-wrap-013.html
(live test)
(source)
pre-wrap-014.html
(live test)
(source)
pre-wrap-017.html
(live test)
(source)
pre-wrap-018.html
(live test)
(source)
pre-wrap-019.html
(live test)
(source)
pre-wrap-020.html
(live test)
(source)
textarea-pre-wrap-001.html
(live test)
(source)
textarea-pre-wrap-002.html
(live test)
(source)
textarea-pre-wrap-003.html
(live test)
(source)
textarea-pre-wrap-004.html
(live test)
(source)
textarea-pre-wrap-005.html
(live test)
(source)
textarea-pre-wrap-006.html
(live test)
(source)
textarea-pre-wrap-007.html
(live test)
(source)
textarea-pre-wrap-011.html
(live test)
(source)
textarea-pre-wrap-012.html
(live test)
(source)
textarea-pre-wrap-013.html
(live test)
(source)
textarea-pre-wrap-014.html
(live test)
(source)
trailing-ideographic-space-003.html
(live test)
(source)
trailing-ideographic-space-004.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-001.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-002.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-003.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-004.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-005.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-006.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-007.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-008.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-010.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-011.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-012.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-013.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-014.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-015.html
(live test)
(source)
white-space-intrinsic-size-003.html
(live test)
(source)
white-space-intrinsic-size-004.html
(live test)
(source)
white-space-intrinsic-size-005.html
(live test)
(source)
white-space-intrinsic-size-006.html
(live test)
(source)
pre-wrap-tab-005.html
(live test)
(source)
pre-wrap-tab-006.html
(live test)
(source)
trailing-other-space-separators-002.html
(live test)
(source)
text-transform-fullwidth-009.html
(live test)
(source)
trailing-space-position-001.html
(live test)
(source)
line-break-anywhere-and-white-space-006.html
(live test)
(source)
line-break-anywhere-and-white-space-007.html
(live test)
(source)
white-space-intrinsic-size-013.html
(live test)
(source)
white-space-intrinsic-size-014.html
(live test)
(source)
white-space-intrinsic-size-017.html
(live test)
(source)
eol-spaces-bidi-002.html
(live test)
(source)
trailing-space-in-inline-box.html
(live test)
(source)
trailing-space-and-text-alignment-003.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-003.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-021.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-022.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-023.html
(live test)
(source)
overflow-wrap-min-content-size-009.html
(live test)
(source)
text-justify-and-trailing-spaces-001.html
(live test)
(source)
text-justify-and-trailing-spaces-002.html
(live test)
(source)
text-justify-and-trailing-spaces-003.html
(live test)
(source)
text-justify-and-trailing-spaces-004.html
(live test)
(source)
text-justify-and-trailing-spaces-005.html
(live test)
(source)
text-justify-and-trailing-spaces-006.html
(live test)
(source)
pre-wrap-align-center-001.html
(live test)
(source)
pre-wrap-align-center-002.html
(live test)
(source)
pre-wrap-align-center-003.html
(live test)
(source)
pre-wrap-align-end-001.html
(live test)
(source)
pre-wrap-align-end-002.html
(live test)
(source)
pre-wrap-align-end-003.html
(live test)
(source)
pre-wrap-align-left-001.html
(live test)
(source)
pre-wrap-align-left-002.html
(live test)
(source)
pre-wrap-align-left-003.html
(live test)
(source)
pre-wrap-align-right-001.html
(live test)
(source)
pre-wrap-align-right-002.html
(live test)
(source)
pre-wrap-align-right-003.html
(live test)
(source)
pre-wrap-align-start-001.html
(live test)
(source)
pre-wrap-align-start-002.html
(live test)
(source)
pre-wrap-align-start-003.html
(live test)
(source)
white-space-pre-wrap-justify-001.html
(live test)
(source)
white-space-pre-wrap-justify-002.html
(live test)
(source)
white-space-pre-wrap-justify-003.html
(live test)
(source)
white-space-pre-wrap-justify-004.html
(live test)
(source)
eol-spaces-bidi-004.html
(live test)
(source)
Note:
Hanging
the white space rather than collapsing it
allows users to see the space when selecting or editing text.
If
white-space-collapse
is set to
break-spaces
spaces
tabs
, and
other space separators
are treated the same as other visible characters:
they cannot
hang
nor have their advance width collapsed.
Tests
break-spaces-001.html
(live test)
(source)
break-spaces-005.html
(live test)
(source)
textarea-break-spaces-001.html
(live test)
(source)
break-spaces-tab-005.html
(live test)
(source)
break-spaces-tab-006.html
(live test)
(source)
trailing-other-space-separators-break-spaces-001.html
(live test)
(source)
trailing-other-space-separators-break-spaces-002.html
(live test)
(source)
trailing-other-space-separators-break-spaces-003.html
(live test)
(source)
trailing-other-space-separators-break-spaces-004.html
(live test)
(source)
trailing-other-space-separators-break-spaces-005.html
(live test)
(source)
trailing-other-space-separators-break-spaces-006.html
(live test)
(source)
trailing-other-space-separators-break-spaces-007.html
(live test)
(source)
trailing-other-space-separators-break-spaces-008.html
(live test)
(source)
trailing-other-space-separators-break-spaces-009.html
(live test)
(source)
trailing-other-space-separators-break-spaces-010.html
(live test)
(source)
trailing-other-space-separators-break-spaces-011.html
(live test)
(source)
trailing-other-space-separators-break-spaces-012.html
(live test)
(source)
trailing-other-space-separators-break-spaces-013.html
(live test)
(source)
trailing-other-space-separators-break-spaces-014.html
(live test)
(source)
trailing-other-space-separators-break-spaces-015.html
(live test)
(source)
line-break-anywhere-and-white-space-008.html
(live test)
(source)
line-break-anywhere-and-white-space-009.html
(live test)
(source)
break-spaces-with-ideographic-space-001.html
(live test)
(source)
break-spaces-with-ideographic-space-001.html
(live test)
(source)
break-spaces-with-ideographic-space-005.html
(live test)
(source)
break-spaces-with-ideographic-space-007.html
(live test)
(source)
break-spaces-with-ideographic-space-008.html
(live test)
(source)
break-spaces-with-ideographic-space-009.html
(live test)
(source)
break-spaces-with-ideographic-space-010.html
(live test)
(source)
trailing-ideographic-space-break-spaces-001.html
(live test)
(source)
trailing-ideographic-space-break-spaces-002.html
(live test)
(source)
trailing-ideographic-space-break-spaces-003.html
(live test)
(source)
trailing-ideographic-space-break-spaces-004.html
(live test)
(source)
trailing-ideographic-space-break-spaces-005.html
(live test)
(source)
trailing-ideographic-space-break-spaces-006.html
(live test)
(source)
trailing-ideographic-space-break-spaces-007.html
(live test)
(source)
trailing-ideographic-space-break-spaces-008.html
(live test)
(source)
trailing-space-and-text-alignment-004.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-004.html
(live test)
(source)
Note:
Such characters therefore take up space,
and depending on the available space
and applicable line breaking controls
will either overflow or cause the line to wrap.
What should happen here for
white-space-collapse: preserve-spaces
This example shows that
conditionally hanging
white space
at the end of lines with forced breaks
provides symmetry with the start of the line.
An underline is added to help visualize the spaces.
white-space
pre-wrap
width
ch
border
solid
px
font-family
monospace
text-align
center
The sample above would be rendered as follows:
Since the final
space
is before a forced line break
and does not overflow,
it does not hang,
and centering works as expected.
This example illustrates the difference
between
hanging
spaces
at the end of lines without forced breaks,
and
conditionally hanging
them at the end of lines with forced breaks.
An underline is added to help visualize the
spaces
white-space
pre-wrap
width
ch
border
solid
px
font-family
monospace
0 0 0 0
The sample above would be rendered as follows:
0 0
If
text-align
right
was added,
the result would be as follows:
0 0
As the
preserved
spaces
at the end of lines without a forced break must
hang
they are not considered when placing the rest of the line during text alignment.
When aligning towards the end,
this means any such
spaces
will overflow,
and will not prevent the rest of the line’s content from being flush with the edge of the line.
On the other hand,
preserved spaces at the end of a line
with
a forced break
conditionally hang
Since the space at the end of the last line would not overflow in this example,
it does not
hang
and therefore is considered during text alignment.
In the following example,
there is not enough room on any line to fit the end-of-line spaces,
so they
hang
on all lines:
the one on the line without a forced break because it must,
as well as the one on the line with a forced break,
because it
conditionally hangs
and overflows.
An underline is added to help visualize the spaces.
white-space
pre-wrap
width
ch
border
solid
px
font-family
monospace
0 0 0 0
0 0
0 0
The last line is not wrapped before the last
because characters that
conditionally hang
are not considered
when measuring the line’s contents for fit.
4.3.3.
Segment Break Transformation Rules
Tests
This section has reasonable test coverage,
though some assertions are only tested indirectly through
test for other features that rely on this,
rather than by dedicated tests.
When
white-space-collapse
is not
collapse
segment breaks
are not
collapsible
For values other than
collapse
or
preserve-spaces
(which transforms them into
spaces
),
segment breaks
are instead transformed into a preserved line feed (U+000A).
Tests
white-space-008.xht
(live test)
(source)
white-space-processing-016.xht
(live test)
(source)
white-space-processing-017.xht
(live test)
(source)
white-space-processing-018.xht
(live test)
(source)
When
white-space-collapse
is
collapse
segment breaks
are
collapsible
and are collapsed as follows:
First, any collapsible
segment break
immediately following another collapsible
segment break
is removed.
Tests
segment-break-transformation-unremovable-2.html
(live test)
(source)
segment-break-transformation-unremovable-4.html
(live test)
(source)
Then any remaining
segment break
is either transformed into a space (U+0020)
or removed
depending on the context before and after the break.
The rules for this operation are UA-defined in this level.
Tests
segment-break-transformation-unremovable-1.html
(live test)
(source)
segment-break-transformation-unremovable-2.html
(live test)
(source)
segment-break-transformation-unremovable-3.html
(live test)
(source)
segment-break-transformation-unremovable-4.html
(live test)
(source)
Should we define this for Level 4?
Note:
The white space processing rules have already
removed any
tabs
and
spaces
around the
segment break
before this context is evaluated.
The purpose of the segment break transformation rules
(and white space collapsing in general)
is to “unbreak” text that has been
broken into segments
to make the document source code easier to work with.
In languages that use word separators, such as English and Korean,
“unbreaking” a line requires joining the two lines with a
space
Here is an English paragraph
that is broken into multiple lines
in the source code so that it can
be more easily read and edited
in a text editor.
Here is an English paragraph that is broken into multiple lines in the source code so that it can be more easily read and edited in a text editor.
Eliminating a line break in English
requires maintaining a
space
in its place.
In languages that have no word separators, such as Chinese,
“unbreaking” a line requires joining the two lines with no intervening space.
這個段落是那麼長,
在一行寫不行。最好
用三行寫。
這個段落是那麼長,在一行寫不行。最好用三行寫。
Eliminating a line break in Chinese
requires eliminating any intervening
white space
The segment break transformation rules can use adjacent context
to either transform the segment break into a space
or eliminate it entirely.
Note:
Historically, HTML and CSS have unconditionally converted
segment breaks
to spaces,
which has prevented content authored in languages such as Chinese
from being able to break lines within the source.
Thus UA heuristics need to be conservative about where they discard
segment breaks
even as they strive to improve support for such languages.
4.4.
Tab Character Size: the
tab-size
property
Tests
This section has good test coverage.
Missing test:
* Applies to text
Name:
tab-size
Value:
Initial:
Applies to:
text
Inherited:
yes
Percentages:
n/a
Computed value:
the specified number or absolute length
Canonical order:
n/a
Animation type:
by computed value type
Tests
tab-size-integer-001.html
(live test)
(source)
tab-size.html
(live test)
(source)
tab-size-inheritance-001.html
(live test)
(source)
inheritance.html
(live test)
(source)
tab-size-valid.html
(live test)
(source)
tab-size-invalid.html
(live test)
(source)
tab-size-computed.html
(live test)
(source)
tab-size-computed-value-001.html
(live test)
(source)
tab-size-inline-001.html
(live test)
(source)
tab-size-interpolation.html
(live test)
(source)
This property determines the
tab size
used to render
preserved
tab characters (U+0009).
represents the measure
as a multiple of the advance width of the space character (U+0020)
of the nearest
block container
ancestor of the
preserved
tab
including its associated
letter-spacing
and
word-spacing
Negative values are not allowed.
Tests
tab-size-integer-001.html
(live test)
(source)
tab-size-integer-002.html
(live test)
(source)
tab-size-integer-003.html
(live test)
(source)
tab-size-integer-004.html
(live test)
(source)
tab-size-integer-005.html
(live test)
(source)
tab-size-length-001.html
(live test)
(source)
tab-size-length-002.html
(live test)
(source)
tab-size-percent-001.html
(live test)
(source)
tab-min-rendered-width-1.html
(live test)
(source)
tab-size-spacing-001.html
(live test)
(source)
tab-size-spacing-002.html
(live test)
(source)
tab-size-spacing-003.html
(live test)
(source)
tab-stop-threshold-001.html
(live test)
(source)
tab-stop-threshold-002.html
(live test)
(source)
tab-stop-threshold-003.html
(live test)
(source)
tab-stop-threshold-004.html
(live test)
(source)
tab-stop-threshold-005.html
(live test)
(source)
tab-stop-threshold-006.html
(live test)
(source)
text-indent-tab-positions-001.html
(live test)
(source)
tab-size-block-ancestor.html
(live test)
(source)
white-space-processing-042.xht
(live test)
(source)
5.
Text Wrapping
Tests
Tests mostly not needed for this section:
these are definitions,
they get tested through their application,
not by themselves.
When inline-level content is laid out into lines, it is broken across line boxes.
Such a break is called a
line break
When a line is broken due to explicit line-breaking controls
(such as a
preserved
newline character),
or due to the start or end of a block,
it is a
forced line break
When a line is broken due to content
wrapping
(i.e. when the UA creates unforced line breaks
in order to fit the content within the measure),
it is a
soft wrap break
The process of breaking inline-level content into lines is called
line breaking
Wrapping is only performed at an allowed break point,
called a
soft wrap opportunity
When wrapping is enabled (see
white-space
),
the UA must minimize the amount of content overflowing a line
by wrapping the line at a
soft wrap opportunity
if one exists.
Tests
line-breaking-020.html
(live test)
(source)
Where text is allowed to wrap is controlled
by the
line-breaking rules and controls
whether
it is allowed to wrap
and how multiple
soft wrap opportunities
within a line are prioritized
is controlled
by the
text-wrap-mode
text-wrap-style
wrap-before
wrap-after
and
wrap-inside
properties.
5.1.
Deciding Whether to Wrap: the
text-wrap-mode
property
Tests
This property is tested extensively through its shorthands,
but not much directly beyond parsing.
Missing test:
* preserved segment breaks are forced line breaks (probably tested already, but need to find those tests)
* CR and LF line breaking class are forced line breaks
* Direct tests of this property as a longhand
Name:
text-wrap-mode
Value:
wrap
nowrap
Initial:
wrap
Applies to:
text
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
per grammar
Animation type:
discrete
Tests
text-wrap-mode-computed.html
(live test)
(source)
text-wrap-mode-invalid.html
(live test)
(source)
text-wrap-mode-valid.html
(live test)
(source)
The name of this property is a placeholder,
pending the CSSWG finding a better name.
Note:
This property is a
longhand
of both
white-space
and
text-wrap
This property specifies whether lines may
wrap
at unforced
soft wrap opportunities
Possible values:
wrap
Content may break across lines
at allowed
soft wrap opportunities
as determined by the line-breaking rules in effect,
in order to minimize
inline-axis
overflow.
Tests
tests using wrap directly through 'text-wrap-mode':
CSS 2 indirect tests via 'white-space: normal':
white-space-normal-001.xht
(live test)
(source)
white-space-normal-002.xht
(live test)
(source)
white-space-normal-003.xht
(live test)
(source)
white-space-normal-004.xht
(live test)
(source)
white-space-normal-005.xht
(live test)
(source)
white-space-normal-006.xht
(live test)
(source)
white-space-normal-007.xht
(live test)
(source)
white-space-normal-008.xht
(live test)
(source)
white-space-normal-009.xht
(live test)
(source)
white-space-p-element-001.xht
(live test)
(source)
CSS 2 indirect tests via 'white-space: pre-line':
white-space-005.xht
(live test)
(source)
white-space-processing-017.xht
(live test)
(source)
white-space-processing-053.xht
(live test)
(source)
tests using wrap through 'text-wrap: wrap':
tests using wrap implicitly through 'text-wrap':
white-space-shorthand-text-wrap.html
(live test)
(source)
text-wrap-balance-001.html
(live test)
(source)
text-wrap-balance-002.html
(live test)
(source)
text-wrap-balance-003.html
(live test)
(source)
text-wrap-balance-align-001.html
(live test)
(source)
text-wrap-balance-dynamic-001.html
(live test)
(source)
text-wrap-balance-line-clamp-001.html
(live test)
(source)
text-wrap-balance-narrow-crash.html
(live test)
(source)
text-wrap-balance-text-indent-001.html
(live test)
(source)
text-wrap-balance-overflow-001.html
(live test)
(source)
tests using wrap through 'white-space: normal':
hyphens-auto-003.html
(live test)
(source)
css3-text-line-break-baspglwj-001.html
(live test)
(source)
css3-text-line-break-baspglwj-002.html
(live test)
(source)
css3-text-line-break-baspglwj-003.html
(live test)
(source)
css3-text-line-break-baspglwj-004.html
(live test)
(source)
css3-text-line-break-baspglwj-005.html
(live test)
(source)
css3-text-line-break-baspglwj-006.html
(live test)
(source)
css3-text-line-break-baspglwj-007.html
(live test)
(source)
css3-text-line-break-baspglwj-008.html
(live test)
(source)
css3-text-line-break-baspglwj-009.html
(live test)
(source)
css3-text-line-break-baspglwj-010.html
(live test)
(source)
css3-text-line-break-baspglwj-011.html
(live test)
(source)
css3-text-line-break-baspglwj-012.html
(live test)
(source)
css3-text-line-break-baspglwj-014.html
(live test)
(source)
css3-text-line-break-baspglwj-015.html
(live test)
(source)
css3-text-line-break-baspglwj-016.html
(live test)
(source)
css3-text-line-break-baspglwj-017.html
(live test)
(source)
css3-text-line-break-baspglwj-018.html
(live test)
(source)
css3-text-line-break-baspglwj-019.html
(live test)
(source)
css3-text-line-break-baspglwj-020.html
(live test)
(source)
css3-text-line-break-baspglwj-021.html
(live test)
(source)
css3-text-line-break-baspglwj-022.html
(live test)
(source)
css3-text-line-break-baspglwj-023.html
(live test)
(source)
css3-text-line-break-baspglwj-024.html
(live test)
(source)
css3-text-line-break-baspglwj-025.html
(live test)
(source)
css3-text-line-break-baspglwj-026.html
(live test)
(source)
css3-text-line-break-baspglwj-030.html
(live test)
(source)
css3-text-line-break-baspglwj-031.html
(live test)
(source)
css3-text-line-break-baspglwj-032.html
(live test)
(source)
css3-text-line-break-baspglwj-033.html
(live test)
(source)
css3-text-line-break-baspglwj-034.html
(live test)
(source)
css3-text-line-break-baspglwj-035.html
(live test)
(source)
css3-text-line-break-baspglwj-036.html
(live test)
(source)
css3-text-line-break-baspglwj-037.html
(live test)
(source)
css3-text-line-break-baspglwj-038.html
(live test)
(source)
css3-text-line-break-baspglwj-039.html
(live test)
(source)
css3-text-line-break-baspglwj-040.html
(live test)
(source)
css3-text-line-break-baspglwj-041.html
(live test)
(source)
css3-text-line-break-baspglwj-042.html
(live test)
(source)
css3-text-line-break-baspglwj-043.html
(live test)
(source)
css3-text-line-break-baspglwj-044.html
(live test)
(source)
css3-text-line-break-baspglwj-045.html
(live test)
(source)
css3-text-line-break-baspglwj-046.html
(live test)
(source)
css3-text-line-break-baspglwj-047.html
(live test)
(source)
css3-text-line-break-baspglwj-048.html
(live test)
(source)
css3-text-line-break-baspglwj-049.html
(live test)
(source)
css3-text-line-break-baspglwj-050.html
(live test)
(source)
css3-text-line-break-baspglwj-051.html
(live test)
(source)
css3-text-line-break-baspglwj-052.html
(live test)
(source)
css3-text-line-break-baspglwj-060.html
(live test)
(source)
css3-text-line-break-baspglwj-061.html
(live test)
(source)
css3-text-line-break-baspglwj-062.html
(live test)
(source)
css3-text-line-break-baspglwj-063.html
(live test)
(source)
css3-text-line-break-baspglwj-064.html
(live test)
(source)
css3-text-line-break-baspglwj-065.html
(live test)
(source)
css3-text-line-break-baspglwj-066.html
(live test)
(source)
css3-text-line-break-baspglwj-067.html
(live test)
(source)
css3-text-line-break-baspglwj-068.html
(live test)
(source)
css3-text-line-break-baspglwj-069.html
(live test)
(source)
css3-text-line-break-baspglwj-070.html
(live test)
(source)
css3-text-line-break-baspglwj-071.html
(live test)
(source)
css3-text-line-break-baspglwj-072.html
(live test)
(source)
css3-text-line-break-baspglwj-073.html
(live test)
(source)
css3-text-line-break-baspglwj-074.html
(live test)
(source)
css3-text-line-break-baspglwj-075.html
(live test)
(source)
css3-text-line-break-baspglwj-076.html
(live test)
(source)
css3-text-line-break-baspglwj-077.html
(live test)
(source)
css3-text-line-break-baspglwj-078.html
(live test)
(source)
css3-text-line-break-baspglwj-080.html
(live test)
(source)
css3-text-line-break-baspglwj-081.html
(live test)
(source)
css3-text-line-break-baspglwj-082.html
(live test)
(source)
css3-text-line-break-baspglwj-083.html
(live test)
(source)
css3-text-line-break-baspglwj-084.html
(live test)
(source)
css3-text-line-break-baspglwj-085.html
(live test)
(source)
css3-text-line-break-baspglwj-086.html
(live test)
(source)
css3-text-line-break-baspglwj-090.html
(live test)
(source)
css3-text-line-break-baspglwj-091.html
(live test)
(source)
css3-text-line-break-baspglwj-092.html
(live test)
(source)
css3-text-line-break-baspglwj-093.html
(live test)
(source)
css3-text-line-break-baspglwj-095.html
(live test)
(source)
css3-text-line-break-baspglwj-096.html
(live test)
(source)
css3-text-line-break-baspglwj-097.html
(live test)
(source)
css3-text-line-break-baspglwj-098.html
(live test)
(source)
css3-text-line-break-baspglwj-099.html
(live test)
(source)
css3-text-line-break-baspglwj-100.html
(live test)
(source)
css3-text-line-break-baspglwj-101.html
(live test)
(source)
css3-text-line-break-baspglwj-102.html
(live test)
(source)
css3-text-line-break-baspglwj-103.html
(live test)
(source)
css3-text-line-break-baspglwj-104.html
(live test)
(source)
css3-text-line-break-baspglwj-105.html
(live test)
(source)
css3-text-line-break-baspglwj-106.html
(live test)
(source)
css3-text-line-break-baspglwj-107.html
(live test)
(source)
css3-text-line-break-baspglwj-108.html
(live test)
(source)
css3-text-line-break-baspglwj-109.html
(live test)
(source)
css3-text-line-break-baspglwj-110.html
(live test)
(source)
css3-text-line-break-baspglwj-111.html
(live test)
(source)
css3-text-line-break-baspglwj-112.html
(live test)
(source)
css3-text-line-break-baspglwj-113.html
(live test)
(source)
css3-text-line-break-baspglwj-114.html
(live test)
(source)
css3-text-line-break-baspglwj-115.html
(live test)
(source)
css3-text-line-break-baspglwj-116.html
(live test)
(source)
css3-text-line-break-baspglwj-117.html
(live test)
(source)
css3-text-line-break-baspglwj-118.html
(live test)
(source)
css3-text-line-break-baspglwj-120.html
(live test)
(source)
css3-text-line-break-baspglwj-121.html
(live test)
(source)
css3-text-line-break-baspglwj-122.html
(live test)
(source)
css3-text-line-break-baspglwj-123.html
(live test)
(source)
css3-text-line-break-baspglwj-124.html
(live test)
(source)
css3-text-line-break-baspglwj-125.html
(live test)
(source)
css3-text-line-break-baspglwj-126.html
(live test)
(source)
css3-text-line-break-baspglwj-127.html
(live test)
(source)
css3-text-line-break-baspglwj-128.html
(live test)
(source)
css3-text-line-break-baspglwj-130.html
(live test)
(source)
css3-text-line-break-baspglwj-131.html
(live test)
(source)
line-break-anywhere-and-white-space-004.html
(live test)
(source)
line-break-anywhere-and-white-space-005.html
(live test)
(source)
line-breaking-001.html
(live test)
(source)
line-breaking-002.html
(live test)
(source)
line-breaking-003.html
(live test)
(source)
line-breaking-004.html
(live test)
(source)
line-breaking-005.html
(live test)
(source)
line-breaking-006.html
(live test)
(source)
line-breaking-007.html
(live test)
(source)
line-breaking-008.html
(live test)
(source)
line-breaking-009.html
(live test)
(source)
line-breaking-010.html
(live test)
(source)
line-breaking-011.html
(live test)
(source)
line-breaking-ic-001.html
(live test)
(source)
line-breaking-ic-002.html
(live test)
(source)
line-breaking-ic-003.html
(live test)
(source)
overflow-wrap-anywhere-011.html
(live test)
(source)
overflow-wrap-break-word-white-space-crash.html
(live test)
(source)
white-space-shorthand-text-wrap.html
(live test)
(source)
trailing-ideographic-space-005.html
(live test)
(source)
trailing-ideographic-space-006.html
(live test)
(source)
trailing-space-and-text-alignment-001.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-001.html
(live test)
(source)
white-space-applies-to-text-001.html
(live test)
(source)
white-space-normal-011.html
(live test)
(source)
white-space-nowrap-011.html
(live test)
(source)
white-space-pre-011.html
(live test)
(source)
white-space-pre-031.html
(live test)
(source)
white-space-pre-032.html
(live test)
(source)
white-space-pre-034.html
(live test)
(source)
white-space-pre-035.html
(live test)
(source)
white-space-pre-wrap-justify-001.html
(live test)
(source)
white-space-pre-wrap-justify-002.html
(live test)
(source)
white-space-pre-wrap-justify-003.html
(live test)
(source)
white-space-pre-wrap-justify-004.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-021.html
(live test)
(source)
white-space-wrap-after-nowrap-001.html
(live test)
(source)
ws-break-spaces-applies-to-012.html
(live test)
(source)
ws-break-spaces-applies-to-013.html
(live test)
(source)
break-boundary-2-chars-001.html
(live test)
(source)
word-break-break-all-062.html
(live test)
(source)
word-break-keep-all-063.html
(live test)
(source)
tests using wrap through 'white-space: pre-wrap':
trailing-space-with-cr-crash.html
(live test)
(source)
white-space-pre-wrap-chash.html
(live test)
(source)
hyphens-auto-002.html
(live test)
(source)
css3-text-line-break-baspglwj-001.html
(live test)
(source)
css3-text-line-break-baspglwj-002.html
(live test)
(source)
css3-text-line-break-baspglwj-003.html
(live test)
(source)
css3-text-line-break-baspglwj-004.html
(live test)
(source)
css3-text-line-break-baspglwj-005.html
(live test)
(source)
css3-text-line-break-baspglwj-006.html
(live test)
(source)
css3-text-line-break-baspglwj-007.html
(live test)
(source)
css3-text-line-break-baspglwj-008.html
(live test)
(source)
css3-text-line-break-baspglwj-009.html
(live test)
(source)
css3-text-line-break-baspglwj-010.html
(live test)
(source)
css3-text-line-break-baspglwj-011.html
(live test)
(source)
css3-text-line-break-baspglwj-012.html
(live test)
(source)
css3-text-line-break-baspglwj-014.html
(live test)
(source)
css3-text-line-break-baspglwj-015.html
(live test)
(source)
css3-text-line-break-baspglwj-016.html
(live test)
(source)
css3-text-line-break-baspglwj-017.html
(live test)
(source)
css3-text-line-break-baspglwj-018.html
(live test)
(source)
css3-text-line-break-baspglwj-019.html
(live test)
(source)
css3-text-line-break-baspglwj-020.html
(live test)
(source)
css3-text-line-break-baspglwj-021.html
(live test)
(source)
css3-text-line-break-baspglwj-022.html
(live test)
(source)
css3-text-line-break-baspglwj-023.html
(live test)
(source)
css3-text-line-break-baspglwj-024.html
(live test)
(source)
css3-text-line-break-baspglwj-025.html
(live test)
(source)
css3-text-line-break-baspglwj-026.html
(live test)
(source)
css3-text-line-break-baspglwj-030.html
(live test)
(source)
css3-text-line-break-baspglwj-031.html
(live test)
(source)
css3-text-line-break-baspglwj-032.html
(live test)
(source)
css3-text-line-break-baspglwj-033.html
(live test)
(source)
css3-text-line-break-baspglwj-034.html
(live test)
(source)
css3-text-line-break-baspglwj-035.html
(live test)
(source)
css3-text-line-break-baspglwj-036.html
(live test)
(source)
css3-text-line-break-baspglwj-037.html
(live test)
(source)
css3-text-line-break-baspglwj-038.html
(live test)
(source)
css3-text-line-break-baspglwj-039.html
(live test)
(source)
css3-text-line-break-baspglwj-040.html
(live test)
(source)
css3-text-line-break-baspglwj-041.html
(live test)
(source)
css3-text-line-break-baspglwj-042.html
(live test)
(source)
css3-text-line-break-baspglwj-043.html
(live test)
(source)
css3-text-line-break-baspglwj-044.html
(live test)
(source)
css3-text-line-break-baspglwj-045.html
(live test)
(source)
css3-text-line-break-baspglwj-046.html
(live test)
(source)
css3-text-line-break-baspglwj-047.html
(live test)
(source)
css3-text-line-break-baspglwj-048.html
(live test)
(source)
css3-text-line-break-baspglwj-049.html
(live test)
(source)
css3-text-line-break-baspglwj-050.html
(live test)
(source)
css3-text-line-break-baspglwj-051.html
(live test)
(source)
css3-text-line-break-baspglwj-052.html
(live test)
(source)
css3-text-line-break-baspglwj-060.html
(live test)
(source)
css3-text-line-break-baspglwj-061.html
(live test)
(source)
css3-text-line-break-baspglwj-062.html
(live test)
(source)
css3-text-line-break-baspglwj-063.html
(live test)
(source)
css3-text-line-break-baspglwj-064.html
(live test)
(source)
css3-text-line-break-baspglwj-065.html
(live test)
(source)
css3-text-line-break-baspglwj-066.html
(live test)
(source)
css3-text-line-break-baspglwj-067.html
(live test)
(source)
css3-text-line-break-baspglwj-068.html
(live test)
(source)
css3-text-line-break-baspglwj-069.html
(live test)
(source)
css3-text-line-break-baspglwj-070.html
(live test)
(source)
css3-text-line-break-baspglwj-071.html
(live test)
(source)
css3-text-line-break-baspglwj-072.html
(live test)
(source)
css3-text-line-break-baspglwj-073.html
(live test)
(source)
css3-text-line-break-baspglwj-074.html
(live test)
(source)
css3-text-line-break-baspglwj-075.html
(live test)
(source)
css3-text-line-break-baspglwj-076.html
(live test)
(source)
css3-text-line-break-baspglwj-077.html
(live test)
(source)
css3-text-line-break-baspglwj-078.html
(live test)
(source)
css3-text-line-break-baspglwj-080.html
(live test)
(source)
css3-text-line-break-baspglwj-081.html
(live test)
(source)
css3-text-line-break-baspglwj-082.html
(live test)
(source)
css3-text-line-break-baspglwj-083.html
(live test)
(source)
css3-text-line-break-baspglwj-084.html
(live test)
(source)
css3-text-line-break-baspglwj-085.html
(live test)
(source)
css3-text-line-break-baspglwj-086.html
(live test)
(source)
css3-text-line-break-baspglwj-090.html
(live test)
(source)
css3-text-line-break-baspglwj-091.html
(live test)
(source)
css3-text-line-break-baspglwj-092.html
(live test)
(source)
css3-text-line-break-baspglwj-093.html
(live test)
(source)
css3-text-line-break-baspglwj-095.html
(live test)
(source)
css3-text-line-break-baspglwj-096.html
(live test)
(source)
css3-text-line-break-baspglwj-097.html
(live test)
(source)
css3-text-line-break-baspglwj-098.html
(live test)
(source)
css3-text-line-break-baspglwj-099.html
(live test)
(source)
css3-text-line-break-baspglwj-100.html
(live test)
(source)
css3-text-line-break-baspglwj-101.html
(live test)
(source)
css3-text-line-break-baspglwj-102.html
(live test)
(source)
css3-text-line-break-baspglwj-103.html
(live test)
(source)
css3-text-line-break-baspglwj-104.html
(live test)
(source)
css3-text-line-break-baspglwj-105.html
(live test)
(source)
css3-text-line-break-baspglwj-106.html
(live test)
(source)
css3-text-line-break-baspglwj-107.html
(live test)
(source)
css3-text-line-break-baspglwj-108.html
(live test)
(source)
css3-text-line-break-baspglwj-109.html
(live test)
(source)
css3-text-line-break-baspglwj-110.html
(live test)
(source)
css3-text-line-break-baspglwj-111.html
(live test)
(source)
css3-text-line-break-baspglwj-112.html
(live test)
(source)
css3-text-line-break-baspglwj-113.html
(live test)
(source)
css3-text-line-break-baspglwj-114.html
(live test)
(source)
css3-text-line-break-baspglwj-115.html
(live test)
(source)
css3-text-line-break-baspglwj-116.html
(live test)
(source)
css3-text-line-break-baspglwj-117.html
(live test)
(source)
css3-text-line-break-baspglwj-118.html
(live test)
(source)
css3-text-line-break-baspglwj-120.html
(live test)
(source)
css3-text-line-break-baspglwj-121.html
(live test)
(source)
css3-text-line-break-baspglwj-122.html
(live test)
(source)
css3-text-line-break-baspglwj-123.html
(live test)
(source)
css3-text-line-break-baspglwj-124.html
(live test)
(source)
css3-text-line-break-baspglwj-125.html
(live test)
(source)
css3-text-line-break-baspglwj-126.html
(live test)
(source)
css3-text-line-break-baspglwj-127.html
(live test)
(source)
css3-text-line-break-baspglwj-128.html
(live test)
(source)
css3-text-line-break-baspglwj-130.html
(live test)
(source)
css3-text-line-break-baspglwj-131.html
(live test)
(source)
letter-spacing-200.html
(live test)
(source)
letter-spacing-201.html
(live test)
(source)
letter-spacing-203.html
(live test)
(source)
letter-spacing-204.html
(live test)
(source)
letter-spacing-205.html
(live test)
(source)
letter-spacing-211.html
(live test)
(source)
letter-spacing-212.html
(live test)
(source)
line-break-anywhere-008.html
(live test)
(source)
line-break-anywhere-010.html
(live test)
(source)
line-break-anywhere-and-white-space-006.html
(live test)
(source)
line-break-anywhere-and-white-space-007.html
(live test)
(source)
overflow-wrap-anywhere-004.html
(live test)
(source)
overflow-wrap-anywhere-005.html
(live test)
(source)
overflow-wrap-break-word-004.html
(live test)
(source)
overflow-wrap-break-word-005.html
(live test)
(source)
overflow-wrap-break-word-007.html
(live test)
(source)
overflow-wrap-break-word-white-space-crash-002.html
(live test)
(source)
overflow-wrap-min-content-size-009.html
(live test)
(source)
text-justify-and-trailing-spaces-001.html
(live test)
(source)
text-justify-and-trailing-spaces-002.html
(live test)
(source)
text-justify-and-trailing-spaces-003.html
(live test)
(source)
text-justify-and-trailing-spaces-004.html
(live test)
(source)
text-justify-and-trailing-spaces-005.html
(live test)
(source)
text-justify-and-trailing-spaces-006.html
(live test)
(source)
text-transform-fullwidth-007.html
(live test)
(source)
text-transform-fullwidth-009.html
(live test)
(source)
break-spaces-newline-011.html
(live test)
(source)
break-spaces-newline-012.html
(live test)
(source)
break-spaces-newline-013.html
(live test)
(source)
break-spaces-newline-014.html
(live test)
(source)
break-spaces-newline-015.html
(live test)
(source)
break-spaces-newline-016.html
(live test)
(source)
control-chars-00D.html
(live test)
(source)
eol-spaces-bidi-002.html
(live test)
(source)
eol-spaces-bidi-003.html
(live test)
(source)
pre-wrap-001.html
(live test)
(source)
pre-wrap-002.html
(live test)
(source)
pre-wrap-003.html
(live test)
(source)
pre-wrap-004.html
(live test)
(source)
pre-wrap-005.html
(live test)
(source)
pre-wrap-006.html
(live test)
(source)
pre-wrap-007.html
(live test)
(source)
pre-wrap-008.html
(live test)
(source)
pre-wrap-009.html
(live test)
(source)
pre-wrap-010.html
(live test)
(source)
pre-wrap-011.html
(live test)
(source)
pre-wrap-012.html
(live test)
(source)
pre-wrap-013.html
(live test)
(source)
pre-wrap-014.html
(live test)
(source)
pre-wrap-015.html
(live test)
(source)
pre-wrap-016.html
(live test)
(source)
pre-wrap-017.html
(live test)
(source)
pre-wrap-018.html
(live test)
(source)
pre-wrap-019.html
(live test)
(source)
pre-wrap-020.html
(live test)
(source)
pre-wrap-051.html
(live test)
(source)
pre-wrap-052.html
(live test)
(source)
pre-wrap-align-center-001.html
(live test)
(source)
pre-wrap-align-center-002.html
(live test)
(source)
pre-wrap-align-center-003.html
(live test)
(source)
pre-wrap-align-end-001.html
(live test)
(source)
pre-wrap-align-end-002.html
(live test)
(source)
pre-wrap-align-end-003.html
(live test)
(source)
pre-wrap-align-left-001.html
(live test)
(source)
pre-wrap-align-left-002.html
(live test)
(source)
pre-wrap-align-left-003.html
(live test)
(source)
pre-wrap-align-right-001.html
(live test)
(source)
pre-wrap-align-right-002.html
(live test)
(source)
pre-wrap-align-right-003.html
(live test)
(source)
pre-wrap-align-start-001.html
(live test)
(source)
pre-wrap-align-start-002.html
(live test)
(source)
pre-wrap-align-start-003.html
(live test)
(source)
pre-wrap-float-001.html
(live test)
(source)
pre-wrap-leading-spaces-001.html
(live test)
(source)
pre-wrap-leading-spaces-002.html
(live test)
(source)
pre-wrap-leading-spaces-003.html
(live test)
(source)
pre-wrap-leading-spaces-004.html
(live test)
(source)
pre-wrap-leading-spaces-005.html
(live test)
(source)
pre-wrap-leading-spaces-006.html
(live test)
(source)
pre-wrap-leading-spaces-007.html
(live test)
(source)
pre-wrap-leading-spaces-008.html
(live test)
(source)
pre-wrap-leading-spaces-009.html
(live test)
(source)
pre-wrap-leading-spaces-010.html
(live test)
(source)
pre-wrap-leading-spaces-011.html
(live test)
(source)
pre-wrap-leading-spaces-012.html
(live test)
(source)
pre-wrap-leading-spaces-013.html
(live test)
(source)
pre-wrap-leading-spaces-014.html
(live test)
(source)
pre-wrap-leading-spaces-015.html
(live test)
(source)
pre-wrap-leading-spaces-016.html
(live test)
(source)
pre-wrap-leading-spaces-017.html
(live test)
(source)
pre-wrap-tab-001.html
(live test)
(source)
pre-wrap-tab-002.html
(live test)
(source)
pre-wrap-tab-003.html
(live test)
(source)
pre-wrap-tab-004.html
(live test)
(source)
pre-wrap-tab-005.html
(live test)
(source)
pre-wrap-tab-006.html
(live test)
(source)
tab-stop-threshold-003.html
(live test)
(source)
tab-stop-threshold-004.html
(live test)
(source)
textarea-pre-wrap-001.html
(live test)
(source)
textarea-pre-wrap-002.html
(live test)
(source)
textarea-pre-wrap-003.html
(live test)
(source)
textarea-pre-wrap-004.html
(live test)
(source)
textarea-pre-wrap-005.html
(live test)
(source)
textarea-pre-wrap-006.html
(live test)
(source)
textarea-pre-wrap-007.html
(live test)
(source)
textarea-pre-wrap-011.html
(live test)
(source)
textarea-pre-wrap-012.html
(live test)
(source)
textarea-pre-wrap-013.html
(live test)
(source)
textarea-pre-wrap-014.html
(live test)
(source)
trailing-ideographic-space-003.html
(live test)
(source)
trailing-ideographic-space-004.html
(live test)
(source)
trailing-other-space-separators-002.html
(live test)
(source)
trailing-space-align-start.tentative.html
(live test)
(source)
trailing-space-and-text-alignment-003.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-003.html
(live test)
(source)
trailing-space-in-inline-box.html
(live test)
(source)
trailing-space-position-001.html
(live test)
(source)
trailing-space-rtl-001.html
(live test)
(source)
white-space-applies-to-text-001.html
(live test)
(source)
white-space-intrinsic-size-003.html
(live test)
(source)
white-space-intrinsic-size-004.html
(live test)
(source)
white-space-intrinsic-size-005.html
(live test)
(source)
white-space-intrinsic-size-006.html
(live test)
(source)
white-space-intrinsic-size-013.html
(live test)
(source)
white-space-intrinsic-size-014.html
(live test)
(source)
white-space-intrinsic-size-017.html
(live test)
(source)
white-space-letter-spacing-001.html
(live test)
(source)
white-space-pre-032.html
(live test)
(source)
white-space-pre-wrap-justify-001.html
(live test)
(source)
white-space-pre-wrap-justify-002.html
(live test)
(source)
white-space-pre-wrap-justify-003.html
(live test)
(source)
white-space-pre-wrap-justify-004.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-001.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-002.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-003.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-004.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-005.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-006.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-007.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-008.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-010.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-011.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-012.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-013.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-014.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-015.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-021.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-022.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-023.html
(live test)
(source)
break-boundary-2-chars-001.html
(live test)
(source)
word-break-break-all-010.html
(live test)
(source)
word-break-break-all-011.html
(live test)
(source)
word-break-break-all-015.html
(live test)
(source)
word-break-break-all-019.html
(live test)
(source)
word-break-break-all-021.html
(live test)
(source)
word-break-break-all-062.html
(live test)
(source)
word-break-keep-all-007.html
(live test)
(source)
word-break-keep-all-063.html
(live test)
(source)
word-break-min-content-007.html
(live test)
(source)
tests using wrap through 'white-space: pre-line':
css3-text-line-break-baspglwj-001.html
(live test)
(source)
css3-text-line-break-baspglwj-002.html
(live test)
(source)
css3-text-line-break-baspglwj-003.html
(live test)
(source)
css3-text-line-break-baspglwj-004.html
(live test)
(source)
css3-text-line-break-baspglwj-005.html
(live test)
(source)
css3-text-line-break-baspglwj-006.html
(live test)
(source)
css3-text-line-break-baspglwj-007.html
(live test)
(source)
css3-text-line-break-baspglwj-008.html
(live test)
(source)
css3-text-line-break-baspglwj-009.html
(live test)
(source)
css3-text-line-break-baspglwj-010.html
(live test)
(source)
css3-text-line-break-baspglwj-011.html
(live test)
(source)
css3-text-line-break-baspglwj-012.html
(live test)
(source)
css3-text-line-break-baspglwj-014.html
(live test)
(source)
css3-text-line-break-baspglwj-015.html
(live test)
(source)
css3-text-line-break-baspglwj-016.html
(live test)
(source)
css3-text-line-break-baspglwj-017.html
(live test)
(source)
css3-text-line-break-baspglwj-018.html
(live test)
(source)
css3-text-line-break-baspglwj-019.html
(live test)
(source)
css3-text-line-break-baspglwj-020.html
(live test)
(source)
css3-text-line-break-baspglwj-021.html
(live test)
(source)
css3-text-line-break-baspglwj-022.html
(live test)
(source)
css3-text-line-break-baspglwj-023.html
(live test)
(source)
css3-text-line-break-baspglwj-024.html
(live test)
(source)
css3-text-line-break-baspglwj-025.html
(live test)
(source)
css3-text-line-break-baspglwj-026.html
(live test)
(source)
css3-text-line-break-baspglwj-030.html
(live test)
(source)
css3-text-line-break-baspglwj-031.html
(live test)
(source)
css3-text-line-break-baspglwj-032.html
(live test)
(source)
css3-text-line-break-baspglwj-033.html
(live test)
(source)
css3-text-line-break-baspglwj-034.html
(live test)
(source)
css3-text-line-break-baspglwj-035.html
(live test)
(source)
css3-text-line-break-baspglwj-036.html
(live test)
(source)
css3-text-line-break-baspglwj-037.html
(live test)
(source)
css3-text-line-break-baspglwj-038.html
(live test)
(source)
css3-text-line-break-baspglwj-039.html
(live test)
(source)
css3-text-line-break-baspglwj-040.html
(live test)
(source)
css3-text-line-break-baspglwj-041.html
(live test)
(source)
css3-text-line-break-baspglwj-042.html
(live test)
(source)
css3-text-line-break-baspglwj-043.html
(live test)
(source)
css3-text-line-break-baspglwj-044.html
(live test)
(source)
css3-text-line-break-baspglwj-045.html
(live test)
(source)
css3-text-line-break-baspglwj-046.html
(live test)
(source)
css3-text-line-break-baspglwj-047.html
(live test)
(source)
css3-text-line-break-baspglwj-048.html
(live test)
(source)
css3-text-line-break-baspglwj-049.html
(live test)
(source)
css3-text-line-break-baspglwj-050.html
(live test)
(source)
css3-text-line-break-baspglwj-051.html
(live test)
(source)
css3-text-line-break-baspglwj-052.html
(live test)
(source)
css3-text-line-break-baspglwj-060.html
(live test)
(source)
css3-text-line-break-baspglwj-061.html
(live test)
(source)
css3-text-line-break-baspglwj-062.html
(live test)
(source)
css3-text-line-break-baspglwj-063.html
(live test)
(source)
css3-text-line-break-baspglwj-064.html
(live test)
(source)
css3-text-line-break-baspglwj-065.html
(live test)
(source)
css3-text-line-break-baspglwj-066.html
(live test)
(source)
css3-text-line-break-baspglwj-067.html
(live test)
(source)
css3-text-line-break-baspglwj-068.html
(live test)
(source)
css3-text-line-break-baspglwj-069.html
(live test)
(source)
css3-text-line-break-baspglwj-070.html
(live test)
(source)
css3-text-line-break-baspglwj-071.html
(live test)
(source)
css3-text-line-break-baspglwj-072.html
(live test)
(source)
css3-text-line-break-baspglwj-073.html
(live test)
(source)
css3-text-line-break-baspglwj-074.html
(live test)
(source)
css3-text-line-break-baspglwj-075.html
(live test)
(source)
css3-text-line-break-baspglwj-076.html
(live test)
(source)
css3-text-line-break-baspglwj-077.html
(live test)
(source)
css3-text-line-break-baspglwj-078.html
(live test)
(source)
css3-text-line-break-baspglwj-080.html
(live test)
(source)
css3-text-line-break-baspglwj-081.html
(live test)
(source)
css3-text-line-break-baspglwj-082.html
(live test)
(source)
css3-text-line-break-baspglwj-083.html
(live test)
(source)
css3-text-line-break-baspglwj-084.html
(live test)
(source)
css3-text-line-break-baspglwj-085.html
(live test)
(source)
css3-text-line-break-baspglwj-086.html
(live test)
(source)
css3-text-line-break-baspglwj-090.html
(live test)
(source)
css3-text-line-break-baspglwj-091.html
(live test)
(source)
css3-text-line-break-baspglwj-092.html
(live test)
(source)
css3-text-line-break-baspglwj-093.html
(live test)
(source)
css3-text-line-break-baspglwj-095.html
(live test)
(source)
css3-text-line-break-baspglwj-096.html
(live test)
(source)
css3-text-line-break-baspglwj-097.html
(live test)
(source)
css3-text-line-break-baspglwj-098.html
(live test)
(source)
css3-text-line-break-baspglwj-099.html
(live test)
(source)
css3-text-line-break-baspglwj-100.html
(live test)
(source)
css3-text-line-break-baspglwj-101.html
(live test)
(source)
css3-text-line-break-baspglwj-102.html
(live test)
(source)
css3-text-line-break-baspglwj-103.html
(live test)
(source)
css3-text-line-break-baspglwj-104.html
(live test)
(source)
css3-text-line-break-baspglwj-105.html
(live test)
(source)
css3-text-line-break-baspglwj-106.html
(live test)
(source)
css3-text-line-break-baspglwj-107.html
(live test)
(source)
css3-text-line-break-baspglwj-108.html
(live test)
(source)
css3-text-line-break-baspglwj-109.html
(live test)
(source)
css3-text-line-break-baspglwj-110.html
(live test)
(source)
css3-text-line-break-baspglwj-111.html
(live test)
(source)
css3-text-line-break-baspglwj-112.html
(live test)
(source)
css3-text-line-break-baspglwj-113.html
(live test)
(source)
css3-text-line-break-baspglwj-114.html
(live test)
(source)
css3-text-line-break-baspglwj-115.html
(live test)
(source)
css3-text-line-break-baspglwj-116.html
(live test)
(source)
css3-text-line-break-baspglwj-117.html
(live test)
(source)
css3-text-line-break-baspglwj-118.html
(live test)
(source)
css3-text-line-break-baspglwj-120.html
(live test)
(source)
css3-text-line-break-baspglwj-121.html
(live test)
(source)
css3-text-line-break-baspglwj-122.html
(live test)
(source)
css3-text-line-break-baspglwj-123.html
(live test)
(source)
css3-text-line-break-baspglwj-124.html
(live test)
(source)
css3-text-line-break-baspglwj-125.html
(live test)
(source)
css3-text-line-break-baspglwj-126.html
(live test)
(source)
css3-text-line-break-baspglwj-127.html
(live test)
(source)
css3-text-line-break-baspglwj-128.html
(live test)
(source)
css3-text-line-break-baspglwj-130.html
(live test)
(source)
css3-text-line-break-baspglwj-131.html
(live test)
(source)
control-chars-00D.html
(live test)
(source)
pre-line-051.html
(live test)
(source)
pre-line-052.html
(live test)
(source)
pre-line-br-with-whitespace-child-crash.html
(live test)
(source)
pre-line-with-space-and-newline.html
(live test)
(source)
trailing-ideographic-space-008.html
(live test)
(source)
trailing-ideographic-space-010.html
(live test)
(source)
trailing-ogham-002.html
(live test)
(source)
trailing-other-space-separators-003.html
(live test)
(source)
trailing-space-and-text-alignment-005.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-005.html
(live test)
(source)
white-space-applies-to-text-001.html
(live test)
(source)
white-space-intrinsic-size-019.html
(live test)
(source)
white-space-intrinsic-size-020.html
(live test)
(source)
white-space-letter-spacing-001.html
(live test)
(source)
white-space-pre-035.html
(live test)
(source)
break-boundary-2-chars-001.html
(live test)
(source)
word-break-break-all-062.html
(live test)
(source)
word-break-keep-all-063.html
(live test)
(source)
tests using wrap through 'white-space: break-spaces':
css3-text-line-break-baspglwj-001.html
(live test)
(source)
css3-text-line-break-baspglwj-002.html
(live test)
(source)
css3-text-line-break-baspglwj-003.html
(live test)
(source)
css3-text-line-break-baspglwj-004.html
(live test)
(source)
css3-text-line-break-baspglwj-005.html
(live test)
(source)
css3-text-line-break-baspglwj-006.html
(live test)
(source)
css3-text-line-break-baspglwj-007.html
(live test)
(source)
css3-text-line-break-baspglwj-008.html
(live test)
(source)
css3-text-line-break-baspglwj-009.html
(live test)
(source)
css3-text-line-break-baspglwj-010.html
(live test)
(source)
css3-text-line-break-baspglwj-011.html
(live test)
(source)
css3-text-line-break-baspglwj-012.html
(live test)
(source)
css3-text-line-break-baspglwj-014.html
(live test)
(source)
css3-text-line-break-baspglwj-015.html
(live test)
(source)
css3-text-line-break-baspglwj-016.html
(live test)
(source)
css3-text-line-break-baspglwj-017.html
(live test)
(source)
css3-text-line-break-baspglwj-018.html
(live test)
(source)
css3-text-line-break-baspglwj-019.html
(live test)
(source)
css3-text-line-break-baspglwj-020.html
(live test)
(source)
css3-text-line-break-baspglwj-021.html
(live test)
(source)
css3-text-line-break-baspglwj-022.html
(live test)
(source)
css3-text-line-break-baspglwj-023.html
(live test)
(source)
css3-text-line-break-baspglwj-024.html
(live test)
(source)
css3-text-line-break-baspglwj-025.html
(live test)
(source)
css3-text-line-break-baspglwj-026.html
(live test)
(source)
css3-text-line-break-baspglwj-030.html
(live test)
(source)
css3-text-line-break-baspglwj-031.html
(live test)
(source)
css3-text-line-break-baspglwj-032.html
(live test)
(source)
css3-text-line-break-baspglwj-033.html
(live test)
(source)
css3-text-line-break-baspglwj-034.html
(live test)
(source)
css3-text-line-break-baspglwj-035.html
(live test)
(source)
css3-text-line-break-baspglwj-036.html
(live test)
(source)
css3-text-line-break-baspglwj-037.html
(live test)
(source)
css3-text-line-break-baspglwj-038.html
(live test)
(source)
css3-text-line-break-baspglwj-039.html
(live test)
(source)
css3-text-line-break-baspglwj-040.html
(live test)
(source)
css3-text-line-break-baspglwj-041.html
(live test)
(source)
css3-text-line-break-baspglwj-042.html
(live test)
(source)
css3-text-line-break-baspglwj-043.html
(live test)
(source)
css3-text-line-break-baspglwj-044.html
(live test)
(source)
css3-text-line-break-baspglwj-045.html
(live test)
(source)
css3-text-line-break-baspglwj-046.html
(live test)
(source)
css3-text-line-break-baspglwj-047.html
(live test)
(source)
css3-text-line-break-baspglwj-048.html
(live test)
(source)
css3-text-line-break-baspglwj-049.html
(live test)
(source)
css3-text-line-break-baspglwj-050.html
(live test)
(source)
css3-text-line-break-baspglwj-051.html
(live test)
(source)
css3-text-line-break-baspglwj-052.html
(live test)
(source)
css3-text-line-break-baspglwj-060.html
(live test)
(source)
css3-text-line-break-baspglwj-061.html
(live test)
(source)
css3-text-line-break-baspglwj-062.html
(live test)
(source)
css3-text-line-break-baspglwj-063.html
(live test)
(source)
css3-text-line-break-baspglwj-064.html
(live test)
(source)
css3-text-line-break-baspglwj-065.html
(live test)
(source)
css3-text-line-break-baspglwj-066.html
(live test)
(source)
css3-text-line-break-baspglwj-067.html
(live test)
(source)
css3-text-line-break-baspglwj-068.html
(live test)
(source)
css3-text-line-break-baspglwj-069.html
(live test)
(source)
css3-text-line-break-baspglwj-070.html
(live test)
(source)
css3-text-line-break-baspglwj-071.html
(live test)
(source)
css3-text-line-break-baspglwj-072.html
(live test)
(source)
css3-text-line-break-baspglwj-073.html
(live test)
(source)
css3-text-line-break-baspglwj-074.html
(live test)
(source)
css3-text-line-break-baspglwj-075.html
(live test)
(source)
css3-text-line-break-baspglwj-076.html
(live test)
(source)
css3-text-line-break-baspglwj-077.html
(live test)
(source)
css3-text-line-break-baspglwj-078.html
(live test)
(source)
css3-text-line-break-baspglwj-080.html
(live test)
(source)
css3-text-line-break-baspglwj-081.html
(live test)
(source)
css3-text-line-break-baspglwj-082.html
(live test)
(source)
css3-text-line-break-baspglwj-083.html
(live test)
(source)
css3-text-line-break-baspglwj-084.html
(live test)
(source)
css3-text-line-break-baspglwj-085.html
(live test)
(source)
css3-text-line-break-baspglwj-086.html
(live test)
(source)
css3-text-line-break-baspglwj-090.html
(live test)
(source)
css3-text-line-break-baspglwj-091.html
(live test)
(source)
css3-text-line-break-baspglwj-092.html
(live test)
(source)
css3-text-line-break-baspglwj-093.html
(live test)
(source)
css3-text-line-break-baspglwj-095.html
(live test)
(source)
css3-text-line-break-baspglwj-096.html
(live test)
(source)
css3-text-line-break-baspglwj-097.html
(live test)
(source)
css3-text-line-break-baspglwj-098.html
(live test)
(source)
css3-text-line-break-baspglwj-099.html
(live test)
(source)
css3-text-line-break-baspglwj-100.html
(live test)
(source)
css3-text-line-break-baspglwj-101.html
(live test)
(source)
css3-text-line-break-baspglwj-102.html
(live test)
(source)
css3-text-line-break-baspglwj-103.html
(live test)
(source)
css3-text-line-break-baspglwj-104.html
(live test)
(source)
css3-text-line-break-baspglwj-105.html
(live test)
(source)
css3-text-line-break-baspglwj-106.html
(live test)
(source)
css3-text-line-break-baspglwj-107.html
(live test)
(source)
css3-text-line-break-baspglwj-108.html
(live test)
(source)
css3-text-line-break-baspglwj-109.html
(live test)
(source)
css3-text-line-break-baspglwj-110.html
(live test)
(source)
css3-text-line-break-baspglwj-111.html
(live test)
(source)
css3-text-line-break-baspglwj-112.html
(live test)
(source)
css3-text-line-break-baspglwj-113.html
(live test)
(source)
css3-text-line-break-baspglwj-114.html
(live test)
(source)
css3-text-line-break-baspglwj-115.html
(live test)
(source)
css3-text-line-break-baspglwj-116.html
(live test)
(source)
css3-text-line-break-baspglwj-117.html
(live test)
(source)
css3-text-line-break-baspglwj-118.html
(live test)
(source)
css3-text-line-break-baspglwj-120.html
(live test)
(source)
css3-text-line-break-baspglwj-121.html
(live test)
(source)
css3-text-line-break-baspglwj-122.html
(live test)
(source)
css3-text-line-break-baspglwj-123.html
(live test)
(source)
css3-text-line-break-baspglwj-124.html
(live test)
(source)
css3-text-line-break-baspglwj-125.html
(live test)
(source)
css3-text-line-break-baspglwj-126.html
(live test)
(source)
css3-text-line-break-baspglwj-127.html
(live test)
(source)
css3-text-line-break-baspglwj-128.html
(live test)
(source)
css3-text-line-break-baspglwj-130.html
(live test)
(source)
css3-text-line-break-baspglwj-131.html
(live test)
(source)
line-break-anywhere-005.html
(live test)
(source)
line-break-anywhere-009.html
(live test)
(source)
line-break-anywhere-and-white-space-008.html
(live test)
(source)
line-break-anywhere-and-white-space-009.html
(live test)
(source)
overflow-wrap-anywhere-002.html
(live test)
(source)
overflow-wrap-anywhere-003.html
(live test)
(source)
overflow-wrap-break-word-002.html
(live test)
(source)
overflow-wrap-break-word-003.html
(live test)
(source)
overflow-wrap-break-word-006.html
(live test)
(source)
overflow-wrap-break-word-008.html
(live test)
(source)
break-spaces-001.html
(live test)
(source)
break-spaces-002.html
(live test)
(source)
break-spaces-003.html
(live test)
(source)
break-spaces-004.html
(live test)
(source)
break-spaces-005.html
(live test)
(source)
break-spaces-006.html
(live test)
(source)
break-spaces-007.html
(live test)
(source)
break-spaces-008.html
(live test)
(source)
break-spaces-009.html
(live test)
(source)
break-spaces-010.html
(live test)
(source)
break-spaces-011.html
(live test)
(source)
break-spaces-051.html
(live test)
(source)
break-spaces-052.html
(live test)
(source)
break-spaces-before-first-char-001.html
(live test)
(source)
break-spaces-before-first-char-002.html
(live test)
(source)
break-spaces-before-first-char-003.html
(live test)
(source)
break-spaces-before-first-char-004.html
(live test)
(source)
break-spaces-before-first-char-005.html
(live test)
(source)
break-spaces-before-first-char-006.html
(live test)
(source)
break-spaces-before-first-char-007.html
(live test)
(source)
break-spaces-before-first-char-008.html
(live test)
(source)
break-spaces-before-first-char-009.html
(live test)
(source)
break-spaces-before-first-char-010.html
(live test)
(source)
break-spaces-before-first-char-011.html
(live test)
(source)
break-spaces-before-first-char-012.html
(live test)
(source)
break-spaces-before-first-char-013.html
(live test)
(source)
break-spaces-before-first-char-014.html
(live test)
(source)
break-spaces-before-first-char-015.html
(live test)
(source)
break-spaces-before-first-char-016.html
(live test)
(source)
break-spaces-before-first-char-017.html
(live test)
(source)
break-spaces-before-first-char-018.html
(live test)
(source)
break-spaces-before-first-ideographic-char-001.html
(live test)
(source)
break-spaces-before-first-ideographic-char-002.html
(live test)
(source)
break-spaces-before-first-ideographic-char-003.html
(live test)
(source)
break-spaces-before-first-ideographic-char-004.html
(live test)
(source)
break-spaces-before-first-ideographic-char-005.html
(live test)
(source)
break-spaces-before-first-ideographic-char-006.html
(live test)
(source)
break-spaces-before-first-ideographic-char-007.html
(live test)
(source)
break-spaces-before-first-ideographic-char-008.html
(live test)
(source)
break-spaces-before-first-ideographic-char-009.html
(live test)
(source)
break-spaces-before-first-ideographic-char-010.html
(live test)
(source)
break-spaces-before-first-ideographic-char-011.html
(live test)
(source)
break-spaces-before-first-ideographic-char-012.html
(live test)
(source)
break-spaces-before-first-ideographic-char-013.html
(live test)
(source)
break-spaces-before-first-ideographic-char-014.html
(live test)
(source)
break-spaces-before-first-ideographic-char-015.html
(live test)
(source)
break-spaces-before-first-ideographic-char-016.html
(live test)
(source)
break-spaces-before-first-ideographic-char-017.html
(live test)
(source)
break-spaces-before-first-ideographic-char-018.html
(live test)
(source)
break-spaces-newline-011.html
(live test)
(source)
break-spaces-newline-012.html
(live test)
(source)
break-spaces-newline-013.html
(live test)
(source)
break-spaces-newline-014.html
(live test)
(source)
break-spaces-newline-015.html
(live test)
(source)
break-spaces-newline-016.html
(live test)
(source)
break-spaces-tab-001.html
(live test)
(source)
break-spaces-tab-002.html
(live test)
(source)
break-spaces-tab-003.html
(live test)
(source)
break-spaces-tab-004.html
(live test)
(source)
break-spaces-tab-005.html
(live test)
(source)
break-spaces-tab-006.html
(live test)
(source)
break-spaces-with-ideographic-space-001.html
(live test)
(source)
break-spaces-with-ideographic-space-002.html
(live test)
(source)
break-spaces-with-ideographic-space-003.html
(live test)
(source)
break-spaces-with-ideographic-space-004.html
(live test)
(source)
break-spaces-with-ideographic-space-005.html
(live test)
(source)
break-spaces-with-ideographic-space-006.html
(live test)
(source)
break-spaces-with-ideographic-space-007.html
(live test)
(source)
break-spaces-with-ideographic-space-008.html
(live test)
(source)
break-spaces-with-ideographic-space-009.html
(live test)
(source)
break-spaces-with-ideographic-space-010.html
(live test)
(source)
break-spaces-with-overflow-wrap-001.html
(live test)
(source)
break-spaces-with-overflow-wrap-002.html
(live test)
(source)
break-spaces-with-overflow-wrap-003.html
(live test)
(source)
break-spaces-with-overflow-wrap-004.html
(live test)
(source)
break-spaces-with-overflow-wrap-005.html
(live test)
(source)
break-spaces-with-overflow-wrap-006.html
(live test)
(source)
break-spaces-with-overflow-wrap-007.html
(live test)
(source)
break-spaces-with-overflow-wrap-008.html
(live test)
(source)
break-spaces-with-overflow-wrap-009.html
(live test)
(source)
break-spaces-with-overflow-wrap-010.html
(live test)
(source)
control-chars-00D.html
(live test)
(source)
tab-stop-threshold-005.html
(live test)
(source)
tab-stop-threshold-006.html
(live test)
(source)
textarea-break-spaces-001.html
(live test)
(source)
textarea-break-spaces-002.html
(live test)
(source)
trailing-ideographic-space-break-spaces-001.html
(live test)
(source)
trailing-ideographic-space-break-spaces-002.html
(live test)
(source)
trailing-ideographic-space-break-spaces-003.html
(live test)
(source)
trailing-ideographic-space-break-spaces-004.html
(live test)
(source)
trailing-ideographic-space-break-spaces-005.html
(live test)
(source)
trailing-ideographic-space-break-spaces-006.html
(live test)
(source)
trailing-ideographic-space-break-spaces-007.html
(live test)
(source)
trailing-ideographic-space-break-spaces-008.html
(live test)
(source)
trailing-other-space-separators-break-spaces-001.html
(live test)
(source)
trailing-other-space-separators-break-spaces-002.html
(live test)
(source)
trailing-other-space-separators-break-spaces-003.html
(live test)
(source)
trailing-other-space-separators-break-spaces-004.html
(live test)
(source)
trailing-other-space-separators-break-spaces-005.html
(live test)
(source)
trailing-other-space-separators-break-spaces-006.html
(live test)
(source)
trailing-other-space-separators-break-spaces-007.html
(live test)
(source)
trailing-other-space-separators-break-spaces-008.html
(live test)
(source)
trailing-other-space-separators-break-spaces-009.html
(live test)
(source)
trailing-other-space-separators-break-spaces-010.html
(live test)
(source)
trailing-other-space-separators-break-spaces-011.html
(live test)
(source)
trailing-other-space-separators-break-spaces-012.html
(live test)
(source)
trailing-other-space-separators-break-spaces-013.html
(live test)
(source)
trailing-other-space-separators-break-spaces-014.html
(live test)
(source)
trailing-other-space-separators-break-spaces-015.html
(live test)
(source)
trailing-space-and-text-alignment-004.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-004.html
(live test)
(source)
white-space-applies-to-text-001.html
(live test)
(source)
white-space-intrinsic-size-001.html
(live test)
(source)
white-space-intrinsic-size-002.html
(live test)
(source)
white-space-letter-spacing-001.html
(live test)
(source)
white-space-pre-034.html
(live test)
(source)
ws-break-spaces-applies-to-001.html
(live test)
(source)
ws-break-spaces-applies-to-002.html
(live test)
(source)
ws-break-spaces-applies-to-003.html
(live test)
(source)
ws-break-spaces-applies-to-005.html
(live test)
(source)
ws-break-spaces-applies-to-006.html
(live test)
(source)
ws-break-spaces-applies-to-007.html
(live test)
(source)
ws-break-spaces-applies-to-008.html
(live test)
(source)
ws-break-spaces-applies-to-009.html
(live test)
(source)
ws-break-spaces-applies-to-010.html
(live test)
(source)
ws-break-spaces-applies-to-011.html
(live test)
(source)
ws-break-spaces-applies-to-012.html
(live test)
(source)
ws-break-spaces-applies-to-013.html
(live test)
(source)
ws-break-spaces-applies-to-014.html
(live test)
(source)
ws-break-spaces-applies-to-015.html
(live test)
(source)
break-boundary-2-chars-001.html
(live test)
(source)
word-break-break-all-012.html
(live test)
(source)
word-break-break-all-013.html
(live test)
(source)
word-break-break-all-017.html
(live test)
(source)
word-break-break-all-022.html
(live test)
(source)
word-break-break-all-062.html
(live test)
(source)
word-break-keep-all-008.html
(live test)
(source)
word-break-keep-all-063.html
(live test)
(source)
Note:
See
§ 5.6 Line Breaking Details
for more information
about rules and constrains on
soft wrap opportunities
nowrap
Inline-level content does not break across lines;
content that does not fit within the block container overflows it.
Tests
tests using nowrap directly through 'text-wrap-mode':
tests using nowrap through 'text-wrap: nowrap':
text-wrap-nowrap-001.html
(live test)
(source)
CSS 2 indirect tests via 'white-space: pre':
white-space-pre-001.xht
(live test)
(source)
white-space-pre-002.xht
(live test)
(source)
white-space-pre-005.xht
(live test)
(source)
white-space-pre-006.xht
(live test)
(source)
CSS 2 indirect tests via 'white-space: nowrap':
white-space-nowrap-001.xht
(live test)
(source)
white-space-nowrap-005.xht
(live test)
(source)
white-space-nowrap-006.xht
(live test)
(source)
text-align-white-space-004.xht
(live test)
(source)
text-align-white-space-008.xht
(live test)
(source)
white-space-nowrap-attribute-001.xht
(live test)
(source)
white-space-processing-006.xht
(live test)
(source)
tests using nowrap through 'white-space: pre':
bidi-lines-001.html
(live test)
(source)
bidi-tab-001.html
(live test)
(source)
letter-spacing-206.html
(live test)
(source)
letter-spacing-bidi-003.xht
(live test)
(source)
letter-spacing-bidi-004.xht
(live test)
(source)
letter-spacing-bidi-005.xht
(live test)
(source)
letter-spacing-nesting-003.xht
(live test)
(source)
line-break-anywhere-005.html
(live test)
(source)
line-break-anywhere-and-white-space-001.html
(live test)
(source)
line-break-anywhere-and-white-space-003.html
(live test)
(source)
line-breaking-009.html
(live test)
(source)
line-breaking-010.html
(live test)
(source)
line-breaking-011.html
(live test)
(source)
line-breaking-023.html
(live test)
(source)
line-breaking-024.html
(live test)
(source)
line-breaking-025.html
(live test)
(source)
line-breaking-026.html
(live test)
(source)
line-breaking-027.html
(live test)
(source)
line-breaking-ic-001.html
(live test)
(source)
line-breaking-ic-002.html
(live test)
(source)
line-breaking-ic-003.html
(live test)
(source)
line-breaking-replaced-006.html
(live test)
(source)
overflow-wrap-break-word-007.html
(live test)
(source)
overflow-wrap-break-word-008.html
(live test)
(source)
overflow-wrap-break-word-white-space-crash.html
(live test)
(source)
tab-size-block-ancestor.html
(live test)
(source)
tab-size-inheritance-001.html
(live test)
(source)
tab-size-inline-001.html
(live test)
(source)
tab-size-inline-002.html
(live test)
(source)
tab-size-integer-004.html
(live test)
(source)
tab-size-spacing-001.html
(live test)
(source)
tab-size-spacing-002.html
(live test)
(source)
tab-size-spacing-003.html
(live test)
(source)
text-indent-length-002.html
(live test)
(source)
text-indent-tab-positions-001.html
(live test)
(source)
text-justify-006.html
(live test)
(source)
text-transform-capitalize-035.html
(live test)
(source)
text-transform-fullwidth-008.html
(live test)
(source)
text-transform-fullwidth-009.html
(live test)
(source)
break-spaces-009.html
(live test)
(source)
break-spaces-newline-011.html
(live test)
(source)
break-spaces-newline-012.html
(live test)
(source)
break-spaces-newline-013.html
(live test)
(source)
break-spaces-newline-014.html
(live test)
(source)
break-spaces-newline-015.html
(live test)
(source)
break-spaces-newline-016.html
(live test)
(source)
break-spaces-tab-005.html
(live test)
(source)
break-spaces-tab-006.html
(live test)
(source)
break-spaces-with-ideographic-space-009.html
(live test)
(source)
break-spaces-with-overflow-wrap-009.html
(live test)
(source)
break-spaces-with-overflow-wrap-010.html
(live test)
(source)
control-chars-00D.html
(live test)
(source)
eol-spaces-bidi-001.html
(live test)
(source)
eol-spaces-bidi-002.html
(live test)
(source)
pre-float-001.html
(live test)
(source)
pre-with-whitespace-crash.html
(live test)
(source)
pre-wrap-008.html
(live test)
(source)
pre-wrap-009.html
(live test)
(source)
pre-wrap-010.html
(live test)
(source)
pre-wrap-016.html
(live test)
(source)
pre-wrap-018.html
(live test)
(source)
pre-wrap-019.html
(live test)
(source)
pre-wrap-020.html
(live test)
(source)
tab-bidi-001.html
(live test)
(source)
tab-stop-threshold-001.html
(live test)
(source)
tab-stop-threshold-002.html
(live test)
(source)
trailing-other-space-separators-001.html
(live test)
(source)
trailing-other-space-separators-003.html
(live test)
(source)
trailing-other-space-separators-004.html
(live test)
(source)
trailing-other-space-separators-break-spaces-001.html
(live test)
(source)
trailing-other-space-separators-break-spaces-002.html
(live test)
(source)
trailing-other-space-separators-break-spaces-003.html
(live test)
(source)
trailing-other-space-separators-break-spaces-004.html
(live test)
(source)
trailing-other-space-separators-break-spaces-005.html
(live test)
(source)
trailing-other-space-separators-break-spaces-006.html
(live test)
(source)
trailing-other-space-separators-break-spaces-007.html
(live test)
(source)
trailing-other-space-separators-break-spaces-008.html
(live test)
(source)
trailing-other-space-separators-break-spaces-009.html
(live test)
(source)
trailing-other-space-separators-break-spaces-010.html
(live test)
(source)
trailing-other-space-separators-break-spaces-011.html
(live test)
(source)
trailing-other-space-separators-break-spaces-012.html
(live test)
(source)
trailing-other-space-separators-break-spaces-013.html
(live test)
(source)
trailing-other-space-separators-break-spaces-014.html
(live test)
(source)
trailing-other-space-separators-break-spaces-015.html
(live test)
(source)
trailing-space-align-start.tentative.html
(live test)
(source)
trailing-space-and-text-alignment-002.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-002.html
(live test)
(source)
white-space-applies-to-text-001.html
(live test)
(source)
white-space-intrinsic-size-015.html
(live test)
(source)
white-space-intrinsic-size-016.html
(live test)
(source)
white-space-intrinsic-size-018.html
(live test)
(source)
white-space-letter-spacing-001.html
(live test)
(source)
white-space-normal-011.html
(live test)
(source)
white-space-pre-011.html
(live test)
(source)
white-space-pre-031.html
(live test)
(source)
white-space-pre-032.html
(live test)
(source)
white-space-pre-034.html
(live test)
(source)
white-space-pre-035.html
(live test)
(source)
white-space-pre-051.html
(live test)
(source)
white-space-pre-052.html
(live test)
(source)
ws-break-spaces-applies-to-001.html
(live test)
(source)
ws-break-spaces-applies-to-002.html
(live test)
(source)
ws-break-spaces-applies-to-003.html
(live test)
(source)
ws-break-spaces-applies-to-005.html
(live test)
(source)
ws-break-spaces-applies-to-006.html
(live test)
(source)
ws-break-spaces-applies-to-007.html
(live test)
(source)
ws-break-spaces-applies-to-008.html
(live test)
(source)
ws-break-spaces-applies-to-009.html
(live test)
(source)
ws-break-spaces-applies-to-010.html
(live test)
(source)
ws-break-spaces-applies-to-011.html
(live test)
(source)
ws-break-spaces-applies-to-014.html
(live test)
(source)
ws-break-spaces-applies-to-015.html
(live test)
(source)
break-boundary-2-chars-001.html
(live test)
(source)
break-boundary-2-chars-002.html
(live test)
(source)
word-break-break-all-010.html
(live test)
(source)
word-break-break-all-011.html
(live test)
(source)
word-break-break-all-012.html
(live test)
(source)
word-break-break-all-013.html
(live test)
(source)
word-break-break-all-015.html
(live test)
(source)
word-break-break-all-017.html
(live test)
(source)
word-break-break-all-ethiopic.html
(live test)
(source)
word-break-normal-ethiopic.html
(live test)
(source)
word-space-transform-008.html
(live test)
(source)
word-space-transform-011.html
(live test)
(source)
tests using nowrap through 'white-space: nowrap':
hanging-punctuation-allow-end-001.xht
(live test)
(source)
hanging-punctuation-first-001.xht
(live test)
(source)
hanging-punctuation-force-end-001.xht
(live test)
(source)
hanging-punctuation-last-001.xht
(live test)
(source)
letter-spacing-206.html
(live test)
(source)
line-break-anywhere-and-white-space-002.html
(live test)
(source)
line-breaking-012.html
(live test)
(source)
line-breaking-atomic-nowrap-001.html
(live test)
(source)
overflow-wrap-002.html
(live test)
(source)
overflow-wrap-anywhere-008.html
(live test)
(source)
overflow-wrap-break-word-white-space-crash-002.html
(live test)
(source)
word-wrap-002.html
(live test)
(source)
text-transform-capitalize-001.html
(live test)
(source)
text-transform-capitalize-003.html
(live test)
(source)
text-transform-capitalize-005.html
(live test)
(source)
text-transform-capitalize-007.html
(live test)
(source)
text-transform-capitalize-009.html
(live test)
(source)
text-transform-capitalize-010.html
(live test)
(source)
text-transform-capitalize-011.html
(live test)
(source)
text-transform-capitalize-014.html
(live test)
(source)
text-transform-capitalize-016.html
(live test)
(source)
text-transform-capitalize-018.html
(live test)
(source)
text-transform-capitalize-020.html
(live test)
(source)
text-transform-capitalize-022.html
(live test)
(source)
text-transform-capitalize-024.html
(live test)
(source)
text-transform-capitalize-026.html
(live test)
(source)
text-transform-capitalize-028.html
(live test)
(source)
text-transform-capitalize-030.html
(live test)
(source)
text-transform-full-size-kana-005.html
(live test)
(source)
text-transform-full-size-kana-006.html
(live test)
(source)
text-transform-full-size-kana-007.html
(live test)
(source)
text-transform-fullwidth-001.xht
(live test)
(source)
text-transform-upperlower-001.html
(live test)
(source)
text-transform-upperlower-002.html
(live test)
(source)
text-transform-upperlower-003.html
(live test)
(source)
text-transform-upperlower-004.html
(live test)
(source)
text-transform-upperlower-005.html
(live test)
(source)
text-transform-upperlower-006.html
(live test)
(source)
text-transform-upperlower-007.html
(live test)
(source)
text-transform-upperlower-008.html
(live test)
(source)
text-transform-upperlower-009.html
(live test)
(source)
text-transform-upperlower-010.html
(live test)
(source)
text-transform-upperlower-011.html
(live test)
(source)
text-transform-upperlower-012.html
(live test)
(source)
text-transform-upperlower-014.html
(live test)
(source)
text-transform-upperlower-015.html
(live test)
(source)
text-transform-upperlower-016.html
(live test)
(source)
text-transform-upperlower-017.html
(live test)
(source)
text-transform-upperlower-018.html
(live test)
(source)
text-transform-upperlower-019.html
(live test)
(source)
text-transform-upperlower-020.html
(live test)
(source)
text-transform-upperlower-021.html
(live test)
(source)
text-transform-upperlower-022.html
(live test)
(source)
text-transform-upperlower-023.html
(live test)
(source)
text-transform-upperlower-024.html
(live test)
(source)
text-transform-upperlower-025.html
(live test)
(source)
text-transform-upperlower-026.html
(live test)
(source)
text-transform-upperlower-027.html
(live test)
(source)
text-transform-upperlower-028.html
(live test)
(source)
text-transform-upperlower-029.html
(live test)
(source)
text-transform-upperlower-030.html
(live test)
(source)
text-transform-upperlower-031.html
(live test)
(source)
text-transform-upperlower-032.html
(live test)
(source)
text-transform-upperlower-033.html
(live test)
(source)
text-transform-upperlower-034.html
(live test)
(source)
text-transform-upperlower-035.html
(live test)
(source)
text-transform-upperlower-039.html
(live test)
(source)
text-transform-upperlower-040.html
(live test)
(source)
text-transform-upperlower-041.html
(live test)
(source)
text-transform-upperlower-042.html
(live test)
(source)
text-transform-upperlower-043.html
(live test)
(source)
text-transform-upperlower-044.html
(live test)
(source)
text-transform-upperlower-101.html
(live test)
(source)
text-transform-upperlower-102.html
(live test)
(source)
text-transform-upperlower-103.html
(live test)
(source)
text-transform-upperlower-104.html
(live test)
(source)
control-chars-00D.html
(live test)
(source)
nowrap-wbr-and-space-crash.html
(live test)
(source)
trailing-ideographic-space-007.html
(live test)
(source)
trailing-ideographic-space-009.html
(live test)
(source)
trailing-ogham-003.html
(live test)
(source)
trailing-other-space-separators-004.html
(live test)
(source)
white-space-applies-to-text-001.html
(live test)
(source)
white-space-nowrap-011.html
(live test)
(source)
white-space-wrap-after-nowrap-001.html
(live test)
(source)
word-break-auto-phrase-wbr-nobr-002.html
(live test)
(source)
break-boundary-2-chars-002.html
(live test)
(source)
word-break-break-word-crash-001.html
(live test)
(source)
Regardless of the
text-wrap-mode
value,
preserved
segment breaks
and any Unicode character with the
BK
CR
LF
, and
NL
line breaking class,
must be treated as
forced line breaks
[UAX14]
Tests
line-breaking-022.html
(live test)
(source)
Note:
The bidi implications of such
forced line breaks
are defined by the
Unicode Bidirectional Algorithm
[UAX9]
5.2.
Controlling Breaks Within Boxes: the
wrap-inside
property
Tests
This section lacks tests.
Name:
wrap-inside
Value:
auto
avoid
Initial:
auto
Applies to:
inline boxes
Inherited:
no
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
per grammar
Animation type:
discrete
auto
Lines may break at allowed break points
within the box,
as determined by the line-breaking rules in effect.
avoid
Line breaking is suppressed within the box:
the UA may only break within the box
if there are no other valid break points in the line.
If the text breaks,
line-breaking restrictions are honored as for
auto
If boxes with
avoid
are nested
and the UA must break within these boxes,
a break in an outer box must be used
before a break within an inner box may be used.
5.2.1.
Example of using 'wrap-inside: avoid' in presenting a footer
Tests
This section does not need tests.
The priority of breakpoints can be set
to reflect the intended grouping of text.
Given the rules
footer { wrap-inside: avoid; }
venue { wrap-inside: avoid; }
date { wrap-inside: avoid; }
place { wrap-inside: avoid; }
and the following markup:
In a narrow window the footer could be broken as
27th Internationalization and Unicode Conference •
April 7, 2005 • Berlin, Germany
or in a narrower window as
27th Internationalization and Unicode
Conference • April 7, 2005 •
Berlin, Germany
but not as
27th Internationalization and Unicode Conference • April
7, 2005 • Berlin, Germany
5.3.
Controlling Breaks Between Boxes: the
wrap-before
wrap-after
properties
Tests
This section lacks tests.
Name:
wrap-before
wrap-after
Value:
auto
avoid
avoid-line
avoid-flex
line
flex
Initial:
auto
Applies to:
inline-level
boxes and
flex items
Inherited:
no
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
per grammar
Animation type:
discrete
These properties specify modifications to break opportunities
in line breaking (and
flex line
breaking
[CSS3-FLEXBOX]
).
Possible values:
auto
Lines may break at allowed break points
before and after the box,
as determined by the line-breaking rules in effect.
avoid
Line breaking is suppressed immediately before/after the box:
the UA may only break there
if there are no other valid break points
in the line.
If the text breaks,
line-breaking restrictions are honored as for
auto
avoid-line
Same as
avoid
but only for line breaks.
avoid-flex
Same as
avoid
but only for flex line breaks.
line
Force a line break immediately before/after the box
if the box is an
inline-level
box.
flex
Force a
flex line
break immediately before/after the box
if the box is a
flex item
in a
multi-line flex container
Forced line breaks on
inline-level
boxes propagate upward
through any parent
inline boxes
the same way forced breaks on
block-level
boxes propagate upward
through any parent
block boxes
in the same
fragmentation context
[CSS3-BREAK]
5.4.
Selecting How to Wrap: the
text-wrap-style
property
Tests
This property has limited coverage.
Missing test:
* tests for values other than balance
* Direct tests of this property as a longhand
Name:
text-wrap-style
Value:
auto
balance
stable
pretty
avoid-orphans
Initial:
auto
Applies to:
block containers
hat establish an
inline formatting context
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
per grammar
Animation type:
discrete
The CSSWG is looking for a better name for
avoid-orphans
Tests
text-wrap-style-computed.html
(live test)
(source)
text-wrap-style-invalid.html
(live test)
(source)
text-wrap-style-valid.html
(live test)
(source)
text-wrap-pretty.html
(live test)
(source)
text-wrap-balance-before-after-002.html
(live test)
(source)
When wrapping is allowed
(see
text-wrap-mode
),
this property selects between several approaches for wrapping lines,
trading off between speed, quality and style of layout, or stability.
It does not change which
soft wrap opportunity
exist,
but changes how the user agent selects among them.
Possible values:
auto
The exact algorithm for selecting
which
soft wrap opportunity
to break at is UA-defined.
The algorithm
may
consider multiple lines
when making break decisions.
The UA
may
bias for speed over best layout.
The UA
must not
attempt to even out all lines
(including the last) as for
balance
This value selects the UA’s preferred (or most Web-compatible)
wrapping algorithm.
balance
Line breaks are chosen to balance
the remaining (empty) space in each line box,
if better balance than
auto
is possible.
This should avoid changing—and in the case of 5 or fewer lines must not change—the number of line boxes
the block would contain
if
text-wrap
were set to
auto
Note:
The height of the line boxes may nevertheless change,
due to changes in which content appears together on one line.
Tests
text-wrap-balance-001.html
(live test)
(source)
text-wrap-balance-002.html
(live test)
(source)
text-wrap-balance-003.html
(live test)
(source)
text-wrap-balance-align-001.html
(live test)
(source)
text-wrap-balance-dynamic-001.html
(live test)
(source)
text-wrap-balance-line-clamp-001.html
(live test)
(source)
text-wrap-balance-narrow-crash.html
(live test)
(source)
text-wrap-balance-float-crash.html
(live test)
(source)
text-wrap-balance-nested-blocks-crash.html
(live test)
(source)
text-wrap-balance-overflow-001.html
(live test)
(source)
text-wrap-balance-overflow-002.html
(live test)
(source)
text-wrap-balance-right-to-left.html
(live test)
(source)
text-wrap-balance-top-to-bottom.html
(live test)
(source)
text-wrap-balance-before-after-001.html
(live test)
(source)
The remaining space to consider
is that which remains after placing floats and inline content,
but before any adjustments due to text justification.
Line boxes are balanced when the standard deviation
from the average
inline-size
of the remaining space in each line box
is reduced over the block
(including lines that end in a forced break).
Tests
text-wrap-balance-text-indent-001.html
(live test)
(source)
text-wrap-balance-float-001.html
(live test)
(source)
text-wrap-balance-float-002.html
(live test)
(source)
text-wrap-balance-float-003.html
(live test)
(source)
text-wrap-balance-float-004.html
(live test)
(source)
text-wrap-balance-float-005.html
(live test)
(source)
text-wrap-balance-float-006.html
(live test)
(source)
Groups of lines separated by a
forced line break
are processed separately.
If the element is affected by
line-clamp
the clamping effect is applied first,
then the remaining lines are balanced.
Tests
text-wrap-balance-004.html
(live test)
(source)
text-wrap-balance-005.html
(live test)
(source)
The exact algorithm is UA-defined.
UAs may treat this value as
auto
if there are more than ten lines to balance.
stable
Specifies that content on subsequent lines
should not
be considered when making break decisions
so that when editing text any content before the cursor
remains stable;
otherwise equivalent to
auto
pretty
Specifies the UA
should
bias for better layout over speed,
and is expected to consider multiple lines
when making break decisions.
Otherwise equivalent to
auto
The user agent may among other things
attempt to avoid excessively short last lines,
similarly to
avoid-orphans
but it should also improve the layout in additional ways.
The precise set of improvements is user agent dependent,
and may include things such as:
reducing the variation in length between lines;
avoiding
typographic rivers
prioritizing different classes of
soft wrap opportunities
hyphenation opportunities
, or
justification opportunities
avoiding hyphenation on too many consecutive lines…
The necessary computations may be expensive,
especially when applied to large amounts of text.
Authors are encouraged to assess the impact on performance
when using
text-wrap-style: pretty
and possibly use it selectively where it matters most.
avoid-orphans
Specifies the UA
should
avoid excessively short last lines,
and is expected to consider more than one line
when making break decisions
(for example, to avoid "fixing" an orphan
by making the previous line too short).
The user agent may decide against improving the last line
when it would make some prior line(s) substantially unbalanced.
The user agent should not attempt to improve other aspects of the layout
beyond what
auto
if those improvements come at a significant performance cost.
Note:
In western typography, an “orphan” can refer to a single word on the last line of a paragraph.
However, not all languages or writing systems wrap lines at word boundaries,
and even in languages that do,
a few very short words on the last line may still be undesirable,
especially if the available inline space is long.
This specification does not therefore strictly define
lines to be too short only when they are composed a single word,
and lets the user agent be the judge of what is excessively short.
Note:
See also the
orphans
property for control over fragmentation
and the other typographic meaning of “orphans”.
For instance, with the given line length, the following test would be wrapped with a single word on the last line,
which could be judged too short.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα
πολλὰ πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον
ἔπερσεν.
Applying
text-wrap-style: avoid-orphans
could yield something like this instead,
which is arguably more pleasing:
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς
μάλα πολλὰ πλάγχθη, ἐπεὶ Τροίης ἱερὸν
πτολίεθρον ἔπερσεν.
However, the following fragment is more vexing:
Circumnavigating
the Mississippi
river
An attempt to make the last line less short by wrapping the previous line earlier would result in the following:
Circumnavigating
the
Mississippi river
While the last line would indeed no longer be short,
the penultimate line would be unsightly.
In such cases, user agents are expected
to prefer the first rendering
despite
text-wrap-style: avoid-orphans
being set.
Note:
The
auto
value will typically map
to Web browsers’ speedy legacy line breaking,
which has so far used first-fit/greedy algorithms
that can often give sub-optimal results.
UAs can experiment with better line breaking algorithms
with this default value,
but as optimal results often take more time,
pretty
and
avoid-orphans
are offered as opt-ins
to take more time for better results.
Both values are intended for body text,
where the last line is expected to be a bit shorter than the average line,
but
avoid-orphans
aims to avoid excessively short last lines while staying performant,
while
pretty
can sacrifice more speed in pursuit of even better layout;
the
balance
value is intended for titles and captions,
where equal-length lines of text tend to be preferred;
and the
stable
is intended for sections that are,
or are likely become toggled as,
editable.
See
thread
Issue is about requiring a minimum length for lines.
Common measures seem to be
At least as long as the text-indent.
At least X characters.
Percentage-based.
Suggestion for value space is
match-indent |
(with
Xch
given as an example to make that use case clear).
Alternately
could actually count the characters.
It’s unclear how this would interact with text balancing (above);
one earlier proposal had them be the same property
(with
100%
meaning full balancing).
People have requested word-based limits, but since this is really
dependent on the length of the word, character-based is better.
5.5.
Joint Wrapping Control: the
text-wrap
shorthand property
Tests
This section has limited coverage.
Name:
text-wrap
Value:
<'text-wrap-mode'>
||
<'text-wrap-style'>
Initial:
wrap
Applies to:
see individual properties
Inherited:
see individual properties
Percentages:
see individual properties
Computed value:
see individual properties
Canonical order:
per grammar
Animation type:
see individual properties
Tests
text-wrap-invalid.html
(live test)
(source)
text-wrap-valid.html
(live test)
(source)
text-wrap-computed.html
(live test)
(source)
text-wrap-pretty.html
(live test)
(source)
TODO: needs review, probably outdated
white-space-shorthand-text-wrap.html
(live test)
(source)
This property is a shorthand for the
text-wrap-mode
and
text-wrap-style
properties.
Any omitted
longhand
is set to its
initial value
5.6.
Line Breaking Details
Tests
This section has partial test coverage.
Missing tests:
* For soft wrap opportunities before the first or after the last character of a box, the break occurs immediately before/after the box (at its margin edge) rather than breaking the box between its content edge and the content.
* Line breaking classes CM and SG must be honored
Untestable(?):
* UAs that allow wrapping at punctuation other than spaces should prioritize breakpoints. […]
When determining
line breaks
The interaction of
line breaking
and bidirectional text is defined by
CSS Writing Modes 4
§ 2.4 Applying the Bidirectional Reordering Algorithm
and the
Unicode Bidirectional Algorithm
UAX9§3.4 Reordering Resolved Levels
in particular).
[CSS-WRITING-MODES-4]
[UAX9]
Tests
bidi-breaking-001.xht
(live test)
(source)
bidi-breaking-002.xht
(live test)
(source)
bidi-breaking-003.xht
(live test)
(source)
Except where explicitly defined otherwise
(e.g. for
line-break: anywhere
or
overflow-wrap: anywhere
line breaking behavior defined for
the
CM
and
SG
WJ
ZW
GL
and
ZWJ
Unicode line breaking classes
must be honored.
[UAX14]
Tests
word-break-normal-001.html
(live test)
(source)
line-breaking-001.html
(live test)
(source)
line-breaking-002.html
(live test)
(source)
line-breaking-003.html
(live test)
(source)
line-breaking-004.html
(live test)
(source)
line-breaking-005.html
(live test)
(source)
line-breaking-006.html
(live test)
(source)
line-breaking-007.html
(live test)
(source)
line-breaking-008.html
(live test)
(source)
line-breaking-021.html
(live test)
(source)
css3-text-line-break-baspglwj-001.html
(live test)
(source)
css3-text-line-break-baspglwj-002.html
(live test)
(source)
css3-text-line-break-baspglwj-120.html
(live test)
(source)
css3-text-line-break-baspglwj-121.html
(live test)
(source)
css3-text-line-break-baspglwj-122.html
(live test)
(source)
css3-text-line-break-baspglwj-123.html
(live test)
(source)
css3-text-line-break-baspglwj-124.html
(live test)
(source)
css3-text-line-break-baspglwj-125.html
(live test)
(source)
css3-text-line-break-baspglwj-126.html
(live test)
(source)
css3-text-line-break-baspglwj-127.html
(live test)
(source)
css3-text-line-break-baspglwj-128.html
(live test)
(source)
css3-text-line-break-baspglwj-130.html
(live test)
(source)
css3-text-line-break-baspglwj-131.html
(live test)
(source)
word-break-break-all-018.html
(live test)
(source)
word-break-break-all-021.html
(live test)
(source)
word-break-break-all-022.html
(live test)
(source)
UAs that allow wrapping at punctuation
other than
word separators
in writing systems that use them
should
prioritize breakpoints.
(For example, if breaks after slashes are given a lower priority than spaces,
the sequence “check /etc” will never break between the "/" and the "e".)
As long as care is taken to avoid such awkward breaks,
allowing breaks at appropriate punctuation other than
word separators
is recommended,
as it results in more even-looking margins, particularly in narrow measures.
The UA may use the width of the containing block, the text’s language,
the
line-break
value,
and other factors in assigning priorities:
CSS does not define prioritization of
soft wrap opportunities
Prioritization of
word separators
is not expected,
however,
if
word-break: break-all
is specified
(since this value explicitly requests line breaking behavior
not based on breaking at
word separators
)—and is forbidden under
line-break: anywhere
Out-of-flow elements
and inline element boundaries
do not introduce a
forced line break
or
soft wrap opportunity
in the flow.
Tests
line-breaking-012.html
(live test)
(source)
line-breaking-015.html
(live test)
(source)
line-breaking-016.html
(live test)
(source)
line-breaking-017.html
(live test)
(source)
line-breaking-018.html
(live test)
(source)
line-breaking-019.html
(live test)
(source)
For Web-compatibility
there is a
soft wrap opportunity
before and after each replaced element or other
atomic inline
even when adjacent to a character that would normally suppress them,
including U+00A0 NO-BREAK SPACE.
However,
with the exception of U+00A0 NO-BREAK SPACE,
there must be no
soft wrap opportunity
between
atomic inlines
and adjacent characters
belonging to the Unicode GL, WJ, or ZWJ line breaking classes.
[UAX14]
Tests
line-breaking-atomic-001.html
(live test)
(source)
line-breaking-atomic-002.html
(live test)
(source)
line-breaking-atomic-003.html
(live test)
(source)
line-breaking-atomic-004.html
(live test)
(source)
line-breaking-atomic-005.html
(live test)
(source)
line-breaking-atomic-006.html
(live test)
(source)
line-breaking-atomic-007.html
(live test)
(source)
line-breaking-atomic-008.html
(live test)
(source)
line-breaking-atomic-009.html
(live test)
(source)
line-breaking-atomic-010.html
(live test)
(source)
line-breaking-atomic-011.html
(live test)
(source)
line-breaking-atomic-012.html
(live test)
(source)
line-breaking-atomic-013.html
(live test)
(source)
line-breaking-atomic-014.html
(live test)
(source)
line-breaking-atomic-015.html
(live test)
(source)
line-breaking-atomic-016.html
(live test)
(source)
line-breaking-atomic-017.html
(live test)
(source)
line-breaking-atomic-018.html
(live test)
(source)
line-breaking-atomic-019.html
(live test)
(source)
line-breaking-atomic-020.html
(live test)
(source)
line-breaking-atomic-021.html
(live test)
(source)
line-breaking-atomic-022.html
(live test)
(source)
line-breaking-atomic-023.html
(live test)
(source)
line-breaking-atomic-024.html
(live test)
(source)
line-breaking-atomic-025.html
(live test)
(source)
line-breaking-atomic-026.html
(live test)
(source)
line-breaking-atomic-027.html
(live test)
(source)
line-breaking-replaced-001.html
(live test)
(source)
line-breaking-replaced-002.html
(live test)
(source)
line-breaking-replaced-003.html
(live test)
(source)
line-breaking-replaced-004.html
(live test)
(source)
line-breaking-replaced-005.html
(live test)
(source)
line-breaking-replaced-006.html
(live test)
(source)
line-breaking-atomic-nowrap-001.html
(live test)
(source)
For
soft wrap opportunities
created by characters
that disappear at the line break (e.g. U+0020 SPACE),
properties on the box directly containing that character
control the line breaking at that opportunity.
For
soft wrap opportunities
defined by the boundary between two characters or
atomic inlines
the
white-space
property
on the nearest common ancestor of the two characters
controls breaking;
which elements’
line-break
word-break
, and
overflow-wrap
properties
control the determination of
soft wrap opportunities
at such boundaries
is undefined in this level.
Tests
line-breaking-009.html
(live test)
(source)
line-breaking-010.html
(live test)
(source)
line-breaking-011.html
(live test)
(source)
line-breaking-ic-001.html
(live test)
(source)
line-breaking-ic-002.html
(live test)
(source)
line-breaking-ic-003.html
(live test)
(source)
white-space-wrap-after-nowrap-001.html
(live test)
(source)
break-boundary-2-chars-001.html
(live test)
(source)
overflow-wrap-anywhere-inline-002.tentative.html
(live test)
(source)
overflow-wrap-anywhere-inline-003.tentative.html
(live test)
(source)
overflow-wrap-anywhere-inline-004.tentative.html
(live test)
(source)
word-break-break-all-inline-004.tentative.html
(live test)
(source)
word-break-break-all-inline-007.tentative.html
(live test)
(source)
word-break-break-all-inline-010.tentative.html
(live test)
(source)
line-breaking-030.html
(live test)
(source)
line-breaking-031.html
(live test)
(source)
line-breaking-032.html
(live test)
(source)
For
soft wrap opportunities
before the first
or after the last character of a box,
the break occurs immediately before/after the box
(at its margin edge)
rather than breaking the box
between its content edge and the content.
Line breaking in/around Ruby is defined
in
CSS Ruby Annotation Layout 1
§ 3.4 Breaking Across Lines
[CSS-RUBY-1]
When shaping scripts such as Arabic
wrap
at unforced
soft wrap opportunities
within words
(such as when breaking due to
word-break: break-all
line-break: anywhere
overflow-wrap: break-word
overflow-wrap: anywhere
or when
hyphenating
the characters must still be shaped
(their joining forms chosen)
as if the word were still whole.
Tests
hyphens-shaping-001.html
(live test)
(source)
hyphens-shaping-002.html
(live test)
(source)
line-break-shaping-001.html
(live test)
(source)
overflow-wrap-shaping-001.html
(live test)
(source)
overflow-wrap-shaping-002.html
(live test)
(source)
word-break-break-all-004.html
(live test)
(source)
For example,
if the word “نوشتن” is broken between the “ش” and “ت”,
the “ش” still takes its initial form (“ﺷ”),
and the “ت” its medial form (“ﺘ”)—forming as in “ﻧﻮﺷ | ﺘﻦ”, not as in “نوش | تن”.
6.
Line Breaking and Word Boundaries
Tests
This section deals in generalities
rather than specific requirements.
Exhaustive coverage is neither practical
nor needed,
as more specific requirements
are made in different sections,
and can be tested there.
Nonetheless,
this can be a good section
to host tests for i18n requirements
not covered in detail by the spec.
Possible additions:
* tests for at least one language with line breaking based on orthographic syllable boundaries
* Basic line breaking tests for some languages mentioned: Javanese, Balinese, Yi
In most writing systems,
in the absence of hyphenation a
soft wrap opportunity
occurs only at word boundaries.
Many such systems use
spaces
or punctuation to explicitly separate words,
and
soft wrap opportunities
can be identified by these characters.
Tests
css3-text-line-break-baspglwj-003.html
(live test)
(source)
css3-text-line-break-baspglwj-004.html
(live test)
(source)
css3-text-line-break-baspglwj-005.html
(live test)
(source)
css3-text-line-break-baspglwj-006.html
(live test)
(source)
css3-text-line-break-baspglwj-007.html
(live test)
(source)
css3-text-line-break-baspglwj-008.html
(live test)
(source)
css3-text-line-break-baspglwj-009.html
(live test)
(source)
css3-text-line-break-baspglwj-010.html
(live test)
(source)
css3-text-line-break-baspglwj-011.html
(live test)
(source)
css3-text-line-break-baspglwj-012.html
(live test)
(source)
css3-text-line-break-baspglwj-014.html
(live test)
(source)
css3-text-line-break-baspglwj-015.html
(live test)
(source)
css3-text-line-break-baspglwj-016.html
(live test)
(source)
css3-text-line-break-baspglwj-017.html
(live test)
(source)
css3-text-line-break-baspglwj-018.html
(live test)
(source)
css3-text-line-break-baspglwj-019.html
(live test)
(source)
css3-text-line-break-baspglwj-020.html
(live test)
(source)
css3-text-line-break-baspglwj-021.html
(live test)
(source)
css3-text-line-break-baspglwj-022.html
(live test)
(source)
css3-text-line-break-baspglwj-023.html
(live test)
(source)
css3-text-line-break-baspglwj-024.html
(live test)
(source)
css3-text-line-break-baspglwj-025.html
(live test)
(source)
css3-text-line-break-baspglwj-026.html
(live test)
(source)
css3-text-line-break-baspglwj-030.html
(live test)
(source)
css3-text-line-break-baspglwj-031.html
(live test)
(source)
css3-text-line-break-baspglwj-032.html
(live test)
(source)
css3-text-line-break-baspglwj-033.html
(live test)
(source)
css3-text-line-break-baspglwj-034.html
(live test)
(source)
css3-text-line-break-baspglwj-035.html
(live test)
(source)
css3-text-line-break-baspglwj-036.html
(live test)
(source)
css3-text-line-break-baspglwj-037.html
(live test)
(source)
css3-text-line-break-baspglwj-038.html
(live test)
(source)
css3-text-line-break-baspglwj-039.html
(live test)
(source)
css3-text-line-break-baspglwj-040.html
(live test)
(source)
css3-text-line-break-baspglwj-041.html
(live test)
(source)
css3-text-line-break-baspglwj-042.html
(live test)
(source)
css3-text-line-break-baspglwj-043.html
(live test)
(source)
css3-text-line-break-baspglwj-044.html
(live test)
(source)
css3-text-line-break-baspglwj-045.html
(live test)
(source)
css3-text-line-break-baspglwj-046.html
(live test)
(source)
css3-text-line-break-baspglwj-047.html
(live test)
(source)
css3-text-line-break-baspglwj-048.html
(live test)
(source)
css3-text-line-break-baspglwj-049.html
(live test)
(source)
css3-text-line-break-baspglwj-050.html
(live test)
(source)
css3-text-line-break-baspglwj-051.html
(live test)
(source)
css3-text-line-break-baspglwj-052.html
(live test)
(source)
css3-text-line-break-baspglwj-060.html
(live test)
(source)
css3-text-line-break-baspglwj-061.html
(live test)
(source)
css3-text-line-break-baspglwj-062.html
(live test)
(source)
css3-text-line-break-baspglwj-063.html
(live test)
(source)
css3-text-line-break-baspglwj-064.html
(live test)
(source)
css3-text-line-break-baspglwj-065.html
(live test)
(source)
css3-text-line-break-baspglwj-066.html
(live test)
(source)
css3-text-line-break-baspglwj-067.html
(live test)
(source)
css3-text-line-break-baspglwj-068.html
(live test)
(source)
css3-text-line-break-baspglwj-069.html
(live test)
(source)
css3-text-line-break-baspglwj-070.html
(live test)
(source)
css3-text-line-break-baspglwj-071.html
(live test)
(source)
css3-text-line-break-baspglwj-072.html
(live test)
(source)
css3-text-line-break-baspglwj-073.html
(live test)
(source)
css3-text-line-break-baspglwj-074.html
(live test)
(source)
css3-text-line-break-baspglwj-075.html
(live test)
(source)
css3-text-line-break-baspglwj-076.html
(live test)
(source)
css3-text-line-break-baspglwj-077.html
(live test)
(source)
css3-text-line-break-baspglwj-078.html
(live test)
(source)
css3-text-line-break-baspglwj-080.html
(live test)
(source)
css3-text-line-break-baspglwj-081.html
(live test)
(source)
css3-text-line-break-baspglwj-082.html
(live test)
(source)
css3-text-line-break-baspglwj-083.html
(live test)
(source)
css3-text-line-break-baspglwj-084.html
(live test)
(source)
css3-text-line-break-baspglwj-085.html
(live test)
(source)
css3-text-line-break-baspglwj-086.html
(live test)
(source)
css3-text-line-break-baspglwj-090.html
(live test)
(source)
css3-text-line-break-baspglwj-091.html
(live test)
(source)
css3-text-line-break-baspglwj-092.html
(live test)
(source)
css3-text-line-break-baspglwj-093.html
(live test)
(source)
css3-text-line-break-baspglwj-095.html
(live test)
(source)
css3-text-line-break-baspglwj-096.html
(live test)
(source)
css3-text-line-break-baspglwj-097.html
(live test)
(source)
css3-text-line-break-baspglwj-098.html
(live test)
(source)
css3-text-line-break-baspglwj-099.html
(live test)
(source)
css3-text-line-break-baspglwj-100.html
(live test)
(source)
css3-text-line-break-baspglwj-101.html
(live test)
(source)
css3-text-line-break-baspglwj-102.html
(live test)
(source)
css3-text-line-break-baspglwj-103.html
(live test)
(source)
css3-text-line-break-baspglwj-104.html
(live test)
(source)
css3-text-line-break-baspglwj-105.html
(live test)
(source)
css3-text-line-break-baspglwj-106.html
(live test)
(source)
css3-text-line-break-baspglwj-107.html
(live test)
(source)
css3-text-line-break-baspglwj-108.html
(live test)
(source)
css3-text-line-break-baspglwj-109.html
(live test)
(source)
css3-text-line-break-baspglwj-110.html
(live test)
(source)
css3-text-line-break-baspglwj-111.html
(live test)
(source)
css3-text-line-break-baspglwj-112.html
(live test)
(source)
css3-text-line-break-baspglwj-113.html
(live test)
(source)
css3-text-line-break-baspglwj-114.html
(live test)
(source)
css3-text-line-break-baspglwj-115.html
(live test)
(source)
css3-text-line-break-baspglwj-116.html
(live test)
(source)
css3-text-line-break-baspglwj-117.html
(live test)
(source)
css3-text-line-break-baspglwj-118.html
(live test)
(source)
word-break-normal-bo-000.html
(live test)
(source)
word-break-normal-en-000.html
(live test)
(source)
word-break-normal-ethiopic.html
(live test)
(source)
word-break-normal-hi-000.html
(live test)
(source)
word-break-normal-ko-000.html
(live test)
(source)
Scripts such as Thai, Lao, and Khmer, however,
do not use spaces or punctuation to separate words.
Although the zero width space (U+200B) can be used as an explicit word delimiter
in these scripts,
this practice is not common.
As a result, a lexical resource is needed
to correctly identify
soft wrap opportunities
in such texts.
Tests
word-break-normal-002.html
(live test)
(source)
word-break-normal-003.html
(live test)
(source)
word-break-normal-th-000.html
(live test)
(source)
word-break-normal-th-001.html
(live test)
(source)
word-break-normal-km-000.html
(live test)
(source)
word-break-normal-lo-000.html
(live test)
(source)
word-break-normal-my-000.html
(live test)
(source)
word-break-normal-tdd-000.html
(live test)
(source)
In some other writing systems,
soft wrap opportunities
are based on orthographic syllable boundaries,
not word boundaries.
Some of these systems,
notably Brahmic scripts such as Javanese and Balinese,
require analysis of the text to find breaking opportunities.
Unlike languages that use characters from the SA line breaking class,
this analysis does not depend on the
content language
nor requires (language specific)
word boundary detection
or a lexical resource.
Tests
In others such as Chinese (as well as Japanese, Yi, and sometimes also Korean),
each syllable tends to correspond to a single
typographic letter unit
and thus line breaking conventions allow the line to break
anywhere
except
between certain character combinations.
Additionally the level of strictness in these restrictions
varies with the typesetting style.
Tests
word-break-normal-ja-000.html
(live test)
(source)
word-break-normal-ja-001.html
(live test)
(source)
word-break-normal-ja-002.html
(live test)
(source)
word-break-normal-ja-004.html
(live test)
(source)
word-break-normal-zh-000.html
(live test)
(source)
css3-text-line-break-opclns-001.html
(live test)
(source)
css3-text-line-break-opclns-002.html
(live test)
(source)
css3-text-line-break-opclns-003.html
(live test)
(source)
css3-text-line-break-opclns-004.html
(live test)
(source)
css3-text-line-break-opclns-005.html
(live test)
(source)
css3-text-line-break-opclns-006.html
(live test)
(source)
css3-text-line-break-opclns-007.html
(live test)
(source)
css3-text-line-break-opclns-008.html
(live test)
(source)
css3-text-line-break-opclns-009.html
(live test)
(source)
css3-text-line-break-opclns-010.html
(live test)
(source)
css3-text-line-break-opclns-011.html
(live test)
(source)
css3-text-line-break-opclns-012.html
(live test)
(source)
css3-text-line-break-opclns-014.html
(live test)
(source)
css3-text-line-break-opclns-015.html
(live test)
(source)
css3-text-line-break-opclns-016.html
(live test)
(source)
css3-text-line-break-opclns-017.html
(live test)
(source)
css3-text-line-break-opclns-018.html
(live test)
(source)
css3-text-line-break-opclns-019.html
(live test)
(source)
css3-text-line-break-opclns-020.html
(live test)
(source)
css3-text-line-break-opclns-021.html
(live test)
(source)
css3-text-line-break-opclns-022.html
(live test)
(source)
css3-text-line-break-opclns-023.html
(live test)
(source)
css3-text-line-break-opclns-024.html
(live test)
(source)
css3-text-line-break-opclns-025.html
(live test)
(source)
css3-text-line-break-opclns-026.html
(live test)
(source)
css3-text-line-break-opclns-027.html
(live test)
(source)
css3-text-line-break-opclns-028.html
(live test)
(source)
css3-text-line-break-opclns-029.html
(live test)
(source)
css3-text-line-break-opclns-030.html
(live test)
(source)
css3-text-line-break-opclns-031.html
(live test)
(source)
css3-text-line-break-opclns-032.html
(live test)
(source)
css3-text-line-break-opclns-033.html
(live test)
(source)
css3-text-line-break-opclns-034.html
(live test)
(source)
css3-text-line-break-opclns-035.html
(live test)
(source)
css3-text-line-break-opclns-036.html
(live test)
(source)
css3-text-line-break-opclns-037.html
(live test)
(source)
css3-text-line-break-opclns-038.html
(live test)
(source)
css3-text-line-break-opclns-039.html
(live test)
(source)
css3-text-line-break-opclns-040.html
(live test)
(source)
css3-text-line-break-opclns-041.html
(live test)
(source)
css3-text-line-break-opclns-042.html
(live test)
(source)
css3-text-line-break-opclns-043.html
(live test)
(source)
css3-text-line-break-opclns-044.html
(live test)
(source)
css3-text-line-break-opclns-045.html
(live test)
(source)
css3-text-line-break-opclns-046.html
(live test)
(source)
css3-text-line-break-opclns-047.html
(live test)
(source)
css3-text-line-break-opclns-049.html
(live test)
(source)
css3-text-line-break-opclns-050.html
(live test)
(source)
css3-text-line-break-opclns-051.html
(live test)
(source)
css3-text-line-break-opclns-052.html
(live test)
(source)
css3-text-line-break-opclns-053.html
(live test)
(source)
css3-text-line-break-opclns-054.html
(live test)
(source)
css3-text-line-break-opclns-055.html
(live test)
(source)
css3-text-line-break-opclns-056.html
(live test)
(source)
css3-text-line-break-opclns-057.html
(live test)
(source)
css3-text-line-break-opclns-058.html
(live test)
(source)
css3-text-line-break-opclns-059.html
(live test)
(source)
css3-text-line-break-opclns-060.html
(live test)
(source)
css3-text-line-break-opclns-061.html
(live test)
(source)
css3-text-line-break-opclns-062.html
(live test)
(source)
css3-text-line-break-opclns-063.html
(live test)
(source)
css3-text-line-break-opclns-064.html
(live test)
(source)
css3-text-line-break-opclns-065.html
(live test)
(source)
css3-text-line-break-opclns-100.html
(live test)
(source)
css3-text-line-break-opclns-101.html
(live test)
(source)
css3-text-line-break-opclns-102.html
(live test)
(source)
css3-text-line-break-opclns-103.html
(live test)
(source)
css3-text-line-break-opclns-104.html
(live test)
(source)
css3-text-line-break-opclns-105.html
(live test)
(source)
css3-text-line-break-opclns-106.html
(live test)
(source)
css3-text-line-break-opclns-107.html
(live test)
(source)
css3-text-line-break-opclns-108.html
(live test)
(source)
css3-text-line-break-opclns-109.html
(live test)
(source)
css3-text-line-break-opclns-110.html
(live test)
(source)
css3-text-line-break-opclns-111.html
(live test)
(source)
css3-text-line-break-opclns-112.html
(live test)
(source)
css3-text-line-break-opclns-113.html
(live test)
(source)
css3-text-line-break-opclns-114.html
(live test)
(source)
css3-text-line-break-opclns-115.html
(live test)
(source)
css3-text-line-break-opclns-116.html
(live test)
(source)
css3-text-line-break-opclns-117.html
(live test)
(source)
css3-text-line-break-opclns-119.html
(live test)
(source)
css3-text-line-break-opclns-120.html
(live test)
(source)
css3-text-line-break-opclns-121.html
(live test)
(source)
css3-text-line-break-opclns-122.html
(live test)
(source)
css3-text-line-break-opclns-123.html
(live test)
(source)
css3-text-line-break-opclns-124.html
(live test)
(source)
css3-text-line-break-opclns-125.html
(live test)
(source)
css3-text-line-break-opclns-126.html
(live test)
(source)
css3-text-line-break-opclns-127.html
(live test)
(source)
css3-text-line-break-opclns-128.html
(live test)
(source)
css3-text-line-break-opclns-129.html
(live test)
(source)
css3-text-line-break-opclns-130.html
(live test)
(source)
css3-text-line-break-opclns-131.html
(live test)
(source)
css3-text-line-break-opclns-132.html
(live test)
(source)
css3-text-line-break-opclns-133.html
(live test)
(source)
css3-text-line-break-opclns-134.html
(live test)
(source)
css3-text-line-break-opclns-135.html
(live test)
(source)
css3-text-line-break-opclns-136.html
(live test)
(source)
css3-text-line-break-opclns-137.html
(live test)
(source)
css3-text-line-break-opclns-138.html
(live test)
(source)
css3-text-line-break-opclns-139.html
(live test)
(source)
css3-text-line-break-opclns-140.html
(live test)
(source)
css3-text-line-break-opclns-141.html
(live test)
(source)
css3-text-line-break-opclns-142.html
(live test)
(source)
css3-text-line-break-opclns-143.html
(live test)
(source)
css3-text-line-break-opclns-144.html
(live test)
(source)
css3-text-line-break-opclns-145.html
(live test)
(source)
css3-text-line-break-opclns-146.html
(live test)
(source)
css3-text-line-break-opclns-147.html
(live test)
(source)
css3-text-line-break-opclns-148.html
(live test)
(source)
css3-text-line-break-opclns-149.html
(live test)
(source)
css3-text-line-break-opclns-150.html
(live test)
(source)
css3-text-line-break-opclns-151.html
(live test)
(source)
css3-text-line-break-opclns-152.html
(live test)
(source)
css3-text-line-break-opclns-153.html
(live test)
(source)
css3-text-line-break-opclns-155.html
(live test)
(source)
css3-text-line-break-opclns-156.html
(live test)
(source)
css3-text-line-break-opclns-157.html
(live test)
(source)
css3-text-line-break-opclns-158.html
(live test)
(source)
css3-text-line-break-opclns-159.html
(live test)
(source)
css3-text-line-break-opclns-160.html
(live test)
(source)
css3-text-line-break-opclns-161.html
(live test)
(source)
css3-text-line-break-opclns-162.html
(live test)
(source)
css3-text-line-break-opclns-163.html
(live test)
(source)
css3-text-line-break-opclns-164.html
(live test)
(source)
css3-text-line-break-opclns-165.html
(live test)
(source)
css3-text-line-break-opclns-166.html
(live test)
(source)
css3-text-line-break-opclns-167.html
(live test)
(source)
css3-text-line-break-opclns-168.html
(live test)
(source)
css3-text-line-break-opclns-169.html
(live test)
(source)
css3-text-line-break-opclns-170.html
(live test)
(source)
css3-text-line-break-opclns-171.html
(live test)
(source)
css3-text-line-break-opclns-200.html
(live test)
(source)
css3-text-line-break-opclns-201.html
(live test)
(source)
css3-text-line-break-opclns-202.html
(live test)
(source)
css3-text-line-break-opclns-203.html
(live test)
(source)
css3-text-line-break-opclns-204.html
(live test)
(source)
css3-text-line-break-opclns-205.html
(live test)
(source)
css3-text-line-break-opclns-206.html
(live test)
(source)
css3-text-line-break-opclns-207.html
(live test)
(source)
css3-text-line-break-opclns-208.html
(live test)
(source)
css3-text-line-break-opclns-209.html
(live test)
(source)
css3-text-line-break-opclns-210.html
(live test)
(source)
css3-text-line-break-opclns-211.html
(live test)
(source)
css3-text-line-break-opclns-212.html
(live test)
(source)
css3-text-line-break-opclns-213.html
(live test)
(source)
css3-text-line-break-opclns-214.html
(live test)
(source)
css3-text-line-break-opclns-215.html
(live test)
(source)
css3-text-line-break-opclns-217.html
(live test)
(source)
css3-text-line-break-opclns-218.html
(live test)
(source)
css3-text-line-break-opclns-219.html
(live test)
(source)
css3-text-line-break-opclns-220.html
(live test)
(source)
css3-text-line-break-opclns-221.html
(live test)
(source)
css3-text-line-break-opclns-222.html
(live test)
(source)
css3-text-line-break-opclns-223.html
(live test)
(source)
css3-text-line-break-opclns-225.html
(live test)
(source)
css3-text-line-break-opclns-226.html
(live test)
(source)
While CSS does not fully define where
soft wrap opportunities
occur,
some controls are provided to distinguish common variations:
The
line-break
property allows choosing various levels of “strictness”
for line breaking restrictions.
The
word-break
property controls what types of letters
are glommed together to form unbreakable “words”,
causing CJK characters to behave like non-CJK text or vice versa,
enabling control over word detection in South East Asian Languages,
or allowing words to be grouped into phrases…
The
hyphens
property controls whether automatic hyphenation
is allowed to break words in scripts that hyphenate.
The
overflow-wrap
property allows the UA to take a break anywhere
in otherwise-unbreakable strings that would otherwise overflow.
Note:
Unicode Standard Annex #14: Unicode Line Breaking Algorithm
defines a baseline behavior
for line breaking for all scripts in Unicode,
which is expected to be further tailored.
[UAX14]
More information on line breaking conventions
can be found in
Requirements for Japanese Text Layout
[JLREQ]
and
Formatting Rules for Japanese Documents
[JIS4051]
for Japanese,
Requirements for Chinese Text Layout
[CLREQ]
and
General Rules for Punctuation
[ZHMARK]
for Chinese.
See also the
Internationalization Working Group
’s
Language Enablement Index
which includes more information on additional languages.
[TYPOGRAPHY]
Any guidance on additional appropriate references
would be much appreciated.
Tests
line-breaking-028.html
(live test)
(source)
line-breaking-029.html
(live test)
(source)
Generic line-breaking tests not particularly anchored to any specific spec language
shaping_lig-001.html
(live test)
(source)
6.1.
Breaking Rules for Letters: the
word-break
property
Tests
This section has partial test coverage.
Missing tests:
* Applies to text
* No test of Animation type.
* affects intrinsic sizing (tested for word-break:break-word)
* treating non-letter typographic character units belonging to the NU, AL, AI, or ID Unicode line breaking classes
* any typographic character units resolving to the any typographic letter units (and any typographic character units resolving to the
NU
(“numeric”),
AL
(“alphabetic”), or
SA
(“Southeast Asian”) line breaking classes
* effect of word-break:keep-all on NU and AI classes
* Symbols that line-break the same way as letters of a particular category are affected the same way as those letters.
* does not suppress wbr (tested with auto-phrase, but not with keep-all or manual)
* More tests for “does not affect rules governing the soft wrap opportunities created around punctuation
Name:
word-break
Value:
normal
break-all
keep-all
manual
auto-phrase
break-word
Initial:
normal
Applies to:
text
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
n/a
Animation type:
discrete
Tests
inheritance.html
(live test)
(source)
word-break-invalid.html
(live test)
(source)
word-break-valid.html
(live test)
(source)
word-break-computed.html
(live test)
(source)
word-break-break-all-inline-001.html
(live test)
(source)
word-break-break-all-inline-002.html
(live test)
(source)
word-break-break-all-inline-003.html
(live test)
(source)
word-break-break-all-inline-004.tentative.html
(live test)
(source)
word-break-break-all-inline-005.html
(live test)
(source)
word-break-break-all-inline-006.html
(live test)
(source)
word-break-break-all-inline-007.tentative.html
(live test)
(source)
word-break-break-all-inline-009.html
(live test)
(source)
word-break-break-all-062.html
(live test)
(source)
word-break-keep-all-063.html
(live test)
(source)
This property specifies
soft wrap opportunities
between and within “words”,
i.e. where it is “normal” and permissible to break lines of text.
It focuses on breaks between letters,
and does not define whether and how
soft wrap opportunities
are created by
white space
and
other space separators
(though
auto-phrase
may suppress some),
nor around punctuation.
(See
line-break
for controls affecting punctuation and small kana.)
Tests
word-break-keep-all-005.html
(live test)
(source)
word-break-keep-all-006.html
(live test)
(source)
word-break-keep-all-007.html
(live test)
(source)
word-break-keep-all-008.html
(live test)
(source)
word-break-min-content-003.html
(live test)
(source)
word-space-transform-013.html
(live test)
(source)
word-space-transform-014.html
(live test)
(source)
In particular,
word-break
controls whether a
soft wrap opportunity
generally exists
between adjacent
typographic letter units
treating non-
letter
typographic character units
belonging to the
NU
AL
AI
or
ID
Unicode line breaking classes
as
typographic letter units
for this purpose (only).
[UAX14]
For example,
in some styles of CJK typesetting,
English words are allowed to break between any two letters,
rather than only at spaces or hyphenation points;
this can be enabled with
word-break:break-all
An example of English text embedded in Japanese
being broken at an arbitrary point in the word.
As another example, Korean has two styles of line-breaking:
between any two Korean syllables (
word-break: normal
or, like English, mainly at spaces (
word-break: keep-all
).
각 줄의 마지막에 한글이 올 때 줄 나눔
준을
“글자” 또는 “어절” 단위로 한다.
각 줄의 마지막에 한글이 올 때 줄 나눔
기준을
“글자” 또는 “어절” 단위로 한다.
Ethiopic similarly has two styles of line-breaking,
either only breaking at
word separators
word-break: normal
),
or also allowing breaks between letters within a word (
word-break: break-all
).
ተወልዱ፡ኵሉ፡ሰብእ፡ግዑዛን፡ወዕሩያን፡
በማዕረግ
፡ወብሕግ።ቦሙ፡ኅሊና፡ወዐቅል፡
ወይትጌበሩ፡አሐዱ፡ምስለ፡አሀዱ፡
በመንፈሰ፡እኍና።
ተወልዱ፡ኵሉ፡ሰብእ፡ግዑዛን፡ወዕሩያን፡
በማ
ዕረግ
፡ወብሕግ።ቦሙ፡ኅሊና፡ወዐቅል፡ወይትጌ
በሩ፡አሐዱ፡ምስለ፡አሀዱ፡በመንፈሰ፡እኍና።
Values have the following meanings:
normal
Words break according to their customary rules,
as described
above
Korean, which commonly exhibits two different behaviors,
allows breaks between any two consecutive Hangul/Hanja.
For Ethiopic, which also exhibits two different behaviors,
such breaks within words are not allowed.
Tests
word-break-normal-001.html
(live test)
(source)
word-break-normal-002.html
(live test)
(source)
word-break-normal-003.html
(live test)
(source)
word-break-normal-ar-000.html
(live test)
(source)
word-break-normal-bo-000.html
(live test)
(source)
word-break-normal-en-000.html
(live test)
(source)
word-break-normal-hi-000.html
(live test)
(source)
word-break-normal-ja-000.html
(live test)
(source)
word-break-normal-ja-001.html
(live test)
(source)
word-break-normal-ja-002.html
(live test)
(source)
word-break-normal-ja-004.html
(live test)
(source)
word-break-normal-km-000.html
(live test)
(source)
word-break-normal-ko-000.html
(live test)
(source)
word-break-normal-lo-000.html
(live test)
(source)
word-break-normal-my-000.html
(live test)
(source)
word-break-normal-tdd-000.html
(live test)
(source)
word-break-normal-th-000.html
(live test)
(source)
word-break-normal-th-001.html
(live test)
(source)
word-break-normal-zh-000.html
(live test)
(source)
word-break-normal-ethiopic.html
(live test)
(source)
Some writing systems require specific processing
to obtain the customarily expected
soft wrap opportunities
as described in
§ 6.1.1 Analytical Word Breaking
break-all
Breaking is allowed within “words”:
specifically,
in addition to
soft wrap opportunities
allowed for
normal
any
typographic letter units
(and any
typographic character units
resolving to the
NU
(“numeric”),
AL
(“alphabetic”),
or
SA
(“Southeast Asian”)
line breaking classes
[UAX14]
are instead treated as
ID
(“ideographic characters”)
for the purpose of line-breaking.
Hyphenation is not applied.
Tests
line-break-loose-hyphens-002.html
(live test)
(source)
line-break-normal-hyphens-002.html
(live test)
(source)
line-break-strict-hyphens-002.html
(live test)
(source)
overflow-wrap-anywhere-006.html
(live test)
(source)
break-spaces-006.html
(live test)
(source)
break-spaces-008.html
(live test)
(source)
break-spaces-before-first-char-004.html
(live test)
(source)
break-spaces-before-first-char-005.html
(live test)
(source)
break-spaces-before-first-char-006.html
(live test)
(source)
break-spaces-before-first-ideographic-char-004.html
(live test)
(source)
break-spaces-before-first-ideographic-char-005.html
(live test)
(source)
break-spaces-before-first-ideographic-char-006.html
(live test)
(source)
break-boundary-2-chars-002.html
(live test)
(source)
word-break-break-all-000.html
(live test)
(source)
word-break-break-all-001.html
(live test)
(source)
word-break-break-all-002.html
(live test)
(source)
word-break-break-all-003.html
(live test)
(source)
word-break-break-all-005.html
(live test)
(source)
word-break-break-all-006.html
(live test)
(source)
word-break-break-all-010.html
(live test)
(source)
word-break-break-all-012.html
(live test)
(source)
word-break-break-all-013.html
(live test)
(source)
word-break-break-all-014.html
(live test)
(source)
word-break-break-all-015.html
(live test)
(source)
word-break-break-all-016.html
(live test)
(source)
word-break-break-all-017.html
(live test)
(source)
word-break-break-all-018.html
(live test)
(source)
word-break-break-all-019.html
(live test)
(source)
word-break-break-all-020.html
(live test)
(source)
word-break-break-all-021.html
(live test)
(source)
word-break-break-all-022.html
(live test)
(source)
word-break-break-all-023.html
(live test)
(source)
word-break-break-all-024.html
(live test)
(source)
word-break-break-all-025.html
(live test)
(source)
word-break-break-all-026.html
(live test)
(source)
word-break-break-all-027.html
(live test)
(source)
word-break-break-all-028.html
(live test)
(source)
word-break-break-all-029.html
(live test)
(source)
word-break-break-all-030.html
(live test)
(source)
word-break-break-all-031.html
(live test)
(source)
word-break-break-all-032.html
(live test)
(source)
word-break-break-all-ethiopic.html
(live test)
(source)
word-break-break-all-inline-001.html
(live test)
(source)
word-break-break-all-inline-002.html
(live test)
(source)
word-break-break-all-inline-003.html
(live test)
(source)
word-break-break-all-inline-004.tentative.html
(live test)
(source)
word-break-break-all-inline-005.html
(live test)
(source)
word-break-break-all-inline-006.html
(live test)
(source)
word-break-break-all-inline-007.tentative.html
(live test)
(source)
word-break-break-all-inline-008.html
(live test)
(source)
word-break-break-all-inline-009.html
(live test)
(source)
word-break-break-all-inline-010.tentative.html
(live test)
(source)
Note:
This value does not affect
whether there are
soft wrap opportunities
around punctuation characters.
To allow breaks anywhere, see
line-break: anywhere
Tests
break-spaces-before-first-char-011.html
(live test)
(source)
break-spaces-before-first-ideographic-char-011.html
(live test)
(source)
word-break-break-all-ethiopic.html
(live test)
(source)
Note:
This option enables the other common behavior for Ethiopic.
It is also often used in a context where
the text consists predominantly of CJK characters
with only short non-CJK excerpts,
and it is desired that the text be better distributed on each line.
keep-all
Breaking is forbidden within “words”:
implicit
soft wrap opportunities
between
typographic letter units
(or other
typographic character units
belonging to the
NU
AL
AI
or
ID
Unicode line breaking classes
[UAX14]
are suppressed,
i.e. breaks are prohibited between pairs of such characters
(regardless of
line-break
settings other than
anywhere
except where opportunities exist due to
§ 6.1.1.1 Lexical Word Breaking
Otherwise this option is equivalent to
normal
In this style, sequences of CJK characters do not break.
Tests
word-break-keep-all-000.html
(live test)
(source)
word-break-keep-all-001.html
(live test)
(source)
word-break-keep-all-002.html
(live test)
(source)
word-break-keep-all-003.html
(live test)
(source)
word-break-keep-all-009.html
(live test)
(source)
word-break-keep-all-010.html
(live test)
(source)
break-spaces-with-word-break-001.html
(live test)
(source)
Note:
This is the other common behavior for Korean
(which uses
spaces
between words),
and is also useful for mixed-script text where CJK snippets are mixed
into another language that uses
spaces
for separation.
manual
Behaves the same as
normal
except that
§ 6.1.1.1 Lexical Word Breaking
must
not
be performed.
Specifically,
typographic character units
with class SA in
[UAX14]
must be treated as if they had class AL
(i.e. assuming a value of
line-break
other than
anywhere
there is no
soft wrap opportunity
between pairs of such characters).
Tests
word-break-manual-001.html
(live test)
(source)
Note:
This value does not affect
syllable-based
soft wrap opportunities
within words
in languages such as Balinese.
(See
§ 6.1.1.2 Orthographic Breaking
for some discussion of such writing systems.)
alternatively, this value could be based
on
keep-all
rather than
normal
Yet another variant is to merge this behavior
with
keep-all
Note: Some Southeast Asian languages are commonly misdetected by user agents.
With
word-break: normal
they would then apply inappropriate language-specific logic
to find wrapping opportunities,
and place them inappropriately.
For instance,
many languages other than Thai are written using the Thai script,
and line-breaking them as if they were Thai
will generally produce inadequate—and possibly confusing—results.
When this occurs,
this value enables authors to turn off
the word boundary detection
built into user agents for
word-break: normal
so that they can manually mark up the text to indicate wrapping opportunities
and obtain sensible results.
Authors using this value
are expected to manually indicate word boundaries for Southeast Asian languages,
using
wbr
or U+200B.
Otherwise, there will be no
soft wrap opportunity
and the text may overflow.
auto-phrase
Behaves the same as
normal
except that
this value directs the user agent to perform language-specific content analysis
to prioritize keeping natural phrases (of multiple words) together.
If the
content language
of the element is unknown,
or if the user agent does not know how to
detect phrase boundaries
for that particular language,
this value must behave as
normal
Otherwise,
the user agent should
detect phrase boundaries
and suppress
soft wrap opportunities
within each phrase.
Tests
word-break-auto-phrase-001.html
(live test)
(source)
word-break-auto-phrase-002.html
(live test)
(source)
word-break-auto-phrase-003.html
(live test)
(source)
word-break-auto-phrase-004.html
(live test)
(source)
word-break-auto-phrase-005.html
(live test)
(source)
word-break-auto-phrase-005.html
(live test)
(source)
word-break-auto-phrase-007.html
(live test)
(source)
word-break-auto-phrase-009.html
(live test)
(source)
word-break-auto-phrase-fallback-001.html
(live test)
(source)
word-break-auto-phrase-fallback-002.html
(live test)
(source)
word-break-auto-phrase-fallback-003.html
(live test)
(source)
word-break-auto-phrase-intrinsic-001.html
(live test)
(source)
word-break-auto-phrase-overflow-001.html
(live test)
(source)
word-break-auto-phrase-wbr-nobr-001.html
(live test)
(source)
word-break-auto-phrase-wbr-nobr-002.html
(live test)
(source)
Regardless of the
content language
and support for
phrase boundary detection
hyphenation opportunities
are suppressed
as if
hyphens: none
had been specified.
Tests
word-break-auto-phrase-006.html
(live test)
(source)
word-break-auto-phrase-008.html
(live test)
(source)
Note: Whether a word boundary detection system designed for one language
is suitable for some or all dialects of that language is somewhat subjective,
and this specifications leaves it at the discretion of the user agent.
Even if a detection system is not able to cope
with all nuances of a particular dialect,
it may be reasonable to claim support
if the detection correctly recognizes word boundaries most of the time.
However, the user agent would do a disservice to authors and users
if it claimed support for languages
where it fails to detect most word boundaries
or has a high error rate.
If a user agent has a word-boundary detection system for Cantonese
that is not suitable for the broader set of Chinese languages,
auto-phrase
should have an effect on content marked as
lang=yue
lang=zh-yue
, or
lang=zh-HK
but not
lang=zh
or
lang=zh-Hant
However, if the user agent supports a generic word-boundary detection system
that is suitable for Chinese in general,
auto-phrase
should have an effect on content
marked with the broad
lang=zh
characterization,
as well as any more specific ones,
such as
lang=zh-yue
lang=zh-Hant-HK
lang=zh-Hans-SG
, or
lang=zh-hak
Symbols that line-break the same way as letters of a particular category
are affected the same way as those letters.
User agents must not,
in response to any value of this property,
suppress
soft wrap opportunities
which are:
introduced by the
wbr
HTML element or U+200B ZERO WIDTH SPACE
Tests
word-break-auto-phrase-006.html
(live test)
(source)
word-break-auto-phrase-wbr-nobr-001.html
(live test)
(source)
required by the
line-break
property
surrounding atomic inlines
Note:
To control additional break opportunities
available only in the case of overflow,
see
overflow-wrap
The effects of
word-break
are taken into account when computing
intrinsic sizes
Here’s a mixed-script sample text:
这是一些汉字 and some Latin
و کمی خط عربی
และตัวอย่างการเขียนภาษาไทย በጽሑፍ፡ማራዘሙን፡አንዳንድ፡
The break-points are determined as follows (indicated by ‘·’):
word-break: normal
这·是·一·些·汉·字·and·some·Latin·
و·کمی·خط·عربی
·และ·ตัวอย่าง·การเขียน·ภาษาไทย·በጽሑፍ፡·ማራዘሙን፡·አንዳንድ፡
word-break: break-all
这·是·一·些·汉·字·a·n·d·s·o·m·e·L·a·t·i·n·
و·ﮐ·ﻤ·ﻰ·ﺧ·ﻁ·ﻋ·ﺮ·ﺑ·ﻰ
·แ·ล·ะ·ตั·ว·อ·ย่·า·ง·ก·า·ร·เ·ขี·ย·น·ภ·า·ษ·า·ไ·ท·ย·በ·ጽ·ሑ·ፍ፡·ማ·ራ·ዘ·ሙ·ን፡·አ·ን·ዳ·ን·ድ፡
word-break: keep-all
这是一些汉字·and·some·Latin·
و·کمی·خط·عربی
·และ·ตัวอย่าง·การเขียน·ภาษาไทย·በጽሑፍ፡·ማራዘሙን፡·አንዳንድ፡
Japanese is usually typeset allowing line breaks between each syllable.
However, it is sometimes preferred to suppress these wrapping opportunities
and to only allow wrapping at the end of certain sentence fragments.
This is most commonly done in very short pieces of text,
such as headings and table or figure captions.
This can be achieved manually by marking the allowed wrapping points
with
wbr
or U+200B ZERO WIDTH SPACE,
and suppressing the other ones using
word-break: keep-all
Alternatively,
in user agents that support detection of phrases boundaries in Japanese,
the same results can be achieved automatically
by using
word-break: auto-phrase
(assuming the
content language
is specified).
Sample markup and style rule
Expected rendering
Result in your browser
h1
窓ぎわの
wbr
トットちゃん
h1
h1
word-break
normal
窓ぎわのトッ
トちゃん
窓ぎわの
h1
窓ぎわの
wbr
トットちゃん
h1
h1
word-break
keep-all
窓ぎわの
トットちゃん
窓ぎわの
h1
lang
ja
窓ぎわのトットちゃん
h1
h1
word-break
auto-phrase
窓ぎわの
トットちゃん
窓ぎわのトットちゃん
When shaping scripts such as Arabic
are allowed to break within words due to
break-all
the characters must still be shaped
as if the word were
not broken
Tests
word-break-break-all-004.html
(live test)
(source)
For compatibility with legacy content,
the
word-break
property also supports
a deprecated
break-word
keyword.
When specified, this has the same effect as
word-break: normal
and
overflow-wrap: anywhere
regardless of the actual value of the
overflow-wrap
property.
Tests
pre-wrap-008.html
(live test)
(source)
pre-wrap-016.html
(live test)
(source)
word-break-break-word-overflow-wrap-interactions.html
(live test)
(source)
word-break-break-word-crash-001.html
(live test)
(source)
break-spaces-003.html
(live test)
(source)
break-spaces-004.html
(live test)
(source)
break-spaces-008.html
(live test)
(source)
break-spaces-before-first-char-010.html
(live test)
(source)
break-spaces-before-first-ideographic-char-010.html
(live test)
(source)
word-break-min-content-001.html
(live test)
(source)
word-break-min-content-002.html
(live test)
(source)
word-break-min-content-003.html
(live test)
(source)
word-break-min-content-004.html
(live test)
(source)
word-break-min-content-005.html
(live test)
(source)
word-break-min-content-006.html
(live test)
(source)
break-spaces-with-ideographic-space-002.html
(live test)
(source)
break-spaces-with-ideographic-space-004.html
(live test)
(source)
break-spaces-with-ideographic-space-006.html
(live test)
(source)
break-spaces-with-ideographic-space-008.html
(live test)
(source)
break-spaces-with-ideographic-space-009.html
(live test)
(source)
word-break-min-content-007.html
(live test)
(source)
6.1.1.
Analytical Word Breaking
6.1.1.1.
Lexical Word Breaking
Tests
This section has basic but adequate coverage
To provide the expected
normal
behavior
for Southeast Asian languages,
typographic character units
with line breaking class SA in
[UAX14]
must be treated as if they had class AL.
However, the user agent must additionally
analyze the content of a run of such characters
to
detect word boundaries
and treat each boundary as a
soft wrap opportunities
Tests
word-break-normal-002.html
(live test)
(source)
word-break-normal-003.html
(live test)
(source)
word-break-normal-km-000.html
(live test)
(source)
word-break-normal-lo-000.html
(live test)
(source)
word-break-normal-my-000.html
(live test)
(source)
word-break-normal-tdd-000.html
(live test)
(source)
word-break-normal-th-000.html
(live test)
(source)
word-break-normal-th-001.html
(live test)
(source)
As various languages can be written in scripts
which use the characters with class SA,
if the
content language
is known,
the user agent should use this information
to tailor its analysis.
Tests
word-break-normal-tdd-000.html
(live test)
(source)
6.1.1.2.
Orthographic Breaking
Tests
This section is untested.
For scripts (such as Balinese) that use line breaking based on orthographic syllables,
the UA must analyze the content
to find the correct points to insert
soft wrap opportunities
Note:
At the time of writing,
Unicode does not define how to perform this analysis,
and treats all characters in these writing systems
as having line breaking class AL.
However,
a proposal
has been made to solve that issue.
Even though it is not final,
it can be informative to consult.
[L2-22-080R]
6.1.1.3.
Fallback Breaking
Tests
This section has basic but adequate coverage
In order to avoid unexpected overflow,
if the user agent is unable to perform the requisite lexical
or orthographic analysis
for line breaking any
content language
that requires it—for example due to lacking a dictionary
for languages written in characters with class SA—it must assume a
soft wrap opportunity
between pairs of
typographic letter units
in that writing system.
Tests
line-breaking-023.html
(live test)
(source)
line-breaking-024.html
(live test)
(source)
line-breaking-025.html
(live test)
(source)
line-breaking-026.html
(live test)
(source)
line-breaking-027.html
(live test)
(source)
Note:
This provision is not triggered merely when
the UA fails to find a word boundary in a particular text run;
the text run may well be a single unbreakable word.
It applies for example
when a text run is composed of Khmer characters (U+1780 to U+17FF)
if the user agent does not know how to determine
word boundaries in Khmer.
6.1.2.
Expressing User Preferences for Phrase-based Line Breaking
Tests
This section is untested, but it is not clear how it could be.
User agents may activate
language-specific content analysis
described in
auto-phrase
in response to user preferences.
User agents with this behavior must do this
by setting the
declared value
of
word-break
to
auto-phrase
in the
user origin
Note:
This allows authors to detect
whether or not this feature is enabled by calling
getComputedStyle()
or to override it in the
author origin
where appropriate.
6.2.
Line Breaking Strictness: the
line-break
property
Tests
This section has extensive test coverage for CJK.
Missing tests:
* applies to text
* affects intrinsic sizing
* Line breaking classes CM and SG must be honored even with line-break: anywhere
Untestable(?):
* behavior of “auto”
Name:
line-break
Value:
auto
loose
normal
strict
anywhere
Initial:
auto
Applies to:
text
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
n/a
Animation type:
discrete
Tests
inheritance.html
(live test)
(source)
line-break-valid.html
(live test)
(source)
line-break-invalid.html
(live test)
(source)
line-break-computed.html
(live test)
(source)
line-break-no-interpolation.html
(live test)
(source)
This property specifies the strictness of line-breaking rules applied
within an element:
especially how
wrapping
interacts with punctuation and symbols.
Values have the following meanings:
auto
The UA determines the set of line-breaking restrictions to use,
and it may vary the restrictions based on the length of the line;
e.g., use a less restrictive set of line-break rules for short lines.
loose
Breaks text using the least restrictive set of line-breaking
rules. Typically used for short lines, such as in newspapers.
normal
Breaks text using the most common set of line-breaking rules.
strict
Breaks text using the most stringent set of line-breaking rules.
anywhere
There is a
soft wrap opportunity
around every
typographic character unit
including around any punctuation character
or
preserved white spaces
or in the middle of words,
disregarding any prohibition against line breaks,
even those introduced by characters with the
GL
WJ
, or
ZWJ
line breaking classes
or mandated by the
word-break
property.
[UAX14]
The different wrapping opportunities must not be prioritized.
Hyphenation is not applied.
Tests
line-break-anywhere-001.html
(live test)
(source)
line-break-anywhere-002.html
(live test)
(source)
line-break-anywhere-003.html
(live test)
(source)
line-break-anywhere-004.html
(live test)
(source)
line-break-anywhere-005.html
(live test)
(source)
line-break-anywhere-006.html
(live test)
(source)
line-break-anywhere-007.html
(live test)
(source)
line-break-anywhere-008.html
(live test)
(source)
line-break-anywhere-009.html
(live test)
(source)
line-break-anywhere-010.html
(live test)
(source)
line-break-anywhere-011.html
(live test)
(source)
line-break-anywhere-012.html
(live test)
(source)
line-break-anywhere-013.html
(live test)
(source)
line-break-anywhere-014.html
(live test)
(source)
line-break-anywhere-015.html
(live test)
(source)
line-break-anywhere-016.html
(live test)
(source)
line-break-anywhere-017.html
(live test)
(source)
line-break-anywhere-and-white-space-001.html
(live test)
(source)
line-break-anywhere-and-white-space-002.html
(live test)
(source)
line-break-anywhere-and-white-space-003.html
(live test)
(source)
line-break-anywhere-and-white-space-004.html
(live test)
(source)
line-break-anywhere-and-white-space-005.html
(live test)
(source)
line-break-anywhere-and-white-space-006.html
(live test)
(source)
line-break-anywhere-and-white-space-007.html
(live test)
(source)
line-break-anywhere-and-white-space-008.html
(live test)
(source)
line-break-anywhere-and-white-space-009.html
(live test)
(source)
line-break-anywhere-and-white-space-009.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-001.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-002.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-003.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-004.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-005.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-006.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-007.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-008.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-009.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-010.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-011.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-012.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-013.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-014.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-015.html
(live test)
(source)
line-break-anywhere-overrides-uax-behavior-016.html
(live test)
(source)
line-break-shaping-001.html
(live test)
(source)
break-spaces-before-first-char-007.html
(live test)
(source)
break-spaces-before-first-char-011.html
(live test)
(source)
break-spaces-before-first-ideographic-char-007.html
(live test)
(source)
break-spaces-before-first-ideographic-char-011.html
(live test)
(source)
Note:
This value triggers the line breaking rules typically seen in terminals.
Note:
This values only creates
soft wrap opportunities
between
typographic character units
not within them.
Consequently, the
CM
and
SG
Unicode line breaking classes must be honored.
[UAX14]
Note:
anywhere
only allows
preserved white spaces
at the end of the line
to be wrapped to the next line
when
white-space
is set to
break-spaces
because in other cases:
preserved white space
at the end/start of the line is discarded
normal
pre-line
wrapping is forbidden altogether (
nowrap
pre
the
preserved white space
hang
pre-wrap
).
When it does have an effect on
preserved white space
with
white-space: break-spaces
it allows breaking before the first space of a sequence,
which
break-spaces
on its own does not.
Tests
line-break-anywhere-005.html
(live test)
(source)
break-spaces-before-first-char-007.html
(live test)
(source)
break-spaces-before-first-char-008.html
(live test)
(source)
break-spaces-before-first-char-009.html
(live test)
(source)
break-spaces-before-first-char-010.html
(live test)
(source)
break-spaces-before-first-ideographic-char-007.html
(live test)
(source)
break-spaces-before-first-ideographic-char-008.html
(live test)
(source)
break-spaces-before-first-ideographic-char-009.html
(live test)
(source)
break-spaces-before-first-ideographic-char-010.html
(live test)
(source)
CSS distinguishes between four levels of strictness
in the rules for text wrapping.
The precise set of rules in effect for each of
loose
normal
and
strict
is up to the UA
and should follow language conventions.
However, for these three keywords, this specification does require that:
The following breaks are forbidden in
strict
line breaking
and allowed in
normal
and
loose
breaks before Japanese small kana
or the Katakana-Hiragana prolonged sound mark,
i.e. characters
from the Unicode line breaking class
CJ
[UAX14]
Tests
line-break-loose-011.xht
(live test)
(source)
line-break-loose-012.xht
(live test)
(source)
line-break-normal-011.xht
(live test)
(source)
line-break-normal-012.xht
(live test)
(source)
line-break-strict-011.xht
(live test)
(source)
line-break-strict-012.xht
(live test)
(source)
css-text-line-break-ja-cj-loose.html
(live test)
(source)
css-text-line-break-ja-cj-normal.html
(live test)
(source)
css-text-line-break-ja-cj-strict.html
(live test)
(source)
css-text-line-break-zh-cj-loose.html
(live test)
(source)
css-text-line-break-zh-cj-normal.html
(live test)
(source)
css-text-line-break-zh-cj-strict.html
(live test)
(source)
css-text-line-break-de-cj-loose.html
(live test)
(source)
css-text-line-break-de-cj-normal.html
(live test)
(source)
css-text-line-break-de-cj-strict.html
(live test)
(source)
css-text-line-break-cj-loose.html
(live test)
(source)
css-text-line-break-cj-normal.html
(live test)
(source)
css-text-line-break-cj-strict.html
(live test)
(source)
The following breaks are allowed for
normal
and
loose
line breaking
if the
writing system
is
Chinese
or
Japanese
and are otherwise forbidden:
breaks before certain CJK hyphen-like characters:
〜 U+301C,
゠ U+30A0
Tests
line-break-loose-013.xht
(live test)
(source)
line-break-normal-013.xht
(live test)
(source)
line-break-strict-013.xht
(live test)
(source)
css-text-line-break-ja-hyphens-loose.html
(live test)
(source)
css-text-line-break-ja-hyphens-normal.html
(live test)
(source)
css-text-line-break-ja-hyphens-strict.html
(live test)
(source)
css-text-line-break-zh-hyphens-loose.html
(live test)
(source)
css-text-line-break-zh-hyphens-normal.html
(live test)
(source)
css-text-line-break-zh-hyphens-strict.html
(live test)
(source)
css-text-line-break-de-hyphens-loose.html
(live test)
(source)
css-text-line-break-de-hyphens-normal.html
(live test)
(source)
css-text-line-break-de-hyphens-strict.html
(live test)
(source)
css-text-line-break-hyphens-loose.html
(live test)
(source)
css-text-line-break-hyphens-normal.html
(live test)
(source)
css-text-line-break-hyphens-strict.html
(live test)
(source)
writing-system-line-break-001.html
(live test)
(source)
The following breaks are allowed for
loose
line breaking
if the preceding character
belongs to the Unicode line breaking class
ID
[UAX14]
(including when the preceding character
is treated as
ID
due to
word-break: break-all
),
and are otherwise forbidden:
breaks before hyphens:
‐ U+2010, – U+2013
Tests
line-break-loose-hyphens-001.html
(live test)
(source)
line-break-normal-hyphens-001.html
(live test)
(source)
line-break-strict-hyphens-001.html
(live test)
(source)
line-break-loose-hyphens-002.html
(live test)
(source)
line-break-normal-hyphens-002.html
(live test)
(source)
line-break-strict-hyphens-002.html
(live test)
(source)
line-break-loose-hyphens-003.html
(live test)
(source)
line-break-normal-hyphens-003.html
(live test)
(source)
line-break-strict-hyphens-003.html
(live test)
(source)
The following breaks are forbidden for
normal
and
strict
line breaking
and allowed in
loose
breaks before iteration marks:
々 U+3005, 〻 U+303B, ゝ U+309D,
ゞ U+309E, ヽ U+30FD, ヾ U+30FE
Tests
line-break-loose-014.xht
(live test)
(source)
line-break-normal-014.xht
(live test)
(source)
line-break-strict-014.xht
(live test)
(source)
css-text-line-break-ja-iteration-loose.html
(live test)
(source)
css-text-line-break-ja-iteration-normal.html
(live test)
(source)
css-text-line-break-ja-iteration-strict.html
(live test)
(source)
css-text-line-break-zh-iteration-loose.html
(live test)
(source)
css-text-line-break-zh-iteration-normal.html
(live test)
(source)
css-text-line-break-zh-iteration-strict.html
(live test)
(source)
css-text-line-break-de-iteration-loose.html
(live test)
(source)
css-text-line-break-de-iteration-normal.html
(live test)
(source)
css-text-line-break-de-iteration-strict.html
(live test)
(source)
css-text-line-break-iteration-loose.html
(live test)
(source)
css-text-line-break-iteration-normal.html
(live test)
(source)
css-text-line-break-iteration-strict.html
(live test)
(source)
breaks between inseparable characters
(such as ‥ U+2025, … U+2026)
i.e. characters from the Unicode line breaking class
IN
[UAX14]
Tests
line-break-loose-015.xht
(live test)
(source)
line-break-normal-015a.xht
(live test)
(source)
line-break-normal-015b.xht
(live test)
(source)
line-break-strict-015a.xht
(live test)
(source)
line-break-strict-015b.xht
(live test)
(source)
css-text-line-break-ja-in-loose.html
(live test)
(source)
css-text-line-break-ja-in-normal.html
(live test)
(source)
css-text-line-break-ja-in-strict.html
(live test)
(source)
css-text-line-break-zh-in-loose.html
(live test)
(source)
css-text-line-break-zh-in-normal.html
(live test)
(source)
css-text-line-break-zh-in-strict.html
(live test)
(source)
css-text-line-break-de-in-loose.html
(live test)
(source)
css-text-line-break-de-in-normal.html
(live test)
(source)
css-text-line-break-de-in-strict.html
(live test)
(source)
css-text-line-break-in-loose.html
(live test)
(source)
css-text-line-break-in-normal.html
(live test)
(source)
css-text-line-break-in-strict.html
(live test)
(source)
The following breaks are allowed for
loose
if the
writing system
is
Chinese
or
Japanese
and are otherwise forbidden:
breaks before certain centered punctuation marks:
・ U+30FB,
: U+FF1A, ; U+FF1B, ・ U+FF65,
‼ U+203C,
⁇ U+2047, ⁈ U+2048, ⁉ U+2049,
! U+FF01, ? U+FF1F
Tests
line-break-loose-016a.xht
(live test)
(source)
line-break-loose-016b.xht
(live test)
(source)
line-break-normal-016a.xht
(live test)
(source)
line-break-normal-016b.xht
(live test)
(source)
line-break-strict-016a.xht
(live test)
(source)
line-break-strict-016b.xht
(live test)
(source)
css-text-line-break-ja-cpm-loose.html
(live test)
(source)
css-text-line-break-ja-cpm-normal.html
(live test)
(source)
css-text-line-break-ja-cpm-strict.html
(live test)
(source)
css-text-line-break-zh-cpm-loose.html
(live test)
(source)
css-text-line-break-zh-cpm-normal.html
(live test)
(source)
css-text-line-break-zh-cpm-strict.html
(live test)
(source)
css-text-line-break-de-cpm-loose.html
(live test)
(source)
css-text-line-break-de-cpm-normal.html
(live test)
(source)
css-text-line-break-de-cpm-strict.html
(live test)
(source)
css-text-line-break-cpm-loose.html
(live test)
(source)
css-text-line-break-cpm-normal.html
(live test)
(source)
css-text-line-break-cpm-strict.html
(live test)
(source)
writing-system-line-break-002.html
(live test)
(source)
breaks before suffixes:
Characters with the Unicode line breaking class
PO
[UAX14]
and the
East Asian Width property
[UAX11]
Ambiguous
Fullwidth
or
Wide
Tests
line-break-loose-017a.xht
(live test)
(source)
line-break-loose-017b.xht
(live test)
(source)
line-break-normal-017a.xht
(live test)
(source)
line-break-normal-017b.xht
(live test)
(source)
line-break-strict-017a.xht
(live test)
(source)
line-break-strict-017b.xht
(live test)
(source)
css-text-line-break-ja-po-loose.html
(live test)
(source)
css-text-line-break-ja-po-normal.html
(live test)
(source)
css-text-line-break-ja-po-strict.html
(live test)
(source)
css-text-line-break-zh-po-loose.html
(live test)
(source)
css-text-line-break-zh-po-normal.html
(live test)
(source)
css-text-line-break-zh-po-strict.html
(live test)
(source)
css-text-line-break-de-po-loose.html
(live test)
(source)
css-text-line-break-de-po-normal.html
(live test)
(source)
css-text-line-break-de-po-strict.html
(live test)
(source)
css-text-line-break-po-loose.html
(live test)
(source)
css-text-line-break-po-normal.html
(live test)
(source)
css-text-line-break-po-strict.html
(live test)
(source)
breaks after prefixes:
Characters with the Unicode line breaking class
PR
[UAX14]
and the
East Asian Width property
[UAX11]
Ambiguous
Fullwidth
or
Wide
Tests
line-break-loose-018.xht
(live test)
(source)
line-break-normal-018.xht
(live test)
(source)
line-break-strict-018.xht
(live test)
(source)
css-text-line-break-ja-pr-loose.html
(live test)
(source)
css-text-line-break-ja-pr-normal.html
(live test)
(source)
css-text-line-break-ja-pr-strict.html
(live test)
(source)
css-text-line-break-zh-pr-loose.html
(live test)
(source)
css-text-line-break-zh-pr-normal.html
(live test)
(source)
css-text-line-break-zh-pr-strict.html
(live test)
(source)
css-text-line-break-de-pr-loose.html
(live test)
(source)
css-text-line-break-de-pr-normal.html
(live test)
(source)
css-text-line-break-de-pr-strict.html
(live test)
(source)
css-text-line-break-pr-loose.html
(live test)
(source)
css-text-line-break-pr-normal.html
(live test)
(source)
css-text-line-break-pr-strict.html
(live test)
(source)
Note:
The requirements listed above
only create distinctions in CJK text.
In an implementation that matches only the rules above,
and no additional rules,
line-break
would only affect CJK code points
unless the writing system is tagged as
Chinese
or
Japanese
Future levels may add additional specific rules
for other writing systems and languages
as their requirements become known.
As UAs can add additional distinctions
between
strict
normal
loose
modes,
these values can exhibit differences in other writing systems as well.
For example, a UA with sufficiently-advanced Thai language processing ability
could choose to map different levels of strictness in Thai line-breaking
to these keywords,
e.g. disallowing breaks within compound words in
strict
mode
(e.g. breaking ตัวอย่างการเขียนภาษาไทย as ตัวอย่าง·การเขียน·ภาษาไทย)
while allowing more breaks in
loose
(ตัวอย่าง·การ·เขียน·ภาษา·ไทย).
Note: While user agents can refer to
[UAX14]
as a starting point
for their line-breaking implementation,
the following deviations could be desirable
for maximum interoperability with existing implementations:
Not introducing a line break opportunity between
U+0021 (Exclamation Mark,
) and
a letter (
Unicode general category
).
This prevents a break in the string “!important”.
Not introducing a line break opportunity between
U+002F (Solidus,
) and
a letter (
Unicode general category
).
This prevents a break in dates such as “23/Jan/2024”.
Not introducing a line break opportunity between
U+007C (Vertical Line,
) and
a letter (
Unicode general category
).
Not introducing a line break opportunity between
U+002D (Hyphen-Minus `-`) and
a digit (
Unicode general category
Nd
if the codepoint prior to the hyphen was _not_ a letter or digit
Unicode general category
or
Nd
).
This prevents breaking after the minus sign before a number
such as in “-13”
whilst allowing breaks after the hyphen in “ABCD-1234” and “1234-5678”
which may appear in long URLs, for example.
Note:
The CSSWG recognizes that in a future edition of the specification
finer control over line breaking may be necessary
to satisfy high-end publishing requirements.
6.3.
Hyphenation: Morphological Breaking Within Words
6.3.1.
Hyphenation Control: the
hyphens
property
Tests
This section has partial test coverage.
Missing tests:
* Applies to text
* “Automatic hyphenation opportunities within a word must be ignored if the word contains a conditional hyphen (shy or U+00AD), in favor of the conditional hyphen(s)”
* “However, if, even after breaking at such opportunities, a portion of that word is still too long to fit on one line, an automatic hyphenation opportunity may be used.”
Hyphenation
is the controlled splitting of words
where they usually would not be allowed to break
to improve the layout of paragraphs,
typically splitting words at syllabic or morphemic boundaries
and often visually indicating the split
(usually by inserting a hyphen, U+2010).
In some cases, hyphenation may also alter the spelling of a word.
Regardless, hyphenation is a rendering effect only:
it must have no effect on the underlying document content
or on text selection or searching.
Tests
hyphens-character.html
(live test)
(source)
hyphens-vertical-001.html
(live test)
(source)
hyphens-vertical-002.html
(live test)
(source)
Hyphenation practices vary across languages,
and can involve not just inserting a hyphen before the line break,
but inserting a hyphen after the break (or both),
inserting a different character than U+2010,
or changing the spelling of the word.
Language
Unbroken
Before
After
Unbroken
Un‐
broken
Dutch
cafeetje
café‐
tje
Hungarian
Összeg
Ösz‐
szeg
Mandarin
tú’àn
tú‐
àn
àizēng‐fēnmíng
àizēng‐
‐fēnmíng
Uyghur
Cree
Tests
hyphens-i18n-auto-001.html
(live test)
(source)
hyphens-i18n-auto-002.html
(live test)
(source)
hyphens-i18n-auto-003.html
(live test)
(source)
hyphens-i18n-auto-004.html
(live test)
(source)
hyphens-i18n-auto-005.html
(live test)
(source)
hyphens-i18n-auto-006.html
(live test)
(source)
Hyphenation occurs
when the line breaks at a valid
hyphenation opportunity
which is a type of
soft wrap opportunity
that exists within a word where
hyphenation
is allowed.
In CSS
hyphenation opportunities
are controlled
with the
hyphens
property.
CSS Text Level 3 does not define the exact rules for
hyphenation
however UAs are strongly encouraged
to optimize their choice of break points
and to chose language-appropriate hyphenation points.
Tests
hyphens-overflow-001.html
(live test)
(source)
Note:
The
soft wrap opportunity
introduced by
the U+002D - HYPHEN-MINUS character
or the U+2010 ‐ HYPHEN character
is not a
hyphenation opportunity
as no visual indication of the split is
created
when wrapping:
these characters are visible whether the line is wrapped at that point or not.
Hyphenation opportunities
are
considered when calculating
min-content intrinsic sizes
Tests
hyphens-auto-min-content.html
(live test)
(source)
Note:
This allows tables to hyphenate their contents
instead of overflowing their containing block,
which is particularly important in long-word languages like German.
Name:
hyphens
Value:
none
manual
auto
Initial:
manual
Applies to:
text
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
n/a
Animation type:
discrete
Tests
inheritance.html
(live test)
(source)
hyphens-valid.html
(live test)
(source)
hyphens-invalid.html
(live test)
(source)
hyphens-computed.html
(live test)
(source)
hyphens-auto-inline-010.html
(live test)
(source)
hyphens-manual-inline-010.html
(live test)
(source)
hyphens-manual-inline-011.html
(live test)
(source)
hyphens-manual-inline-012.html
(live test)
(source)
hyphen-no-interpolation.html
(live test)
(source)
This property controls whether
hyphenation
is allowed to create more
soft wrap opportunities
within a line of text.
Values have the following meanings:
none
Words are not hyphenated,
even if characters inside the word
explicitly define
hyphenation opportunities
Note:
This does not suppress the existing
soft wrap opportunities
introduced by always visible characters such as
U+002D - HYPHEN-MINUS
or U+2010 ‐ HYPHEN.
Tests
hyphens-none-011.html
(live test)
(source)
hyphens-none-012.html
(live test)
(source)
hyphens-none-013.html
(live test)
(source)
hyphens-none-014.html
(live test)
(source)
hyphens-none-015.html
(live test)
(source)
hyphens-none-shy-on-2nd-line-001.html
(live test)
(source)
manual
Words are only hyphenated where there are characters inside the word
that explicitly suggest
hyphenation opportunities
The UA must use the appropriate language-specific hyphenation character(s)
and should apply any appropriate spelling changes
just as for automatic hyphenation at the same point.
Tests
hyphens-overflow-001.html
(live test)
(source)
hyphens-manual-010.html
(live test)
(source)
hyphens-manual-011.html
(live test)
(source)
hyphens-manual-012.html
(live test)
(source)
hyphens-manual-013.html
(live test)
(source)
hyphens-out-of-flow-001.html
(live test)
(source)
hyphens-shaping-001.html
(live test)
(source)
hyphens-shaping-002.html
(live test)
(source)
hyphens-span-001.html
(live test)
(source)
shy-styling-001.html
(live test)
(source)
hyphens-i18n-manual-001.html
(live test)
(source)
hyphens-i18n-manual-002.html
(live test)
(source)
hyphens-i18n-manual-003.html
(live test)
(source)
hyphens-i18n-manual-004.html
(live test)
(source)
hyphens-i18n-manual-005.html
(live test)
(source)
hyphens-vertical-001.html
(live test)
(source)
hyphens-vertical-002.html
(live test)
(source)
hyphens-vertical-003.html
(live test)
(source)
hyphens-vertical-004.html
(live test)
(source)
hyphens-vs-float-clearance-002.html
(live test)
(source)
In Unicode, U+00AD is a conditional "soft hyphen"
and U+2010 is an unconditional hyphen.
Unicode Standard Annex #14
describes the
role of soft hyphens in
Unicode line breaking.
[UAX14]
In HTML,
represents the soft hyphen character,
which suggests a hyphenation opportunity.
ex
ample
auto
Words may be broken at
hyphenation opportunities
determined automatically by a language-appropriate hyphenation resource
in addition to those indicated explicitly by a conditional hyphen.
Automatic
hyphenation opportunities
elsewhere within a word must be ignored
if the word contains a conditional hyphen
( or U+00AD SOFT HYPHEN),
in favor of the conditional hyphen(s).
However, if, even after breaking at such opportunities,
a portion of that word is still too long to fit on one line,
an automatic hyphenation opportunity may be used.
Tests
hyphens-auto-control.html
(live test)
(source)
hyphens-auto-001.html
(live test)
(source)
hyphens-auto-002.html
(live test)
(source)
hyphens-auto-003.html
(live test)
(source)
hyphens-auto-004.html
(live test)
(source)
hyphens-auto-005.html
(live test)
(source)
hyphens-auto-010.html
(live test)
(source)
hyphens-out-of-flow-002.html
(live test)
(source)
hyphens-span-002.html
(live test)
(source)
hyphens-auto-and-contenteditable-crash.html
(live test)
(source)
hyphens-auto-last-word-001.html
(live test)
(source)
hyphens-punctuation-001.html
(live test)
(source)
hyphens-vs-float-clearance-001.html
(live test)
(source)
Correct automatic hyphenation requires a hyphenation resource
appropriate to the language of the text being broken.
The UA must therefore only automatically hyphenate text
for which the
content language
is known
and for which it has an appropriate hyphenation resource.
Tests
hyphens-auto-001.html
(live test)
(source)
Authors should correctly tag their content’s
language
(e.g. using the HTML
lang
attribute
or XML
xml:lang
attribute)
in order to obtain correct automatic hyphenation.
The UA may use language-tailored heuristics
to exclude certain words
from automatic hyphenation.
For example, a UA might try to avoid hyphenation in proper nouns
by excluding words matching certain capitalization and punctuation patterns.
Such heuristics are not defined by this specification.
(Note that such heuristics will need to vary by language:
English and German, for example, have very different capitalization conventions.)
For the purpose of the
hyphens
property,
what constitutes a “word” is UA-dependent.
However, inline element boundaries
and
out-of-flow
elements
must be ignored when determining word boundaries.
Tests
hyphens-span-001.html
(live test)
(source)
hyphens-span-002.html
(live test)
(source)
hyphens-out-of-flow-001.html
(live test)
(source)
hyphens-out-of-flow-002.html
(live test)
(source)
Any glyphs shown due to hyphenation
at a
hyphenation opportunity
created by a conditional hyphen character
(such as U+00AD SOFT HYPHEN)
are represented by that character
and are styled according to the properties applied to it.
Tests
shy-styling-001.html
(live test)
(source)
When shaping scripts such as Arabic are allowed to break within words
due to hyphenation,
the characters must still be shaped
as if the word were
not broken
Tests
hyphens-shaping-001.html
(live test)
(source)
hyphens-shaping-002.html
(live test)
(source)
For example, if the Uyghur word “داميدى”
were hyphenated, it would appear as
not as
6.3.2.
Hyphens: the
hyphenate-character
property
Tests
This section has partial coverage.
Missing tests:
* applies to text
* inheritance
* the UA must insert the string according to the typographic conventions of the content language
Likely untestable:
* when the UA truncates the string (which it may not do),
it must not truncate part of a typographic character unit.
Name:
hyphenate-character
Value:
auto
Initial:
auto
Applies to:
text
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
per grammar
Animation type:
discrete
Tests
hyphen-no-interpolation.html
(live test)
(source)
hyphenate-character-computed.html
(live test)
(source)
hyphenate-character-invalid.html
(live test)
(source)
hyphenate-character-valid.html
(live test)
(source)
This property specifies the string that is shown
between parts of hyphenated words.
Values have the following meanings:
auto
Specifies that the user agent should find an appropriate string
based on the
content language
’s typographic conventions,
possibly from the same source as the hyphenation dictionary.
Specifies the string that appears
at the hyphenation break when hyphenating.
(The position of this string is not affected:
the UA must insert the string
according to the typographic conventions of the
content language
defaulting to immediately before the hyphenation break.)
The UA
may
truncate the
used value
to a limited number of
typographic character units
it must not truncate only part of a
typographic character unit
Tests
hyphenate-character-003.html
(live test)
(source)
hyphenate-character-004.html
(live test)
(source)
hyphenate-character-005.html
(live test)
(source)
hyphenate-limit-chars-001.html
(live test)
(source)
hyphens-vertical-003.html
(live test)
(source)
hyphens-vertical-004.html
(live test)
(source)
Note:
Specifying the empty string
""
is valid,
and causes the UA to break at
hyphenation opportunities
without inserting a visible hyphenation character.
Tests
hyphenate-character-001.html
(live test)
(source)
hyphenate-character-002.html
(live test)
(source)
The hyphen character (U+2010) is most typically used
to indicate that a word has been split.
However,
hyphenate-character
can be used
to specify a different type of hyphen when necessary.
[lang]:lang(ojs) { hyphenate-character: "᐀" /* CANADIAN SYLLABICS HYPHEN (U+1400) */ }
Note:
Both hyphens triggered by automatic hyphenation
and hyphens triggered by soft hyphens
are rendered according to
hyphenate-character
6.3.3.
Hyphenation Size Limit: the
hyphenate-limit-zone
property
Tests
This section lacks tests.
Name:
hyphenate-limit-zone
Value:
Initial:
Applies to:
block containers
Inherited:
yes
Percentages:
refers to length of the line box
Computed value:
computed
value
Canonical order:
per grammar
Animation type:
by computed value type
Is
hyphenate-limit-zone
a good name? Comments/suggestions?
This property specifies the maximum amount of unfilled space
(before justification)
that may be left in the line box before hyphenation is triggered
to pull part of a word from the next line back up into the current line.
6.3.4.
Hyphenation Character Limits: the
hyphenate-limit-chars
property
Tests
This section has limited coverage.
Missing tests:
* applies to text
* inherited
* If the third value is missing, it is the same as the second.
* tests of the two-value syntax (but not just syntax tests, check that it has an effect)
* tests of the 3 value syntax with auto in positions other than first (but not just syntax tests, check that it has an effect)
Name:
hyphenate-limit-chars
Value:
[ auto
{1,3}
Initial:
auto
Applies to:
text
Inherited:
yes
Percentages:
n/a
Computed value:
three values, each either the
auto
keyword or an integer
Canonical order:
per grammar
Animation type:
by computed value type
Tests
hyphen-no-interpolation.html
(live test)
(source)
hyphen-limit-chars-interpolation.html
(live test)
(source)
hyphenate-limit-chars-computed.html
(live test)
(source)
hyphenate-limit-chars-invalid.html
(live test)
(source)
hyphenate-limit-chars-valid.html
(live test)
(source)
This property specifies the minimum number of characters
in a hyphenated word.
If the word does not meet the required minimum number of characters
in the word / before the hyphen / after the hyphen,
then the word must not be hyphenated.
Nonspacing combining marks (Unicode General Category Mn)
and intra-word punctuation (Unicode General Category P*)
do not count towards the minimum.
If three values are specified,
the first value is the required minimum for the total characters in a word,
the second value is the minimum for characters before the hyphenation point,
and the third value is the minimum for characters after the hyphenation point.
If the third value is missing, it is the same as the second.
If the second value is missing, then it is
auto
The
auto
value means that
the UA chooses a value that adapts to the current layout.
Tests
hyphenate-limit-chars-001.html
(live test)
(source)
Note:
Unless the UA is able to calculate a better value,
it is suggested that
auto
means
2 for before and after, and 5 for the word total.
In the example below,
the minimum size of a hyphenated word is left to the UA
(which means it may vary depending on the language,
the length of the line, or other factors),
but the minimum number of characters
before and after the hyphenation point
is set to 3.
p { hyphenate-limit-chars: auto 3; }
6.3.5.
Hyphenation Line Limits: the
hyphenate-limit-lines
and
hyphenate-limit-last
properties
Tests
This section lacks tests.
Name:
hyphenate-limit-lines
Value:
no-limit
Initial:
no-limit
Applies to:
block containers
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword or integer
Canonical order:
per grammar
Animation type:
by computed value type
This property indicates the maximum number of
successive hyphenated lines in an element.
The
no-limit
value means that there is no limit.
In some cases, user agents may not be able to honor the specified value.
(See overflow-wrap.)
It is not defined whether hyphenation introduced by such emergency breaking
influences nearby hyphenation points.
Name:
hyphenate-limit-last
Value:
none
always
column
page
spread
Initial:
none
Applies to:
block containers
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
per grammar
Animation type:
discrete
This property indicates hyphenation behavior at the end
of elements, column, pages, and spreads.
A spread is a set of two pages
that are visible to the reader at the same time.
Values have the following meanings:
none
No restrictions imposed.
always
The last full line of the element,
or the last line before any column, page, or spread break inside the element
should not be hyphenated.
column
The last line before any column, page, or spread break inside the element
should not be hyphenated.
page
The last line before page or spread break inside the element
should not be hyphenated.
spread
The last line before any spread break inside the element
should not be hyphenated.
p { hyphenate-limit-last: always }
div.chapter { hyphenate-limit-last: spread }
A paragraph may be formatted like this
when
hyphenate-limit-last: none
is set:
This is just a
simple example
to show Antarc-
tica.
With 'hyphenate-limit-last: always' one would get:
This is just a
simple example
to show
Antarctica.
6.4.
Overflow Wrapping: the
overflow-wrap
word-wrap
property
Tests
This section has fairly good test coverage.
Missing tests:
* Applies to text
* in the case of auto-phrase, opportunities brought by anywhere only kick in after those from normal
* No test of Animation type
Name:
overflow-wrap
word-wrap
Value:
normal
break-word
anywhere
Initial:
normal
Applies to:
text
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
n/a
Animation type:
discrete
Tests
inheritance.html
(live test)
(source)
overflow-wrap-invalid.html
(live test)
(source)
overflow-wrap-valid.html
(live test)
(source)
overflow-wrap-computed.html
(live test)
(source)
word-wrap-invalid.html
(live test)
(source)
word-wrap-valid.html
(live test)
(source)
word-wrap-computed.html
(live test)
(source)
overflow-wrap-anywhere-span-001.html
(live test)
(source)
overflow-wrap-anywhere-span-002.html
(live test)
(source)
overflow-wrap-break-word-span-001.html
(live test)
(source)
overflow-wrap-break-word-span-002.html
(live test)
(source)
overflow-wrap-break-word-long-crash.html
(live test)
(source)
overflow-wrap-break-word-white-space-crash.html
(live test)
(source)
overflow-wrap-break-word-white-space-crash-002.html
(live test)
(source)
overflow-wrap-anywhere-inline-002.tentative.html
(live test)
(source)
This property specifies whether the UA may break
at otherwise disallowed points within a line
to prevent overflow,
when an otherwise-unbreakable string is too long to fit within the line box.
It only has an effect when
white-space
allows
wrapping
. Possible values:
Tests
overflow-wrap-002.html
(live test)
(source)
normal
Lines may break only at allowed break points.
However,
the restrictions introduced by
word-break: keep-all
may be relaxed
to match
word-break: normal
if there are no otherwise-acceptable break points in the line.
Tests
overflow-wrap-004.html
(live test)
(source)
overflow-wrap-normal-keep-all-001.html
(live test)
(source)
Also, the restrictions introduced by
word-break: auto-phrase
are relaxed
if there are no otherwise-acceptable break points in the line:
If suppressing
soft wrap opportunities
within a particular phrase
would cause that phrase to overflow even when placed on an otherwise empty line,
the user agent must fall back
to the same
soft wrap opportunities
as
normal
within that phrase.
Tests
word-break-auto-phrase-009.html
(live test)
(source)
word-break-auto-phrase-overflow-001.html
(live test)
(source)
If that is not enough to prevent overflow,
suppression of
hyphenation opportunities
must also be abandoned
within each line that would overflow.
Tests
word-break-auto-phrase-008.html
(live test)
(source)
As an intermediary measure,
user agents may also detect multiple levels of phrases,
choosing to shorter ones
(possibly down to individual words)
when longer ones would lead to overflow.
The
soft wrap opportunities
obtained by relaxing the restrictions
introduced by
word-break: keep-all
and
word-break: auto-phrase
are
not
considered
when calculating
min-content intrinsic sizes
anywhere
An otherwise unbreakable sequence of
characters
may be broken at an arbitrary point
if there are no otherwise-acceptable break points in the line.
Shaping characters are still shaped
as if the word were not broken,
and grapheme clusters must stay together as one unit.
No hyphenation character is inserted at the break point.
Soft wrap opportunities
introduced by
anywhere
are considered
when calculating
min-content intrinsic sizes
Tests
overflow-wrap-min-content-size-001.html
(live test)
(source)
overflow-wrap-min-content-size-002.html
(live test)
(source)
overflow-wrap-min-content-size-003.html
(live test)
(source)
overflow-wrap-anywhere-001.html
(live test)
(source)
overflow-wrap-anywhere-003.html
(live test)
(source)
overflow-wrap-anywhere-006.html
(live test)
(source)
overflow-wrap-anywhere-007.html
(live test)
(source)
overflow-wrap-anywhere-008.html
(live test)
(source)
overflow-wrap-anywhere-009.html
(live test)
(source)
overflow-wrap-anywhere-010.html
(live test)
(source)
overflow-wrap-anywhere-011.html
(live test)
(source)
overflow-wrap-anywhere-inline-001.html
(live test)
(source)
overflow-wrap-anywhere-inline-002.tentative.html
(live test)
(source)
overflow-wrap-anywhere-inline-003.tentative.html
(live test)
(source)
overflow-wrap-anywhere-inline-004.tentative.html
(live test)
(source)
overflow-wrap-anywhere-fit-content-001.html
(live test)
(source)
overflow-wrap-min-content-size-005.html
(live test)
(source)
overflow-wrap-min-content-size-007.html
(live test)
(source)
overflow-wrap-cluster-002.html
(live test)
(source)
overflow-wrap-shaping-002.html
(live test)
(source)
break-spaces-before-first-char-009.html
(live test)
(source)
break-spaces-before-first-char-013.html
(live test)
(source)
break-spaces-before-first-ideographic-char-009.html
(live test)
(source)
break-spaces-before-first-ideographic-char-013.html
(live test)
(source)
word-break-min-content-001.html
(live test)
(source)
word-break-min-content-002.html
(live test)
(source)
word-break-min-content-003.html
(live test)
(source)
word-break-min-content-004.html
(live test)
(source)
word-break-min-content-005.html
(live test)
(source)
word-break-min-content-006.html
(live test)
(source)
pre-wrap-009.html
(live test)
(source)
pre-wrap-010.html
(live test)
(source)
break-spaces-with-overflow-wrap-002.html
(live test)
(source)
break-spaces-with-overflow-wrap-004.html
(live test)
(source)
break-spaces-with-overflow-wrap-006.html
(live test)
(source)
break-spaces-with-overflow-wrap-008.html
(live test)
(source)
break-spaces-with-overflow-wrap-010.html
(live test)
(source)
text-wrap-balance-overflow-002.html
(live test)
(source)
In the case of
word-break: auto-phrase
these additional
soft wrap opportunities
are only introduced
if relaxing the restrictions introduced by
word-break: auto-phrase
as described in
overflow-wrap: normal
is insufficient to prevent overflow.
break-word
As for
anywhere
except that
soft wrap opportunities
introduced by
break-word
are
not
considered
when calculating
min-content intrinsic sizes
Tests
overflow-wrap-001.html
(live test)
(source)
overflow-wrap-break-word-001.html
(live test)
(source)
overflow-wrap-break-word-003.html
(live test)
(source)
overflow-wrap-break-word-008.html
(live test)
(source)
overflow-wrap-break-word-009.html
(live test)
(source)
overflow-wrap-break-word-010.html
(live test)
(source)
overflow-wrap-min-content-size-004.html
(live test)
(source)
overflow-wrap-min-content-size-006.html
(live test)
(source)
overflow-wrap-min-content-size-008.html
(live test)
(source)
overflow-wrap-break-word-fit-content-001.html
(live test)
(source)
overflow-wrap-cluster-001.html
(live test)
(source)
overflow-wrap-shaping-001.html
(live test)
(source)
break-spaces-before-first-char-008.html
(live test)
(source)
break-spaces-before-first-char-012.html
(live test)
(source)
break-spaces-before-first-ideographic-char-008.html
(live test)
(source)
break-spaces-before-first-ideographic-char-012.html
(live test)
(source)
overflow-wrap-break-word-keep-all-001.html
(live test)
(source)
break-spaces-with-overflow-wrap-001.html
(live test)
(source)
break-spaces-with-overflow-wrap-003.html
(live test)
(source)
break-spaces-with-overflow-wrap-005.html
(live test)
(source)
break-spaces-with-overflow-wrap-007.html
(live test)
(source)
break-spaces-with-overflow-wrap-009.html
(live test)
(source)
trailing-ideographic-space-013.html
(live test)
(source)
trailing-ideographic-space-014.html
(live test)
(source)
trailing-ideographic-space-015.html
(live test)
(source)
trailing-ideographic-space-016.html
(live test)
(source)
text-wrap-balance-overflow-001.html
(live test)
(source)
Do we need to add a
none
value to
overflow-wrap
to opt out of relaxing the
keep-all
and
auto-phrase
restrictions
as allowed by
overflow-wrap: normal
For legacy reasons, UAs must treat
word-wrap
as a
legacy name alias
of the
overflow-wrap
property.
Tests
word-wrap-alias.html
(live test)
(source)
word-wrap-001.html
(live test)
(source)
word-wrap-002.html
(live test)
(source)
word-wrap-004.html
(live test)
(source)
7.
Alignment and Justification
Tests
Tests only needed in subsections.
Alignment and justification controls
how inline content is distributed within a line box.
7.1.
Text Alignment: the
text-align
shorthand
Tests
This section has partial test coverage.
Missing tests:
* tests for the <
> value
* If (after justification, if any) the inline contents of a line box are too long to fit within it, then the contents are start-aligned: any content that doesn’t fit overflows the line box’s end edge.
* “Values other than justify-all or match-parent are assigned to text-align-all and reset text-align-last to auto.”, and being a shorthand in general
Name:
text-align
Value:
start
end
left
right
center
justify
match-parent
justify-all
Initial:
start
Applies to:
block containers
Inherited:
yes
Percentages:
see individual properties
Computed value:
see individual properties
Animation type:
discrete
Canonical order:
n/a
Tests
inheritance.html
(live test)
(source)
text-align-valid.html
(live test)
(source)
text-align-invalid.html
(live test)
(source)
text-align-computed.html
(live test)
(source)
text-align-webkit-match-parent.html
(live test)
(source)
c546-txt-align-000.xht (visual test)
(source)
text-align-005.xht (visual test)
(source)
text-align-applies-to-001.xht (visual test)
(source)
text-align-applies-to-002.xht (visual test)
(source)
text-align-applies-to-003.xht (visual test)
(source)
text-align-applies-to-005.xht (visual test)
(source)
text-align-applies-to-006.xht (visual test)
(source)
text-align-applies-to-007.xht (visual test)
(source)
text-align-applies-to-008.xht (visual test)
(source)
text-align-applies-to-009.xht (visual test)
(source)
text-align-applies-to-010.xht (visual test)
(source)
text-align-applies-to-011.xht (visual test)
(source)
text-align-applies-to-012.xht (visual test)
(source)
text-align-applies-to-013.xht (visual test)
(source)
text-align-applies-to-014.xht (visual test)
(source)
text-align-applies-to-015.xht (visual test)
(source)
text-align-inherit-001.xht (visual test)
(source)
text-align-bidi-011.xht
(live test)
(source)
This
shorthand property
sets the
text-align-all
and
text-align-last
properties
and describes how the inline-level content of a block
is aligned along the inline axis
if the content does not completely fill the line box.
Values other than
justify-all
or
match-parent
are assigned to
text-align-all
and reset
text-align-last
to
auto
Values have the following meanings:
start
Inline-level content is aligned
to the
start
edge of the line box.
Tests
text-align-006.html
(live test)
(source)
text-align-start-001.html
(live test)
(source)
text-align-start-002.html
(live test)
(source)
text-align-start-003.html
(live test)
(source)
text-align-start-004.html
(live test)
(source)
text-align-start-005.html
(live test)
(source)
text-align-start-006.html
(live test)
(source)
text-align-start-007.html
(live test)
(source)
text-align-start-008.html
(live test)
(source)
text-align-start-009.html
(live test)
(source)
text-align-start-010.html
(live test)
(source)
text-align-start-014.html
(live test)
(source)
text-align-start-015.html
(live test)
(source)
text-align-start-016.html
(live test)
(source)
text-align-start-017.html
(live test)
(source)
text-align-start-018.html (visual test)
(source)
text-align-start-019.html (visual test)
(source)
text-align-start-020.html (visual test)
(source)
text-align-start-021.html (visual test)
(source)
end
Inline-level content is aligned
to the
end
edge of the line box.
Tests
text-align-007.html
(live test)
(source)
text-align-end-001.html
(live test)
(source)
text-align-end-002.html
(live test)
(source)
text-align-end-003.html
(live test)
(source)
text-align-end-004.html
(live test)
(source)
text-align-end-005.html
(live test)
(source)
text-align-end-006.html
(live test)
(source)
text-align-end-007.html
(live test)
(source)
text-align-end-008.html
(live test)
(source)
text-align-end-009.html
(live test)
(source)
text-align-end-010.html
(live test)
(source)
text-align-end-014.html
(live test)
(source)
text-align-end-015.html
(live test)
(source)
text-align-end-016.html
(live test)
(source)
text-align-end-017.html
(live test)
(source)
text-align-end-018.html (visual test)
(source)
text-align-end-019.html (visual test)
(source)
text-align-end-020.html (visual test)
(source)
text-align-end-021.html (visual test)
(source)
left
Inline-level content is aligned
to the
line-left
edge of the line box.
(In vertical writing modes,
this can be either the physical top or bottom,
depending on
writing-mode
.)
[CSS-WRITING-MODES-4]
Tests
text-align-001.xht (visual test)
(source)
text-align-bidi-001.xht (visual test)
(source)
text-align-bidi-006.xht (visual test)
(source)
text-align-bidi-007.xht (visual test)
(source)
right
Inline-level content is aligned
to the
line-right
edge of the line box.
(In vertical writing modes,
this can be either the physical top or bottom,
depending on
writing-mode
.)
[CSS-WRITING-MODES-4]
Tests
text-align-002.xht (visual test)
(source)
text-align-bidi-005.xht (visual test)
(source)
center
Inline-level content is centered within the line box.
Tests
text-align-003.xht (visual test)
(source)
text-align-bidi-002.xht (visual test)
(source)
text-align-bidi-003.xht (visual test)
(source)
text-align-bidi-004.xht (visual test)
(source)
text-align-inherit-001.xht (visual test)
(source)
text-align-center-last-center.html
(live test)
(source)
The string must be a single character;
otherwise the declaration is invalid and must be
ignored
When applied to a table cell, specifies the
alignment character
around which the cell’s contents will align.
See
below
for further details
and how this value combines with keywords.
justify
Text is justified
according to the method specified by the
text-justify
property,
in order to exactly fill the line box.
Unless otherwise specified by
text-align-last
the last line before a forced break
or the end of the block
is
start
-aligned.
Tests
text-align-justify-001.html
(live test)
(source)
text-align-justify-002.html
(live test)
(source)
text-align-justify-003.html
(live test)
(source)
text-align-justify-004.html
(live test)
(source)
text-align-justify-005.html
(live test)
(source)
text-align-justify-006.html
(live test)
(source)
text-align-justify-shy-001.html
(live test)
(source)
text-align-justify-bidi-control.html
(live test)
(source)
letter-spacing-justify-001.xht
(live test)
(source)
text-align-004.xht (visual test)
(source)
text-align-bidi-008.xht (visual test)
(source)
text-align-bidi-009.xht (visual test)
(source)
text-align-bidi-010.xht (visual test)
(source)
text-align-bidi-012.xht (visual test)
(source)
text-align-bidi-013.xht (visual test)
(source)
text-align-white-space-002.xht
(live test)
(source)
text-align-white-space-004.xht
(live test)
(source)
text-align-white-space-006.xht
(live test)
(source)
text-align-white-space-008.xht
(live test)
(source)
word-spacing-justify-001.xht
(live test)
(source)
justify-all
Sets both
text-align-all
and
text-align-last
to
justify
forcing the last line to justify as well.
Tests
text-align-justifyall-001.html
(live test)
(source)
text-align-justifyall-002.html
(live test)
(source)
text-align-justifyall-003.html
(live test)
(source)
text-align-justifyall-004.html
(live test)
(source)
text-align-justifyall-005.html
(live test)
(source)
text-align-justifyall-006.html
(live test)
(source)
letter-spacing-bidi-003.xht
(live test)
(source)
match-parent
This value behaves the same as
inherit
(computes to its parent’s computed value)
except that an
inherited value
of
start
or
end
is interpreted against the parent’s
direction
value
and results in a computed value of either
left
or
right
Computes to
start
when specified on the
root element
Tests
text-align-match-parent-001.html
(live test)
(source)
text-align-match-parent-002.html
(live test)
(source)
text-align-match-parent-01.html
(live test)
(source)
text-align-match-parent-02.html
(live test)
(source)
text-align-match-parent-03.html
(live test)
(source)
text-align-match-parent-04.html
(live test)
(source)
text-align-match-parent-root-ltr.html
(live test)
(source)
text-align-match-parent-root-rtl.html
(live test)
(source)
text-align-match-parent-root-logical.html
(live test)
(source)
When specified on the
text-align
shorthand,
sets both
text-align-all
and
text-align-last
to
match-parent
Tests
text-align-match-parent-05.html
(live test)
(source)
A block of text
is a stack of
line boxes
This property specifies how the inline-level boxes within each line box
align with respect to the start and end sides of the line box.
Alignment is not with respect to the
viewport
or containing block.
In the case of
justify
the UA may stretch or shrink any inline boxes
by
adjusting
their text.
(See
text-justify
.)
If an element’s
white space
is not
collapsible
then the UA is not required to adjust its text
for the purpose of justification
and may instead treat the text
as having no
justification opportunities
If the UA chooses to adjust the text,
then it must ensure
that
tab stops
continue to line up as required by the
white space processing rules
Tests
text-align-white-space-001.xht
(live test)
(source)
text-align-white-space-005.xht
(live test)
(source)
text-align-justify-tabs-001.html
(live test)
(source)
text-align-justify-tabs-002.html
(live test)
(source)
text-align-justify-tabs-003.html
(live test)
(source)
text-align-justify-tabs-004.html
(live test)
(source)
If (after justification, if any)
the inline contents of a line box are too long to fit within it,
then the contents are
start
-aligned:
any content that doesn’t fit
overflows the line box’s
end
edge.
See
§ 9.3 Bidirectionality and Line Boxes
for details on how to determine
the
start
and
end
edges
of a line box.
7.2.
Character-based Alignment in a Table Column
Tests
This section lacks tests.
When multiple cells in a column have an alignment character specified,
the alignment character of each such cell in the column
is centered along a single column-parallel axis
and the rest of the text in the column shifted accordingly.
(Note that the strings do not have to be the same for each cell,
although they usually are.)
Is this intended to say that it’s the centers
of the alignment characters that should be aligned?
It’s not clear that’s what it says,
but that (or a different behavior) needs to be specified,
to describe what happens
when different occurrences of the alignment character
are in different fonts.
(Further, is that the intended behavior? Probably the most
significant use case to consider is bold vs. non-bold text,
which only varies slightly in width.)
feedback
[minutes face-to-face 2016-02-02 10:00 AM]
The following style sheet:
TD { text-align: "." center }
will cause the column of dollar figures in the following HTML table: Long distance calls $1.30 $2.50 $10.80 $111.01 $85. N/A $.05 $.06
to align along the decimal point. The table might be rendered as
follows:
+---------------------+
| Long distance calls |
+---------------------+
| $1.30 |
| $2.50 |
| $10.80 |
| $111.01 |
| $85. |
| N/A |
| $.05 |
| $.06 |
+---------------------+
A keyword value may be specified in conjunction with the
value;
if it is not given, it defaults to
right
This value is used:
when character-based alignment is applied
to boxes that are not table cells.
when the text wraps to multiple lines (at unforced break points).
when a character-aligned cell spans more than one column.
In this case the keyword alignment value is used
to determine which column’s axis to align with:
the leftmost column for
left
the rightmost column for
right
and
center
the startmost column for
start
the endmost column for
end
when the column is wide enough that the character alignment alone
does not determine the positions of its character-aligned contents.
In this case the keyword alignment of the first cell in the column
with a specified alignment character
is used to slide the position of the character-aligned contents
to match the keyword alignment
insofar as possible without changing the width of the column.
For
center
the UA may center the aligned contents using its extremes,
center the alignment axis itself (insofar as possible),
or optically center the aligned contents some other way
(such as by taking a weighted average
of the extent of the cells' contents to either side of the axis).
Note:
Right alignment is used by default for character-based alignment
because numbering systems are almost all left-to-right
even in right-to-left writing systems,
and the primary use case of character-based alignment
is for numerical alignment.
If the alignment character appears more than once in the text,
the first instance is used for alignment.
If the alignment character does not appear in a cell at all,
the string is aligned as if
the alignment character had been inserted at the end of its contents.
This needs to specify what text is searched
for the alignment character.
Is it only in-flow text whose containing block is the cell?
Or is text within any in-flow descendants
in the block formatting context established by the cell considered?
If so, is it considered only as long as its
text-align
property
is consistent with the cell’s?
(Consistent in the alignment character, or fully consistent?)
This behavior of aligning as though the alignment character
had been inserted at the end of the contents of the cell,
combined with center-of-character alignment,
will produce gaps on the end-side of lines
that are alone on a line with
text-alignment,
when none of the lines of the column has the alignment character,
or, more importantly, when some of the lines
do have the alignment character,
but the column is not laid out at its max-content width.
This is probably undesirable.
When the alignment character is inserted
at the end of the contents,
which font is used?
(In particular, if the alignment character might be within a descendant block,
is it the font of the block or the font of the table cell?
Or if the insertion is at a forced break within an inline,
does it use the font of the inline or the font of the block or cell?)
Character-based alignment occurs before table cell width computation
so that auto width computations can leave enough space for alignment.
Whether column-spanning cells participate in the alignment
prior to or after width computation is undefined.
If width constraints on the cell contents prevent
full alignment throughout the column,
the resulting alignment is undefined.
This should have a formal definition
of how character alignment affects
the min-content and max-content intrinsic widths
(of table columns and all content that can be inside table columns).
Max-content intrinsic widths need to be split
into three numbers (assuming that it’s the centers of the
alignment character that are aligned):
one for widths without alignment characters,
one for widths on the inline-start side
of the center of the alignment character,
one for widths on the inline-end side
of the center of the alignment character.
This operates based on all segments of text
between forced breaks for max-content widths.
For min-content widths, segments of text between forced breaks
that contain optional breaks within them should clearly contribute
only to the without-alignment-character width.
However, it’s less clear
whether all min-content widths should work this way,
or whether segments between forced breaks
that do not have optional breaks
(and perhaps only those that actually contain the alignment character)
should contribute to start-side-of-alignment-character
and end-side-of-alignment-character min-content widths instead;
this choice is a tradeoff between the meaning of min-content
sizing of a table meaning the narrowest reasonable size versus
honoring alignment characters in more cases.
Another option might be to use whether line-breaking of optional breaks
is allowed as a control for which behavior to use.
Formally defining the intrinsic width contributions
of column-spanning cells with
values of
text-align
is a complicated (although straightforward) extension
of the decisions made for intrinsic width contributions
of non-column-spanning cells;
this should also be formally defined.
Contributions end up being made to the split intrinsic widths
of the startmost or endmost column (whichever is used for alignment),
and to the without-alignment-character intrinsic widths
of the other spanned columns.
7.3.
Default Text Alignment: the
text-align-all
property
Tests
This section lacks tests.
Name:
text-align-all
Value:
start
end
left
right
center
justify
match-parent
Initial:
start
Applies to:
block containers
Inherited:
yes
Percentages:
n/a
Computed value:
keyword as specified, except for
match-parent
which computes as defined above
Canonical order:
n/a
Animation type:
discrete
Tests
inheritance.html
(live test)
(source)
text-align-all-valid.html
(live test)
(source)
text-align-all-invalid.html
(live test)
(source)
This longhand of the
text-align
shorthand property
specifies the inline alignment of all lines of inline content in the block container,
except for last lines
overridden by a non-
auto
value of
text-align-last
See
text-align
for a full description of values.
Authors should use the
text-align
shorthand instead of this property.
7.4.
Last Line Alignment: the
text-align-last
property
Tests
This section has fairly good test coverage:
all value combinations for text-align / text-align-last are exercised,
except for text-align-last: match-parent (which is exercised, but in a more limited way).
Missing tests:
* tests for Animation type
Name:
text-align-last
Value:
auto
start
end
left
right
center
justify
match-parent
Initial:
auto
Applies to:
block containers
Inherited:
yes
Percentages:
n/a
Computed value:
keyword as specified, except for
match-parent
which computes as defined above
Canonical order:
n/a
Animation type:
discrete
Tests
inheritance.html
(live test)
(source)
text-align-last-valid.html
(live test)
(source)
text-align-last-invalid.html
(live test)
(source)
text-align-last-computed.html
(live test)
(source)
text-align-last-013.html (visual test)
(source)
text-align-last-014.html (visual test)
(source)
text-align-last-justify-br.html
(live test)
(source)
This property describes how the last line of a block or a line
right before a
forced line break
is aligned.
Tests
text-align-last-001.html (visual test)
(source)
text-align-last-002.html (visual test)
(source)
text-align-last-003.html (visual test)
(source)
text-align-last-004.html (visual test)
(source)
text-align-last-005.html (visual test)
(source)
text-align-last-006.html (visual test)
(source)
text-align-last-010.html
(live test)
(source)
text-align-last-011.html
(live test)
(source)
text-align-last-012.html (visual test)
(source)
text-align-last-wins-001.html
(live test)
(source)
If
auto
is specified,
content on the affected line is aligned per
text-align-all
unless
text-align-all
is set to
justify
in which case it is
start
-aligned.
All other values are interpreted as described for
text-align
Tests
text-align-last-007.html (visual test)
(source)
text-align-last-008.html (visual test)
(source)
text-align-last-009.html (visual test)
(source)
text-align-center-last-center.html
(live test)
(source)
text-align-center-last-default.html
(live test)
(source)
text-align-center-last-end.html
(live test)
(source)
text-align-center-last-justify.html
(live test)
(source)
text-align-center-last-start.html
(live test)
(source)
text-align-default-last-default.html
(live test)
(source)
text-align-end-last-center.html
(live test)
(source)
text-align-end-last-default.html
(live test)
(source)
text-align-end-last-end.html
(live test)
(source)
text-align-end-last-justify.html
(live test)
(source)
text-align-end-last-start.html
(live test)
(source)
text-align-inline-end-crash.html
(live test)
(source)
text-align-justify-last-center.html
(live test)
(source)
text-align-justify-last-default.html
(live test)
(source)
text-align-justify-last-end.html
(live test)
(source)
text-align-justify-last-justify.html
(live test)
(source)
text-align-justify-last-start.html
(live test)
(source)
text-align-last-center.html
(live test)
(source)
text-align-last-end.html
(live test)
(source)
text-align-last-interpolation.html
(live test)
(source)
text-align-last-justify-rtl.html
(live test)
(source)
text-align-last-justify.html
(live test)
(source)
text-align-last-simple.html
(live test)
(source)
text-align-last-start.html
(live test)
(source)
text-align-start-last-center.html
(live test)
(source)
text-align-start-last-default.html
(live test)
(source)
text-align-start-last-end.html
(live test)
(source)
text-align-start-last-justify.html
(live test)
(source)
text-align-start-last-start.html
(live test)
(source)
text-align-match-parent-05.html
(live test)
(source)
text-align-last-015.html
(live test)
(source)
7.5.
Justification Method: the
text-justify
property
Tests
This section has light test coverage.
All values (other than auto) are tested,
but the tests are minimal.
Not sure we can do better though.
Missing tests:
* Applies to text
* no-compress
* ruby
Untestable(?):
* behavior of auto
Name:
text-justify
Value:
[ auto
none
inter-word
inter-character
ruby ]
||
no-compress
Initial:
auto
Applies to:
text
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword (except for the
distribute
legacy value)
Canonical order:
n/a
Animation type:
discrete
Tests
inheritance.html
(live test)
(source)
text-justify-valid.html
(live test)
(source)
text-justify-invalid.html
(live test)
(source)
text-justify-computed.html
(live test)
(source)
text-justify-006.html
(live test)
(source)
text-justify-interpolation.html
(live test)
(source)
This property selects the justification method
used when a line’s alignment is set to
justify
(see
text-align
).
The property applies to text,
but is inherited from block containers
to the root inline box containing their inline-level contents.
It takes the following values:
Tests
text-justify-006.html
(live test)
(source)
auto
The UA determines the justification algorithm to follow,
based on a balance between performance and adequate presentation quality.
Since justification rules vary by
writing system
and
language
UAs should, where possible,
use a justification algorithm appropriate to the text.
Tests
letter-spacing-justify-001.xht
(live test)
(source)
word-spacing-justify-001.xht
(live test)
(source)
For example,
the UA could use by default a justification method
that is a simple universal compromise for all writing systems—such as primarily expanding
word separators
and between CJK
typographic letter units
along with secondarily expanding
between Southeast Asian
typographic letter units
Then, in cases where the
content language
of the paragraph is known,
it could choose a more language-tailored justification behavior
e.g. following the
Requirements for Japanese Text Layout
for Japanese
[JLREQ]
using cursive elongation for Arabic,
using
inter-word
for German,
etc.
An example of cursively-justified Arabic text,
rendered by
Tasmeem
Like English,
Arabic can be justified by adjusting the spacing between words,
but in most styles
it can also be justified by calligraphically elongating
or compressing the letterforms themselves.
In this example,
the upper text is extended to fill the line
by the use of elongated (kashida) forms and swash forms,
while the bottom line is compressed slightly
by using a stacked combination for the characters between ت and م.
By employing traditional calligraphic techniques,
a typesetter can justify the line while preserving flow and color,
providing a very high quality justification effect.
However, this is by its nature a very script-specific effect.
Mixed-script text with
text-justify: auto
this interpretation uses a universal-compromise justification method,
expanding at spaces as well as between CJK and Southeast Asian letters.
This effectively uses inter-word + inter-ideograph spacing
for lines that have word-separators and/or CJK characters
and falls back to inter-cluster behavior for lines that don’t
or for which the space stretches too far.
none
Justification is disabled:
there are no
justification opportunities
within the text.
Tests
text-justify-001.html
(live test)
(source)
text-justify-006.html
(live test)
(source)
text-justify-none-001.html
(live test)
(source)
Mixed-script text with
text-justify: none
Note:
This value is intended for use in user stylesheets
to improve readability or for accessibility purposes.
inter-word
Justification adjusts spacing at
word separators
only
(effectively varying the used
word-spacing
on the line).
This behavior is typical for languages that separate words using spaces,
like English or Korean.
Tests
text-justify-inter-word-001.html
(live test)
(source)
text-justify-word-separators.html
(live test)
(source)
Mixed-script text with
text-justify: inter-word
inter-character
Justification adjusts spacing
between each pair of adjacent
typographic character units
(effectively varying the used
letter-spacing
on the line).
This value is sometimes used in East Asian systems such as Japanese.
Tests
text-justify-002.html (visual test)
(source)
text-justify-inter-character-001.html
(live test)
(source)
Mixed-script text with
text-justify: inter-character
For legacy reasons,
UAs must also support the alternate keyword
distribute
which must compute to
inter-character
thus having the exact same meaning and behavior.
UAs may treat this as a
legacy value alias
Tests
text-justify-003.html (visual test)
(source)
text-justify-computed-legacy.html
(live test)
(source)
text-justify-distribute-001.html
(live test)
(source)
ruby
Justification adjusts spacing as for
auto
except
Justification opportunities
are disabled at
word separators
Justification opportunities
are disabled between
Bopomofo characters
Note:
This value is intended for use in
ruby annotations
providing a reasonable default alignment.
See
[CSS-RUBY-1]
no-compress
Justification must not compress spacing controlled by
text-spacing-trim
or
text-autospace
(If this value is not specified,
the justification process may reduce such spacing
except when the spacing is at the start or end of the line.)
Note:
An example of compression rules is given for Japanese
in 3.8 Line Adjustment in
[JLREQ]
This keyword used to be part of
text-spacing
it might need renaming to be more specific now that it’s here,
as it implies that e.g. U+0020 cannot be compressed.
[Issue #7079]
Since optimal justification is
language
-sensitive,
authors should correctly language-tag their content for the best results.
Note:
The guidelines in this level of CSS
do not describe a complete justification algorithm.
They are merely a minimum set of requirements
that a complete algorithm should meet.
Limiting the set of requirements gives UAs some latitude
in choosing a justification algorithm
that meets their needs and desired balance of quality, speed, and complexity.
7.5.1.
Expanding and Compressing Text
Tests
This section lacks tests.
Missing tests:
* whether a typographic character unit provides a justification opportunity is controlled by the text-justify value of its parent;
* whether a justification opportunity exists between two consecutive typographic character units is determined by the text-justify value of their nearest common ancestor.
* UAs must not break required ligatures or otherwise disable features required to correctly shape complex scripts
* … and maybe more
When justifying text,
the user agent takes the remaining space
between the ends of a line’s contents and the edges of its line box,
and distributes that space throughout its content
so that the contents exactly fill the line box.
The user agent may alternatively distribute negative space,
putting more content on the line
than would otherwise fit under normal spacing conditions.
justification opportunity
is a point
where the justification algorithm may alter spacing within the text.
A justification opportunity can be provided by a single
typographic character unit
(such as a
word separator
),
or by the juxtaposition of two
typographic character units
As with controls for
soft wrap opportunities
whether a
typographic character unit
provides a
justification opportunity
is controlled by the
text-justify
value of its parent;
similarly,
whether a
justification opportunity
exists
between two consecutive
typographic character units
is determined by the
text-justify
value of their nearest common ancestor.
Space distributed by justification is
in addition to
the spacing defined by the
letter-spacing
or
word-spacing
properties.
When such additional space is distributed
to a
word separator
justification opportunity
it is applied under the same rules as for
word-spacing
Similarly, when space is distributed
to a
justification opportunity
between two
typographic character units
should be applied under the same rules as for
letter-spacing
A justification algorithm may divide
justification opportunities
into different priority levels.
All
justification opportunities
within a given level
are expanded or compressed at the same priority,
regardless of which
typographic character units
created that opportunity.
For example,
if
justification opportunities
between two Han characters
and between two Latin letters
are defined to be at the same level
(as they are in the
inter-character
justification style),
they are not treated differently
because they originate from different
typographic character units
It is not defined in this level
whether or how other factors
(such as font size, letter-spacing, glyph shape, position within the line, etc.)
may influence the distribution of space to
justification opportunities
within the line.
The UA may enable or break optional ligatures
or use other font features
such as alternate glyphs or glyph compression
to help justify the text under any method.
This behavior is not controlled by this level of CSS.
However,
UAs
must not
break required ligatures
or otherwise disable features required to correctly shape complex scripts.
If a
justification opportunity
exists within a line,
and
text alignment
specifies full justification
justify
for that line,
it must be justified.
7.5.2.
Handling Symbols and Punctuation
Tests
This section lacks tests. Not sure what is testable though.
When determining
justification opportunities
typographic character unit
from the Unicode Symbols (S*) and Punctuation (P*) classes
is generally treated the same as a
typographic letter unit
of the same script
(or, if the character’s script property is Common,
then as a
typographic letter unit
of the dominant script).
However, by typographic tradition
there may be additional rules controlling the justification of symbols and punctuation.
Therefore, the UA may reassign specific characters
or introduce additional levels of prioritization
to handle
justification opportunities
involving symbols and punctuation.
For example, there are traditionally no
justification opportunities
between consecutive
U+2014 — EM DASH,
U+2015 ― HORIZONTAL BAR,
U+2026 … HORIZONTAL ELLIPSIS,
or U+2025 ‥ TWO DOT LEADER
characters
[JLREQ]
thus a UA might assign these characters to a “never” prioritization level.
As another example, certain full-width punctuation characters
(such as U+301A 〚 LEFT WHITE SQUARE BRACKET)
are considered to contain a
justification opportunity
in Japanese.
The UA might therefore assign these characters to a higher prioritization
level than the opportunities between ideographic characters.
7.5.3.
Unexpandable Text
Tests
This section has basic test coverage.
Missing tests:
* Values of text-align-last other than justify
* A broader range of non-stretchable content that just an empty span with padding
If the inline contents of a line cannot be stretched to the full width of the line box,
then they must be aligned as specified by the
text-align-last
property.
(If
text-align-last
is
justify
then they must be aligned as for
center
.)
Tests
text-align-last-empty-inline.html
(live test)
(source)
7.5.4.
Cursive Scripts
Tests
This section lacks automated tests.
Justification
must not
introduce gaps
between the joined
typographic letter units
of
cursive scripts
such as Arabic.
If it is able,
the UA
may
translate space distributed to
justification opportunities
within a run of such
typographic letter units
into some form of cursive elongation for that run.
It otherwise
must
assume that no
justification opportunity
exists
between any pair of
typographic letter units
in
cursive script
(regardless of whether they join).
Tests
text-justify-004.html (visual test)
(source)
text-justify-005.html (visual test)
(source)
The following are examples of unacceptable justification:
Adding gaps between every pair of Arabic letters
Adding gaps between every pair of unjoined Arabic letters
Some font designs allow for the use of the tatweel character for justification.
A UA that performs tatweel-based justification
must properly handle the rules for its use.
Note that correct insertion of tatweel characters depends on context,
including the letter-combinations involved,
location within the word,
and location of the word within the line.
7.5.5.
Minimum Requirements for
auto
Justification
Tests
This section lacks tests.
For
auto
justification,
this specification does not define
what all of the
justification opportunities
are,
how they are prioritized,
or when and how multiple levels of
justification opportunities
interact.
However, it does require that:
Unless contraindicated by the typographic traditions
of the
content language
or adjacent symbols/punctuation,
each of the following provides a
justification opportunity
Word separators
The boundary between a
typographic character unit
of any
block scripts
and any other
typographic character unit
The boundary between a
typographic character unit
of any
clustered scripts
and any other
typographic character unit
All
letters
belonging to all
block scripts
are treated the same,
and all
letters
belonging to all
clustered scripts
are treated the same.
For example, no distinction is made
between the justification opportunity
between a Han letter followed by another Han letter,
vs. the justification opportunity
between a Han letter followed by a Hangul letter.
Further information on text justification can be found in (or submitted to)
“Approaches to Full Justification”
which indexes by writing system and language,
and is maintained by the
W3C Internationalization Working Group
[JUSTIFY]
7.6.
Aligning a block of text within its container: the
text-group-align
property
Tests
This section has basic coverage.
Missing tests:
* not inherited
* animation type
* the contents of descendants that establish independent formatting contexts are skipped.
* works accross block containers within a single formatting context
* interaction with floats
* interaction with indents
Name:
text-group-align
Value:
none
start
end
left
right
center
Initial:
none
Applies to:
block containers
Inherited:
no
Percentages:
N/A
Computed value:
specified keyword
Canonical order:
per grammar
Animation type:
discrete
Tests
text-group-align-invalid.html
(live test)
(source)
text-group-align-valid.html
(live test)
(source)
This property aligns the contents of the line boxes as a group
while maintaining their text alignment.
Group alignment
is performed by finding the line box with the shortest remaining space
and adding that amount of space as padding to one or both sides of the line box,
reducing the amount of space available for its contents;
text alignment
is then applied
to its contents within the remaining space.
All descendant
in-flow
line boxes within the same
block formatting context
are considered
both when searching for the shortest remaining space
and when adding the padding;
the contents of descendants that establish
independent formatting contexts
are skipped.
Tests
text-group-align-center-vlr.html
(live test)
(source)
text-group-align-center.html
(live test)
(source)
text-group-align-end-vlr.html
(live test)
(source)
text-group-align-end.html
(live test)
(source)
text-group-align-left-vlr.html
(live test)
(source)
text-group-align-left.html
(live test)
(source)
text-group-align-right-vlr.html
(live test)
(source)
text-group-align-right.html
(live test)
(source)
text-group-align-start-vlr.html
(live test)
(source)
text-group-align-start.html
(live test)
(source)
A variant of this property is inherited,
and applies on each block container individually,
only affecting the line boxes that are direct children of that block.
This is less useful, but probably easier to implement.
Somehow also moving the floats that originate in the same block container
by the same amount
would make things line up more nicely,
which would be especially valuable in CJK layout.
Exactly how that works, and how it interacts with intruding floats
from ancestor elements is left as an exercise for the reader.
Values have the following meanings:
none
Text alignment happens normally:
group alignment
is not performed.
start
Inline-level content is
group-aligned
to the
inline start
side,
by padding the
inline end
side of each line box.
Tests
text-group-align-start-vlr.html
(live test)
(source)
text-group-align-start.html
(live test)
(source)
end
Inline-level content is
group-aligned
to the
inline end
side,
by padding the
inline start
side of each line box.
Tests
text-group-align-end-vlr.html
(live test)
(source)
text-group-align-end.html
(live test)
(source)
left
Inline-level content is
group-aligned
to the
line-left
side,
by padding the
line-right
side of each line box.
Tests
text-group-align-left-vlr.html
(live test)
(source)
text-group-align-left.html
(live test)
(source)
right
Inline-level content is
group-aligned
to the
line-right
side,
by padding the
line-left
side of each line box.
Tests
text-group-align-right-vlr.html
(live test)
(source)
text-group-align-right.html
(live test)
(source)
center
Inline-level content is
group-aligned
to the center,
by padding both sides of each line box,
half the spacing to each side.
Tests
text-group-align-center-vlr.html
(live test)
(source)
text-group-align-center.html
(live test)
(source)
7.7.
Text fitting: the
text-fit
property
Tests
This section has no coverage yet.
Name:
text-fit
Value:
[ none
grow
shrink ] [consistent
per-line
per-line-all]
Initial:
none
Applies to:
block containers
Inherited:
no
Percentages:
N/A
Computed value:
specified keywords or computed
value
Canonical order:
per grammar
Animation type:
discrete
The
text-fit
property describes how
inline-level
contents are
scaled if they do not fit to the
line box
Values have the following meanings:
none
The user agent doesn’t scale
inline-level
contents to fit to
the
line box
grow
The user agent scales up
inline-level
contents to fit to the
line box
shrink
The user agent scales down
inline-level
contents to fit to the
line box
consistent
Specifies that all lines in the container are scaled with a single
scaling factor.
This keyword has no effect if
none
is specified.
If none of
consistent
per-line
, or
per-line-all
are specified,
consistent
is
assumed.
per-line
Specifies that each line is scaled with its own scaling factor.
However, the last line of the block and lines that end in a forced
break are not scaled.
This keyword has no effect if
none
is specified.
per-line-all
Specifies that each line is scaled with its own scaling factor,
including the last line of the block and lines that end in a forced
break.
This keyword has no effect if
none
is specified.
Specifies the limit of the scaling factor.
If
grow
is specified and the value is 100% or greater,
it is the maximum scaling factor.
If
shrink
is specified and the value is between 0% and
100% inclusive, it is the minimum scaling factor.
Otherwise, or if this component is omitted, there is no limit on
the scaling factor.
This property provides a functionality to make
inline-level
contents
exactly fill the inline size of the
line box
Unlike
justify
of the
text-align
property, which achieves
this by adjusting spacing between characters, this property scales the
font size.
When
grow
or
shrink
is specified,
line scaling factor
is computed for each
line box
If
consistent
applies, all
line boxes
are scaled by the
smallest computed
line scaling factor
Otherwise, each
line box
is scaled by its own
line scaling factor
This property does not affect the
font-size
computed value
and thus does not affect font-size-relative
values of other properties.
For example, "line-height: 1.5em" and "letter-spacing: 0.1em" are not
affected by this scaling.
The
used value
of the text
font-size
is its
computed value
multiplied by the
line scaling factor
Scaling can change the
block size
of a
line box
which can in turn change its position along the
block-axis
If any feature is active that would cause the
inline size
of the
line box
to change based on its
block-axis
position (such as
float
or
initial-letter
), scaling is disabled for the block.
If the
inline size
of a block container depends on the size of
the viewport, its apparent
inline size
may not change even if
the user changes the page zoom level.
In that case, if text is fitted with this feature, the text size may
not change at all even though the zoom level has changed.
There is no agreement yet on how to deal with this issue. See
csswg#12886
7.7.1.
Computing line scaling factor
The parts of the
line box
’s contents that can be scaled by this
property are called
scalable parts
These include:
Text, including text in
inline boxes
, but excluding trailing
white space.
Spacing whose
inline size
is proportional to the
font-size
used value.
E.g. percentage-based
letter-spacing
or
word-spacing
, and
text-autospace
text-indent
line-padding
, non-percentage-based
letter-spacing
and
word-spacing
, and
atomic inlines
are not
scalable parts
The
inline-axis
padding
border
, and
margin
of inline boxes are
also not
scalable parts
line scaling factor
is the ratio by which the
scalable parts
of a line must be scaled in order to make its
inline-level
content exactly fit the
line box
’s
inline size
line scaling factor
is computed from:
The total
inline size
of the
scalable parts
in the line.
The remaining space in the
line box
, including any trailing whitespace
(which may be negative if the content overflows the
line box
).
If a
is specified, it clamps the
line scaling factor
A simple calculation for the
line scaling factor
would be
(A + B) / A
, where A is the total
inline size
of
scalable parts
and B is the remaining space.
However, due to
optical sizing
, the
inline size
of text might not be perfectly proportional to its
font-size
The exact method for determining a reasonable
line scaling factor
is up to the implementation.
The
line scaling factor
for a
line box
with no
scalable parts
is 1.
8.
Spacing
Tests
Tests only needed in subsections.
CSS offers control over regular text spacing
via the
word-spacing
letter-spacing
, and
line-padding
properties,
which specify additional space
around
word separators
between
typographic character units
or at the start/end of the line,
respectively.
It also provides contextual control over spacing
via the
text-spacing-trim
property,
which allows for contextual fullwidth vs halfwidth setting of CJK punctuation;
and the
text-autospace
property,
which allows automatic insertion of extra space
at script changes or around punctuation.
8.1.
Word Spacing: the
word-spacing
property
Tests
This section has limited test coverage.
Missing tests:
* Applies to text
* inherit lengths as absolute
* values may be negative
* computed / resolved value of normal
* should be applied half on each side of the character unless otherwise dictated by typographic tradition.
* doesn’t do anything between words defined by text analysis like in Thai, only on actual word separators
* works on the Ethiopic word space (U+1361), the Aegean word separators (U+10100,U+10101), the Ugaritic word divider (U+1039F), and the Phoenician Word Separator (U+1091F).
* word-spacing and bidi
Name:
word-spacing
Value:
normal
Initial:
normal
Applies to:
text
Inherited:
yes
Percentages:
relative to used
font-size
Computed value:
an absolute length and/or a percentage
Canonical order:
n/a
Animation type:
by computed value type
Tests
inheritance.html
(live test)
(source)
word-spacing-valid.html
(live test)
(source)
word-spacing-invalid.html
(live test)
(source)
word-spacing-computed.html
(live test)
(source)
word-spacing-interpolation.html
(live test)
(source)
word-spacing-composition.html
(live test)
(source)
c541-word-sp-000.xht
(live test)
(source)
c541-word-sp-001.xht
(live test)
(source)
word-spacing-101.xht
(live test)
(source)
word-spacing-applies-to-001.xht
(live test)
(source)
word-spacing-applies-to-002.xht
(live test)
(source)
word-spacing-applies-to-003.xht
(live test)
(source)
word-spacing-applies-to-005.xht
(live test)
(source)
word-spacing-applies-to-006.xht
(live test)
(source)
word-spacing-applies-to-007.xht
(live test)
(source)
word-spacing-applies-to-008.xht
(live test)
(source)
word-spacing-applies-to-009.xht
(live test)
(source)
word-spacing-applies-to-010.xht
(live test)
(source)
word-spacing-applies-to-011.xht
(live test)
(source)
word-spacing-applies-to-012.xht
(live test)
(source)
word-spacing-applies-to-013.xht
(live test)
(source)
word-spacing-applies-to-014.xht
(live test)
(source)
word-spacing-applies-to-015.xht
(live test)
(source)
word-spacing-justify-001.xht
(live test)
(source)
This property specifies additional spacing
between “words”.
Values are interpreted as defined below:
normal
No additional spacing is applied.
Computes to zero.
Tests
word-spacing-100.xht
(live test)
(source)
word-spacing-computed-001.html
(live test)
(source)
Specifies extra spacing
in addition to
the intrinsic inter-word spacing
defined by the font.
Tests
word-spacing-001.html
(live test)
(source)
word-spacing-002.html
(live test)
(source)
word-spacing-percent-001.html
(live test)
(source)
tab-size-spacing-001.html
(live test)
(source)
Note:
Percentages inherit intact,
and are resolved against
the computed
font-size
of the current element
(and thus represent a size relative to
the size of the text to which they apply),
unlike
em
units which are resolved against
the computed
font-size
of the element from which they inherit,
as an absolute length.
Tests
word-spacing-004.xht
(live test)
(source)
word-spacing-005.xht
(live test)
(source)
word-spacing-006.xht
(live test)
(source)
word-spacing-007.xht
(live test)
(source)
word-spacing-008.xht
(live test)
(source)
word-spacing-016.xht
(live test)
(source)
word-spacing-017.xht
(live test)
(source)
word-spacing-018.xht
(live test)
(source)
word-spacing-019.xht
(live test)
(source)
word-spacing-020.xht
(live test)
(source)
word-spacing-028.xht
(live test)
(source)
word-spacing-029.xht
(live test)
(source)
word-spacing-030.xht
(live test)
(source)
word-spacing-031.xht
(live test)
(source)
word-spacing-032.xht
(live test)
(source)
word-spacing-040.xht
(live test)
(source)
word-spacing-041.xht
(live test)
(source)
word-spacing-042.xht
(live test)
(source)
word-spacing-043.xht
(live test)
(source)
word-spacing-044.xht
(live test)
(source)
word-spacing-052.xht
(live test)
(source)
word-spacing-053.xht
(live test)
(source)
word-spacing-054.xht
(live test)
(source)
word-spacing-055.xht
(live test)
(source)
word-spacing-056.xht
(live test)
(source)
word-spacing-064.xht
(live test)
(source)
word-spacing-065.xht
(live test)
(source)
word-spacing-066.xht
(live test)
(source)
word-spacing-067.xht
(live test)
(source)
word-spacing-068.xht
(live test)
(source)
word-spacing-076.xht
(live test)
(source)
word-spacing-077.xht
(live test)
(source)
word-spacing-078.xht
(live test)
(source)
word-spacing-079.xht
(live test)
(source)
word-spacing-080.xht
(live test)
(source)
word-spacing-088.xht
(live test)
(source)
word-spacing-089.xht
(live test)
(source)
word-spacing-090.xht
(live test)
(source)
word-spacing-091.xht
(live test)
(source)
word-spacing-092.xht
(live test)
(source)
word-spacing-097.xht
(live test)
(source)
word-spacing-098.xht
(live test)
(source)
word-spacing-099.xht
(live test)
(source)
Additional spacing is applied to each
word separator
left in the text
after the
white space processing rules
have been applied,
and should be applied half on each side of the character
unless otherwise dictated by typographic tradition.
Values may be negative, but there may be implementation-dependent limits.
Tests
word-spacing-remove-space-001.xht
(live test)
(source)
word-spacing-remove-space-002.xht
(live test)
(source)
word-spacing-remove-space-003.xht
(live test)
(source)
word-spacing-remove-space-004.xht
(live test)
(source)
word-spacing-remove-space-005.xht
(live test)
(source)
word-spacing-remove-space-006.xht
(live test)
(source)
word-spacing-negative-value-001.html
(live test)
(source)
Word-separator characters
are
typographic character units
whose primary purpose and general usage is to separate words.
In Unicode this includes
(but is not exhaustively defined as)
the space (U+0020),
the no-break space (U+00A0),
the Ethiopic word space (U+1361),
the Aegean word separators (U+10100,U+10101),
the Ugaritic word divider (U+1039F),
and the Phoenician word separator (U+1091F).
[UNICODE]
Tests
word-spacing-characters-001.xht
(live test)
(source)
Note:
Neither punctuation in general,
nor fixed-width spaces (such as U+3000 and U+2000 through U+200A),
are considered
word-separator characters
because even though they frequently happen to separate words,
their primary purpose is not to separate words.
Tests
word-spacing-characters-002.xht
(live test)
(source)
If there are no
word-separator characters
or if a word-separating character has a zero advance width
(such as U+200B ZERO WIDTH SPACE)
then the user agent must not create an additional spacing between words.
Tests
word-spacing-characters-003.xht
(live test)
(source)
8.2.
Tracking: the
letter-spacing
property
Tests
This section has partial test coverage.
Missing tests:
* Applies to text
* Due to
issue 1518
, some/many tests in this section should be converted from MUST to SHOULD.
* inherit lengths as absolute
* For legacy reasons, a computed letter-spacing of zero yields a resolved value (getComputedStyle() return value) of normal.
* However, ligatures and other font features specified via the low-level font-feature-settings property take precedence over this rule
Name:
letter-spacing
Value:
normal
Initial:
normal
Applies to:
inline boxes
and text
Inherited:
yes
Percentages:
relative to used
font-size
Computed value:
an absolute length and/or a percentage
Canonical order:
n/a
Animation type:
by computed value type
Tests
inheritance.html
(live test)
(source)
letter-spacing-valid.html
(live test)
(source)
letter-spacing-invalid.html
(live test)
(source)
letter-spacing-computed.html
(live test)
(source)
letter-spacing-interpolation.html
(live test)
(source)
letter-spacing-composition.html
(live test)
(source)
letter-spacing-nesting-003.xht
(live test)
(source)
letter-spacing-bidi-003.xht
(live test)
(source)
letter-spacing-bidi-004.xht
(live test)
(source)
letter-spacing-bidi-005.xht
(live test)
(source)
letter-spacing-200.html
(live test)
(source)
letter-spacing-201.html
(live test)
(source)
letter-spacing-203.html
(live test)
(source)
letter-spacing-206.html
(live test)
(source)
letter-spacing-end-of-line-002.html
(live test)
(source)
c542-letter-sp-000.xht
(live test)
(source)
c542-letter-sp-001.xht
(live test)
(source)
letter-spacing-applies-to-001.xht
(live test)
(source)
letter-spacing-applies-to-002.xht
(live test)
(source)
letter-spacing-applies-to-003.xht
(live test)
(source)
letter-spacing-applies-to-005.xht
(live test)
(source)
letter-spacing-applies-to-006.xht
(live test)
(source)
letter-spacing-applies-to-007.xht
(live test)
(source)
letter-spacing-applies-to-008.xht
(live test)
(source)
letter-spacing-applies-to-009.xht
(live test)
(source)
letter-spacing-applies-to-010.xht
(live test)
(source)
letter-spacing-applies-to-011.xht
(live test)
(source)
letter-spacing-applies-to-012.xht
(live test)
(source)
letter-spacing-applies-to-013.xht
(live test)
(source)
letter-spacing-applies-to-014.xht
(live test)
(source)
letter-spacing-applies-to-015.xht
(live test)
(source)
This property specifies additional spacing
(commonly called
tracking
between adjacent
typographic character units
Letter-spacing is applied after
bidi reordering
and is in addition to
kerning
and
word-spacing
[CSS-WRITING-MODES-4]
[CSS-FONTS-3]
Depending on the justification rules in effect,
user agents may further increase or decrease the space
between
typographic character units
in order to
justify text
Tests
letter-spacing-bidi-001.html
(live test)
(source)
letter-spacing-bidi-004.xht
(live test)
(source)
letter-spacing-nesting-003.xht
(live test)
(source)
letter-spacing-bidi-003.xht
(live test)
(source)
letter-spacing-bidi-004.xht
(live test)
(source)
letter-spacing-bidi-005.xht
(live test)
(source)
letter-spacing-206.html
(live test)
(source)
letter-spacing-211.html
(live test)
(source)
letter-spacing-212.html
(live test)
(source)
letter-spacing-bengali-yaphala-001.html
(live test)
(source)
bidi-005.xht
(live test)
(source)
bidi-006.xht
(live test)
(source)
bidi-007.xht
(live test)
(source)
bidi-008.xht
(live test)
(source)
bidi-009.xht
(live test)
(source)
bidi-010.xht
(live test)
(source)
bidi-005a.xht
(live test)
(source)
bidi-005b.xht
(live test)
(source)
bidi-006a.xht
(live test)
(source)
bidi-006b.xht
(live test)
(source)
bidi-007b.xht
(live test)
(source)
bidi-008b.xht
(live test)
(source)
bidi-009b.xht
(live test)
(source)
bidi-010b.xht
(live test)
(source)
letter-spacing-justify-001.xht
(live test)
(source)
Values have the following meanings:
normal
No additional spacing is applied. Computes to zero.
Tests
letter-spacing-100.xht
(live test)
(source)
Specifies
additional
spacing
between
typographic character units
Values may be negative,
but there may be implementation-dependent limits.
Tests
tab-size-spacing-001.html
(live test)
(source)
Note:
Percentages inherit intact,
and are resolved against
the computed
font-size
of the current element
(and thus represent a size relative to
the size of the text to which they apply),
unlike
em
units which are resolved against
the computed
font-size
of the element from which they inherit,
as an absolute length.
Tests
letter-spacing-004.xht
(live test)
(source)
letter-spacing-005.xht
(live test)
(source)
letter-spacing-006.xht
(live test)
(source)
letter-spacing-007.xht
(live test)
(source)
letter-spacing-008.xht
(live test)
(source)
letter-spacing-016.xht
(live test)
(source)
letter-spacing-017.xht
(live test)
(source)
letter-spacing-018.xht
(live test)
(source)
letter-spacing-019.xht
(live test)
(source)
letter-spacing-020.xht
(live test)
(source)
letter-spacing-028.xht
(live test)
(source)
letter-spacing-029.xht
(live test)
(source)
letter-spacing-030.xht
(live test)
(source)
letter-spacing-031.xht
(live test)
(source)
letter-spacing-032.xht
(live test)
(source)
letter-spacing-040.xht
(live test)
(source)
letter-spacing-041.xht
(live test)
(source)
letter-spacing-042.xht
(live test)
(source)
letter-spacing-043.xht
(live test)
(source)
letter-spacing-044.xht
(live test)
(source)
letter-spacing-052.xht
(live test)
(source)
letter-spacing-053.xht
(live test)
(source)
letter-spacing-054.xht
(live test)
(source)
letter-spacing-055.xht
(live test)
(source)
letter-spacing-056.xht
(live test)
(source)
letter-spacing-064.xht
(live test)
(source)
letter-spacing-065.xht
(live test)
(source)
letter-spacing-066.xht
(live test)
(source)
letter-spacing-067.xht
(live test)
(source)
letter-spacing-068.xht
(live test)
(source)
letter-spacing-076.xht
(live test)
(source)
letter-spacing-077.xht
(live test)
(source)
letter-spacing-078.xht
(live test)
(source)
letter-spacing-079.xht
(live test)
(source)
letter-spacing-080.xht
(live test)
(source)
letter-spacing-088.xht
(live test)
(source)
letter-spacing-089.xht
(live test)
(source)
letter-spacing-090.xht
(live test)
(source)
letter-spacing-091.xht
(live test)
(source)
letter-spacing-092.xht
(live test)
(source)
letter-spacing-097.xht
(live test)
(source)
letter-spacing-098.xht
(live test)
(source)
letter-spacing-099.xht
(live test)
(source)
letter-spacing-101.xht
(live test)
(source)
letter-spacing-102.xht
(live test)
(source)
letter-spacing-percent-001.html
(live test)
(source)
For
legacy reasons
a computed
letter-spacing
of zero
yields a
resolved value
getComputedStyle()
return value)
of
normal
For the purpose of
letter-spacing
each consecutive run of
atomic inlines
(such as images and inline blocks)
is treated as a single
typographic character unit
Tests
letter-spacing-204.html
(live test)
(source)
Letter-spacing must not be applied at the beginning of a line.
Whether letter-spacing is applied at the end of a line is undefined in this level.
Tests
letter-spacing-trim-start-001.html
(live test)
(source)
letter-spacing-trim-start-002.html
(live test)
(source)
letter-spacing-end-of-line-001.html
(live test)
(source)
tab-size-spacing-001.html
(live test)
(source)
letter-spacing-200.html
(live test)
(source)
letter-spacing-201.html
(live test)
(source)
white-space-letter-spacing-001.html
(live test)
(source)
When letter-spacing is not applied at the beginning or end of a line,
text always fits flush with the edge of the block.
letter-spacing
em
abc
a b c
a b c
UAs therefore
really should not
[RFC6919]
append letter spacing to the right or trailing edge of a line:
a b c
Letter spacing between two
typographic character units
effectively “belongs” to the innermost element
that contains the two
typographic character units
the total letter spacing between two adjacent
typographic character units
(after bidi reordering)
is specified by and rendered within the innermost element
that
contains
the boundary
between the two
typographic character units
However, the UA may instead attach letter-spacing at element boundaries
to one or the other
typographic character unit
using the letter-spacing value pertaining to its containing element.
Note:
This secondary behavior is permitted in this level
due to Web-compat concerns.
Tests
letter-spacing-bidi-002.html
(live test)
(source)
letter-spacing-bidi-004.xht
(live test)
(source)
letter-spacing-bidi-005.xht
(live test)
(source)
letter-spacing-nesting-001.html
(live test)
(source)
letter-spacing-nesting-002.html
(live test)
(source)
letter-spacing-nesting-003.xht
(live test)
(source)
letter-spacing-203.html
(live test)
(source)
letter-spacing-205.html
(live test)
(source)
An inline box is expected to only include
letter spacing between characters completely contained within that element,
thus excluding letter spacing on the right or trailing edge of the element:
letter-spacing
em
span
bb
span
b b
b b
Consequently a given value of
letter-spacing
is expected
to only affect the spacing between characters
completely contained within the element for which it is specified:
letter-spacing
em
span
letter-spacing
em
span
bb
span
b b
This further implies that applying
letter-spacing
to
an element containing only a single character
has no effect on the rendered result:
letter-spacing
em
span
letter-spacing
em
span
span
Since letter spacing is inserted
after
RTL reordering,
the letter spacing applied to the inner span below likewise has no effect,
since after reordering the "c" doesn’t end up next to "א":
letter-spacing
em
span
letter-spacing
em
ab
span
cא
span
בג
a b
ב ג
Letter spacing ignores invisible zero-width formatting characters
(such as those from the Unicode Cf category).
Spacing must be added as if those characters did not exist in the document.
Tests
letter-spacing-control-chars-001.html
(live test)
(source)
letter-spacing-202.html
(live test)
(source)
For example,
letter-spacing
applied to
is identical to
AB
regardless of where any element boundaries might fall.
When the effective spacing between two characters is not zero
(due to either
justification
or a non-zero value of
letter-spacing
),
user agents should not apply optional ligatures,
i.e. those that are not defined as required
for fundamentally correct glyph shaping.
However, ligatures and other font features
specified via the low-level
font-feature-settings
property
take precedence over this rule.
See
CSS Fonts Module Level 3 § feature-precedence
Tests
letter-spacing-ligatures-001.html
(live test)
(source)
letter-spacing-ligatures-002.html
(live test)
(source)
letter-spacing-ligatures-003.html
(live test)
(source)
letter-spacing-ligatures-004.html
(live test)
(source)
For example, if the word “filial” is letter-spaced,
an “fi” ligature should not be used
as it will prevent even spacing of the text.
filial
vs
filial
Note:
In OpenType, required ligatures are expected
to be associated to the
rlig
feature.
All other ligatures are therefore considered optional.
In some cases, however, UA or platform heuristics
apply additional ligatures in order to handle broken fonts;
this specification does not define or override such exceptional handling.
8.2.1.
Cursive Scripts
Tests
This section lacks tests. Not sure automated tests are possible.
If it is able,
the UA
may
apply letter spacing to
cursive scripts
by translating the total extra space to be distributed to a run of such letters
into some form of cursive elongation
(or compression, for negative tracking values)
for that run
that results in an equivalent total expansion (or compression) of the run.
Otherwise,
if the UA cannot expand text from a
cursive script
without breaking its cursive connections,
it
must not
apply spacing
between any pair of that script’s
typographic letter units
at all
(effectively treating each word as a single
typographic letter unit
for the purpose of letter-spacing).
Both cases will result in an effective spacing of zero between such letters;
however the former will preserve the sense of stretching out the text.
Below are some appropriate and inappropriate examples of spacing out Arabic text.
Original text
BAD
Even distribution of space between each letter.
Notice this breaks cursive joins!
OK
Distributing ∑
letter-spacing
by typographically-appropriate cursive elongation.
The resulting text is as long as the previous evenly-spaced example.
OK
Suppressing
letter-spacing
between Arabic letters.
Notice
letter-spacing
is nonetheless applied
to non-Arabic characters (like
spaces
).
BAD
Applying
letter-spacing
only between non-joined letters.
This distorts typographic color and obfuscates word boundaries.
Note:
Proper cursive elongation or compression of a text
can vary depending on the
script,
typeface,
language,
location within a word,
location within a line,
implementation complexity,
font capabilities,
and calligraphic preferences,
and may not be possible in certain cases at all.
It may involve the use of shortening ligatures,
swash variants,
contextual forms,
elongation glyphs such as U+0640 ـ ARABIC TATWEEL,
or other microtypography.
It is outside the scope of CSS to define rules for these effects.
Authors should avoid applying
letter-spacing
to cursive scripts
unless they are prepared to accept non-interoperable results.
8.3.
Line Start/End Padding: the
line-padding
property
Tests
This section lacks tests.
Name:
line-padding
Value:
Initial:
Applies to:
inline boxes
Inherited:
yes
Percentages:
N/A
Computed value:
absolute length
Canonical order:
per grammar
Animation type:
by computed value type
Whereas
letter-spacing
adjusts spacing
between
typographic character units
and does not apply at the start or end of a line,
this property adjusts spacing only at the start/end of a line.
The extra spacing is applied only
by the
innermost
inline box
at the start/end of the line box,
and is inserted between that
inline box
’s content edge
and the adjacent
inline-level
content
text
or
atomic inline
).
This extra space is not a
justification opportunity
Given the following HTML and CSS:
p { line-padding: 0.5em; line-height: 1; text-align: center }
span { background: black; color: white; }
em { background: green; color: white; }
Here is some text
Line-padding will be inserted such that
an extra 0.5em of inline background will be visible
on each side of each line.
If it renders such that there is a break between “some” and “text”,
the additional padding will be:
on the first line, black on the left and green on the right,
and on the second line, green on both sides.
Here is
some
text
8.4.
Automatic Contextual Spacing: the
text-autospace
property
Tests
This section has spotty coverage.
Name:
text-autospace
Value:
normal
auto
Initial:
normal
Applies to:
text
Inherited:
yes
Percentages:
N/A
Computed value:
specified keyword(s)
Canonical order:
per grammar
Animation type:
discrete
Tests
text-autospace-computed.html
(live test)
(source)
text-autospace-invalid.html
(live test)
(source)
text-autospace-valid.html
(live test)
(source)
text-autospace-001.html
(live test)
(source)
text-autospace-break-001.html
(live test)
(source)
Controls spacing between adjacent characters
on the same line within the same
inline formatting context
using a set of character-class-based rules,
allowing for automatic control over inter-script spacing
and for spacing around punctuation.
Tests
text-autospace-vertical-combine-001.html
(live test)
(source)
text-autospace-vertical-upright-001.html
(live test)
(source)
Values are defined as follows:
= no-autospace
[ ideograph-alpha
||
ideograph-numeric
||
punctuation ]
||
[ insert
replace ]
normal
Same behavior as
ideograph-alpha ideograph-numeric
Tests
text-autospace-break-001.html
(live test)
(source)
text-autospace-dynamic-001.html
(live test)
(source)
text-autospace-dynamic-text-001.html
(live test)
(source)
text-autospace-dynamic-text-002.html
(live test)
(source)
text-autospace-dynamic-text-003.html
(live test)
(source)
text-autospace-dynamic-text-004.html
(live test)
(source)
text-autospace-first-line-001.html
(live test)
(source)
text-autospace-ligature-001.html
(live test)
(source)
text-autospace-mixed-001.html
(live test)
(source)
no-autospace
No automatic space is inserted.
Tests
text-autospace-001.html
(live test)
(source)
text-autospace-no-001.html
(live test)
(source)
text-autospace-dynamic-001.html
(live test)
(source)
text-autospace-ligature-001.html
(live test)
(source)
text-autospace-mixed-001.html
(live test)
(source)
insert
The specified spacing is automatically inserted
if there are no space characters of any kind (
Unicode general category
) already there.
If neither
insert
nor
replace
are specified,
the behavior is the same as
insert
replace
The specified spacing is automatically inserted
even if there is already a
space
(U+0020) at that point;
additionally, the
space
(U+0020) is removed.
Other types of space characters (
Unicode general category
suppress automatic spacing, as for
insert
Note:
This is for correcting text which is using the easy-to-type U+0020
instead of proper spacing.
ideograph-alpha
Creates extra spacing between runs of
ideographs
and
non-ideographic letters
see
§ 8.4.1 Inter-script Spacing
Tests
text-autospace-ideogram-alpha-001.html
(live test)
(source)
ideograph-numeric
Creates extra spacing between runs of
ideographs
and
non-ideographic numerals
see
§ 8.4.1 Inter-script Spacing
punctuation
Creates extra non-breaking spacing around punctuation as required by language-specific typographic conventions.
In this level, if the element’s content language is French,
narrow no-break space (U+202F) and no-break space (U+00A0) is inserted
where required by
French typographic guidelines
Otherwise this value has no effect.
However future specifications may add automatic spacing behavior for other languages.
auto
The user agent chooses a set of typographically high quality spacing values.
Different user agents running on different platforms may pick different values.
Note:
These spacing values may or may not match OS platform conventions.
This property is additive with the
word-spacing
and
letter-spacing
properties.
That is, the amount of spacing contributed by the
letter-spacing
setting (if any)
is added to the spacing created by
text-autospace
The same applies to
word-spacing
At element boundaries, the amount of extra spacing introduced between characters
is determined by and rendered within the innermost element that contains the boundary.
8.4.1.
Inter-script Spacing
Tests
This section does not need direct tests:
the definition given here is exercised by
''text-autospace: ideograph-alpha'' and
''text-autospace: ideograph-numeric''.
The
ideograph-alpha
and
ideograph-numeric
values
introduce spacing at the boundary between particular classes of characters
when they are directly adjoining on a line,
i.e. without any intervening non-zero
margin
border
, or
padding
or intervening characters (such as a quotation mark or a space).
The amount of space introduced by these keywords is 1/8 of the CJK advance measure,
i.e
0.125ic
if the
used value
of
font-size
is same as its
computed value
Note:
Spacing conventions vary, but values typically range from 1/4ic to as low as 1/8ic,
with 1/4ic being more common in historical contexts due to metal type limitations
and 1/6ic or thinner being more common in proportional typesetting.
Because these spaces are inserted by default
(through the initial value,
normal
),
CSS uses 1/8ic in order to be conservative in its interference.
A future level of this module may introduce control
over the amount of spacing.
8.5.
CJK Punctuation Spacing: the
text-spacing-trim
property
Tests
This section has spotty test coverage.
The following aspects lack tests:
* inheritance
* animation type
* applies to text
* tests for end-of-line behavior for all values
* tests for start-of-line behavior for all values other than normal, trim-start, and space-first
* tests for adjacent pairs for all values other than the initial value
Name:
text-spacing-trim
Value:
auto
Initial:
normal
Applies to:
text
Inherited:
yes
Percentages:
N/A
Computed value:
specified keyword(s)
Canonical order:
per grammar
Animation type:
discrete
Tests
text-spacing-trim-computed.html
(live test)
(source)
text-spacing-trim-invalid.html
(live test)
(source)
text-spacing-trim-valid.html
(live test)
(source)
text-spacing-trim-001.html
(live test)
(source)
text-spacing-trim-colon-001.html
(live test)
(source)
text-spacing-trim-combinations-001.html
(live test)
(source)
text-spacing-trim-dot-001.html
(live test)
(source)
Controls spacing around CJK punctuation characters
on the same line within the same
inline formatting context
using a set of character-class-based rules,
allowing them to be set halfwidth or fullwidth
based on their position and neighbors within the line.
Values are defined as follows:
= space-all
normal
space-first
trim-start
trim-both
trim-all
Tests
text-spacing-trim-invalid.html
(live test)
(source)
text-spacing-trim-valid.html
(live test)
(source)
space-all
All fullwidth punctuation characters are set with full-width glyphs (spaced).
Tests
text-spacing-trim-space-all-001.html
(live test)
(source)
text-spacing-trim-dynamic-001.html
(live test)
(source)
normal
Set
fullwidth opening punctuation
with full-width glyphs (spaced)
at the start of each line;
set
fullwidth closing punctuation
with half-width glyphs (flush)
at the end of each line
if it does not otherwise fit prior to justification,
else set the punctuation with full-width glyphs;
and collapse spacing between punctuation glyphs
as described below
Tests
text-spacing-trim-span-001.html
(live test)
(source)
text-spacing-trim-subset-001.html
(live test)
(source)
trim-both
Set
fullwidth opening punctuation
with half-width glyphs (flush)
at the start of each line;
set
fullwidth closing punctuation
with half-width glyphs (flush)
at the end of each line;
and collapse spacing between punctuation glyphs
as described below
space-first
Set
fullwidth opening punctuation
with full-width glyphs (spaced)
on the first line of the
block container
and each line after a
forced line break
Otherwise as
normal
Tests
text-spacing-trim-001.html
(live test)
(source)
text-spacing-trim-colon-001.html
(live test)
(source)
text-spacing-trim-combinations-001.html
(live test)
(source)
text-spacing-trim-dot-001.html
(live test)
(source)
text-spacing-trim-quote-001.html
(live test)
(source)
text-spacing-trim-start-001.html
(live test)
(source)
text-spacing-trim-span-001.html
(live test)
(source)
This value exists for compat requirements.
This value exists to manage formatting of some existing Chinese and Japanese content,
for which
trim-both
would have been appropriate typographically,
except that they are already written
to expect the first line to be set as for
space-all
Specifically,
due to the lack of reliable
hanging-punctuation
support across UAs,
existing content (especially ePub content)
uses U+3000 ideographic space in place of
text-indent
but omits it when the paragraph begins with punctuation
that is desired to hang in the indent
in order to create the hanging punctuation effect.
Using
trim-both
on the first line
would thus trim away the effective indent in such content
and thus obscure that line’s distinction
as the first line of a new paragraph.
Note that this typesetting practice
of using ideographic spaces for indentation
(sometimes and not always)
is contrary to the separation of content and style offered by HTML and CSS.
Using
hanging-punctuation
and
text-indent
to control paragraph formatting
rather than tweaking the text content of the document
preserves the text’s true semantics in the document source
and allows the style sheet designer
to freely switch among the various spacing/indentation styles
without needing to alter the content.
See
§ 8.5.3 Japanese Paragraph-start Conventions in CSS
for examples.
Additionally, the behavior at the end of lines is aligned
with the
normal
and
trim-start
values
rather than
trim-both
in that it only trims the glyphs
if they do not otherwise fit prior to justification.
While improving the typography in fewer cases,
it is closer to the legacy behavior of
space-all
which reduces compatibility concerns.
trim-start
Set
fullwidth opening punctuation
with half-width glyphs (flush)
at the start of each line.
Otherwise as
normal
Tests
text-spacing-trim-start-001.html
(live test)
(source)
text-spacing-trim-start-002.html
(live test)
(source)
text-spacing-trim-end-001.html
(live test)
(source)
text-spacing-trim-span-001.html
(live test)
(source)
trim-all
Set
fullwidth opening punctuation
fullwidth closing punctuation
and
fullwidth middle dot punctuation
with half-width glyphs,
without regards for the position within the line
nor for adjacent characters.
Tests
text-spacing-trim-trim-all-001.html
(live test)
(source)
auto
The user agent chooses a set of typographically high quality spacing values.
Different user agents running on different platforms may pick different values.
Note:
These spacing values may or may not match OS platform conventions.
Do we need
auto
? It would be weird for the author to choose platform-dependent behavior at the start of the first line, and it should otherwise use
trim-both
Here is an informal summary of what the various values do:
Value
Trim at line start
Trim at line end
Trim adjacent pairs
Trim everywhere
space-all
no
normal
no
only if would not fit
yes
no
space-first
yes except on the first line
trim-start
yes
trim-both
yes
trim-all
yes
auto
user-agent specific / platform dependent
8.5.1.
Fullwidth Punctuation Collapsing
Tests
This section has basic test coverage.
The following aspects lack tests:
* The UA must not use the hwid feature or otherwise substitute halfwidth forms as switching to halfwidth glyphs can change the glyph shape which is not acceptable here.
* changing font sizes
Typically, fullwidth characters have glyphs with the same advance width
as a standard Han character (e.g. 水 U+6C34).
However, many fullwidth punctuation glyphs only take up part of the fullwidth design space.
Thus such punctuation are not always set fullwidth.
Several values of
text-spacing-trim
allow the author to control
when such characters are set half-width (typically half the width of an ideograph)
and when they are set full-width.
In order to set the text as specified, the UA will need to either
trim (kern) the blank half of the glyphs,
if they are given full-width and must be set half-width, or
add space to the glyphs,
if they are given half-width and must be set full-width.
The UA
may
use the OpenType
halt
and
vhal
features
if implemented by a font
in order to perform the requisite trimming of a particular glyph.
The UA
must not
use the
hwid
feature
or otherwise substitute halfwidth forms
as switching to halfwidth glyphs can change the glyph shape
which is not acceptable here.
Some fonts use proportional glyphs for fullwidth punctuation characters.
If there is no support in the font for distinguishing
fullwidth vs halfwidth glyph shapes
(e.g. through font features),
then for such proportional glyphs,
the given advance width is considered
simultaneously full-width and half-width:
the UA must not add or remove space to these glyphs.
Tests
text-spacing-trim-feature-001.html
(live test)
(source)
Note:
The advance width of a standard Han character
can be determined either from font metrics
such as the OpenType
ideo
and
idtp
baselines for the opposite writing mode,
or by taking the advance width of a Han character such as 水 U+6C34.
(The opposite writing mode must be used because some fonts are compressed
so that the characters are not square.)
More information on OpenType metrics can be found
in the OpenType spec
Note that if 水 U+6C34, 卜 U+535C, and 一 U+4E00 do not all have the same advance width,
the font has proportional ideographs
and the fullwidth advance width cannot be reliably determined by measuring glyphs.
Some fonts have fullwidth punctuation characters
whose blank are too small to trim (kern.)
UA may choose not to trim (kern)
when the UA determined the trimming (kerning) may cause
glyph cut-offs, collisions, or excessive kerning
through glyph bounding box, glyph metrics, or font features.
If
text-spacing-trim
is
trim-all
the UA must collapse the space typically associated with such full width glyphs
regardless of the context in which they appear.
Otherwise, unless
text-spacing-trim
is set to
space-all
(or the font has proportional fullwidth punctuation glyphs),
the UA must collapse the space typically associated with such full width glyphs
when placed adjacently on a line
as follows:
Set
fullwidth opening punctuation
half-width if the previous character is any of:
fullwidth opening punctuation
Tests
text-spacing-trim-001.html
(live test)
(source)
text-spacing-trim-colon-001.html
(live test)
(source)
fullwidth middle dot punctuation
Tests
text-spacing-trim-dot-001.html
(live test)
(source)
an ideographic space (U+3000)
Tests
text-spacing-trim-001.html
(live test)
(source)
fullwidth closing punctuation
of an equivalent or larger
font-size
Tests
text-spacing-trim-001.html
(live test)
(source)
a character belonging to Unicode
general category
Ps
Tests
text-spacing-trim-quote-001.html
(live test)
(source)
text-spacing-trim-narrow-001.html
(live test)
(source)
Otherwise set it full-width.
Set
fullwidth closing punctuation
half-width if the next character is any of:
fullwidth closing punctuation
Tests
text-spacing-trim-001.html
(live test)
(source)
fullwidth middle dot punctuation
Tests
text-spacing-trim-dot-001.html
(live test)
(source)
an ideographic space (U+3000)
Tests
text-spacing-trim-001.html
(live test)
(source)
fullwidth opening punctuation
of a larger
font-size
a character belonging to Unicode
general category
Pe
Tests
text-spacing-trim-narrow-001.html
(live test)
(source)
Otherwise set it full-width.
Tests
text-spacing-trim-001.html
(live test)
(source)
text-spacing-trim-colon-001.html
(live test)
(source)
text-spacing-trim-combinations-001.html
(live test)
(source)
text-spacing-trim-dot-001.html
(live test)
(source)
The following example table lists the punctuation pairs
affected by adjacent-pairs trimming.
It uses halfwidth equivalents to approximate the trimming effect.
Demonstration of adjacent-pairs punctuation trimming
Combination
Sample Pair
Looks Like
Opening—Opening
Middle Dot—Opening
Closing—Opening
Ideographic Space—Opening
Closing—Closing
Closing—Middle Dot
Closing—Ideographic Space
8.5.2.
Text Spacing Character Classes
Tests
This section is mostly definitions,
which are tested through their use in other sections,
rather than needing tests of their own.
However, there are normative statements,
so far untested,
notably the classification
of fullwidth colon punctuation and fullwidth dot punctuation
under either the fullwidth closing punctuation category
or the fullwidth middle dot punctuation category.
In the context of this property the following definitions apply:
Classes and Unicode code points are under review,
and at least some changes are needed to accommodate more recent additions to Unicode.
[Issue #9503]
ideographs
Includes all
typographic character units
[CSS-TEXT-3]
whose base character is listed below:
All characters in the range of U+3041 to U+30FF,
except those that belong to Unicode Punctuation [P*]
general category
CJK Strokes (U+31C0 to U+31EF).
Katakana Phonetic Extensions (U+31F0 to U+31FF).
All characters that have the Han
script property
non-ideographic letters
Includes all
typographic character units
that
belong to Unicode Letters [L*] and Mark [M*]
general category
except when any of the following conditions are met:
is defined as
ideograph
is categorized as East Asian Fullwidth (F) by
[UAX11]
is upright in vertical text flow using the
text-orientation
property
or the
text-combine-upright
property.
Tests
text-autospace-vertical-upright-001.html
(live test)
(source)
text-autospace-vertical-combine-001.html
(live test)
(source)
non-ideographic numerals
Includes all
typographic character
units that
belong to the Unicode Decimal Digit Number [Nd]
general category
except when any of the following conditions are met:
is categorized as East Asian Fullwidth (F) by
[UAX11]
is upright in vertical text flow using the
text-orientation
property
or the
text-combine-upright
property.
fullwidth opening punctuation
Includes any opening punctuation character (Unicode category
Ps
that belongs to the CJK Symbols and Punctuation block (U+3000–U+303F)
or is categorized as East Asian Fullwidth (F) by
[UAX11]
Also includes LEFT SINGLE QUOTATION MARK (U+2018) and LEFT DOUBLE QUOTATION MARK (U+201C).
When trimmed, the left (for horizontal text) or top (for vertical text) half is kerned.
fullwidth closing punctuation
Includes any closing punctuation character (Unicode category
Pe
that belongs to the CJK Symbols and Punctuation block (U+3000–U+303F)
or is categorized as East Asian Fullwidth (F) by
[UAX11]
Also includes RIGHT SINGLE QUOTATION MARK (U+2019) and RIGHT DOUBLE QUOTATION MARK (U+201D).
May also include
fullwidth colon punctuation
and/or
fullwidth dot punctuation
see below
).
When trimmed, the right (for horizontal text) or bottom (for vertical text) half is kerned.
fullwidth middle dot punctuation
Includes MIDDLE DOT (U+00B7), HYPHENATION POINT (U+2027), and KATAKANA MIDDLE DOT (U+30FB).
May also include
fullwidth colon punctuation
and/or
fullwidth dot punctuation
see below
).
fullwidth colon punctuation
Includes FULLWIDTH COLON (U+FF1A) and FULLWIDTH SEMICOLON (U+FF1B).
fullwidth dot punctuation
Includes
IDEOGRAPHIC COMMA (U+3001),
IDEOGRAPHIC FULL STOP (U+3002),
FULLWIDTH COMMA (U+FF0C),
FULLWIDTH FULL STOP (U+FF0E).
Whether
fullwidth colon punctuation
and
fullwidth dot punctuation
should be considered
fullwidth closing punctuation
or
fullwidth middle dot punctuation
depends on where in the glyph’s box the punctuation is drawn.
If the punctuation is centered,
then it should be considered middle dot punctuation.
If the punctuation is drawn to one side (left in horizontal text, top in vertical text)
and the other half is therefore blank
then the punctuation should be considered closing punctuation and trimmed accordingly.
The UA must classify
fullwidth colon punctuation
and
fullwidth dot punctuation
under either the
fullwidth closing punctuation
category or the
fullwidth middle dot punctuation
category
as appropriate.
The UA may rely on language conventions and the writing mode (horizontal vs. vertical),
and/or font information to determine this categorization.
The UA may also add additional characters to any category as appropriate.
The following informative table summarizes language conventions
for classifying fullwidth colon and dot punctuation:
colon punctuation
dot punctuation
Simplified Chinese (horizontal)
closing
closing
Simplified Chinese (vertical)
closing
closing
Traditional Chinese
middle dot
middle dot
Korean
middle dot
closing
Japanese
middle dot
closing
Note that for Chinese fonts at least,
the author observes that the standard convention is often not followed.
8.5.3.
Japanese Paragraph-start Conventions in CSS
Tests
This section is an example, and doesn't need tests.
Japanese has three common start-edge typesetting schemes,
which are distinguished by their handling of opening brackets.
Positioning of opening brackets at line head
[JLREQ]
Assuming a UA style sheet of
p { margin: 1em 0; }
CSS can achieve the Japanese typesetting styles with the following rules:
Brackets flush with indent, flush with other lines (first scheme):
p { /* Flush alignment */
margin: 0;
text-indent: 1em;
text-spacing-trim: trim-both;
Brackets preserve fullwidth spacing on all lines (second scheme):
p { /* Fullwidth alignment */
margin: 0;
text-indent: 1em;
text-spacing-trim: space-all;
Brackets hang in indent, flush with other lines (third scheme):
p { /* Hanging alignment */
margin: 0;
text-indent: 1em;
text-spacing-trim: trim-both;
hanging-punctuation: first;
8.6.
Character Class Spacing Shorthand: the
text-spacing
property
Tests
This section lacks tests.
Name:
text-spacing
Value:
none
auto
||
Initial:
see individual properties
Applies to:
text
Inherited:
yes
Percentages:
N/A
Computed value:
specified keyword(s)
Animation type:
discrete
Canonical order:
per grammar
Tests
text-spacing-computed.html
(live test)
(source)
text-spacing-invalid.html
(live test)
(source)
text-spacing-valid.html
(live test)
(source)
This property is a shorthand
for setting
text-spacing-trim
and
text-autospace
in a single declaration.
Values are defined as follows:
none
Turns off all text-spacing features:
sets
text-spacing-trim
to
space-all
and
text-autospace
to
no-autospace
auto
Sets both
text-spacing-trim
and
text-autospace
to
auto
Sets
text-spacing-trim
to the specified value.
If no
value is given,
text-autospace
is set to its
initial value
Sets
text-autospace
to the specified value.
If no
value is given,
text-spacing-trim
is set to its
initial value
Note:
As
normal
is the initial value of both
text-spacing-trim
and
text-autospace
text-spacing: normal
resets both to their initial values.
8.7.
Shaping Across Element Boundaries
Tests
This section has good test coverage.
Text shaping
must
be broken at inline box boundaries
when any of the following are true
for any box whose boundary separates the two
typographic character units
Any of
margin
border
padding
separating the two
typographic character units
in the inline axis
is non-zero.
Tests
shaping-009.html
(live test)
(source)
shaping-009-ref.html
(live test)
(source)
shaping-010.html
(live test)
(source)
shaping-010-ref.html
(live test)
(source)
shaping-011.html
(live test)
(source)
shaping-011-ref.html
(live test)
(source)
boundary-shaping-003.html
(live test)
(source)
boundary-shaping-004.html
(live test)
(source)
boundary-shaping-005.html
(live test)
(source)
boundary-shaping-007.html
(live test)
(source)
boundary-shaping-009.html
(live test)
(source)
vertical-align
is not
baseline
Tests
boundary-shaping-002.html
(live test)
(source)
boundary-shaping-006.html
(live test)
(source)
The boundary is a
bidi isolation boundary
Tests
shaping-012.html
(live test)
(source)
shaping-012-ref.html
(live test)
(source)
shaping-013.html
(live test)
(source)
boundary-shaping-008.html
(live test)
(source)
Text shaping
must not
be broken across inline box boundaries
when there is no effective change in formatting,
or if the only formatting changes do not affect the glyphs
(as in applying
text decoration
).
Tests
text-transform-shaping-001.html
(live test)
(source)
text-transform-shaping-002.html
(live test)
(source)
text-transform-shaping-003.html
(live test)
(source)
shaping-000.html
(live test)
(source)
shaping-000-ref.html
(live test)
(source)
shaping-004.html
(live test)
(source)
shaping-005.html
(live test)
(source)
shaping-006.html
(live test)
(source)
shaping-007.html
(live test)
(source)
shaping-014.html
(live test)
(source)
shaping-014-ref.html
(live test)
(source)
shaping-016.html
(live test)
(source)
shaping-016-ref.html
(live test)
(source)
shaping-022.html
(live test)
(source)
shaping-022-ref.html
(live test)
(source)
shaping-025.html
(live test)
(source)
shaping-025-ref.html
(live test)
(source)
shaping_lig-000.html
(live test)
(source)
boundary-shaping-001.html
(live test)
(source)
boundary-shaping-010.html
(live test)
(source)
Text shaping
should not
be broken across inline box boundaries otherwise,
if it is reasonable and possible for that case given the limitations of the font technology.
Tests
shaping-001.html
(live test)
(source)
shaping-001-ref.html
(live test)
(source)
shaping-002.html
(live test)
(source)
shaping-002-ref.html
(live test)
(source)
shaping-003.html
(live test)
(source)
shaping-003-ref.html
(live test)
(source)
shaping-008.html
(live test)
(source)
shaping-008-ref.html
(live test)
(source)
shaping-017.html
(live test)
(source)
shaping-018.html
(live test)
(source)
shaping-020.html
(live test)
(source)
shaping-020-ref.html
(live test)
(source)
shaping-021.html
(live test)
(source)
shaping-021-ref.html
(live test)
(source)
shaping-023.html
(live test)
(source)
shaping-023-ref.html
(live test)
(source)
shaping-024.html
(live test)
(source)
shaping-024-ref.html
(live test)
(source)
boundary-shaping-009.html
(live test)
(source)
An example of reasonable and possible shaping across boundaries
is Arabic shaping:
in many systems this is performed by the font engine,
allowing the font to provide variant glyphs
with potentially very sophisticated contextual shaping.
It’s not generally possible to rely on this system across a font change
unless the font engine has an API to provide context,
but it is straightforward and therefore quite reasonable
for an engine to work around this limitation by, for example,
using the zero-width-joiner (U+200D) or zero-width-non-joiner (U+200C)
as appropriate to solicit the correct choice of
initial/medial/final/isolated glyph.
An example of possible but not reasonable shaping across boundaries
is handling a font that is sensitive to 20 characters of context
on either side to choose its glyphs:
passing all the text before
and after
the string in question,
even through multiple inline boundaries with formatting changes,
is complicated.
The UA
could
handle such cases,
but is not required to,
as they are not typical or fundamentally required
by any modern writing system.
An example of impossible shaping across boundaries
is a change in font weight partway through the word “and”
in a font where a ligature would replace
all three letters of the word “and”
with an ampersand glyph (“&”).
9.
Edge Effects
Tests
Tests only needed in subsections.
Edge effects control
the indentation of lines with respect to other lines in the block (
text-indent
and how content is measured at the start and end edges of a line (
hanging-punctuation
).
9.1.
First Line Indentation: the
text-indent
property
Tests
This section has adequate test coverage.
Name:
text-indent
Value:
&&
hanging
&&
each-line
Initial:
Applies to:
block containers
Inherited:
yes
Percentages:
refers to block container’s own
inline-axis
inner size
Computed value:
computed
value, plus any specified keywords
Canonical order:
per grammar
Animation type:
by computed value type
Tests
inheritance.html
(live test)
(source)
text-indent-valid.html
(live test)
(source)
text-indent-invalid.html
(live test)
(source)
text-indent-computed.html
(live test)
(source)
text-indent-interpolation.html
(live test)
(source)
text-indent-composition.html
(live test)
(source)
text-indent-long-line-crash.html
(live test)
(source)
anonymous-flex-item-001.html
(live test)
(source)
anonymous-grid-item-001.html
(live test)
(source)
c547-indent-000.xht
(live test)
(source)
c547-indent-001.xht
(live test)
(source)
text-indent-012.xht
(live test)
(source)
text-indent-013.xht
(live test)
(source)
text-indent-014.xht
(live test)
(source)
text-indent-112.xht
(live test)
(source)
text-indent-applies-to-001.xht
(live test)
(source)
text-indent-applies-to-002.xht
(live test)
(source)
text-indent-applies-to-003.xht
(live test)
(source)
text-indent-applies-to-005.xht
(live test)
(source)
text-indent-applies-to-006.xht
(live test)
(source)
text-indent-applies-to-007.xht
(live test)
(source)
text-indent-applies-to-008.xht
(live test)
(source)
text-indent-applies-to-009.xht
(live test)
(source)
text-indent-applies-to-010.xht
(live test)
(source)
text-indent-applies-to-011.xht
(live test)
(source)
text-indent-applies-to-012.xht
(live test)
(source)
text-indent-applies-to-013.xht
(live test)
(source)
text-indent-applies-to-014.xht
(live test)
(source)
text-indent-applies-to-015.xht
(live test)
(source)
text-indent-inherited-001.xht
(live test)
(source)
This property specifies the indentation
applied to lines of inline content in a block.
The indent is treated as a margin
applied to the
start
edge of the line box.
Tests
text-indent-010.xht
(live test)
(source)
text-indent-012.xht
(live test)
(source)
text-indent-013.xht
(live test)
(source)
text-indent-115.xht
(live test)
(source)
text-indent-on-blank-line-rtl-left-align.html
(live test)
(source)
text-indent-overflow-001.xht
(live test)
(source)
text-indent-overflow-002.xht
(live test)
(source)
text-indent-overflow-003.xht
(live test)
(source)
text-indent-overflow-004.xht
(live test)
(source)
text-indent-rtl-001.xht
(live test)
(source)
text-indent-rtl-002.xht
(live test)
(source)
text-indent-min-max-content-001.html
(live test)
(source)
text-indent-overflow.html
(live test)
(source)
text-indent-text-align-end.html
(live test)
(source)
below-float.html
(live test)
(source)
Unless otherwise specified
by the
each-line
and/or
hanging
keywords,
only lines that are the
first formatted line
of an element are affected.
[CSS-PSEUDO-4]
For example, the first line of an anonymous block box is only affected
if it is the first child of its parent element.
Tests
text-indent-014.xht
(live test)
(source)
text-indent-wrap-001.xht
(live test)
(source)
text-indent-with-absolute-pos-child.html
(live test)
(source)
Values have the following meanings:
Gives the amount of the indent as an absolute length.
Tests
text-indent-004.xht
(live test)
(source)
text-indent-005.xht
(live test)
(source)
text-indent-006.xht
(live test)
(source)
text-indent-007.xht
(live test)
(source)
text-indent-008.xht
(live test)
(source)
text-indent-010.xht
(live test)
(source)
text-indent-012.xht
(live test)
(source)
text-indent-013.xht
(live test)
(source)
text-indent-014.xht
(live test)
(source)
text-indent-016.xht
(live test)
(source)
text-indent-017.xht
(live test)
(source)
text-indent-018.xht
(live test)
(source)
text-indent-019.xht
(live test)
(source)
text-indent-020.xht
(live test)
(source)
text-indent-028.xht
(live test)
(source)
text-indent-029.xht
(live test)
(source)
text-indent-030.xht
(live test)
(source)
text-indent-031.xht
(live test)
(source)
text-indent-032.xht
(live test)
(source)
text-indent-040.xht
(live test)
(source)
text-indent-041.xht
(live test)
(source)
text-indent-042.xht
(live test)
(source)
text-indent-043.xht
(live test)
(source)
text-indent-044.xht
(live test)
(source)
text-indent-052.xht
(live test)
(source)
text-indent-053.xht
(live test)
(source)
text-indent-054.xht
(live test)
(source)
text-indent-055.xht
(live test)
(source)
text-indent-056.xht
(live test)
(source)
text-indent-064.xht
(live test)
(source)
text-indent-065.xht
(live test)
(source)
text-indent-066.xht
(live test)
(source)
text-indent-067.xht
(live test)
(source)
text-indent-068.xht
(live test)
(source)
text-indent-076.xht
(live test)
(source)
text-indent-077.xht
(live test)
(source)
text-indent-078.xht
(live test)
(source)
text-indent-079.xht
(live test)
(source)
text-indent-080.xht
(live test)
(source)
text-indent-088.xht
(live test)
(source)
text-indent-089.xht
(live test)
(source)
text-indent-090.xht
(live test)
(source)
text-indent-091.xht
(live test)
(source)
text-indent-092.xht
(live test)
(source)
text-indent-109.xht
(live test)
(source)
text-indent-110.xht
(live test)
(source)
text-indent-111.xht
(live test)
(source)
text-indent-113.xht
(live test)
(source)
text-indent-114.xht
(live test)
(source)
text-indent-115.xht
(live test)
(source)
text-indent-intrinsic-001.xht
(live test)
(source)
text-indent-intrinsic-002.xht
(live test)
(source)
text-indent-intrinsic-003.xht
(live test)
(source)
text-indent-intrinsic-004.xht
(live test)
(source)
text-indent-on-blank-line-rtl-left-align.html
(live test)
(source)
text-indent-overflow-001.xht
(live test)
(source)
text-indent-overflow-002.xht
(live test)
(source)
text-indent-overflow-003.xht
(live test)
(source)
text-indent-overflow-004.xht
(live test)
(source)
text-indent-rtl-001.xht
(live test)
(source)
text-indent-rtl-002.xht
(live test)
(source)
text-indent-length-001.html
(live test)
(source)
text-indent-length-002.html
(live test)
(source)
text-indent-overflow.html
(live test)
(source)
text-indent-text-align-end.html
(live test)
(source)
Gives the amount of the indent
as a percentage of the block container’s own
logical width
Tests
text-indent-011.xht
(live test)
(source)
text-indent-100.xht
(live test)
(source)
text-indent-101.xht
(live test)
(source)
text-indent-102.xht
(live test)
(source)
text-indent-103.xht
(live test)
(source)
text-indent-104.xht
(live test)
(source)
text-indent-percent-001.xht
(live test)
(source)
Percentages must be treated as
for the purpose of calculating
intrinsic size contributions
but are always resolved normally when performing layout.
Tests
percentage-value-intrinsic-size.html
(live test)
(source)
text-indent-percentage-001.xht
(live test)
(source)
text-indent-percentage-002.html
(live test)
(source)
text-indent-percentage-003.html
(live test)
(source)
text-indent-percentage-004.html
(live test)
(source)
Note:
This can lead to the element overflowing.
It is not recommended to use percentage indents and intrinsic sizing together.
each-line
Indentation affects the first line of each block container
and each line after a
forced line break
(but not lines after a
soft wrap break
).
Tests
text-indent-each-line-hanging.html
(live test)
(source)
hanging
Inverts which lines are affected.
Tests
text-indent-each-line-hanging.html
(live test)
(source)
If
text-align
is
start
and
text-indent
is
5em
in
left-to-right text with no floats present, then first line of text
will start 5em into the block:
Since CSS1 it has been possible to
indent the first line of a block element
5em by setting the 'text-indent' property
to '5em'.
If we add the
hanging
keyword,
then the first line will start flush,
but other lines will be indented 5em:
In CSS3 we can instead indent all other
lines of the block element by 5em
by setting the 'text-indent' property
to 'hanging 5em'.
Since the
text-indent
property only affects the “first formatted line”,
a line after a forced break will not be indented.
For example, in the middle of
this paragraph is an equation,
which is centered:
x + y = z
The first line after the equation
is flush (else it would look like
we started a new paragraph).
However, sometimes (as in poetry or code),
it is appropriate to indent each line
that happens to be long enough to wrap.
In the following example,
text-indent
is given a value of
3em hanging each-line
giving the third line of the poem a hanging indent
where it soft-wraps at the block’s right boundary:
In a short line of text
There need be no wrapping,
But when we go on and on and on
and on,
Sometimes a soft break
Can help us stay on the page.
Note:
Since the
text-indent
property inherits,
when specified on a block element, it will affect descendant
inline-block elements.
For this reason, it is often wise to specify
text-indent: 0
on
elements that are specified
display: inline-block
9.2.
Hanging Glyphs
Tests
Test coverage TBD.
Partly tested through [[#hanging-punctuation-property]]
partly through [[#white-space-phase-2]].
When a glyph at the start or end edge of a line
hangs
it is not considered
when measuring the line’s contents for fit, alignment, or justification.
Depending on the line’s alignment/justification, this can
result in the mark being placed outside the line box.
The
hanging
glyph is also not taken into account
when computing
intrinsic sizes
min-content size
and
max-content size
),
and any sizes derived thereof.
(The interaction of this measurement and kerning is currently UA-defined;
the CSSWG
welcomes advice
on this point.)
Tests
full-width-leading-spaces-004.html
(live test)
(source)
white-space-intrinsic-size-005.html
(live test)
(source)
white-space-intrinsic-size-006.html
(live test)
(source)
overflow-wrap-min-content-size-009.html
(live test)
(source)
hanging
glyph
is still enclosed inside its parent inline box
and still participates in text justification:
its character advance is just not measured when determining
how much content fits on the line,
how much the line’s contents need to be expanded or compressed for justification,
or how to position the content within the line box for text alignment.
Effectively, the
hanging
glyph character advance
is re-interpreted as an additional negative margin
on the affected edge of its parent
inline box
the line is otherwise laid out as usual.
An overflowing
hanging glyph
should typically be considered
ink overflow
so as to avoid creating unnecessary scrollbars,
but the UA may treat it as
scrollable overflow
when the content is editable
or in other circumstances where treating it as
scrollable overflow
would be useful to the user.
[CSS-OVERFLOW-3]
Tests
hanging-scrollable-001.html
(live test)
(source)
white-space-intrinsic-size-019.html
(live test)
(source)
white-space-intrinsic-size-020.html
(live test)
(source)
hanging-punctuation-block-bound-001.html
(live test)
(source)
hanging-punctuation-inline-bound-001.html
(live test)
(source)
trailing-space-and-text-alignment-001.html
(live test)
(source)
trailing-space-and-text-alignment-003.html
(live test)
(source)
trailing-space-and-text-alignment-005.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-001.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-003.html
(live test)
(source)
trailing-space-and-text-alignment-rtl-005.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-021.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-022.html
(live test)
(source)
white-space-pre-wrap-trailing-spaces-023.html
(live test)
(source)
text-justify-and-trailing-spaces-001.html
(live test)
(source)
text-justify-and-trailing-spaces-002.html
(live test)
(source)
text-justify-and-trailing-spaces-003.html
(live test)
(source)
text-justify-and-trailing-spaces-004.html
(live test)
(source)
text-justify-and-trailing-spaces-005.html
(live test)
(source)
text-justify-and-trailing-spaces-006.html
(live test)
(source)
In some cases, a glyph at the end of a line
can
conditionally hang
it
hangs
only if it does not otherwise fit in the line prior to justification.
It is not considered when measuring the line’s contents for fit;
however, any part of it that does not fit
is considered to
hang
Glyphs that
conditionally hang
are not taken into account
when computing
min-content sizes
and any sizes derived thereof,
but they are taken into account for
max-content sizes
and any sizes derived thereof.
Tests
white-space-intrinsic-size-013.html
(live test)
(source)
white-space-intrinsic-size-014.html
(live test)
(source)
white-space-intrinsic-size-017.html
(live test)
(source)
Non-zero inline-axis borders or padding between
hang
able glyph and the edge of the line prevent the glyph from hanging.
For example, a period at the end of an inline box with end padding
does not
hang
at the end edge of a line.
Multiple adjacent glyphs can hang together,
however specific limits on how many are allowed to hang may be specified
(e.g. at most one punctuation character may
hang
at each edge of the line).
9.2.1.
Hanging Punctuation: the
hanging-punctuation
property
Tests
This section has spotty test coverage.
All values have tests.
Missing tests:
* No test of Animation type.
* Applies to text
* Affects intrinsic sizing
* each value has a test, and checks with some characters, but there isn’t a test for every relevant unicode character
* it is not considered when measuring the line’s contents for […] alignment
* it is not considered when measuring the line’s contents for […] justification
* Non-zero inline-axis borders or padding between a hangable mark and the edge of the line prevent the mark from hanging
* At most one punctuation character may hang at each edge of the line.
* should be treated as ink overflow
Name:
hanging-punctuation
Value:
none
[ first
||
[ force-end
allow-end ]
||
last ]
Initial:
none
Applies to:
text
Inherited:
yes
Percentages:
n/a
Computed value:
specified keyword(s)
Canonical order:
per grammar
Animation type:
discrete
Tests
inheritance.html
(live test)
(source)
hanging-punctuation-valid.html
(live test)
(source)
hanging-punctuation-invalid.html
(live test)
(source)
hanging-punctuation-inline-001.html
(live test)
(source)
This property determines whether a punctuation mark,
if one is present,
hangs
and may be placed outside the line box (or in the indent)
at the start or at the end of a line of text.
Note:
If there is not sufficient padding on the
block container,
hanging-punctuation
can trigger overflow.
Values have the following meanings:
none
No punctuation character is made to
hang
first
An opening bracket, quote, or ideographic space at the start
of the
first formatted line
of an element
hangs
This applies to all characters in the Unicode categories Ps, Pf, Pi
plus the ASCII quote marks U+0027 ' APOSTROPHE and U+0022 " QUOTATION MARK
and the IDEOGRAPHIC SPACE U+3000.
Tests
hanging-punctuation-first-001.xht
(live test)
(source)
hanging-punctuation-first-002.html
(live test)
(source)
last
A closing bracket or quote at the end
of the last formatted line of an element
hangs
This applies to all characters in the Unicode categories Pe, Pf, Pi
plus the ASCII quote marks U+0027 ' APOSTROPHE and U+0022 " QUOTATION MARK.
Tests
hanging-punctuation-last-001.xht
(live test)
(source)
force-end
stop or comma
at the end of a line
hangs
Tests
hanging-punctuation-force-end-001.xht
(live test)
(source)
allow-end
stop or comma
at the end of a line
conditionally hangs
Tests
hanging-punctuation-allow-end-001.xht
(live test)
(source)
At most one punctuation character may
hang
at each edge of the line.
Stops and commas
allowed to
hang
include:
U+002C
COMMA
U+002E
FULL STOP
U+060C
ARABIC COMMA
U+06D4
ARABIC FULL STOP
U+3001
IDEOGRAPHIC COMMA
U+3002
IDEOGRAPHIC FULL STOP
U+FF0C
FULLWIDTH COMMA
U+FF0E
FULLWIDTH FULL STOP
U+FE50
SMALL COMMA
U+FE51
SMALL IDEOGRAPHIC COMMA
U+FE52
SMALL FULL STOP
U+FF61
HALFWIDTH IDEOGRAPHIC FULL STOP
U+FF64
HALFWIDTH IDEOGRAPHIC COMMA
The UA may include other characters as appropriate.
Note:
The CSS Working Group would appreciate if UAs including
other characters would
inform the working group
of such additions.
The
allow-end
and
force-end
are two variations
of hanging punctuation used in East Asia.
text-align
justify
hanging-punctuation
allow-end
text-align
justify
hanging-punctuation
force-end
The punctuation at the end of the first line for
allow-end
does not hang, because it fits without hanging.
However, if
force-end
is used, it is forced to hang.
The justification measures the line without the hanging punctuation.
Therefore when the line is expanded, the punctuation is pushed outside the line.
9.3.
Bidirectionality and Line Boxes
Tests
This section lacks tests.
The
start
and
end
sides of a line box
are determined by the
inline base direction
of the line box.
Although they usually match,
the
inline base direction
of a
line box
is distinct from the
inline base direction
of the
containing block
or the
bidi paragraph
The
line box
’s
inline base direction
affects
text-align-all
text-align-last
text-indent
, and
hanging-punctuation
—i.e. the position and alignment of its contents with respect to its edges.
It does not affect the formatting or ordering of inline content
(which is controlled by the
Unicode Bidirectional Algorithm
as applied by
CSS Writing Modes
[UAX9]
[CSS-WRITING-MODES-4]
).
In most cases, a
line box
’s
inline base direction
is given by its
containing block
’s computed
direction
However,
if its
containing block
has
unicode-bidi: plaintext
[CSS-WRITING-MODES-4]
If the
bidi paragraph
to which the
line box
belongs
(that is, the
bidi paragraph
for which the line box holds content)
has strong directionality,
the line box’s
inline base direction
is that direction.
Tests
bidi-lines-001.html
(live test)
(source)
bidi-lines-002.html
(live test)
(source)
If the
line box
is empty
(i.e. contains no
atomic inlines
or
characters other than the newline character, if any)
or otherwise has no strong directionality
(contains only weak or neutral characters),
its
inline base direction
is taken
from the preceding line box (if any),
or, if this is the first line box in the containing block,
from the
direction
property of the containing block.
(This can result in an RTL line box whose contents have an LTR base direction.)
Tests
bidi-lines-002.html
(live test)
(source)
In the following example,
assuming the
is a start-aligned preformatted block
display: block; white-space: pre; text-align: start
),
every other line is right-aligned:
block
style
"unicode-bidi: plaintext"
فارسی
فارسی
فارسی
block
Because neutral characters (such as punctuation)
and isolated runs are skipped
when
finding the inline base direction of a plaintext bidi paragraph
the line box in the following example will be left-to-right
(and thus left-aligned given
text-align: start
),
as dictated by the first strong character, ‘h’:
para
style
"display: block; direction: rtl; unicode-bidi:plaintext"
quote
style
"unicode-bidi:plaintext"
שלום!
quote
”, they said.
para
textarea
style
"direction: rtl; unicode-bidi:plaintext"
Hello!
textarea
Because of
unicode-bidi: plaintext
the “Hello!” is typeset LTR
(i.e. with the exclamation mark on the right side)
and left-aligned,
ignoring the containing block’s RTL
direction
This makes the empty line following it LTR as well,
which means that a caret on that line should appear at its left edge.
The empty first line, however, is right-aligned:
having no preceding line,
it assumes the RTL direction of its containing block.
Appendix A:
Text Processing Order of Operations
Tests
Tests probably not needed for this section, as it is exercised through the rest of the specification.
This appendix is normative.
The following list defines the order of text operations.
(Implementations are not bound to this order as long as the resulting layout is the same.)
§ 4.2 White Space Trimming: the white-space-trim property
white space processing
part I (pre-wrapping)
§ 2.2 Expanding Between Words: the word-space-transform property
and
text transformation
Tests
word-space-transform-007.html
(live test)
(source)
word-space-transform-008.html
(live test)
(source)
word-space-transform-009.html
(live test)
(source)
word-space-transform-030.html
(live test)
(source)
text combination
[CSS-WRITING-MODES-4]
text orientation
[CSS-WRITING-MODES-4]
text wrapping
while applying per line:
indentation
bidirectional reordering
[CSS2]
[CSS-WRITING-MODES-4]
white space processing
part II
font/glyph selection and positioning
[CSS-FONTS-3]
letter-spacing
word-spacing
text-spacing
, and
line-padding
hanging punctuation
text fitting
font/glyph selection
and positioning
[CSS-FONTS-3]
may be done again
letter-spacing
word-spacing
, and
text-spacing
may be updated.
justification
(which may affect glyph selection and/or text wrapping, looping back into that step)
text alignment
text group alignment
Tests
letter-spacing-bidi-003.xht
(live test)
(source)
Appendix B:
Conversion to Plaintext
Tests
This section lacks tests.
This appendix is normative
for the purpose of plaintext copy-paste operations.
When a CSS-rendered document is converted to a plaintext format,
it is expected that:
The
text-transform
property has no effect.
white-space-trim
and
§ 4.3.1 Phase I: Collapsing and Transformation
is applied
and any sequence of
collapsible
white space
at the beginning of a
block
or immediately following a
forced line break
is removed.
Appendix C:
Default UA Stylesheet
Tests
Tests not needed for this section.
This appendix is informative,
and is to help UA developers to implement a default stylesheet for HTML,
but UA developers are free to ignore or modify as appropriate.
/* make option elements align together */
option
text-align
match-parent
/* do not allow white space to collapse in textarea */
textarea
white-space-collapse
preserve !important
/* preserve character grid in preformatted text */
pre
code
kbd
samp
tt
text-spacing
none
/* Avoid hanging punctuation inheriting into preformatted blocks */
pre
hanging-punctuation
none
Appendix D:
Scripts and Spacing
Tests
Tests not needed for this section:
these are definitions,
they get tested through their application,
not by themselves.
This appendix is normative.
Typographic behavior varies somewhat by language,
but varies drastically by writing system.
This appendix categorizes some common
scripts
in Unicode 6.0
according to their justification and spacing behavior.
Category descriptions are descriptive, not prescriptive;
the determining factor is the prioritization of
justification opportunities
block scripts
CJK and by extension all Wide characters
(see
East Asian Width
[UAX11]
).
The following
Unicode scripts
are included:
Bopomofo, Han, Hangul, Hiragana, Katakana, and Yi.
Characters of the
East Asian Width property
Wide
and
Fullwidth
are also included,
but
Ambiguous
characters are included
only if the
writing system
is
Chinese
Korean
or
Japanese
clustered scripts
Clustered scripts have discrete units
and break only at word boundaries,
but do not use visible word separators.
They prioritize stretching spaces,
but comfortably admit inter-character spacing for justification.
The clustered scripts include,
but are not limited to,
the following
Unicode scripts
Khmer,
Lao,
Myanmar,
New Tai Lue,
Tai Le,
Tai Tham,
Tai Viet,
Thai
cursive scripts
Cursive scripts do not admit gaps
between their letters for either justification or
letter-spacing
The following
Unicode scripts
are included:
Arabic,
Hanifi Rohingya,
Mandaic,
Mongolian,
N’Ko,
Phags Pa,
Syriac
Note:
Indic scripts with baseline connectors
(such as Devanagari and Gujarati)
are not
considered
cursive scripts
and
do
admit such gaps
between
typographic character units
See
Indic Layout Requirements
[ILREQ]
User agents should update this list
as they update their Unicode support
to handle as-yet-unencoded cursive scripts in future versions of Unicode,
and are encouraged to ask the CSSWG to update this spec accordingly.
Appendix E:
Characters and Properties
Tests
This section lacks tests.
This appendix is normative.
Unicode defines four code point-level properties
that are referenced in CSS typesetting:
East Asian width property
Defined in
Unicode Standard Annex #11
[UAX11]
and given as the
East_Asian_Width
property
in the
Unicode Character Database
[UAX44]
general category
Defined in
Unicode Standard Annex #44
[UAX44]
and given as the
General_Category
property
in the
Unicode Character Database
[UAX44]
script property
Defined in
Unicode Standard Annex #24
[UAX24]
and given as the
Script
property
in the
Unicode Character Database
[UAX44]
(UAs must include any ScriptExtensions.txt assignments in this mapping.)
Vertical Orientation
Defined in
Unicode Standard Annex #50
[UAX50]
as the Vertical_Orientation property
in the
Unicode Character Database
[UAX44]
Unicode defines properties for individual code points,
but sometimes it is necessary to determine the properties
of a
typographic character unit
For the purposes of CSS Text,
the properties of a
typographic character unit
are given
by the base character of its first
grapheme cluster
—except in two cases:
Grapheme clusters
formed with an Enclosing Mark
Me
of the Common script
are considered to be Other Symbols
So
in the Common script.
They are assumed to have the same Unicode properties
as the replacement character (U+FFFD).
Grapheme clusters
formed with a Space Separator
Zs
as the base
are considered to be Modifier Symbols
Sk
).
They are assumed to have the same East Asian Width property as the base,
but take their other properties
from the first combining character in the sequence.
Appendix F:
Identifying the Content Writing System
Tests
This section has partial test coverage.
Each of the various properties
that take the content language into account is tested,
except tested on text-justification:auto,
but probably not testable anyway.
Missing tests:
* if the writing system to specified to be one of the Hant, Hans, Hani, Hanb, or Bopo ISO15924 codes, then the writing system is Chinese.
* if the writing system to specified to be one of the Jpan, Hira ISO15924 codes, then the writing system is Japanese.
* if the writing system to specified to be one of the Kore, Hang, or Jamo ISO15924 codes, then the writing system is Korean.
This appendix is normative.
While most languages have a preferred writing system,
some have multiple, and
most can also be transcribed into one or more foreign writing systems.
As a common example, most languages have at least one Latin transcription,
and can thus be written in the Latin writing system.
Transcribed texts typically adopt the typographic conventions of the writing system:
for example Japanese “romaji” and Chinese Pinyin use Latin letters and word spaces,
and follow Latin line-breaking and justification practices accordingly.
As another example, historical ideographic Korean
ko-Hani
does not use word spaces,
and should therefore be typeset similar to Chinese
rather than modern Korean.
In HTML or any other
document language
using
BCP47
tags for identifying languages to declare the
content language
authors can disambiguate or indicate the use of an atypical writing system
with script subtags.
[BCP47]
For example, to indicate use of the Latin writing system
for languages which don’t natively use it,
the
-Latn
script subtag can be added,
e.g.
ja-Latn
for Japanese romaji.
Other subtags exist for other writing systems,
see ISO’s
Code for the Representation of Names of Scripts
and the
ISO15924 script tag registry
[ISO15924]
Some common/historical examples of using
BCP47
tags with script subtags:
zh-Latn
Chinese, written in Latin transcription.
ko-Hani
Korean, written in Hanja (Chinese ideographic characters).
tr-Arab
Turkish, written in Arabic script.
mn-Cyrl
Mongolian, written in Cyrillic.
mn-Mong
Mongolian, written in traditional Mongolian script.
However,
BCP47
script subtags are not typically used
(and are in fact discouraged)
for languages strongly associated with a single writing system:
instead that writing system is expected to be implied
when no other is specified.
[BCP47]
IANA maintains a database of various languages’ most common writing system
via the
Suppress-Script
field in its
language subtag registry
for this purpose.
Note:
More advice on language tagging can be found in
the
Internationalization Working Group
’s
“Language tags in HTML and XML”
and
“Choosing a Language Tag”
When no writing system is explicitly indicated,
UAs should assume the most common writing system
of the declared
content language
for language-sensitive typographic behaviors
such as line-breaking or justification.
However, UAs must not assume that writing system
if the author has explicitly declared a different one.
If the UA has no language-specific knowledge
of a particular language and writing system combination,
it must use the typographic conventions of the declared writing system
(assuming the conventions of a different language if necessary),
not the conventions of the declared language in an assumed writing system,
which would be inappropriate to the declared writing system.
Tests
writing-system-font-001.html
(live test)
(source)
writing-system-text-transform-001.html
(live test)
(source)
writing-system-segment-break-001.html
(live test)
(source)
writing-system-line-break-001.html
(live test)
(source)
writing-system-line-break-002.html
(live test)
(source)
The full correspondence between languages and their most common writing systems
is out of scope for this document.
However, user agents must assume at least the following:
If the
content language
is Chinese and the
writing system
is unspecified,
or for any
content language
if the
writing system
to specified to be one of the
Hant
Hans
Hani
Hanb
or
Bopo
ISO script codes,
then the
writing system
is
Chinese
If the
content language
is Japanese and the
writing system
is unspecified,
or for any
content language
if the
writing system
to specified to be one of the
Jpan
Hrkt
Hira
or
Kana
ISO script codes,
then the
writing system
is
Japanese
Tests
writing-system-line-break-002.html
(live test)
(source)
writing-system-segment-break-001.html
(live test)
(source)
If the
content language
is Korean and the
writing system
is unspecified,
or for any
content language
if the
writing system
to specified to be one of the
Kore
Hang
or
Jamo
ISO script codes,
then the
writing system
is
Korean
The
writing system
is only considered
to be
unknown
if the
content language
itself is unknown,
or if it explicitly indicates an unknown writing system.
Note:
Mere omission of the
writing system
information
when the
content language
is declared
means the that the
writing system
is implied, not unknown.
Appendix G:
Small Kana Mappings
Tests
This section has good test coverage,
through the text-transform property.
This appendix is normative.
Small Kana Map to Full-size Kana
Small
Full-size
ぁ U+3041
あ U+3042
ぃ U+3043
い U+3044
ぅ U+3045
う U+3046
ぇ U+3047
え U+3048
ぉ U+3049
お U+304A
ゕ U+3095
か U+304B
ゖ U+3096
け U+3051
𛄲 U+1B132
こ U+3053
っ U+3063
つ U+3064
ゃ U+3083
や U+3084
ゅ U+3085
ゆ U+3086
ょ U+3087
よ U+3088
ゎ U+308E
わ U+308F
𛅐 U+1B150
ゐ U+3090
𛅑 U+1B151
ゑ U+3091
𛅒 U+1B152
を U+3092
ァ U+30A1
ア U+30A2
ィ U+30A3
イ U+30A4
ゥ U+30A5
ウ U+30A6
ェ U+30A7
エ U+30A8
ォ U+30A9
オ U+30AA
ヵ U+30F5
カ U+30AB
ㇰ U+31F0
ク U+30AF
ヶ U+30F6
ケ U+30B1
𛅕 U+1B155
コ U+30B3
ㇱ U+31F1
シ U+30B7
ㇲ U+31F2
ス U+30B9
ッ U+30C3
ツ U+30C4
ㇳ U+31F3
ト U+30C8
ㇴ U+31F4
ヌ U+30CC
ㇵ U+31F5
ハ U+30CF
ㇶ U+31F6
ヒ U+30D2
ㇷ U+31F7
フ U+30D5
ㇸ U+31F8
ヘ U+30D8
ㇹ U+31F9
ホ U+30DB
ㇺ U+31FA
ム U+30E0
ャ U+30E3
ヤ U+30E4
ュ U+30E5
ユ U+30E6
ョ U+30E7
ヨ U+30E8
ㇻ U+31FB
ラ U+30E9
ㇼ U+31FC
リ U+30EA
ㇽ U+31FD
ル U+30EB
ㇾ U+31FE
レ U+30EC
ㇿ U+31FF
ロ U+30ED
ヮ U+30EE
ワ U+30EF
𛅤 U+1B164
ヰ U+30F0
𛅥 U+1B165
ヱ U+30F1
𛅦 U+1B166
ヲ U+30F2
𛅧 U+1B167
ン U+30F3
ァ U+FF67
ア U+FF71
ィ U+FF68
イ U+FF72
ゥ U+FF69
ウ U+FF73
ェ U+FF6A
エ U+FF74
ォ U+FF6B
オ U+FF75
ッ U+FF6F
ツ U+FF82
ャ U+FF6C
ヤ U+FF94
ュ U+FF6D
ユ U+FF95
ョ U+FF6E
ヨ U+FF96
Tests
text-transform-full-size-kana-001.html
(live test)
(source)
text-transform-full-size-kana-002.html
(live test)
(source)
text-transform-full-size-kana-003.html
(live test)
(source)
text-transform-full-size-kana-004.html
(live test)
(source)
text-transform-full-size-kana-005.html
(live test)
(source)
text-transform-full-size-kana-006.html
(live test)
(source)
text-transform-full-size-kana-007.html
(live test)
(source)
text-transform-full-size-kana-008.html
(live test)
(source)
Appendix H:
Word and Phrase Detection
Tests
This section has partial test coverage.
Missing tests:
* If a word or phrase is immediately followed by one or more of the following characters, the user agent must consider them to be part of the preceeding word or phrase
* Punctuation is not a phrase by itself […]
Likely untestable:
* The user agent must not place a word or phrase boundary between characters that compose a single typographic character unit
This appendix is normative.
A few operations in this specification
depend on automated
word boundary detection
or
phrase boundary detection
Both operations are similar:
the user agent performs linguistic analysis of the text
to identify language-specific meaningful sequences of characters.
They differ only targetting different units of text:
either words or phrases.
While easily understood in a broad sense,
both concepts of word and phrase are difficult to precisely define,
especially in a way that works accross multiple languages.
Nonetheless, in this context:
A word is a recognizable semantic unit which may comprise one or more characters or syllables.
Note:
See
What is a word?
for some discussion of this concept.
A phrase is a short grouping of one or several words
standing together as a conceptual or grammatical unit,
forming a component of a clause or sentence.
Note:
This is not to be confused with the French word
phrase
which means sentence rather than phrase in the English sense used here.
In Japanese,
this corresponds to the concept of 文節.
A phrase could be
a noun with its article and prepositions or postpositions,
a phrasal verb,
a compound verb tense…
The start and end position of each detected word or phrase
is called a
word boundary
or
phrase boundary
By themselves, word and phrase boundaries are not observable,
but properties like
word-space-transform
or
word-break
can cause visible effects at those positions.
The specific algorithm to detect word or phrases
and to place their boundaries is UA-dependent,
and may take into account a variety of factors or approaches,
such as
dictionary-based lexical analysis,
identification of punctuation or other delimiting characters,
morphological analysis,
machine learning methods…
The following constraints must nevertheless be respected:
The user agent must not place a word or phrase boundary
between characters that compose a single
typographic character unit
The user agent must not place a word or phrase boundary
adjacent to any characters with the line breaking class GL, WJ, or ZWJ;
when two would-be words or phrases are separated by such characters,
they must be treated as a single one.
[UAX14]
Tests
word-space-transform-024.html
(live test)
(source)
word-space-transform-025.html
(live test)
(source)
word-space-transform-026.html
(live test)
(source)
word-break-auto-phrase-003.html
(live test)
(source)
word-break-auto-phrase-004.html
(live test)
(source)
word-break-auto-phrase-005.html
(live test)
(source)
If a word or phrase is immediately followed by one or more of the following characters,
the user agent
must
consider them to be part of the preceeding word or phrase:
word-separator characters
other space separators
U+200B ZERO WIDTH SPACE characters
Punctuation is not a phrase by itself:
it should to be attached to the relevant side of an adjacent linguistic word or phrase.
For example,
enclosing punctuation such as brackets and quotes
are part of the phrase they enclose;
commas and semicolons are suffixed to the preceding phrase;
U+00BF INVERTED QUESTION MARK is attached to the subsequent word;
etc.
However, unconventional use of punctuation,
such as smileys, kaomoji, or Perl snippets,
may cause the user agent to need to deviate from this principle.
Inline box boundaries
and
out-of-flow
elements must be ignored
when determining word or phrase boundaries.
However,
if a
word
or
phrase boundary
is found at the same position as
one or more inline box boundaries,
the
word
or
phrase boundary
must be inserted
in the outermost element that participates in this inline box boundary.
Tests
Tests for ignoring inline box boundaries
word-space-transform-018.html
(live test)
(source)
word-space-transform-019.html
(live test)
(source)
word-break-auto-phrase-wbr-nobr-002.html
(live test)
(source)
Tests placing the word/phrase boundary in the outermost element
word-space-transform-018.html
(live test)
(source)
word-space-transform-019.html
(live test)
(source)
word-space-transform-020.html
(live test)
(source)
In the following example,
the red “
” indicates
reasonable positions for a user agent
detecting word boundaries
to place them:
กรุงเทพ
คือ
สวยงาม
If that sentence had contained some inline markup,
the following example shows the correct position to place the word boundaries:
กรุงเทพ
คือ
em
สวยงาม
em
The following example shows
incorrect
positions:
กรุงเทพ
คือ
em
สวยงาม
em
The following shows the correct positions in a more contrived situation:
กรุงเทพ
><
คือ
em
สวยงาม
em
>
Security Considerations
Tests
Tests not needed for this section.
This specification introduces no new security considerations.
Privacy Considerations
Tests
Tests not needed for this section.
This specification leaks the user’s installed hyphenation and line-breaking dictionaries.
Acknowledgements
Tests
Tests not needed for this section.
This specification would not have been possible without the help from:
Addison Phillips,
Aharon Lanin,
Alan Stearns,
Ambrose Li,
Arnold Schrijver,
Arye Gittelman,
Ayman Aldahleh,
Ben Errez,
Bert Bos,
Chris Lilley,
Chris Pratley,
Chris Thrasher,
Chris Wilson,
Dave Hyatt,
David Baron,
Emilio Cobos Álvarez,
Eric LeVine,
Etan Wexler,
Frank Tang,
Håkon Wium Lie,
IM Mincheol,
Ian Hickson,
James Clark,
Javier Fernandez,
John Daggett,
Jonathan Kew,
Ken Lunde,
Laurie Anna Edlund,
Marcin Sawicki,
Martin Dürst,
Martin Heijdra,
Masafumi Yabe,
Masayasu Ishikawa,
Michael Jochimsen,
Michel Suignard,
Mike Bemford,
Myles Maxfield,
Nat McCully,
Paul Nelson,
Pierre-Anthony Lemieux,
Rahul Sonnad,
Randy Edmunds,
Richard Ishida,
Shinyu Murakami,
Stephen Deach,
Steve Zilles,
Takao Suzuki,
Tantek Çelik,
Xidorn Quan,
Yaniv Feinberg.
Changes
This draft is kept in sync with
[CSS-TEXT-3]
, see
CSS Text 3
§ Changes
Changes specific to Level 4 are listed below.
Significant changes since the
29 May 2024 Working Draft
include:
Add
text-fit
property.
Significant changes since the
19 February 2024 Working Draft
include:
Renamed the
text-spacing-trim
value
trim-auto
to
trim-both
Issue 10161
Loosened requirement about not changing lines for
text-wrap-style: balance
for cases with large numbers of lines.
Issue 10186
Define interraction between
text-wrap-style: balance
and
line-clamp
Issue 9310
Add the
math-auto
value for
text-transform
Issue 5386
Significant changes since the
20 October 2023 Working Draft
include:
Restored accidentally deleted “and each line after a
forced line break
from definition of
text-spacing-trim: space-first
Issue 9532
Make
normal
the initial value of
text-spacing-trim
Issue 9511
Change the end-of-line behavior of
space-first
Issue 9736
space-first
applies after line-breaks.
Issue 9532
Clarify details of fullwidth punctuation collapsing.
Issue 9225
Prevent pre from inheriting hanging-punctuation by default with a user-agent style rule.
Issue 9689
Significant changes since the
29 March 2023 Working Draft
include:
Recast the
text-wrap
property as a shorthand of two new properties,
text-wrap-mode
and
text-wrap-style
and making
text-wrap-mode
rather than
text-wrap
a longhand of the
white-space
property.
Updated
Appendix G:
Small Kana Mappings
to Unicode 15.0.
Issue 8442
Redesign of the
word-break: auto-phrase
word-break: manual
features
(from an earlier attempt as a standalone
word-boundary-detection
property),
and add an
auto-phrase
value to
word-space-transform
(since it can no longer depend on
word-boundary-detection
).
and update supporting related mechanics.
Rename
word-boundary-expansion
to
word-space-transform
Add
trim-all
to
text-spacing-trim
Issue 8482
Non-tailorable Unicode line breaking controls other than NBSP
take precedence over our rule about atomic inlines.
Issue 8972
Tests
line-breaking-atomic-003.html
(live test)
(source)
line-breaking-atomic-004.html
(live test)
(source)
line-breaking-atomic-005.html
(live test)
(source)
line-breaking-atomic-006.html
(live test)
(source)
line-breaking-replaced-002.html
(live test)
(source)
line-breaking-replaced-003.html
(live test)
(source)
line-breaking-atomic-010.html
(live test)
(source)
line-breaking-atomic-011.html
(live test)
(source)
line-breaking-atomic-012.html
(live test)
(source)
line-breaking-atomic-013.html
(live test)
(source)
line-breaking-atomic-014.html
(live test)
(source)
line-breaking-atomic-015.html
(live test)
(source)
line-breaking-atomic-016.html
(live test)
(source)
line-breaking-atomic-017.html
(live test)
(source)
line-breaking-atomic-018.html
(live test)
(source)
line-breaking-atomic-019.html
(live test)
(source)
line-breaking-atomic-020.html
(live test)
(source)
line-breaking-atomic-021.html
(live test)
(source)
line-breaking-atomic-022.html
(live test)
(source)
line-breaking-atomic-023.html
(live test)
(source)
line-breaking-atomic-024.html
(live test)
(source)
line-breaking-atomic-025.html
(live test)
(source)
line-breaking-atomic-026.html
(live test)
(source)
line-breaking-atomic-027.html
(live test)
(source)
Significant changes since the
1 March 2023 Working Draft
include:
Completed the translation of
white-space
to multiple longhands by
adding
break-spaces
to
white-space-collapse
so that all shorthand values can be represented in the longhands
Issue 8256
integrating all longhand keywords into the
white-space
shorthand
updating prose accordingly
Renamed
text-space-collapse
and
text-space-trim
to
white-space-collapse
and
white-space-trim
Issue 8273
Significant changes since the
31 December 2022 Working Draft
include:
Redesigned
text-spacing
by:
Removing non-useful keyword combinations
(Issues
4246
8288
Making
space-first
the initial value
Issue 2462
Splitting into longhands
(Issues
4246
7183
8288
Ensuring the ability to turn each feature “off”.
(Issues
6950
8288
Add keywords to allow replacing incorrect space characters in the source.
(Issues
318
7183
8263
Allow
hanging-punctuation
to hang leading ideographic spaces
to compensate for plaintext-derived source text practices.
Issue 2462
Move
no-compress
to
text-justify
since it controls justification more than spacing.
Issue 7079
Extended contextual characters evaluated in
text-spacing
to include characters from the
Pe
and
Ps
categories.
Issue 6091
Renamed
text-space-collapse
back to
white-space-collapse
Issue 8273
Significant changes since the
5 May 2022 Working Draft
include:
Added
ruby
value to
text-justify
Issue 771
Issue 779
Switched
text-spacing: normal
to use
trim-end
instead of
allow-end
Issue 7055
Switched
text-spacing: normal
to also apply
ideograph-alpha
and
ideograph-numeric
updated UA default stylesheet to exclude these from monospace contexts,
specified that non-zero margin/border/padding inhibits space insertion,
and defined the amount of inserted space as
0.125ic
Issue 6950
Defined
text-align: match-parent
to compute to
start
on the
root element
for simplicity of implementation.
Issue 6542
Allow
distribute
keyword to be a
legacy value alias
or to simply compute to
inter-character
this allows UAs to do whichever is easier, since the distinction does not matter for backwards-compatibility.
Issue 7322
Renamed
trim-inner
value of
white-space-trim
to
discard-inner
for consistency with other values.
Issue 448
Significant changes since the
2019 Working Draft
include:
Integrating the full text of
[CSS-TEXT-3]
Adding percentages to
word-spacing
and
letter-spacing
to represent sizes relative to the current
font-size
Issue 2165
Suggesting a UA rule to prevent spaces in
textarea
from collapsing.
Issue 6309
Additions Since Level 3
New features in Level 4:
word-break: auto-phrase
, for automaticly determining phrases to keep together while line breaking
word-space-transform
, for transforming word separators
breaking up of the
white-space
property into multiple longhands:
white-space-collapse
and its
preserve-spaces
and
discard
values
white-space-trim
, for trimming excess white space at the boundaries of an element
text-wrap-mode
to control whether wrapping occurs or not
text-wrap-style
and its
balance
stable
, and
pretty
values
wrap-before
wrap-after
, and
wrap-inside
, to avoid or force wrapping (similar to the
break-*
properties for pagination)
hyphenate-character
, to explicitly control the hyphenation character
hyphenate-limit-zone
hyphenate-limit-chars
hyphenate-limit-lines
hyphenate-limit-last
, for better control over automatic hyphenation
values for
text-align
for aligning on, e.g., a decimal point
text-group-align
for group-aligning a set of line boxes whose contents are aligned by
text-align
line-padding
for inserting spaces within the inline box at the start/end of lines
text-spacing
for automatic spacing around punctuation and script changes
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
, 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
CSS
style sheet
renderer
UA
that interprets the semantics of a style sheet and renders
documents that use them.
authoring tool
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
Questions should be directed to the
public-css-testsuite@w3.org
mailing list.
Index
Terms defined by this specification
alignment character
, in § 7.1
allow-end
, in § 9.2.1
always
, in § 6.3.5
anywhere
value for line-break
, in § 6.2
value for overflow-wrap
, in § 6.4
auto
value for hyphenate-character
, in § 6.3.2
value for hyphenate-limit-chars
, in § 6.3.4
value for hyphens
, in § 6.3.1
value for line-break
, in § 6.2
value for text-align-last
, in § 7.4
value for text-autospace
, in § 8.4
value for text-justify
, in § 7.5
value for text-spacing
, in § 8.6
value for text-spacing-trim
, in § 8.5
value for text-wrap-style
, in § 5.4
value for wrap-before, wrap-after
, in § 5.3
value for wrap-inside
, in § 5.2
auto-phrase
value for word-break
, in § 6.1
value for word-space-transform
, in § 2.2
(type)
, in § 8.4
value for text-spacing
, in § 8.6
avoid
value for wrap-before, wrap-after
, in § 5.3
value for wrap-inside
, in § 5.2
avoid-flex
, in § 5.3
avoid-line
, in § 5.3
avoid-orphans
, in § 5.4
balance
, in § 5.4
bidi formatting characters
, in § 4.3.1
block scripts
, in § Unnumbered section
break-all
, in § 6.1
break-spaces
, in § 4.1
break-word
value for overflow-wrap
, in § 6.4
value for word-break
, in § 6.1
capitalize
, in § 2.1
center
value for text-align
, in § 7.1
value for text-group-align
, in § 7.6
character
, in § 1.4
Chinese
, in § Unnumbered section
clustered scripts
, in § Unnumbered section
collapse
, in § 4.1
collapsible
, in § 4.3.1
collapsible white space
, in § 4.3.1
column
, in § 6.3.5
conditionally hang
, in § 9.2
consistent
, in § 7.7
content language
, in § 1.3
content writing system
, in § 1.3
cursive script
, in § Unnumbered section
detecting phrase boundaries
, in § Unnumbered section
detecting word boundaries
, in § Unnumbered section
detect phrase boundaries
, in § Unnumbered section
detect word boundaries
, in § Unnumbered section
discard
, in § 4.1
discard-after
, in § 4.2
discard-before
, in § 4.2
discard-inner
, in § 4.2
distribute
, in § 7.5
document white space
, in § 4.3
document white space characters
, in § 4.3
each-line
, in § 9.1
East Asian Width property
, in § Unnumbered section
end
value for text-align
, in § 7.1
value for text-group-align
, in § 7.6
expandable separators
, in § 2.2
first
, in § 9.2.1
flex
, in § 5.3
forced line break
, in § 5
force-end
, in § 9.2.1
full-size
, in § Unnumbered section
full-size kana
, in § Unnumbered section
full-size-kana
, in § 2.1
full-width
definition of
, in § 2.1.1
value for text-transform
, in § 2.1
fullwidth closing punctuation
, in § 8.5.2
fullwidth colon punctuation
, in § 8.5.2
fullwidth dot punctuation
, in § 8.5.2
fullwidth middle dot punctuation
, in § 8.5.2
fullwidth opening punctuation
, in § 8.5.2
General Category
, in § Unnumbered section
grapheme cluster
, in § 1.4
group-align
, in § 7.6
group-aligned
, in § 7.6
group alignment
, in § 7.6
grow
, in § 7.7
half-width
, in § 2.1.1
hang
, in § 9.2
hanging
, in § 9.1
hanging glyph
, in § 9.2
hanging-punctuation
, in § 9.2.1
hyphenate
, in § 6.3.1
hyphenate-character
, in § 6.3.2
hyphenate-limit-chars
, in § 6.3.4
hyphenate-limit-last
, in § 6.3.5
hyphenate-limit-lines
, in § 6.3.5
hyphenate-limit-zone
, in § 6.3.3
hyphenation
, in § 6.3.1
hyphenation opportunity
, in § 6.3.1
hyphens
, in § 6.3.1
ideograph-alpha
, in § 8.4
ideographic-space
, in § 2.2
ideograph-numeric
, in § 8.4
ideographs
, in § 8.5.2
insert
, in § 8.4
inter-character
, in § 7.5
inter-word
, in § 7.5
Japanese
, in § Unnumbered section
justification opportunity
, in § 7.5.1
justify
, in § 7.1
justify-all
, in § 7.1
keep-all
, in § 6.1
known
, in § Unnumbered section
Korean
, in § Unnumbered section
last
, in § 9.2.1
left
value for text-align
, in § 7.1
value for text-group-align
, in § 7.6
, in § 9.1
value for letter-spacing
, in § 8.2
value for word-spacing
, in § 8.1
letter
, in § 1.4
letter-spacing
, in § 8.2
line
, in § 5.3
line break
, in § 5
line-break
, in § 6.2
line breaking
, in § 5
line breaking process
, in § 5
line-padding
, in § 8.3
line scaling factor
, in § 7.7.1
loose
, in § 6.2
lowercase
, in § 2.1
manual
value for hyphens
, in § 6.3.1
value for word-break
, in § 6.1
match-parent
, in § 7.1
math-auto
, in § 2.1
no-autospace
, in § 8.4
no-compress
, in § 7.5
none
value for hanging-punctuation
, in § 9.2.1
value for hyphenate-limit-lines
, in § 6.3.5
value for hyphens
, in § 6.3.1
value for text-fit
, in § 7.7
value for text-group-align
, in § 7.6
value for text-justify
, in § 7.5
value for text-spacing
, in § 8.6
value for text-transform
, in § 2.1
value for word-space-transform
, in § 2.2
non-ideographic letters
, in § 8.5.2
non-ideographic numerals
, in § 8.5.2
normal
value for letter-spacing
, in § 8.2
value for line-break
, in § 6.2
value for overflow-wrap
, in § 6.4
value for text-autospace
, in § 8.4
value for text-spacing-trim
, in § 8.5
value for white-space
, in § 3
value for word-break
, in § 6.1
value for word-spacing
, in § 8.1
nowrap
, in § 5.1
other space separators
, in § 4.3
overflow-wrap
, in § 6.4
page
, in § 6.3.5
value for text-fit
, in § 7.7
value for text-indent
, in § 9.1
per-line
, in § 7.7
per-line-all
, in § 7.7
phrase boundary
, in § Unnumbered section
phrase boundary detection
, in § Unnumbered section
pre
, in § 3
pre-line
, in § 3
preserve
, in § 4.1
preserve-breaks
, in § 4.1
preserved
, in § 4.1
preserved white space
, in § 4.1
preserve-spaces
, in § 4.1
pretty
, in § 5.4
pre-wrap
, in § 3
punctuation
, in § 8.4
replace
, in § 8.4
right
value for text-align
, in § 7.1
value for text-group-align
, in § 7.6
ruby
, in § 7.5
scalable parts
, in § 7.7.1
Script property
, in § Unnumbered section
segment break
, in § 4
shrink
, in § 7.7
small
, in § Unnumbered section
small kana
, in § Unnumbered section
soft wrap break
, in § 5
soft wrap opportunity
, in § 5
space
, in § 2.2
space-all
, in § 8.5
space-first
, in § 8.5
spaces
, in § 4.3
(type)
, in § 8.5
value for text-spacing
, in § 8.6
spread
, in § 6.3.5
stable
, in § 5.4
start
value for text-align
, in § 7.1
value for text-group-align
, in § 7.6
stop or comma
, in § 9.2.1
strict
, in § 6.2
value for hyphenate-character
, in § 6.3.2
value for text-align
, in § 7.1
tabs
, in § 4.3
tab size
, in § 4.4
tab-size
, in § 4.4
tab stop
, in § 4.3.2
text-align
, in § 7.1
text-align-all
, in § 7.3
text-align-last
, in § 7.4
text-autospace
, in § 8.4
text-fit
, in § 7.7
text-group-align
, in § 7.6
text-indent
, in § 9.1
text-justify
, in § 7.5
text-spacing
, in § 8.6
text-spacing-trim
, in § 8.5
text-transform
, in § 2.1
text-wrap
, in § 5.5
text-wrap-mode
, in § 5.1
text-wrap-style
, in § 5.4
tracking
, in § 8.2
trim-all
, in § 8.5
trim-both
, in § 8.5
trim-start
, in § 8.5
typographic character
, in § 1.4
typographic character unit
, in § 1.4
typographic letter unit
, in § 1.4
Unicode category
, in § Unnumbered section
Unicode East Asian Width
, in § Unnumbered section
Unicode General Category
, in § Unnumbered section
Unicode Script
, in § Unnumbered section
Unicode Vertical Orientation
, in § Unnumbered section
unknown
, in § Unnumbered section
uppercase
, in § 2.1
Vertical Orientation
, in § Unnumbered section
virtual expandable separator
, in § 2.2
white space
, in § 4.3
white-space
, in § 3
white space characters
, in § 4.3
white-space-collapse
, in § 4.1
white-space-trim
, in § 4.2
word boundary
, in § Unnumbered section
word boundary detection
, in § Unnumbered section
word-break
, in § 6.1
word separator
, in § 8.1
word-separator character
, in § 8.1
word-space-transform
, in § 2.2
word-spacing
, in § 8.1
word-wrap
, in § 6.4
wrap
definition of
, in § 5
value for text-wrap-mode
, in § 5.1
wrap-after
, in § 5.3
wrap-before
, in § 5.3
wrap-inside
, in § 5.2
wrapping
, in § 5
writing system
, in § 1.3
Terms defined by reference
[CSS-BACKGROUNDS-3]
defines the following terms:
border
[CSS-BOX-4]
defines the following terms:
border
margin
padding
[CSS-BREAK-4]
defines the following terms:
fragmentation context
[CSS-CASCADE-5]
defines the following terms:
author origin
computed value
declared value
inherit
inherited value
initial value
legacy name alias
legacy value alias
longhand
shorthand
shorthand property
used value
user origin
[CSS-COLOR-HDR-1]
defines the following terms:
no-limit
[CSS-DISPLAY-3]
defines the following terms:
display
[CSS-DISPLAY-4]
defines the following terms:
atomic inline
block
block box
block container
block formatting context
block-level
containing block
in-flow
independent formatting context
inline box
inline formatting context
inline-level
out-of-flow
root element
text sequence
[CSS-FONTS-4]
defines the following terms:
font-feature-settings
font-size
[CSS-INLINE-3]
defines the following terms:
initial-letter
line box
vertical-align
[CSS-OVERFLOW-3]
defines the following terms:
ink overflow
scrollable overflow
[CSS-OVERFLOW-4]
defines the following terms:
line-clamp
[CSS-PSEUDO-4]
defines the following terms:
first formatted line
[CSS-RUBY-1]
defines the following terms:
bopomofo characters
ruby
ruby annotation
[CSS-SIZING-3]
defines the following terms:
inner size
intrinsic size
intrinsic size contribution
intrinsic sizing
max-content size
min-content size
[CSS-TEXT-3]
defines the following terms:
break-spaces
nowrap
[CSS-VALUES-4]
defines the following terms:
&&
CSS-wide keywords
em
{A,B}
||
[CSS-WRITING-MODES-3]
defines the following terms:
direction
unicode-bidi
[CSS-WRITING-MODES-4]
defines the following terms:
bidi paragraph
bidi-isolate
block size
block-axis
end
inline base direction
inline end
inline size
inline start
inline-axis
inline-size
line-left
line-right
logical width
start
text-combine-upright
text-orientation
upright
writing-mode
[CSS2]
defines the following terms:
baseline
document language
float
[CSS3-BREAK]
defines the following terms:
orphans
[CSS3-FLEXBOX]
defines the following terms:
flex item
flex line
multi-line flex container
[CSSOM-1]
defines the following terms:
getComputedStyle(elt)
resolved value
[HTML]
defines the following terms:
language
textarea
wbr
[INFRA]
defines the following terms:
normalize newlines
References
Normative References
[CSS-BACKGROUNDS-3]
Elika Etemad; Brad Kemper.
CSS Backgrounds and Borders Module Level 3
. URL:
[CSS-BOX-4]
Elika Etemad.
CSS Box Model Module Level 4
. URL:
[CSS-BREAK-4]
Rossen Atanassov; Elika Etemad.
CSS Fragmentation Module Level 4
. URL:
[CSS-CASCADE-5]
Elika Etemad; Miriam Suzanne; Tab Atkins Jr..
CSS Cascading and Inheritance Level 5
. URL:
[CSS-COLOR-HDR-1]
Chris Lilley.
CSS Color HDR Module Level 1
. URL:
[CSS-DISPLAY-4]
Elika Etemad; Tab Atkins Jr..
CSS Display Module Level 4
. URL:
[CSS-FONTS-3]
John Daggett; Myles Maxfield; Chris Lilley.
CSS Fonts Module Level 3
. URL:
[CSS-FONTS-4]
Chris Lilley.
CSS Fonts Module Level 4
. URL:
[CSS-INLINE-3]
Elika Etemad.
CSS Inline Layout Module Level 3
. URL:
[CSS-OVERFLOW-3]
Elika Etemad; Florian Rivoal.
CSS Overflow Module Level 3
. URL:
[CSS-OVERFLOW-4]
David Baron; Florian Rivoal; Elika Etemad.
CSS Overflow Module Level 4
. URL:
[CSS-PSEUDO-4]
Elika Etemad; Alan Stearns.
CSS Pseudo-Elements Module Level 4
. URL:
[CSS-RUBY-1]
Elika Etemad; et al.
CSS Ruby Annotation Layout Module Level 1
. URL:
[CSS-SIZING-3]
Tab Atkins Jr.; Elika Etemad.
CSS Box Sizing Module Level 3
. URL:
[CSS-TEXT-3]
Elika Etemad; Koji Ishii; Florian Rivoal.
CSS Text Module Level 3
. URL:
[CSS-VALUES-3]
Tab Atkins Jr.; Elika Etemad.
CSS Values and Units Module Level 3
. URL:
[CSS-VALUES-4]
Tab Atkins Jr.; Elika Etemad.
CSS Values and Units Module Level 4
. URL:
[CSS-WRITING-MODES-3]
Elika Etemad; Koji Ishii.
CSS Writing Modes Level 3
. URL:
[CSS-WRITING-MODES-4]
Elika Etemad; Koji Ishii.
CSS Writing Modes Level 4
. URL:
[CSS2]
Bert Bos; et al.
Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification
. URL:
[CSS3-BREAK]
Rossen Atanassov; Elika Etemad.
CSS Fragmentation Module Level 3
. URL:
[CSS3-FLEXBOX]
Elika Etemad; Tab Atkins Jr.; Rossen Atanassov.
CSS Flexible Box Layout Module Level 1
. URL:
[CSSOM-1]
Daniel Glazman; Emilio Cobos Álvarez.
CSS Object Model (CSSOM)
. URL:
[HTML]
Anne van Kesteren; et al.
HTML Standard
. Living Standard. URL:
[INFRA]
Anne van Kesteren; Domenic Denicola.
Infra Standard
. Living Standard. URL:
[MATHML-CORE]
David Carlisle; Frédéric Wang.
MathML Core
. URL:
[RFC2119]
S. Bradner.
Key words for use in RFCs to Indicate Requirement Levels
. March 1997. Best Current Practice. URL:
[UAX11]
Ken Lunde 小林剣.
East Asian Width
. 24 July 2025. Unicode Standard Annex #11. URL:
[UAX14]
Robin Leroy.
Unicode Line Breaking Algorithm
. 5 September 2025. Unicode Standard Annex #14. URL:
[UAX24]
Ken Whistler.
Unicode Script Property
. 31 July 2025. Unicode Standard Annex #24. URL:
[UAX29]
Josh Hadley.
Unicode Text Segmentation
. 17 August 2025. Unicode Standard Annex #29. URL:
[UAX44]
Ken Whistler.
Unicode Character Database
. 27 August 2025. Unicode Standard Annex #44. URL:
[UAX50]
Ken Lunde 小林剣; Koji Ishii 石井宏治.
Unicode Vertical Text Layout
. 24 July 2025. Unicode Standard Annex #50. URL:
[UAX9]
Manish Goregaokar मनीष गोरेगांवकर; Robin Leroy.
Unicode Bidirectional Algorithm
. 13 August 2025. Unicode Standard Annex #9. URL:
[UNICODE]
The Unicode Standard
. URL:
Non-Normative References
[BCP47]
A. Phillips, Ed.; M. Davis, Ed..
Tags for Identifying Languages
. September 2009. Best Current Practice. URL:
[CLREQ]
Fuqiao Xue; Richard Ishida.
Requirements for Chinese Text Layout - 中文排版需求
. URL:
[CSS-DISPLAY-3]
Elika Etemad; Tab Atkins Jr..
CSS Display Module Level 3
. URL:
[CSS-TEXT-DECOR-3]
Elika Etemad; Koji Ishii.
CSS Text Decoration Module Level 3
. URL:
[DOM]
Anne van Kesteren.
DOM Standard
. Living Standard. URL:
[ILREQ]
Swaran Lata.
Indic Layout Requirements
. URL:
[ISO15924]
Code for the representation of names of scripts.
. 1998. ISO 15924:1998. Draft International Standard.
[JIS4051]
Formatting rules for Japanese documents (日本語文書の組版方法).
. 2004. JIS X 4051:2004. In Japanese.
[JLREQ]
Hiroyuki Chiba; et al.
Requirements for Japanese Text Layout 日本語組版処理の要件(日本語版)
. URL:
[JUSTIFY]
Elika Etemad; Richard Ishida.
Approches to Full Justification
. URL:
[L2-22-080R]
Norbert Lindenberg; Elika Etemad; Vaishnavi Murthy Yerkadithaya.
Line breaking at orthographic syllable boundaries
. Proposal. URL:
[RFC6919]
R. Barnes; S. Kent; E. Rescorla.
Further Key Words for Use in RFCs to Indicate Requirement Levels
. 1 April 2013. Experimental. URL:
[TYPOGRAPHY]
Richard Ishida.
Language enablement index
. URL:
[XML10]
Tim Bray; et al.
Extensible Markup Language (XML) 1.0 (Fifth Edition)
. 26 November 2008. REC. URL:
[ZHMARK]
General Rules for Punctuation (《标点符号用法》).
. 2011. GB/T 15834―2011. In Chinese..
Property Index
Name
Value
Initial
Applies to
Inh.
%ages
Animation type
Canonical order
Computed value
hanging-punctuation
none | [ first || [ force-end | allow-end ] || last ]
none
text
yes
n/a
discrete
per grammar
specified keyword(s)
hyphenate-character
auto |
auto
text
yes
n/a
discrete
per grammar
specified keyword
hyphenate-limit-chars
[ auto |
auto
text
yes
n/a
by computed value type
per grammar
three values, each either the auto keyword or an integer
hyphenate-limit-last
none | always | column | page | spread
none
block containers
yes
n/a
discrete
per grammar
specified keyword
hyphenate-limit-lines
no-limit |
no-limit
block containers
yes
n/a
by computed value type
per grammar
specified keyword or integer
hyphenate-limit-zone
block containers
yes
refers to length of the line box
by computed value type
per grammar
computed
hyphens
none | manual | auto
manual
text
yes
n/a
discrete
n/a
specified keyword
letter-spacing
normal |
normal
inline boxes and text
yes
relative to used font-size
by computed value type
n/a
an absolute length and/or a percentage
line-break
auto | loose | normal | strict | anywhere
auto
text
yes
n/a
discrete
n/a
specified keyword
line-padding
inline boxes
yes
N/A
by computed value type
per grammar
absolute length
overflow-wrap
normal | break-word | anywhere
normal
text
yes
n/a
discrete
n/a
specified keyword
tab-size
text
yes
n/a
by computed value type
n/a
the specified number or absolute length
text-align
start | end | left | right | center |
start
block containers
yes
see individual properties
discrete
n/a
see individual properties
text-align-all
start | end | left | right | center |
start
block containers
yes
n/a
discrete
n/a
keyword as specified, except for match-parent which computes as defined above
text-align-last
auto | start | end | left | right | center | justify | match-parent
auto
block containers
yes
n/a
discrete
n/a
keyword as specified, except for match-parent which computes as defined above
text-autospace
normal |
normal
text
yes
N/A
discrete
per grammar
specified keyword(s)
text-fit
[ none | grow | shrink ] [consistent | per-line | per-line-all]?
none
block containers
no
N/A
discrete
per grammar
specified keywords or computed
text-group-align
none | start | end | left | right | center
none
block containers
no
N/A
discrete
per grammar
specified keyword
text-indent
[
block containers
yes
refers to block container’s own inline-axis inner size
by computed value type
per grammar
computed
text-justify
[ auto | none | inter-word | inter-character | ruby ] || no-compress
auto
text
yes
n/a
discrete
n/a
specified keyword (except for the distribute legacy value)
text-spacing
none | auto |
see individual properties
text
yes
N/A
discrete
per grammar
specified keyword(s)
text-spacing-trim
normal
text
yes
N/A
discrete
per grammar
specified keyword(s)
text-transform
none | [capitalize | uppercase | lowercase ] || full-width || full-size-kana | math-auto
none
text
yes
n/a
discrete
n/a
specified keyword
text-wrap
<'text-wrap-mode'> || <'text-wrap-style'>
wrap
see individual properties
see individual properties
see individual properties
see individual properties
per grammar
see individual properties
text-wrap-mode
wrap | nowrap
wrap
text
yes
n/a
discrete
per grammar
specified keyword
text-wrap-style
auto | balance | stable | pretty | avoid-orphans
auto
block containers hat establish an inline formatting context
yes
n/a
discrete
per grammar
specified keyword
white-space
normal | pre | pre-wrap | pre-line | <'white-space-collapse'> || <'text-wrap-mode'> || <'white-space-trim'>
normal
text
see individual properties
n/a
discrete
n/a
specified keyword
white-space-collapse
collapse | discard | preserve | preserve-breaks | preserve-spaces | break-spaces
collapse
text
yes
n/a
discrete
per grammar
specified keyword
white-space-trim
none | discard-before || discard-after || discard-inner
none
inline boxes and block containers
no
n/a
discrete
per grammar
specified keyword(s)
word-break
normal | break-all | keep-all | manual | auto-phrase | break-word
normal
text
yes
n/a
discrete
n/a
specified keyword
word-space-transform
none | [ space | ideographic-space ] && auto-phrase?
none
text
yes
N/A
discrete
per grammar
as specified
word-spacing
normal |
normal
text
yes
relative to used font-size
by computed value type
n/a
an absolute length and/or a percentage
word-wrap
normal | break-word | anywhere
normal
text
yes
n/a
discrete
n/a
specified keyword
wrap-after
auto | avoid | avoid-line | avoid-flex | line | flex
auto
inline-level boxes and flex items
no
n/a
discrete
per grammar
specified keyword
wrap-before
auto | avoid | avoid-line | avoid-flex | line | flex
auto
inline-level boxes and flex items
no
n/a
discrete
per grammar
specified keyword
wrap-inside
auto | avoid
auto
inline boxes
no
n/a
discrete
per grammar
specified keyword
Issues Index
This section is still under discussion and may change in future drafts.
Does this preserve line break opportunities or no? Do we need a distinct "hide" value?
If it preserves line break opportunities,
maybe it should be replaced with a
word-space-transform
value?
What should happen here for
white-space-collapse: preserve-spaces
Should we define this for Level 4?
The name of this property is a placeholder,
pending the CSSWG finding a better name.
The CSSWG is looking for a better name for
avoid-orphans
See
thread
Issue is about requiring a minimum length for lines.
Common measures seem to be
At least as long as the text-indent.
At least X characters.
Percentage-based.
Suggestion for value space is
match-indent |
(with
Xch
given as an example to make that use case clear).
Alternately
could actually count the characters.
It’s unclear how this would interact with text balancing (above);
one earlier proposal had them be the same property
(with
100%
meaning full balancing).
People have requested word-based limits, but since this is really
dependent on the length of the word, character-based is better.
alternatively, this value could be based
on
keep-all
rather than
normal
Yet another variant is to merge this behavior
with
keep-all
Is
hyphenate-limit-zone
a good name? Comments/suggestions?
Do we need to add a
none
value to
overflow-wrap
to opt out of relaxing the
keep-all
and
auto-phrase
restrictions
as allowed by
overflow-wrap: normal
Is this intended to say that it’s the centers
of the alignment characters that should be aligned?
It’s not clear that’s what it says,
but that (or a different behavior) needs to be specified,
to describe what happens
when different occurrences of the alignment character
are in different fonts.
(Further, is that the intended behavior? Probably the most
significant use case to consider is bold vs. non-bold text,
which only varies slightly in width.)
feedback
[minutes face-to-face 2016-02-02 10:00 AM]
This needs to specify what text is searched
for the alignment character.
Is it only in-flow text whose containing block is the cell?
Or is text within any in-flow descendants
in the block formatting context established by the cell considered?
If so, is it considered only as long as its
text-align
property
is consistent with the cell’s?
(Consistent in the alignment character, or fully consistent?)
This behavior of aligning as though the alignment character
had been inserted at the end of the contents of the cell,
combined with center-of-character alignment,
will produce gaps on the end-side of lines
that are alone on a line with
text-alignment,
when none of the lines of the column has the alignment character,
or, more importantly, when some of the lines
do have the alignment character,
but the column is not laid out at its max-content width.
This is probably undesirable.
When the alignment character is inserted
at the end of the contents,
which font is used?
(In particular, if the alignment character might be within a descendant block,
is it the font of the block or the font of the table cell?
Or if the insertion is at a forced break within an inline,
does it use the font of the inline or the font of the block or cell?)
This should have a formal definition
of how character alignment affects
the min-content and max-content intrinsic widths
(of table columns and all content that can be inside table columns).
Max-content intrinsic widths need to be split
into three numbers (assuming that it’s the centers of the
alignment character that are aligned):
one for widths without alignment characters,
one for widths on the inline-start side
of the center of the alignment character,
one for widths on the inline-end side
of the center of the alignment character.
This operates based on all segments of text
between forced breaks for max-content widths.
For min-content widths, segments of text between forced breaks
that contain optional breaks within them should clearly contribute
only to the without-alignment-character width.
However, it’s less clear
whether all min-content widths should work this way,
or whether segments between forced breaks
that do not have optional breaks
(and perhaps only those that actually contain the alignment character)
should contribute to start-side-of-alignment-character
and end-side-of-alignment-character min-content widths instead;
this choice is a tradeoff between the meaning of min-content
sizing of a table meaning the narrowest reasonable size versus
honoring alignment characters in more cases.
Another option might be to use whether line-breaking of optional breaks
is allowed as a control for which behavior to use.
Formally defining the intrinsic width contributions
of column-spanning cells with
values of
text-align
is a complicated (although straightforward) extension
of the decisions made for intrinsic width contributions
of non-column-spanning cells;
this should also be formally defined.
Contributions end up being made to the split intrinsic widths
of the startmost or endmost column (whichever is used for alignment),
and to the without-alignment-character intrinsic widths
of the other spanned columns.
This keyword used to be part of
text-spacing
it might need renaming to be more specific now that it’s here,
as it implies that e.g. U+0020 cannot be compressed.
[Issue #7079]
A variant of this property is inherited,
and applies on each block container individually,
only affecting the line boxes that are direct children of that block.
This is less useful, but probably easier to implement.
Somehow also moving the floats that originate in the same block container
by the same amount
would make things line up more nicely,
which would be especially valuable in CJK layout.
Exactly how that works, and how it interacts with intruding floats
from ancestor elements is left as an exercise for the reader.
If the
inline size
of a block container depends on the size of
the viewport, its apparent
inline size
may not change even if
the user changes the page zoom level.
In that case, if text is fitted with this feature, the text size may
not change at all even though the zoom level has changed.
There is no agreement yet on how to deal with this issue. See
csswg#12886
Do we need
auto
? It would be weird for the author to choose platform-dependent behavior at the start of the first line, and it should otherwise use
trim-both
Classes and Unicode code points are under review,
and at least some changes are needed to accommodate more recent additions to Unicode.
[Issue #9503]
MDN
hyphenate-character
Firefox
98+
Safari
None
Chrome
106+
Opera
Edge
106+
Edge (Legacy)
IE
None
Firefox for Android
iOS Safari
Chrome for Android
Android WebView
Samsung Internet
Opera Mobile
MDN
text-wrap
In no current engines.
Firefox
None
Safari
None
Chrome
None
Opera
Edge
None
Edge (Legacy)
IE
None
Firefox for Android
iOS Safari
Chrome for Android
Android WebView
Samsung Internet
Opera Mobile
MDN
white-space-collapse
In no current engines.
Firefox
None
Safari
None
Chrome
None
Opera
Edge
None
Edge (Legacy)
IE
None
Firefox for Android
iOS Safari
Chrome for Android
Android WebView
Samsung Internet
Opera Mobile
CanIUse
Support:
Android Browser
147+
Baidu Browser
13.52+
Blackberry Browser (limited)
7+
Chrome
42+
Chrome for Android
147+
Edge
79+
Firefox
91+
Firefox for Android
150+
IE
None
IE Mobile
None
KaiOS Browser
None
Opera
29+
Opera Mini
None
Opera Mobile
80+
QQ Browser
14.9+
Safari
13.1+
Safari on iOS
13.4+
Samsung Internet
4+
UC Browser for Android
15.5+
Source:
caniuse.com
as of 2026-04-22
CanIUse
Support:
Android Browser
147+
Baidu Browser
13.52+
Blackberry Browser (limited)
7+
Chrome
44+
Chrome for Android
147+
Edge
12+
Firefox
15+
Firefox for Android
150+
IE
5.5+
IE Mobile
10+
KaiOS Browser
2.5+
Opera
31+
Opera Mini
None
Opera Mobile
80+
QQ Browser
14.9+
Safari
9+
Safari on iOS
9.0+
Samsung Internet
4+
UC Browser for Android
15.5+
Source:
caniuse.com
as of 2026-04-22
CanIUse
Support:
Android Browser
147+
Baidu Browser
13.52+
Blackberry Browser
None
Chrome
88+
Chrome for Android
147+
Edge
105+
Firefox
43+
Firefox for Android
150+
IE
None
IE Mobile
None
KaiOS Browser
2.5+
Opera
91+
Opera Mini
None
Opera Mobile
80+
QQ Browser
14.9+
Safari
17.0+
Safari on iOS
17.0+
Samsung Internet
6.2+
UC Browser for Android
15.5+
Source:
caniuse.com
as of 2026-04-22
CanIUse
Support:
Android Browser
4.4+
Baidu Browser
13.52+
Blackberry Browser
10+
Chrome
23+
Chrome for Android
147+
Edge
18+
Firefox
49+
Firefox for Android
150+
IE (limited)
5.5+
IE Mobile (limited)
10+
KaiOS Browser
3.0+
Opera
12.1+
Opera Mini (limited)
All
Opera Mobile
80+
QQ Browser
14.9+
Safari
6.1+
Safari on iOS
7.0+
Samsung Internet
4+
UC Browser for Android
15.5+
Source:
caniuse.com
as of 2026-04-22
CanIUse
Support:
Android Browser
147+
Baidu Browser
13.52+
Blackberry Browser
None
Chrome
47+
Chrome for Android
147+
Edge
79+
Firefox
49+
Firefox for Android
150+
IE (limited)
5.5+
IE Mobile (limited)
10+
KaiOS Browser
3.0+
Opera
34+
Opera Mini
None
Opera Mobile
80+
QQ Browser
14.9+
Safari
16.0+
Safari on iOS
16.0+
Samsung Internet
5.0+
UC Browser for Android
15.5+
Source:
caniuse.com
as of 2026-04-22
CanIUse
Support:
Android Browser
147+
Baidu Browser
None
Blackberry Browser
None
Chrome
145+
Chrome for Android
147+
Edge
145+
Firefox
55+
Firefox for Android
150+
IE (limited)
8+
IE Mobile (limited)
10+
KaiOS Browser
3.0+
Opera
None
Opera Mini
None
Opera Mobile
None
QQ Browser
None
Safari
None
Safari on iOS
None
Samsung Internet
None
UC Browser for Android
None
Source:
caniuse.com
as of 2026-04-22
CanIUse
Support:
Android Browser
4.4+
Baidu Browser
13.52+
Blackberry Browser (limited)
7+
Chrome
30+
Chrome for Android
147+
Edge
12+
Firefox
2+
Firefox for Android
150+
IE
9+
IE Mobile
10+
KaiOS Browser
2.5+
Opera
17+
Opera Mini
None
Opera Mobile
80+
QQ Browser
14.9+
Safari
6.1+
Safari on iOS
4.0+
Samsung Internet
4+
UC Browser for Android
15.5+
Source:
caniuse.com
as of 2026-04-22
CanIUse
Support:
Android Browser
147+
Baidu Browser (limited)
13.52+
Blackberry Browser (limited)
7+
Chrome
146+
Chrome for Android
147+
Edge
146+
Firefox
121+
Firefox for Android
150+
IE (limited)
5.5+
IE Mobile (limited)
10+
KaiOS Browser (limited)
2.5+
Opera (limited)
9+
Opera Mini (limited)
All
Opera Mobile (limited)
10+
QQ Browser (limited)
14.9+
Safari
16.0+
Safari on iOS
16.0+
Samsung Internet (limited)
4+
UC Browser for Android (limited)
15.5+
Source:
caniuse.com
as of 2026-04-22
CanIUse
Support:
Android Browser
None
Baidu Browser
None
Blackberry Browser
None
Chrome
None
Chrome for Android
None
Edge
None
Firefox
None
Firefox for Android
None
IE
None
IE Mobile
None
KaiOS Browser
None
Opera
None
Opera Mini
None
Opera Mobile
None
QQ Browser
None
Safari (limited)
10+
Safari on iOS (limited)
10.0+
Samsung Internet
None
UC Browser for Android
None
Source:
caniuse.com
as of 2026-04-22