Skip to content

[css-text-3] Segment Break Transformation Rules, U+200B, inline box boundaries, and display:none #4259

Closed
@frivoal

Description

@frivoal

The Segment Break Transformation Rules says this:

If the character immediately before or immediately after the segment break is the zero-width space character (U+200B), then the break is removed, leaving behind the zero-width space.

It means that

aaaa​
bbbb

is rendered as if it were

aaaa​bbbb

I like it, but:

  • If there is an inline box boundary between the U+200B and the segment break, does it still count as "immediately before or immediately after" or not? Since inline box boundaries are not meant to affect text layout, I'd say yes, but I don't know for sure that this is what the spec means. In other words, does
    aaaa<span>&#x200b;</span>
    bbbb
    
    get rendered as if it were
    aaaa<span>&#x200b;</span>bbbb
    
    or
    aaaa<span>&#x200b;</span> bbbb
    
  • Assuming inline boundaries don't make a difference (otherwise the point is moot), does the display value of the U+200B matter? Obviously, if it has a display value that makes it not inline, then it does, but what if it's display none? In other words, does
    aaaa<span style=display:none>&#x200b;</span>
    bbbb
    
    get rendered as if it were
    aaaabbbb
    
    or
    aaaa bbbb
    

I'd propose clarifying the sentence to:

If the character immediately before or immediately after (ignoring any intervening inline box boundaries) the segment break is the zero-width space character (U+200B) and the computed value of the 'display' property on that character is not ''none'', then the break is removed, leaving behind the zero-width space.

I suppose the alternative would be to consider that this operation works on the element tree rather than the box tree, but that seems weird.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions