Modified: trunk/Source/WebCore/ChangeLog (283441 => 283442)
--- trunk/Source/WebCore/ChangeLog 2021-10-02 13:40:20 UTC (rev 283441)
+++ trunk/Source/WebCore/ChangeLog 2021-10-02 13:51:47 UTC (rev 283442)
@@ -1,3 +1,18 @@
+2021-10-02 Alan Bujtas <[email protected]>
+
+ [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):
+
2021-10-02 Cathie Chen <[email protected]>
[Performance] Optimize RenderLayer::establishesTopLayer
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp (283441 => 283442)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp 2021-10-02 13:40:20 UTC (rev 283441)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp 2021-10-02 13:51:47 UTC (rev 283442)
@@ -189,7 +189,7 @@
// Check for partially collapsible content.
if (m_ignoreTrailingLetterSpacing)
return { };
- auto letterSpacing = inlineItem.style().letterSpacing();
+ auto letterSpacing = style.letterSpacing();
if (letterSpacing <= 0)
return { };
ASSERT(logicalWidth > letterSpacing);
@@ -705,7 +705,7 @@
// This continuous content can be fully placed on the current line.
m_lineLogicalRect = lineLogicalRectForCandidateContent;
for (auto& run : candidateRuns)
- m_line.append(run.inlineItem, run.inlineItem.style(), run.logicalWidth);
+ m_line.append(run.inlineItem, run.style, run.logicalWidth);
if (lineCandidate.inlineContent.hasTrailingSoftWrapOpportunity()) {
// Check if we are allowed to wrap at this position.
auto& trailingRun = candidateRuns.last();
@@ -804,10 +804,10 @@
return;
}
// The partial run is the last content to commit.
- m_line.append(run.inlineItem, run.inlineItem.style(), run.logicalWidth);
+ m_line.append(run.inlineItem, run.style, run.logicalWidth);
return;
}
- m_line.append(run.inlineItem, run.inlineItem.style(), run.logicalWidth);
+ m_line.append(run.inlineItem, run.style, run.logicalWidth);
}
}
@@ -826,7 +826,8 @@
}
for (; currentItemIndex < layoutRange.end; ++currentItemIndex) {
auto& inlineItem = m_inlineItems[currentItemIndex];
- m_line.append(inlineItem, inlineItem.style(), inlineItemWidth(inlineItem, m_line.contentLogicalRight()));
+ auto& style = m_isFirstLine ? inlineItem.firstLineStyle() : inlineItem.style();
+ m_line.append(inlineItem, style, inlineItemWidth(inlineItem, m_line.contentLogicalRight()));
if (&inlineItem == &lastInlineItemToAdd)
return currentItemIndex - layoutRange.start + 1;
}