⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283314 in webkit


Ignore:
Timestamp:
Sep 30, 2021, 8:43:13 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] RootInlineBox should use the first-line style when applicable
https://bugs.webkit.org/show_bug.cgi?id=231003

Reviewed by Antti Koivisto.

This is in preparation for supporting first-line style.

  • layout/formattingContexts/inline/InlineLineBox.cpp:

(WebCore::Layout::LineBox::LineBox):

  • layout/formattingContexts/inline/InlineLineBox.h:
  • layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:

(WebCore::Layout::LineBoxBuilder::build):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r283313 r283314  
     12021-09-30  Alan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] RootInlineBox should use the first-line style when applicable
     4        https://bugs.webkit.org/show_bug.cgi?id=231003
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This is in preparation for supporting first-line style.
     9
     10        * layout/formattingContexts/inline/InlineLineBox.cpp:
     11        (WebCore::Layout::LineBox::LineBox):
     12        * layout/formattingContexts/inline/InlineLineBox.h:
     13        * layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
     14        (WebCore::Layout::LineBoxBuilder::build):
     15
    1162021-09-30  Alex Christensen  <achristensen@webkit.org>
    217
  • trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBox.cpp

    r283042 r283314  
    3535namespace Layout {
    3636
    37 LineBox::LineBox(const Box& rootLayoutBox, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth, size_t nonSpanningInlineLevelBoxCount)
    38     : m_rootInlineBox(rootLayoutBox, rootLayoutBox.style(), contentLogicalLeft, InlineLayoutSize { contentLogicalWidth, { } }, InlineLevelBox::Type::RootInlineBox)
     37LineBox::LineBox(const Box& rootLayoutBox, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth, size_t lineIndex, size_t nonSpanningInlineLevelBoxCount)
     38    : m_rootInlineBox(rootLayoutBox, !lineIndex ? rootLayoutBox.firstLineStyle() : rootLayoutBox.style(), contentLogicalLeft, InlineLayoutSize { contentLogicalWidth, { } }, InlineLevelBox::Type::RootInlineBox)
    3939{
    4040    m_nonRootInlineLevelBoxList.reserveInitialCapacity(nonSpanningInlineLevelBoxCount);
  • trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBox.h

    r283158 r283314  
    6060    WTF_MAKE_FAST_ALLOCATED;
    6161public:
    62     LineBox(const Box& rootLayoutBox, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth, size_t nonSpanningInlineLevelBoxCount);
     62    LineBox(const Box& rootLayoutBox, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth, size_t lineIndex, size_t nonSpanningInlineLevelBoxCount);
    6363
    6464    // Note that the line can have many inline boxes and be "empty" the same time e.g. <div><span></span><span></span></div>
  • trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp

    r283260 r283314  
    116116    auto textAlign = !lineIndex ? rootBox().firstLineStyle().textAlign() : rootBox().style().textAlign();
    117117    auto contentLogicalLeft = Layout::horizontalAlignmentOffset(runs, textAlign, lineContent.lineLogicalWidth, contentLogicalWidth, lineContent.isLastLineWithInlineContent).value_or(InlineLayoutUnit { });
    118     auto lineBox = LineBox { rootBox(), contentLogicalLeft, contentLogicalWidth, lineContent.nonSpanningInlineLevelBoxCount };
     118    auto lineBox = LineBox { rootBox(), contentLogicalLeft, contentLogicalWidth, lineIndex, lineContent.nonSpanningInlineLevelBoxCount };
    119119
    120120    auto lineBoxLogicalHeight = constructAndAlignInlineLevelBoxes(lineBox, runs, lineIndex);
Note: See TracChangeset for help on using the changeset viewer.