[webkit-changes] [WebKit/WebKit] 951ce5: [leading-trim][IFC] Add support for leading-trim o...

Alan Baradlay noreply at github.com
Sat Dec 3 16:36:44 PST 2022


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

  Changed paths:
    M Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBox.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h

  Log Message:
  -----------
  [leading-trim][IFC] Add support for leading-trim on non-root inline boxes
https://bugs.webkit.org/show_bug.cgi?id=248644

Reviewed by Antti Koivisto.

This patch adds initial support for leading-trim on non-root inline boxes.
"leading-trim" consults "text-edge" and trims the over/under sides accordingly.

Trimming here means that the content box of the inline box shrinks to match what "text-edge" says.
It also means that now the content logical top inside the inline box does not necessarily match the inline box's logical top. e.g. when text-edge says "ex" and leading-trim says "start", the "over ex" part of the text content starts overflowing the inline box's content box, or in other words the text content's top position is above the containing inline box's top.

* Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h:
(WebCore::Layout::InlineLevelBox::leadingTrim const):
(WebCore::Layout::InlineLevelBox::inlineBoxContentOffsetForLeadingTrim const):
(WebCore::Layout::InlineLevelBox::setInlineBoxContentOffsetForLeadingTrim):
(WebCore::Layout::m_style):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBox.cpp:
(WebCore::Layout::LineBox::logicalRectForTextRun const):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::computedAsentAndDescentForInlineBox const):
(WebCore::Layout::LineBoxBuilder::setVerticalPropertiesForInlineLevelBox const):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h:

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




More information about the webkit-changes mailing list