Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 79a60c46a38e1755de8489acaa6349acad80f9cb
      
https://github.com/WebKit/WebKit/commit/79a60c46a38e1755de8489acaa6349acad80f9cb
  Author: Yulun Wu <[email protected]>
  Date:   2025-02-07 (Fri, 07 Feb 2025)

  Changed paths:
    M 
Source/WebCore/layout/formattingContexts/inline/InlineContentConstrainer.cpp

  Log Message:
  -----------
  [text-wrap-style pretty] Refactor cost function and entry data struct.
https://bugs.webkit.org/show_bug.cgi?id=287177
<rdar://144333739>

Reviewed by Alan Baradlay.

This is a cleanup/refactor PR that does a couple things:

1) Refactors out the float adjusting text-wrap-style:pretty target line length.
This makes it easier to find and adjust this float in the future.

2) Refactors out `entry` struct into `entryBalance` and `entryPretty` for 
clarity.
This removes duplicate code shared between balanceRangeWithLineRequirement and
balanceRangeWithoutLineRequirement, as well as clarifies that prettifyRange a
different struct. Note that entryPretty:endsWithHyphen is currently not used. 
This
will be fixed in a follow up PR.

3) Refactors out cost computation for pretty, balance, and raggedness.
This clarifies the scoring use for text-wrap-style:balance and 
text-wrap-style:pretty,
making it easier for future authors to understand what heuristics are being used
for different text-wrap-styles and how the differ. Additionally, this also 
clarifies
the use of the raggedness metric which is used by both text-wrap-mode:balance 
as well
as the first line for text-wrap-mode:pretty.

Finally, this PR adds FIXMEs for computeCostPretty, clarifying opportunities 
for future work.

Canonical link: https://commits.webkit.org/290053@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to