[webkit-changes] [WebKit/WebKit] 9cc33f: [IFC] Move horizontal alignment offset computation...

Alan Baradlay noreply at github.com
Thu Jan 5 08:04:05 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9cc33f113f0fdb5987c5c3622ad9dbca1e5d8482
      https://github.com/WebKit/WebKit/commit/9cc33f113f0fdb5987c5c3622ad9dbca1e5d8482
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-01-05 (Thu, 05 Jan 2023)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h
    M Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp

  Log Message:
  -----------
  [IFC] Move horizontal alignment offset computation to LineBuilder
https://bugs.webkit.org/show_bug.cgi?id=250077

Reviewed by Antti Koivisto.

This patch is in preparation for fixing webkit.org/b/249974 (Incorrect ellipsis placement with text-align: center).

In order to compute the (real) available space for the ellipsis (and whether the trailing content needs truncation),
we need to know the alignment offset.

E.g. when the content is right aligned, the available space for the ellipsis is 0 even when the line still has some space left.

|    right aligned text| <- available space is clearly > 0, though it's in front of the content.
|    right aligned t...| <- this is where the ellipsis should be placed (by truncating "text" run)

* Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::build):
(WebCore::Layout::horizontalAlignmentOffset): Deleted.
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::layoutInlineContent):
(WebCore::Layout::LineBuilder::close):
(WebCore::Layout::LineBuilder::inlineBaseDirectionForLineContent const):
(WebCore::Layout::LineBuilder::horizontalAlignmentOffset const):
(WebCore::Layout::LineBuilder::inlineBaseDirectionForLineContent): Deleted.
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h:
* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp:
(WebCore::Layout::InlineDisplayLineBuilder::build const):

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




More information about the webkit-changes mailing list