Bug 249840 - [text-wrap] Support text-wrap: balance
Summary: [text-wrap] Support text-wrap: balance
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Choi
Keywords: InRadar
: 230473 (view as bug list)
Depends on:
Blocks: 245561
  Show dependency treegraph
Reported: 2022-12-23 00:15 PST by Tim Nguyen (:ntim)
Modified: 2024-02-11 09:58 PST (History)
12 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Tim Nguyen (:ntim) 2022-12-23 00:15:10 PST

> balance

Same as wrap for inline boxes. For block containers that establish an inline formatting context, line breaks are chosen to balance the remaining (empty) space in each line box, if better balance than wrap is possible. This must not change the number of line boxes the block would contain if text-wrap were set to wrap.
The remaining space to consider is that which remains after placing floats and inline content, but before any adjustments due to text justification. Line boxes are balanced when the standard deviation from the average inline-size of the remaining space in each line box is reduced over the block (including lines that end in a forced break).

The exact algorithm is UA-defined.

UAs may treat this value as wrap if there are more than ten lines to balance.
Comment 1 Radar WebKit Bug Importer 2022-12-23 00:16:46 PST
Comment 2 Tim Nguyen (:ntim) 2022-12-23 01:32:47 PST
*** Bug 230473 has been marked as a duplicate of this bug. ***
Comment 3 David Choi 2023-06-27 15:44:39 PDT
Pull request: https://github.com/WebKit/WebKit/pull/15348
Comment 4 David Choi 2023-08-07 15:39:56 PDT
Pull request: https://github.com/WebKit/WebKit/pull/16455
Comment 5 David Choi 2023-08-15 15:20:39 PDT
Pull request: https://github.com/WebKit/WebKit/pull/16723
Comment 6 EWS 2023-08-16 19:53:13 PDT
Committed 266980@main (2d299a2dd8bb): <https://commits.webkit.org/266980@main>

Reviewed commits have been landed. Closing PR #16723 and removing active labels.