Title: [240895] trunk
Revision
240895
Author
[email protected]
Date
2019-02-02 08:32:05 -0800 (Sat, 02 Feb 2019)

Log Message

[LFC] Initialize ICB's style with fixed width/height.
https://bugs.webkit.org/show_bug.cgi?id=194188

Reviewed by Antti Koivisto.

Source/WebCore:

Let's set ICB's logical width/height to Fixed so that it's available when we try to resolve a box's height
in FormattingContext::Geometry::computedHeightValue() by using the containing block's height (ICB in this case).

* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::LayoutState):
* layout/LayoutState.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutTree):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240894 => 240895)


--- trunk/Source/WebCore/ChangeLog	2019-02-02 16:26:42 UTC (rev 240894)
+++ trunk/Source/WebCore/ChangeLog	2019-02-02 16:32:05 UTC (rev 240895)
@@ -1,5 +1,21 @@
 2019-02-02  Zalan Bujtas  <[email protected]>
 
+        [LFC] Initialize ICB's style with fixed width/height.
+        https://bugs.webkit.org/show_bug.cgi?id=194188
+
+        Reviewed by Antti Koivisto.
+
+        Let's set ICB's logical width/height to Fixed so that it's available when we try to resolve a box's height
+        in FormattingContext::Geometry::computedHeightValue() by using the containing block's height (ICB in this case).
+
+        * layout/LayoutState.cpp:
+        (WebCore::Layout::LayoutState::LayoutState):
+        * layout/LayoutState.h:
+        * layout/layouttree/LayoutTreeBuilder.cpp:
+        (WebCore::Layout::TreeBuilder::createLayoutTree):
+
+2019-02-02  Zalan Bujtas  <[email protected]>
+
         [LFC] Add missing case to out-of-flow non-replaced horizontal used margin value computation
         https://bugs.webkit.org/show_bug.cgi?id=194185
 

Modified: trunk/Source/WebCore/layout/LayoutState.cpp (240894 => 240895)


--- trunk/Source/WebCore/layout/LayoutState.cpp	2019-02-02 16:26:42 UTC (rev 240894)
+++ trunk/Source/WebCore/layout/LayoutState.cpp	2019-02-02 16:32:05 UTC (rev 240895)
@@ -45,7 +45,7 @@
 
 WTF_MAKE_ISO_ALLOCATED_IMPL(LayoutState);
 
-LayoutState::LayoutState(const Container& initialContainingBlock, const LayoutSize& containerSize)
+LayoutState::LayoutState(const Container& initialContainingBlock)
     : m_initialContainingBlock(makeWeakPtr(initialContainingBlock))
 {
     // LayoutState is always initiated with the ICB.
@@ -59,8 +59,8 @@
     displayBox.setBorder({ });
     displayBox.setPadding({ });
     displayBox.setTopLeft({ });
-    displayBox.setContentBoxHeight(containerSize.height());
-    displayBox.setContentBoxWidth(containerSize.width());
+    displayBox.setContentBoxHeight(initialContainingBlock.style().logicalHeight().value());
+    displayBox.setContentBoxWidth(initialContainingBlock.style().logicalWidth().value());
 
     m_formattingContextRootListForLayout.add(&initialContainingBlock);
 }

Modified: trunk/Source/WebCore/layout/LayoutState.h (240894 => 240895)


--- trunk/Source/WebCore/layout/LayoutState.h	2019-02-02 16:26:42 UTC (rev 240894)
+++ trunk/Source/WebCore/layout/LayoutState.h	2019-02-02 16:32:05 UTC (rev 240895)
@@ -59,7 +59,7 @@
 class LayoutState {
     WTF_MAKE_ISO_ALLOCATED(LayoutState);
 public:
-    LayoutState(const Container& initialContainingBlock, const LayoutSize&);
+    LayoutState(const Container& initialContainingBlock);
 
     void updateLayout();
     void styleChanged(const Box&, StyleDiff);

Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (240894 => 240895)


--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2019-02-02 16:26:42 UTC (rev 240894)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2019-02-02 16:32:05 UTC (rev 240895)
@@ -51,7 +51,11 @@
 
 std::unique_ptr<Container> TreeBuilder::createLayoutTree(const RenderView& renderView)
 {
-    std::unique_ptr<Container> initialContainingBlock(new BlockContainer(WTF::nullopt, RenderStyle::clone(renderView.style())));
+    auto style = RenderStyle::clone(renderView.style());
+    style.setLogicalWidth(Length(renderView.width(), Fixed));
+    style.setLogicalHeight(Length(renderView.height(), Fixed));
+
+    std::unique_ptr<Container> initialContainingBlock(new BlockContainer(WTF::nullopt, WTFMove(style)));
     TreeBuilder::createSubTree(renderView, *initialContainingBlock);
     return initialContainingBlock;
 }

Modified: trunk/Source/WebCore/page/FrameViewLayoutContext.cpp (240894 => 240895)


--- trunk/Source/WebCore/page/FrameViewLayoutContext.cpp	2019-02-02 16:26:42 UTC (rev 240894)
+++ trunk/Source/WebCore/page/FrameViewLayoutContext.cpp	2019-02-02 16:32:05 UTC (rev 240895)
@@ -59,7 +59,7 @@
     if (!RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextEnabled())
         return;
     auto initialContainingBlock = Layout::TreeBuilder::createLayoutTree(renderView);
-    auto layoutState = std::make_unique<Layout::LayoutState>(*initialContainingBlock, renderView.size());
+    auto layoutState = std::make_unique<Layout::LayoutState>(*initialContainingBlock);
     layoutState->setInQuirksMode(renderView.document().inQuirksMode());
     layoutState->updateLayout();
     layoutState->verifyAndOutputMismatchingLayoutTree(renderView);

Modified: trunk/Tools/ChangeLog (240894 => 240895)


--- trunk/Tools/ChangeLog	2019-02-02 16:26:42 UTC (rev 240894)
+++ trunk/Tools/ChangeLog	2019-02-02 16:32:05 UTC (rev 240895)
@@ -1,5 +1,14 @@
 2019-02-02  Zalan Bujtas  <[email protected]>
 
+        [LFC] Initialize ICB's style with fixed width/height.
+        https://bugs.webkit.org/show_bug.cgi?id=194188
+
+        Reviewed by Antti Koivisto.
+
+        * LayoutReloaded/misc/LFC-passing-tests.txt:
+
+2019-02-02  Zalan Bujtas  <[email protected]>
+
         [LFC] Add missing case to out-of-flow non-replaced horizontal used margin value computation
         https://bugs.webkit.org/show_bug.cgi?id=194185
 

Modified: trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt (240894 => 240895)


--- trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt	2019-02-02 16:26:42 UTC (rev 240894)
+++ trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt	2019-02-02 16:32:05 UTC (rev 240895)
@@ -504,8 +504,10 @@
 css2.1/20110323/abspos-containing-block-initial-005a.htm
 css2.1/20110323/abspos-containing-block-initial-005c.htm
 css2.1/20110323/abspos-containing-block-initial-007.htm
+css2.1/20110323/abspos-containing-block-initial-009a.htm
 css2.1/20110323/abspos-containing-block-initial-009b.htm
 css2.1/20110323/abspos-containing-block-initial-009e.htm
+css2.1/20110323/abspos-containing-block-initial-009f.htm
 css2.1/t0803-c5504-mrgn-l-00-c-ag.html
 css2.1/t0803-c5504-mrgn-l-02-c.html
 css2.1/t0803-c5504-mrgn-l-03-c.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to