[webkit-changes] [WebKit/WebKit] bb7f2d: [IFC][hanging punctuation] Line::appendTextContent...

Alan Baradlay noreply at github.com
Mon Dec 19 05:52:37 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bb7f2ddd047c3e65c1ccfb76f23164457b9eebba
      https://github.com/WebKit/WebKit/commit/bb7f2ddd047c3e65c1ccfb76f23164457b9eebba
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2022-12-19 (Mon, 19 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/InlineLineBuilder.h
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h

  Log Message:
  -----------
  [IFC][hanging punctuation] Line::appendTextContent should take leading punctuation into account
https://bugs.webkit.org/show_bug.cgi?id=249567

Reviewed by Antti Koivisto.

This patch is in preparation for supporting "hanging-punctuation" property.

Line needs to know if the current line is the first formatted line in order to be able to deal with leading punctuation.
(Rename firstLine to firstFormattedLine, spec language).

* Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp:
(WebCore::Layout::Line::initialize):
(WebCore::Layout::Line::appendTextContent):
* Source/WebCore/layout/formattingContexts/inline/InlineLine.h:
(WebCore::Layout::Line::isFirstFormattedLine const):
(WebCore::Layout::Line::HangingContent::leadingWidth const): flip these 2.
(WebCore::Layout::Line::HangingContent::trailingWidth const):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::inlineItemWidth const):
(WebCore::Layout::LineBuilder::layoutInlineContent):
(WebCore::Layout::LineBuilder::initialize):
(WebCore::Layout::LineBuilder::candidateContentForLine):
(WebCore::Layout::eligibleOverflowWidthAsLeading):
(WebCore::Layout::LineBuilder::lineBoxForCandidateInlineContent const):
(WebCore::Layout::LineBuilder::handleInlineContent):
(WebCore::Layout::LineBuilder::rebuildLineWithInlineContent):
(WebCore::Layout::LineBuilder::rootStyle const):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h:
(WebCore::Layout::LineBuilder::isFirstFormattedLine const):
(WebCore::Layout::LineBuilder::isFirstLine const): Deleted.
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::hasHangablePunctuationStart):
(WebCore::Layout::TextUtil::hangablePunctuationStartWidth):
(WebCore::Layout::TextUtil::hasHangablePunctuationEnd):
(WebCore::Layout::TextUtil::hangablePunctuationEndWidth):
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h:

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




More information about the webkit-changes mailing list