The current implementation of text-wrap: balance does not account for ::first-line styling, text-indent, and white-space-collapse. Indentation and ::first-line styling are both CSS factors related to the first line of inline content (or, at least in the case of indentation, the first line after a forced line break). There is also the question of whether leading/trailing white space with `white-space-collapse: preserve` should count as content to be balanced. It turns out that we should always trim leading/trailing preserved white space, except if it is leading preserved white space on the first line (or the first line after a forced line break).
<rdar://problem/113934501>
Pull request: https://github.com/WebKit/WebKit/pull/16773
Committed 267009@main (d25ec10246e8): <https://commits.webkit.org/267009@main> Reviewed commits have been landed. Closing PR #16773 and removing active labels.