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.
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.
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. ㅎ=h, ㅏ=a, ㄴ=n) 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
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.
Note: The rules for such tailorings are out of scope for CSS.
- 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]
A 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)
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)
- 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.
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.
- 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)
- 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.
- 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.
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.
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.
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 boxes and inline box boundaries must not introduce a text-transform word boundary and must be ignored when determining such word boundaries.
Tests
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)
Tests
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 <wide>
or the <narrow> tag
in their Decomposition_Mapping
in Unicode Standard Annex #44: Unicode Character Database.
[UAX44]
For the <narrow> tag,
the mapping is from the code point to the decomposition
(minus <narrow> tag),
and for the <wide> tag,
the mapping is from the decomposition
(minus the <wide> 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.
- 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.
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)
-
wbrelementsTests
- 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)
A 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 a forced line break (ignoring any intervening inline box boundaries, and associated margin/border/padding).
Tests
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.
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.
< p > むかしむかし、< wbr > あるところに、< wbr > おじいさんと< wbr > おばあさんが< wbr > すんでいました。
むかしむかし、あるところに、おじいさんとおばあさんがすんでいました。
Phrase-based spacing can be achieved with the following css:
p {
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:
p {
word-break : keep-all;
word-space-transform : ideographic-space;
}
むかしむかし、
Tests
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 p when they also delimit a phrase.
< p > らいしゅう< wbr > の< wbr > じゅぎょう< wbr > に< wbr class = p > たいこ< wbr > と< wbr > ばち< wbr > を< wbr class = p > もって< 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.
らいしゅう
p wbr.p {
word-space-transform : ideographic-space;
}
らいしゅう
p wbr {
word-space-transform : ideographic-space;
}
らいしゅう
p {
word-break : keep-all;
}
p wbr.p {
word-space-transform : ideographic-space;
}
らいしゅう
p {
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 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.
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)
- 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
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)
Carriage returns (U+000D) are treated identically to spaces (U+0020) in all respects.
Tests
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
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:
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.
-
A 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.
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.
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 >
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
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)
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
-
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).
-
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)
-
Any sequence of collapsible spaces and tabs
immediately preceding or following a segment break
is removed.
- 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
a soft wrap opportunity exists at the end of each maximal sequence of spaces and/or tabs.
For break-spaces,
a 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)
Tests
<ltr>A <rtl> B </rtl> C</ltr>
where the <ltr> element represents a left-to-right embedding
and the <rtl> 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:
A 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.
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)
Note: See the Unicode rules on how tabulation (U+0009) interacts with bidi. [UAX9]
-
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]
-
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?
-
If white-space-collapse is collapse or preserve-breaks,
the UA must hang this sequence (unconditionally).
p {
white-space : pre-wrap;
width : 5 ch ;
border : solid 1 px ;
font-family : monospace;
text-align : center;
}
< p > 0</ p >
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.
p {
white-space : pre-wrap;
width : 3 ch ;
border : solid 1 px ;
font-family : monospace;
}
< p > 0 0 0 0</ p >
The sample above would be rendered as follows:
0 0
0
If p was added,
the result would be as follows:
0 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.
p {
white-space : pre-wrap;
width : 3 ch ;
border : solid 1 px ;
font-family : monospace;
}
< p > 0 0 0 0</ p >
0 0
The last line is not wrapped before the last 0
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
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.
-
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
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.
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.
In languages that have no word separators, such as Chinese, “unbreaking” a line requires joining the two lines with no intervening 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: | <number [0,∞]> | <length [0,∞]> |
| Initial: | 8 |
| 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). A <number> 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)
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. Valid soft wrap opportunities depend on the content language and writing system, as well as on CSS properties that control them, see § 6 Line Breaking and Word Boundaries.
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
This property specifies whether inline-level content wraps at unforced soft wrap opportunities.
Note: This property is a longhand of both white-space and text-wrap.
Possible values:
- wrap
-
Lines may wrap 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 § 6.5 Line Breaking Details for more information about rules and constrains on soft wrap opportunities.
- nowrap
-
Lines only break at forced line breaks;
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':
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]
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:
<footer> <venue>27th Internationalization and Unicode Conference</venue> • <date>April 7, 2005</date> • <place>Berlin, Germany</place> </footer>
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-short-last-line |
| 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 |
Tests
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 line 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
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-short-last-line, 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-short-last-line
-
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-short-last-line 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-short-last-line 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-short-last-line 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-short-last-line 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.
- At least as long as the text-indent.
- At least X characters.
- Percentage-based.
Suggestion for value space is match-indent | <length> | <percentage> (with Xch given as an example to make that use case clear). Alternately <integer> 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
This property is a shorthand for the text-wrap-mode and text-wrap-style properties. Any omitted longhand is set to its initial value.
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 (such as English written using the Latin alphabet) 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, notably Brahmic scripts such as Javanese and Balinese, soft wrap opportunities are based on orthographic syllable boundaries, not word boundaries. Although orthographic syllable breaking does not depend on the content language or require lexical resource, it nonetheless requires analysis of the text to find breaking opportunities.
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
Generic line-breaking tests not particularly anchored to any specific spec language
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]
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).
ተወልዱ፡ኵሉ፡ሰብእ፡ግዑዛን፡ወዕሩያን፡ በማዕረግ፡ወብሕግ።ቦሙ፡ኅሊና፡ወዐቅል፡ ወይትጌበሩ፡አሐዱ፡ምስለ፡አሀዱ፡ በመንፈሰ፡እኍና።
ተወልዱ፡ኵሉ፡ሰብእ፡ግዑዛን፡ወዕሩያን፡በማ ዕረግ፡ወብሕግ።ቦሙ፡ኅሊና፡ወዐቅል፡ወይትጌ በሩ፡አሐዱ፡ምስለ፡አሀዱ፡በመንፈሰ፡እኍና።
Note: To enable additional break opportunities only in the case of overflow, see overflow-wrap.
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”), orSA(“Southeast Asian”) line breaking classes [UAX14]) are instead treated asID(“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
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, orIDUnicode 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).
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, usingwbror 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
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.
这是一些汉字 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·و·کمی·خط·عربی·และ·ตัวอย่าง·การเขียน·ภาษาไทย·በጽሑፍ፡·ማራዘሙን፡·አንዳንድ፡
User agents must not, in response to any value of this property, suppress soft wrap opportunities which are:
-
introduced by the
wbrHTML element or U+200B ZERO WIDTH SPACE -
required by the line-break property
The effects of word-break are taken into account when computing intrinsic sizes.
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.
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
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
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, orZWJline 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: 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 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+30A0Tests
- 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)
-
breaks before certain CJK hyphen-like characters:
-
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 asIDdue to word-break: break-all), and are otherwise forbidden:-
breaks before hyphens:
‐ U+2010, – U+2013Tests
- 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)
-
breaks before hyphens:
-
The following breaks are forbidden for normal
and strict line breaking
and allowed in 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)
-
breaks before iteration marks:
々 U+3005, 〻 U+303B, ゝ U+309D, ゞ U+309E, ヽ U+30FD, ヾ U+30FETests
- 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]
-
breaks before Japanese small kana
or the Katakana-Hiragana prolonged sound mark,
i.e. characters
from the Unicode line breaking class