Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 5e3a00ec453fb5bdcf2db0e4ddb3ae0d9e6eee43 https://github.com/WebKit/WebKit/commit/5e3a00ec453fb5bdcf2db0e4ddb3ae0d9e6eee43 Author: Yulun Wu <yulu...@chromium.org> Date: 2025-02-25 (Tue, 25 Feb 2025)
Changed paths: M Source/WebCore/layout/formattingContexts/inline/InlineContentConstrainer.cpp M Source/WebCore/layout/formattingContexts/inline/InlineContentConstrainer.h Log Message: ----------- [text-wrap-style:pretty] improve orphan avoidance heuristic. https://bugs.webkit.org/show_bug.cgi?id=288236 <rdar://145318314> Reviewed by Alan Baradlay. This PR improves the orphan avoidance heuristic for text-wrap-style:pretty by targeting a minimum of 2 inline items for the last line. This is done by updating computeCostPretty to automatically accept breaking points that would create an acceptable last line without causing excessive line shrinkage. In addition, this PR also updates layoutSingleLineForPretty() support orphan avoidance by shortening the layout range by lastLinePreferredInlineItemCount to prevent it from creating orphan lines. This PR also sets a minimum idealLineWidth for prettifyRange() which is based on the size of the longest inline item to be prettified. When this minimum is not met, we fall back to using greedy text wrapping. Canonical link: https://commits.webkit.org/291066@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes