[webkit-changes] [WebKit/WebKit] e65bb2: [IFC][hanging punctuation] Move trailing hanging c...

Alan Baradlay noreply at github.com
Tue Dec 20 18:12:26 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e65bb2e32c3ff1672159bd68c676755844d0f8aa
      https://github.com/WebKit/WebKit/commit/e65bb2e32c3ff1672159bd68c676755844d0f8aa
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2022-12-20 (Tue, 20 Dec 2022)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLine.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp

  Log Message:
  -----------
  [IFC][hanging punctuation] Move trailing hanging content handling from LineBuilder to Line
https://bugs.webkit.org/show_bug.cgi?id=249650

Reviewed by Antti Koivisto.

1. reset trailing punctuation if the current line is not the last formatted line (trailing punctuation is not supposed to be hanging)
2. shrink the content logical width by the hanging content if in preferred width computation mode

* Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp:
(WebCore::Layout::Line::handleTrailingHangingContent):
(WebCore::Layout::Line::removeHangingGlyphs): Deleted.
* Source/WebCore/layout/formattingContexts/inline/InlineLine.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::close):
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::hangablePunctuationStartWidth): off-by-one fix.
(WebCore::Layout::TextUtil::hasHangablePunctuationEnd):
(WebCore::Layout::TextUtil::hangablePunctuationEndWidth):
(WebCore::Layout::TextUtil::hangableStopOrCommaEndWidth):

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




More information about the webkit-changes mailing list