Skip to content

Commit

Permalink
Support first-line related CSS interactions in text-wrap: balance
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=260229
rdar://113934501

Reviewed by Alan Baradlay.

This patch implements support for first-line styling, text-indent,
and white-space-collapse in text-wrap: balance. All three of these
properties depend on special-casing the first line when balancing
inline content. In the case of white-space-collapse: preserve, we
mostly trim leading/trailing white space, except in the case where
there is preserved leading white space on the first line.

This patch also supports white-space-collapse: break-spaces.

* LayoutTests/TestExpectations:
* Source/WebCore/layout/formattingContexts/inline/InlineContentBalancer.cpp:
(WebCore::Layout::InlineContentBalancer::initialize):
(WebCore::Layout::InlineContentBalancer::computeBalanceConstraints):
(WebCore::Layout::InlineContentBalancer::balanceRangeWithLineRequirement):
(WebCore::Layout::InlineContentBalancer::balanceRangeWithNoLineRequirement):
(WebCore::Layout::InlineContentBalancer::inlineItemWidth const):
(WebCore::Layout::InlineContentBalancer::shouldTrimLeading const):
(WebCore::Layout::InlineContentBalancer::shouldTrimTrailing const):
(WebCore::Layout::InlineContentBalancer::SlidingWidth::SlidingWidth):
(WebCore::Layout::InlineContentBalancer::SlidingWidth::advanceStart):
(WebCore::Layout::InlineContentBalancer::SlidingWidth::advanceEnd):
* Source/WebCore/layout/formattingContexts/inline/InlineContentBalancer.h:

Canonical link: https://commits.webkit.org/267009@main
  • Loading branch information
RWDavid authored and stwrt committed Aug 17, 2023
1 parent 7090728 commit d25ec10
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 51 deletions.
1 change: 0 additions & 1 deletion LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -2896,7 +2896,6 @@ webkit.org/b/257049 imported/w3c/web-platform-tests/css/css-text/white-space/seg
webkit.org/b/257049 imported/w3c/web-platform-tests/css/css-text/white-space/seg-break-transformation-019.tentative.html [ ImageOnlyFailure ]
webkit.org/b/257049 imported/w3c/web-platform-tests/css/css-text/white-space/tab-bidi-001.html [ ImageOnlyFailure ]
webkit.org/b/257049 imported/w3c/web-platform-tests/css/css-text/white-space/text-wrap-balance-line-clamp-001.html [ ImageOnlyFailure ]
webkit.org/b/257049 imported/w3c/web-platform-tests/css/css-text/white-space/text-wrap-balance-text-indent-001.html [ ImageOnlyFailure ]
webkit.org/b/257049 imported/w3c/web-platform-tests/css/css-text/white-space/trailing-ideographic-space-005.html [ ImageOnlyFailure ]
webkit.org/b/257049 imported/w3c/web-platform-tests/css/css-text/white-space/trailing-ideographic-space-006.html [ ImageOnlyFailure ]
webkit.org/b/257049 imported/w3c/web-platform-tests/css/css-text/white-space/trailing-ideographic-space-008.html [ ImageOnlyFailure ]
Expand Down
Loading

0 comments on commit d25ec10

Please sign in to comment.