Skip to content

[css-text] Clarification on the trimming and positioning of whitespace #9307

Open
@yarusome

Description

@yarusome

In 4.1.2. Phase II: Trimming and Positioning:

Then, the entire block is rendered. Inlines are laid out,[…] and wrapping as specified by the white-space property. As each line is laid out,
[…]
3. A sequence of collapsible spaces at the end of a line is removed,[…]

Given the above procedure, the markup:

<style>div {
  border: solid;
  font-family: monospace;
  width: 1ch;
}</style>
<div>a b</div>

would first have <div> broken into two lines: a (a followed by a space) and b, then the space would be removed.

However, removing the space:

  1. is clearly different from what UAs currently do;

  2. is contradictory to UAX #14;

  3. renders the first case in Step 4 in 4.1.2. Phase II: Trimming and Positioning unreachable:

    If white-space is set to normal, nowrap, or pre-line, the UA must hang this sequence (unconditionally).

So what's the correct interpretation of Step 3?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions