Title: [256098] trunk/Source/WebCore
Revision
256098
Author
[email protected]
Date
2020-02-08 18:51:46 -0800 (Sat, 08 Feb 2020)

Log Message

[LFC][BFC] Remove establishesBlockFormattingContextOnly and establishesInlineFormattingContextOnly
https://bugs.webkit.org/show_bug.cgi?id=207431
<rdar://problem/59288366>

Reviewed by Antti Koivisto.

The current caller of establishesInlineFormattingContextOnly is actually interested in whether the box is float avoider
(and the debug-only caller of establishesBlockFormattingContextOnly should instead check if the box also establishes an IFC).

* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::createFormattingContext):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::establishesInlineFormattingContextOnly const): Deleted.
(WebCore::Layout::Box::establishesBlockFormattingContextOnly const): Deleted.
* layout/layouttree/LayoutBox.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (256097 => 256098)


--- trunk/Source/WebCore/ChangeLog	2020-02-09 02:01:13 UTC (rev 256097)
+++ trunk/Source/WebCore/ChangeLog	2020-02-09 02:51:46 UTC (rev 256098)
@@ -1,5 +1,25 @@
 2020-02-08  Zalan Bujtas  <[email protected]>
 
+        [LFC][BFC] Remove establishesBlockFormattingContextOnly and establishesInlineFormattingContextOnly
+        https://bugs.webkit.org/show_bug.cgi?id=207431
+        <rdar://problem/59288366>
+
+        Reviewed by Antti Koivisto.
+
+        The current caller of establishesInlineFormattingContextOnly is actually interested in whether the box is float avoider
+        (and the debug-only caller of establishesBlockFormattingContextOnly should instead check if the box also establishes an IFC).
+
+        * layout/LayoutContext.cpp:
+        (WebCore::Layout::LayoutContext::createFormattingContext):
+        * layout/blockformatting/BlockFormattingContext.cpp:
+        (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot):
+        * layout/layouttree/LayoutBox.cpp:
+        (WebCore::Layout::Box::establishesInlineFormattingContextOnly const): Deleted.
+        (WebCore::Layout::Box::establishesBlockFormattingContextOnly const): Deleted.
+        * layout/layouttree/LayoutBox.h:
+
+2020-02-08  Zalan Bujtas  <[email protected]>
+
         [LFC][BFC] Adjust Box::isFloatAvoider() for Inline and Independent FCs.
         https://bugs.webkit.org/show_bug.cgi?id=207430
         <rdar://problem/59288236>

Modified: trunk/Source/WebCore/layout/LayoutContext.cpp (256097 => 256098)


--- trunk/Source/WebCore/layout/LayoutContext.cpp	2020-02-09 02:01:13 UTC (rev 256097)
+++ trunk/Source/WebCore/layout/LayoutContext.cpp	2020-02-09 02:51:46 UTC (rev 256098)
@@ -118,7 +118,7 @@
     }
 
     if (formattingContextRoot.establishesBlockFormattingContext()) {
-        ASSERT(formattingContextRoot.establishesBlockFormattingContextOnly());
+        ASSERT(!formattingContextRoot.establishesInlineFormattingContext());
         auto& blockFormattingState = layoutState.ensureBlockFormattingState(formattingContextRoot);
         return makeUnique<BlockFormattingContext>(formattingContextRoot, blockFormattingState);
     }

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp (256097 => 256098)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2020-02-09 02:01:13 UTC (rev 256097)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2020-02-09 02:51:46 UTC (rev 256098)
@@ -303,10 +303,8 @@
     computeEstimatedVerticalPosition(layoutBox, horizontalConstraints.containingBlock, verticalConstraints.containingBlock);
     computeEstimatedVerticalPositionForAncestors(layoutBox, horizontalConstraints, verticalConstraints);
 
-    // If the inline formatting root is also the root for the floats (happens when the root box also establishes a block formatting context)
-    // the floats are in the coordinate system of this root. No need to find the final vertical position.
-    auto inlineContextInheritsFloats = layoutBox.establishesInlineFormattingContextOnly();
-    if (inlineContextInheritsFloats) {
+    // We only need the final vertical position if the formatting context does let intrusive floats in (aka not a float avoider).
+    if (!layoutBox.isFloatAvoider()) {
         computeEstimatedVerticalPosition(layoutBox, horizontalConstraints.containingBlock, verticalConstraints.containingBlock);
         computeEstimatedVerticalPositionForAncestors(layoutBox, horizontalConstraints, verticalConstraints);
     }

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp (256097 => 256098)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2020-02-09 02:01:13 UTC (rev 256097)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2020-02-09 02:51:46 UTC (rev 256098)
@@ -124,11 +124,6 @@
     return downcast<Container>(*this).firstInFlowChild()->isInlineLevelBox();
 }
 
-bool Box::establishesInlineFormattingContextOnly() const
-{
-    return establishesInlineFormattingContext() && !establishesBlockFormattingContext();
-}
-
 bool Box::establishesTableFormattingContext() const
 {
     return isTableBox();
@@ -140,11 +135,6 @@
     return isAbsolutelyPositioned();
 }
 
-bool Box::establishesBlockFormattingContextOnly() const
-{
-    return establishesBlockFormattingContext() && !establishesInlineFormattingContext();
-}
-
 bool Box::isRelativelyPositioned() const
 {
     return m_style.position() == PositionType::Relative;

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.h (256097 => 256098)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.h	2020-02-09 02:01:13 UTC (rev 256097)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.h	2020-02-09 02:51:46 UTC (rev 256098)
@@ -79,9 +79,6 @@
     bool establishesTableFormattingContext() const;
     bool establishesIndependentFormattingContext() const;
 
-    bool establishesBlockFormattingContextOnly() const;
-    bool establishesInlineFormattingContextOnly() const;
-
     bool isInFlow() const { return !isFloatingOrOutOfFlowPositioned(); }
     bool isPositioned() const { return isInFlowPositioned() || isOutOfFlowPositioned(); }
     bool isInFlowPositioned() const { return isRelativelyPositioned() || isStickyPositioned(); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to