Title: [271088] trunk/Source/WebCore
Revision
271088
Author
[email protected]
Date
2020-12-26 07:22:08 -0800 (Sat, 26 Dec 2020)

Log Message

[LFC][Integration] Set pre-computed inline box geometries (margin, border and padding)
https://bugs.webkit.org/show_bug.cgi?id=220149

Reviewed by Antti Koivisto.

* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::updateInlineBoxDimensions):
* layout/integration/LayoutIntegrationLineLayout.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutModernLines):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (271087 => 271088)


--- trunk/Source/WebCore/ChangeLog	2020-12-26 10:20:03 UTC (rev 271087)
+++ trunk/Source/WebCore/ChangeLog	2020-12-26 15:22:08 UTC (rev 271088)
@@ -1,5 +1,18 @@
 2020-12-26  Zalan Bujtas  <[email protected]>
 
+        [LFC][Integration] Set pre-computed inline box geometries (margin, border and padding)
+        https://bugs.webkit.org/show_bug.cgi?id=220149
+
+        Reviewed by Antti Koivisto.
+
+        * layout/integration/LayoutIntegrationLineLayout.cpp:
+        (WebCore::LayoutIntegration::LineLayout::updateInlineBoxDimensions):
+        * layout/integration/LayoutIntegrationLineLayout.h:
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::layoutModernLines):
+
+2020-12-26  Zalan Bujtas  <[email protected]>
+
         [LFC][IFC] Remove redundant LineBox::inlineLevelBoxList()
         https://bugs.webkit.org/show_bug.cgi?id=220147
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (271087 => 271088)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2020-12-26 10:20:03 UTC (rev 271087)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2020-12-26 15:22:08 UTC (rev 271088)
@@ -169,6 +169,16 @@
     boxGeometry.setVerticalMargin({ });
 }
 
+void LineLayout::updateInlineBoxDimensions(const RenderInline& renderInline)
+{
+    auto& boxGeometry = m_layoutState.ensureGeometryForBox(m_boxTree.layoutBoxForRenderer(renderInline));
+
+    boxGeometry.setBorder({ { renderInline.borderLeft(), renderInline.borderRight() }, { renderInline.borderTop(), renderInline.borderBottom() } });
+    boxGeometry.setPadding(Layout::Edges { { renderInline.paddingLeft(), renderInline.paddingRight() }, { renderInline.paddingTop(), renderInline.paddingBottom() } });
+    boxGeometry.setHorizontalMargin({ renderInline.marginLeft(), renderInline.marginRight() });
+    boxGeometry.setVerticalMargin({ });
+}
+
 void LineLayout::updateStyle(const RenderBoxModelObject& renderer)
 {
     m_boxTree.updateStyle(renderer);

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h (271087 => 271088)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h	2020-12-26 10:20:03 UTC (rev 271087)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h	2020-12-26 15:22:08 UTC (rev 271088)
@@ -44,6 +44,7 @@
 class RenderBlockFlow;
 class RenderBox;
 class RenderBoxModelObject;
+class RenderInline;
 class RenderLineBreak;
 struct PaintInfo;
 
@@ -68,6 +69,7 @@
     void updateReplacedDimensions(const RenderBox&);
     void updateInlineBlockDimensions(const RenderBlock&);
     void updateLineBreakBoxDimensions(const RenderLineBreak&);
+    void updateInlineBoxDimensions(const RenderInline&);
     void updateStyle(const RenderBoxModelObject&);
     void layout();
 

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (271087 => 271088)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2020-12-26 10:20:03 UTC (rev 271087)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2020-12-26 15:22:08 UTC (rev 271088)
@@ -3644,6 +3644,12 @@
             continue;
         }
 
+        if (is<RenderInline>(renderer)) {
+            layoutFormattingContextLineLayout.updateInlineBoxDimensions(downcast<RenderInline>(renderer));
+            renderer.clearNeedsLayout();
+            continue;
+        }
+
         renderer.clearNeedsLayout();
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to