Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 08cf556acd493da21586d7b8e81c7bf7671eb7de
      
https://github.com/WebKit/WebKit/commit/08cf556acd493da21586d7b8e81c7bf7671eb7de
  Author: Alan Baradlay <[email protected]>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/reference/white-space-trim-discard-inner-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/white-space-trim-discard-inner-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/white-space-trim-discard-inner.html
    M Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp

  Log Message:
  -----------
  [CSS] Support the white-space-trim: discard-inner value
https://bugs.webkit.org/show_bug.cgi?id=319173
rdar://182010222

Reviewed by Antti Koivisto.

Implement the 'discard-inner' value of the CSS Text 4 'white-space-trim' 
property
(https://drafts.csswg.org/css-text-4/#white-space-trim) in the modern inline 
layout
path, behind the existing CSSWhiteSpaceTrimEnabled setting. This builds on the
'discard-before' / 'discard-after' support.

'discard-inner' removes the collapsible white space at the start and end of the
element's own content -- i.e. immediately inside its edges. It maps onto the 
same
single forward pass over the inline items that already implements 
discard-before /
discard-after: a discard-inner inline box start arms the "discard the following
collapsible white space" state (like discard-after does at an end edge), and a
discard-inner inline box end discards the collapsible white space accumulated 
since
the last piece of real content (like discard-before does at a start edge). 
Inline
box boundaries remain transparent, so the trimming reaches across nested empty
boxes. As with the other values, only collapsible white space is affected:
preserved white space and non-collapsible characters (e.g. the ideographic space
U+3000) are left untouched.

This covers discard-inner on inline boxes. The block-level facet of the spec --
trimming the collapsible white space at the start and end of each line of a 
block
container -- is a line-layout-time concern and is left as a follow-up.

* LayoutTests/TestExpectations: The imported 
white-space-trim-discard-inner-001.xht
now passes; remove its ImageOnlyFailure expectation.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/white-space-trim-discard-inner.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/white-space-trim-discard-inner-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/reference/white-space-trim-discard-inner-ref.html:
 Added.
* Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::InlineItemsBuilder::adjustInlineItemsForWhiteSpaceTrim): 
Discard the
collapsible white space at the start and end of a discard-inner box's content, 
reusing
the discard-after / discard-before mechanisms at the box's start / end edges.

Canonical link: https://commits.webkit.org/317210@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to