Title: [281359] trunk/Source/WebCore
Revision
281359
Author
[email protected]
Date
2021-08-20 19:48:24 -0700 (Fri, 20 Aug 2021)

Log Message

[LFC][Integration] Initialize root box's border and padding values
https://bugs.webkit.org/show_bug.cgi?id=229109

Reviewed by Antti Koivisto.

This is what LFC would normally do.

* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::layout):
(WebCore::LayoutIntegration::LineLayout::prepareLayoutState):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (281358 => 281359)


--- trunk/Source/WebCore/ChangeLog	2021-08-21 02:44:59 UTC (rev 281358)
+++ trunk/Source/WebCore/ChangeLog	2021-08-21 02:48:24 UTC (rev 281359)
@@ -1,5 +1,18 @@
 2021-08-20  Alan Bujtas  <[email protected]>
 
+        [LFC][Integration] Initialize root box's border and padding values
+        https://bugs.webkit.org/show_bug.cgi?id=229109
+
+        Reviewed by Antti Koivisto.
+
+        This is what LFC would normally do.
+
+        * layout/integration/LayoutIntegrationLineLayout.cpp:
+        (WebCore::LayoutIntegration::LineLayout::layout):
+        (WebCore::LayoutIntegration::LineLayout::prepareLayoutState):
+
+2021-08-20  Alan Bujtas  <[email protected]>
+
         [LFC][Integration] HTMLTextFormControlElement should use the inline iterator to collect content for wrap=hard
         https://bugs.webkit.org/show_bug.cgi?id=228882
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (281358 => 281359)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2021-08-21 02:44:59 UTC (rev 281358)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2021-08-21 02:48:24 UTC (rev 281359)
@@ -205,7 +205,8 @@
 
 void LineLayout::layout()
 {
-    if (!rootLayoutBox().hasInFlowOrFloatingChild())
+    auto& rootLayoutBox = this->rootLayoutBox();
+    if (!rootLayoutBox.hasInFlowOrFloatingChild())
         return;
 
     prepareLayoutState();
@@ -212,12 +213,13 @@
     prepareFloatingState();
 
     m_inlineContent = nullptr;
-    auto inlineFormattingContext = Layout::InlineFormattingContext { rootLayoutBox(), m_inlineFormattingState };
+    auto& rootGeometry = m_layoutState.geometryForBox(rootLayoutBox);
+    auto inlineFormattingContext = Layout::InlineFormattingContext { rootLayoutBox, m_inlineFormattingState };
 
     auto invalidationState = Layout::InvalidationState { };
-    auto horizontalConstraints = Layout::HorizontalConstraints { flow().borderAndPaddingStart(), flow().contentLogicalWidth() };
+    auto horizontalConstraints = Layout::HorizontalConstraints { rootGeometry.contentBoxLeft(), rootGeometry.contentBoxWidth() };
 
-    inlineFormattingContext.lineLayoutForIntergration(invalidationState, { horizontalConstraints, flow().borderAndPaddingBefore() });
+    inlineFormattingContext.lineLayoutForIntergration(invalidationState, { horizontalConstraints, rootGeometry.contentBoxTop() });
 
     constructContent();
 }
@@ -246,12 +248,13 @@
 
 void LineLayout::prepareLayoutState()
 {
-    m_layoutState.setViewportSize(flow().frame().view()->size());
+    auto& flow = this->flow();
+    m_layoutState.setViewportSize(flow.frame().view()->size());
 
     auto& rootGeometry = m_layoutState.ensureGeometryForBox(rootLayoutBox());
-    rootGeometry.setContentBoxWidth(flow().contentSize().width());
-    rootGeometry.setPadding({ });
-    rootGeometry.setBorder({ });
+    rootGeometry.setContentBoxWidth(flow.contentSize().width());
+    rootGeometry.setPadding(Layout::Edges { { flow.paddingStart(), flow.paddingEnd() }, { flow.paddingBefore(), flow.paddingAfter() } });
+    rootGeometry.setBorder(Layout::Edges { { flow.borderStart(), flow.borderEnd() }, { flow.borderBefore(), flow.borderAfter() } });
     rootGeometry.setHorizontalMargin({ });
     rootGeometry.setVerticalMargin({ });
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to