Diff
Modified: trunk/Source/WebCore/ChangeLog (283313 => 283314)
--- trunk/Source/WebCore/ChangeLog 2021-09-30 15:42:31 UTC (rev 283313)
+++ trunk/Source/WebCore/ChangeLog 2021-09-30 15:43:13 UTC (rev 283314)
@@ -1,3 +1,18 @@
+2021-09-30 Alan Bujtas <za...@apple.com>
+
+ [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):
+
2021-09-30 Alex Christensen <achristen...@webkit.org>
Clean up PrivateClickMeasurement
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBox.cpp (283313 => 283314)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBox.cpp 2021-09-30 15:42:31 UTC (rev 283313)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBox.cpp 2021-09-30 15:43:13 UTC (rev 283314)
@@ -34,8 +34,8 @@
namespace WebCore {
namespace Layout {
-LineBox::LineBox(const Box& rootLayoutBox, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth, size_t nonSpanningInlineLevelBoxCount)
- : m_rootInlineBox(rootLayoutBox, rootLayoutBox.style(), contentLogicalLeft, InlineLayoutSize { contentLogicalWidth, { } }, InlineLevelBox::Type::RootInlineBox)
+LineBox::LineBox(const Box& rootLayoutBox, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth, size_t lineIndex, size_t nonSpanningInlineLevelBoxCount)
+ : m_rootInlineBox(rootLayoutBox, !lineIndex ? rootLayoutBox.firstLineStyle() : rootLayoutBox.style(), contentLogicalLeft, InlineLayoutSize { contentLogicalWidth, { } }, InlineLevelBox::Type::RootInlineBox)
{
m_nonRootInlineLevelBoxList.reserveInitialCapacity(nonSpanningInlineLevelBoxCount);
m_nonRootInlineLevelBoxMap.reserveInitialCapacity(nonSpanningInlineLevelBoxCount);
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBox.h (283313 => 283314)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBox.h 2021-09-30 15:42:31 UTC (rev 283313)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBox.h 2021-09-30 15:43:13 UTC (rev 283314)
@@ -59,7 +59,7 @@
class LineBox {
WTF_MAKE_FAST_ALLOCATED;
public:
- LineBox(const Box& rootLayoutBox, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth, size_t nonSpanningInlineLevelBoxCount);
+ LineBox(const Box& rootLayoutBox, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth, size_t lineIndex, size_t nonSpanningInlineLevelBoxCount);
// Note that the line can have many inline boxes and be "empty" the same time e.g. <div><span></span><span></span></div>
bool hasContent() const { return m_hasContent; }
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp (283313 => 283314)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp 2021-09-30 15:42:31 UTC (rev 283313)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp 2021-09-30 15:43:13 UTC (rev 283314)
@@ -115,7 +115,7 @@
auto contentLogicalWidth = lineContent.contentLogicalWidth;
auto textAlign = !lineIndex ? rootBox().firstLineStyle().textAlign() : rootBox().style().textAlign();
auto contentLogicalLeft = Layout::horizontalAlignmentOffset(runs, textAlign, lineContent.lineLogicalWidth, contentLogicalWidth, lineContent.isLastLineWithInlineContent).value_or(InlineLayoutUnit { });
- auto lineBox = LineBox { rootBox(), contentLogicalLeft, contentLogicalWidth, lineContent.nonSpanningInlineLevelBoxCount };
+ auto lineBox = LineBox { rootBox(), contentLogicalLeft, contentLogicalWidth, lineIndex, lineContent.nonSpanningInlineLevelBoxCount };
auto lineBoxLogicalHeight = constructAndAlignInlineLevelBoxes(lineBox, runs, lineIndex);