Skip to content

[css-inline-3] Is text-box-trim-half-leading-block-box-003.html incorrectly counting phantom line boxes? #61079

Description

@kbhomes

Based on my reading of CSS Inline 3 § 2.3. Phantom Line Boxes and the history of text-box-trim-half-leading-block-box-003.html, I think this test is currently asserting the wrong thing because the reference is not correctly skipping past phantom line boxes. Per wpt.fyi, this test is passing in Blink because it's not trimming the inner div, while Gecko and WebKit fail because they ignore the empty spans and therefore do trim the inner div.

<div class="div-parent">
  <span>    </span>
  <div>Testline1<br>Testline2<br>Testline3</div>
  <span>	</span>
</div>

I believe these spans should be phantom line boxes, because they have no text, the white space is not preserved, no inline-axis margin/padding/borders, no other children, and no forced line break after. So per the spec, they must be ignored for first/last formatted line and for text-box-trim. Accordingly, the first/last line of #div-parent are actually Testline1 / Testline3, so the expected rendering should be as Gecko and WebKit do.

I also found that this test originally did assert the phantom line box behavior I've described. In #47606, the test directly referenced the phantom (invisible) line box definition ("text-box-trim trims through invisible line boxes"), and the reference did have trimming. This was then changed in #48815.

(cc: @fantasai who updated this test in #47606 to reference phantom line boxes, and @mstensho who made the latest edit in #48815 that changed behavior)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions