CSS Text 3 test coverage report
2019-09-27
- Prepared by:
- Florian Rivoal (Invited Expert)
Abstract
This report evaluates the test coverage of the CSS Text Module Level 3
as it was on 2019-09-27
when the latest commit was 3c52c266d27e0bdcc583f8d232fdd359efc1ba81.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C,
or the CSS-Working Group.
Don’t cite this document other than as work in progress.
It takes into account tests in:
It does not include tests from:
- wpt/css/CSS2/, other than those related to the
white-space
property.
The following sections mirror
the outline of the specification itself,
and each section links to the corresponding one in he specification.
Issue:
Problems other than missing spec coverage are highlighted he same as as this paragraph is.
Tests not needed.
Tests not needed.
Tests not really needed.
Possible addition:
- Check that the css-wide keywords work on every property.
Tests not really needed: these are definitions, they get tested through their applications, not standalone.
Possible addition:
- whether The HTTP Content-Language header is having the desired effect on things that depend on content language
For the most part, tests not really needed:
these are definitions, they get tested through their applications, not standalone.
The few testable assertions that are made have coverage.
Possible addition:
- turning the content of example 1 into tests (first, check that it’s not already done)
Adequate coverage.
Exhaustive coverage unrealistic, since this section is effectively a dependency on all of Unicode.
Some tests nonetheless provided for sanity checking
(such as the effect of certain control characters on Arabic shaping).
Test only needed in subsection.
Overall good coverage. Very good i18n coverage.
Missing:
- No test of Animation type.
Possible addition:
- 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.
Good overal coverage through section 4 (white space processing details) and subsections.
Missing tests:
- wrappable inlines inside white-space:pre blocks don’t get ignored
- No test of Animation type.
- intrinsic (min and max) sizing tests for values other than pre-wrap and break-spaces
Possible addition:
- coverage of "break-spaces" not as exhaustive as other values. Basic behavior is covered, and difference from "pre-wrap" is covered as well, so this is adequate, but it doesn't have the long list of basic tests that other values got from the CSS2 test suite.
Partial coverage.
Missing tests:
- As required by [UNICODE], unsupported Default_ignorable characters must be ignored for rendering.
Sufficient coverage. All parts of this section are well exercised.
Most tests to be found in subsections.
Sufficient coverage. All parts of this section are well exercised.
Partial coverage.
Indirectly tested, no dedicated tests:
- When 'white-space' is ''break-spaces'' segment breaks are not collapsible and are instead transformed into a preserved line feed (U+000A).
Missing tests:
- the first 3 bullet points are not tested for “nowrap”
- “Otherwise, if the writing system of the segment break is Chinese, Japanese, or Yi, […]”
- For this purpose, Emoji (Unicode property Emoji) with an East Asian Width property of W or N are treated as having an East Asian Width property of A.
- “Otherwise, the segment break is converted to a space (U+0020).”
- inline element boundary and out of flow elements have no effect on these rules
Almost sufficient coverage. Most parts of this section are well exercised.
Missing tests:
- See [UAX9] for rules on how U+0009 tabulation interacts with bidi.
Partial coverage.
Missing tests
- No test of Animation type.
Tests not really needed: these are definitions, they get tested through their applications, not standalone.
Can be a good section to host tests for i18n requirements not covered in detail by the spec.
Possible Additions:
- Basic line breaking tests for any language mentioned (Thai, Lao, Khmer, Javanese, Balinese, Yi…)
Partial Coverage.
Missing tests:
- “Regardless of the white-space value […] the BK, NL […] classes […] must be honored”
- For soft wrap opportunities before the first or after the last character of a box, the break occurs immediately before/after the box (at its margin edge) rather than breaking the box between its content edge and the content.
Untestable(?):
- UAs that allow wrapping at punctuation other than spaces should prioritize breakpoints. […]
Partial Coverage.
Missing tests:
- keep-all and break-word apply to inlines
- No test of Animation type.
- affects intrinsic sizing (tested for word-break:break-word)
- and/or non-letter typographic character units belonging to the NU, AL, AI, or ID Unicode line breaking classes [UAX14]
- 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>
Covered, but could have more:
- It does not affect rules governing the soft wrap opportunities created around punctuation
Extensive CJK coverage.
Missing tests:
- applies to inlines
- No test of Animation type.
- affects intrinsic sizing
Untestable(?):
Spotty coverage.
Covered, but insufficiently:
Missing tests:
- applies to inlines
- No test of Animation type.
- Affects intrinsic sizing
- none value
- none does not suppress wrapping after an actual hyphen
- basic behavior of auto when lang is declared and there’s no soft hyphen
- However, if, even after breaking at such opportunities, a portion of that word is is still too long to fit on one line, an automatic hyphenation opportunity may be used.
Partial coverage.
Missing tests:
- No test of Animation type.
Good Coverage.
Test only needed in subsection.
Partial Coverage.
Missing tests:
- If (after justification, if any) the inline contents of a line box are too long to fit within it, then the contents are start-aligned: any content that doesn’t fit overflows the line box’s end edge.
- If the UA chooses to adjust the text, then it must ensure that tab stops continue to line up
- “Values other than justify-all or match-parent are assigned to text-align-all and reset text-align-last to auto.”, and being a shorthand in general
No Tests.
Almost no automated tests.
Light coverage.
Note: all values (other than auto) are tested, but the tests are minimal. Not sure we can do better though.
Missing tests:
- No test of Animation type.
Untestable(?):
No tests.
Missing tests:
- whether a typographic character unit provides a justification opportunity is controlled by the text-justify value of its parent;
- whether a justification opportunity exists between two consecutive typographic character units is determined by the text-justify value of their nearest common ancestor.
- UAs must not break required ligatures or otherwise disable features required to correctly shape complex scripts
- … and maybe more
No tests.
Not sure what is testable though
Basic coverage.
Missing tests:
- Values of text-align-last other than justify
- A broader range of non-stretchable content that just an empty span with padding
No automated tests.
No Tests
Test only needed in subsections.
Almost No tests.
Missing tests:
- applies to inlines
- inherit lengths as absolute
- computed / resolved value of normal
- <length> Specifies extra spacing in addition
- negative values are allowed
- doesn’t do anything between words defined by text analysis like in Thai, only on actual word separators
- if a word-separating character has a zero advance width (such as the zero width space U+200B) then the user agent must not create an additional spacing between words.
- General punctuation and fixed-width spaces (such as U+3000 and U+2000 through U+200A) are not considered word-separator characters.
- word-spacing and bidi
- Tests for https://github.com/w3c/csswg-drafts/issues/3878
Problematic test
- text-word-spacing-001.html is wrong, the property no longer takes percentages
Spotty Coverage.
Missing tests:
- applies to inlines
- is in addition to any word-spacing
- inherit lengths as absolute
- <length> Specifies extra spacing in addition
- negative values are allowed
- For legacy reasons, a computed letter-spacing of zero yields a resolved value (getComputedStyle() return value) of normal.
- For the purpose of letter-spacing, each consecutive run of atomic inlines (such as images and inline blocks) is treated as a single typographic character unit.
- When the effective spacing between two characters is not zero (due to either justification or a non-zero value of letter-spacing), user agents should not apply optional ligatures
- However, ligatures and other font features specified via the low-level font-feature-settings property take precedence over this rule
No Tests.
Not sure this can be tested automatically.
Good Coverage.
Test only needed in subsection.
Partial Coverage.
Missing tests:
- length values
- applies to first line only
- hanging keyword
- applied to the correct side in rtl
- each-line keyword
Coverage TBD. Partly tested through 8.2, partly through white-space.
Spotty Coverage.
All values tested.
Missing tests:
- No test of Animation type.
- Affects intrinsic sizing
- each value has a test, and checks with some characters, but there isn’t a test for every relevant unicode character
- it is not considered when measuring the line’s contents for […] alignment
- it is not considered when measuring the line’s contents for […] justification
- Non-zero inline-axis borders or padding between a hangable mark and the edge of the line prevent the mark from hanging
- At most one punctuation character may hang at each edge of the line.
- is still counted as part of the scrollable overflow region
No tests.
Missing tests:
- if its containing block has unicode-bidi: plaintext [CSS-WRITING-MODES-3], the line box’s inline base direction must be determined by the inline base direction of the bidi paragraph to which it belongs
- An empty line box (i.e. one that contains no atomic inlines or characters other than the line-breaking character, if any), takes its inline base direction from the preceding line box (if any), or, if this is the first line box in the containing block, then from the direction property of the containing block.
No Tests. Probably not needed anyway.
No Tests.
Missing tests:
- §4.1.1 Phase I: Collapsing and Transformation is applied and any sequence of collapsible spaces at the beginning of a block or immediately following a forced line break is removed.
Tests not needed.
Tests not needed?
No Tests.
Missing tests:
- For the purposes of CSS Text, the properties of a typographic character unit are given by the base character of its first grapheme cluster—except in two cases:
- Grapheme clusters formed with an Enclosing Mark (Me) of the Common script are considered to be Other Symbols (So) in the Common script. They are assumed to have the same Unicode properties as the Replacement Character U+FFFD.
- Grapheme clusters formed with a Space Separator (Zs) as the base are considered to be Modifier Symbols (Sk). They are assumed to have the same East Asian Width property as the base, but take their other properties from the first combining character in the sequence.
Partial Coverage.
Each of the diverse properties that take the content language into account is tested, except tested on text-justification:auto, but probably not testable anyway.
Missing tests:
- if the writing system to specified to be one of the Hant, Hans, Hani, Hanb, or Bopo [ISO15924] codes, then the writing system is Chinese.
- if the writing system to specified to be one of the Jpan, Hira [ISO15924] codes, then the writing system is Japanese.
- if the writing system to specified to be one of the Kore, Hang, or Jamo [ISO15924] codes, then the writing system is Korean.
Adequate Coverage.
Tested via the text-transform property.