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

Changeset 283442 in webkit


Ignore:
Timestamp:
Oct 2, 2021, 6:51:47 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Pass in the correct style when adding a run to Line
https://bugs.webkit.org/show_bug.cgi?id=231100

Reviewed by Antti Koivisto.

This is in preparation for supporting first-line style.

  • layout/formattingContexts/inline/InlineLineBuilder.cpp:

(WebCore::Layout::LineCandidate::InlineContent::appendInlineItem):
(WebCore::Layout::LineBuilder::handleInlineContent):
(WebCore::Layout::LineBuilder::commitPartialContent):
(WebCore::Layout::LineBuilder::rebuildLine):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r283441 r283442  
     12021-10-02  Alan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Pass in the correct style when adding a run to Line
     4        https://bugs.webkit.org/show_bug.cgi?id=231100
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This is in preparation for supporting first-line style.
     9
     10        * layout/formattingContexts/inline/InlineLineBuilder.cpp:
     11        (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem):
     12        (WebCore::Layout::LineBuilder::handleInlineContent):
     13        (WebCore::Layout::LineBuilder::commitPartialContent):
     14        (WebCore::Layout::LineBuilder::rebuildLine):
     15
    1162021-10-02  Cathie Chen  <cathiechen@igalia.com>
    217
  • trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp

    r283440 r283442  
    190190        if (m_ignoreTrailingLetterSpacing)
    191191            return { };
    192         auto letterSpacing = inlineItem.style().letterSpacing();
     192        auto letterSpacing = style.letterSpacing();
    193193        if (letterSpacing <= 0)
    194194            return { };
     
    706706        m_lineLogicalRect = lineLogicalRectForCandidateContent;
    707707        for (auto& run : candidateRuns)
    708             m_line.append(run.inlineItem, run.inlineItem.style(), run.logicalWidth);
     708            m_line.append(run.inlineItem, run.style, run.logicalWidth);
    709709        if (lineCandidate.inlineContent.hasTrailingSoftWrapOpportunity()) {
    710710            // Check if we are allowed to wrap at this position.
     
    805805            }
    806806            // The partial run is the last content to commit.
    807             m_line.append(run.inlineItem, run.inlineItem.style(), run.logicalWidth);
     807            m_line.append(run.inlineItem, run.style, run.logicalWidth);
    808808            return;
    809809        }
    810         m_line.append(run.inlineItem, run.inlineItem.style(), run.logicalWidth);
     810        m_line.append(run.inlineItem, run.style, run.logicalWidth);
    811811    }
    812812}
     
    827827    for (; currentItemIndex < layoutRange.end; ++currentItemIndex) {
    828828        auto& inlineItem = m_inlineItems[currentItemIndex];
    829         m_line.append(inlineItem, inlineItem.style(), inlineItemWidth(inlineItem, m_line.contentLogicalRight()));
     829        auto& style = m_isFirstLine ? inlineItem.firstLineStyle() : inlineItem.style();
     830        m_line.append(inlineItem, style, inlineItemWidth(inlineItem, m_line.contentLogicalRight()));
    830831        if (&inlineItem == &lastInlineItemToAdd)
    831832            return currentItemIndex - layoutRange.start + 1;
Note: See TracChangeset for help on using the changeset viewer.