Title: [283256] trunk/Source/WebCore
Revision
283256
Author
[email protected]
Date
2021-09-29 13:29:09 -0700 (Wed, 29 Sep 2021)

Log Message

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

Reviewed by Antti Koivisto.

This is in preparation for supporting first-line style.

* layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::build):
(WebCore::Layout::InlineDisplayContentBuilder::createBoxesAndUpdateGeometryForLineContent):
(WebCore::Layout::InlineDisplayContentBuilder::createBoxesAndUpdateGeometryForLineSpanningInlineBoxes):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (283255 => 283256)


--- trunk/Source/WebCore/ChangeLog	2021-09-29 20:16:10 UTC (rev 283255)
+++ trunk/Source/WebCore/ChangeLog	2021-09-29 20:29:09 UTC (rev 283256)
@@ -1,5 +1,19 @@
 2021-09-29  Alan Bujtas  <[email protected]>
 
+        [LFC][IFC] InlineDisplayContentBuilder should use the first-line style when applicable
+        https://bugs.webkit.org/show_bug.cgi?id=230932
+
+        Reviewed by Antti Koivisto.
+
+        This is in preparation for supporting first-line style.
+
+        * layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:
+        (WebCore::Layout::InlineDisplayContentBuilder::build):
+        (WebCore::Layout::InlineDisplayContentBuilder::createBoxesAndUpdateGeometryForLineContent):
+        (WebCore::Layout::InlineDisplayContentBuilder::createBoxesAndUpdateGeometryForLineSpanningInlineBoxes):
+
+2021-09-29  Alan Bujtas  <[email protected]>
+
         [LFC][IFC] Pass in the first-line style to the InlineContentBreaker::ContinuousContent runs if applicable
         https://bugs.webkit.org/show_bug.cgi?id=230924
 

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp (283255 => 283256)


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp	2021-09-29 20:16:10 UTC (rev 283255)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp	2021-09-29 20:29:09 UTC (rev 283256)
@@ -50,7 +50,7 @@
     // Every line starts with a root box, even the empty ones.
     auto rootInlineBoxRect = lineBox.logicalRectForRootInlineBox();
     rootInlineBoxRect.moveBy(lineBoxLogicalTopLeft);
-    boxes.append({ lineIndex, InlineDisplay::Box::Type::RootInlineBox, root(), root().style(), rootInlineBoxRect, rootInlineBoxRect, { }, { },  lineBox.rootInlineBox().hasContent()});
+    boxes.append({ lineIndex, InlineDisplay::Box::Type::RootInlineBox, root(), !lineIndex ? root().firstLineStyle() : root().style(), rootInlineBoxRect, rootInlineBoxRect, { }, { },  lineBox.rootInlineBox().hasContent()});
 
     createBoxesAndUpdateGeometryForLineSpanningInlineBoxes(lineBox, lineBoxLogicalTopLeft, lineIndex, boxes);
     createBoxesAndUpdateGeometryForLineContent(lineContent, lineBox, lineBoxLogicalTopLeft, lineIndex, boxes);
@@ -64,8 +64,9 @@
     // Create the inline boxes on the current line. This is mostly text and atomic inline boxes.
     for (auto& lineRun : lineContent.runs) {
         auto& layoutBox = lineRun.layoutBox();
-        // FIXME: This should be lineIndex dependent to support first-line style.
-        auto& style = layoutBox.style();
+        auto& style = [&] () -> const RenderStyle& {
+            return !lineIndex ? layoutBox.firstLineStyle() : layoutBox.style();
+        }();
 
         switch (lineRun.type()) {
         case InlineItem::Type::Text: {
@@ -195,8 +196,9 @@
         if (!inlineLevelBox.isLineSpanningInlineBox())
             continue;
         auto& layoutBox = inlineLevelBox.layoutBox();
-        // FIXME: This should be lineIndex dependent to support first-line style.
-        auto& style = layoutBox.style();
+        auto& style = [&] () -> const RenderStyle& {
+            return !lineIndex ? layoutBox.firstLineStyle() : layoutBox.style();
+        }();
         auto& boxGeometry = formattingState.boxGeometry(layoutBox);
         // Inline boxes may or may not be wrapped and have boxes on multiple lines (e.g. <span>first line<br>second line<br>third line</span>)
         auto inlineBoxBorderBox = lineBox.logicalBorderBoxForInlineBox(layoutBox, boxGeometry);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to