Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 1be1a3f. rdar://123854414
text-wrap: balance, prefering longer lines at the beginning of block https://bugs.webkit.org/show_bug.cgi?id=268780 rdar://122338948 Reviewed by Alan Baradlay. When balancing, there are different results that produce the same score, i.e.: the overall deviation to the ideal line is the same for different layout configurations. The current implementation prefers to keep longer lines at the end of the block, rather than at the beginning. Although this is not a bug, since specification doesn't dictates the shape of balancing, this might look a bit weird for some authors, as we are used to the Greedy behavior of "wrap", which will have a shorter line at the end. Also, other UAs prefers to have longer lines at the beginning, so, although it is not a bug, it would make the feature less confusing for authors if we would match the same behavior. We are introducing a new test to track the behavior of WebKit shape, but since this is not dictate by specification, this should not be WPT test. * LayoutTests/fast/text/whitespace/text-wrap-balance-shape-expected.html: Added. * LayoutTests/fast/text/whitespace/text-wrap-balance-shape.html: Added. * Source/WebCore/layout/formattingContexts/inline/InlineContentBalancer.cpp: (WebCore::Layout::InlineContentBalancer::balanceRangeWithLineRequirement): Canonical link: https://commits.webkit.org/274125@main Canonical link: https://commits.webkit.org/272448.663@safari-7618-branch
- Loading branch information