Title: [276707] trunk/Source/WebCore
Revision
276707
Author
[email protected]
Date
2021-04-28 06:30:36 -0700 (Wed, 28 Apr 2021)

Log Message

Remove unused RenderObject::isOutOfFlowRenderFragmentedFlow
https://bugs.webkit.org/show_bug.cgi?id=225133

Reviewed by Simon Fraser.

Out-of-flow fragmented flows were originally added for CSS regions (r91760) to provide
an anonymous container for the region content. This is not to be confused with a multi-column box with
"position: absolute/fixed" (such content would still generate an in-flow fragment container).

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeVisibleRectInContainer const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint const):
* rendering/RenderElement.h:
(WebCore::RenderElement::canContainFixedPositionObjects const):
* rendering/RenderLayer.cpp:
(WebCore::accumulateOffsetTowardsAncestor):
(WebCore::RenderLayer::hitTestContents const):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
(WebCore::RenderLayer::isRenderFragmentedFlow const):
(WebCore::RenderLayer::isOutOfFlowRenderFragmentedFlow const): Deleted.
* rendering/RenderObject.h:
(WebCore::RenderObject::isInFlowRenderFragmentedFlow const):
(WebCore::RenderObject::isOutOfFlowRenderFragmentedFlow const): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (276706 => 276707)


--- trunk/Source/WebCore/ChangeLog	2021-04-28 13:30:15 UTC (rev 276706)
+++ trunk/Source/WebCore/ChangeLog	2021-04-28 13:30:36 UTC (rev 276707)
@@ -1,3 +1,31 @@
+2021-04-28  Zalan Bujtas  <[email protected]>
+
+        Remove unused RenderObject::isOutOfFlowRenderFragmentedFlow
+        https://bugs.webkit.org/show_bug.cgi?id=225133
+
+        Reviewed by Simon Fraser.
+
+        Out-of-flow fragmented flows were originally added for CSS regions (r91760) to provide
+        an anonymous container for the region content. This is not to be confused with a multi-column box with
+        "position: absolute/fixed" (such content would still generate an in-flow fragment container).
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeVisibleRectInContainer const):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint const):
+        * rendering/RenderElement.h:
+        (WebCore::RenderElement::canContainFixedPositionObjects const):
+        * rendering/RenderLayer.cpp:
+        (WebCore::accumulateOffsetTowardsAncestor):
+        (WebCore::RenderLayer::hitTestContents const):
+        (WebCore::RenderLayer::calculateClipRects const):
+        * rendering/RenderLayer.h:
+        (WebCore::RenderLayer::isRenderFragmentedFlow const):
+        (WebCore::RenderLayer::isOutOfFlowRenderFragmentedFlow const): Deleted.
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isInFlowRenderFragmentedFlow const):
+        (WebCore::RenderObject::isOutOfFlowRenderFragmentedFlow const): Deleted.
+
 2021-04-28  Miguel Gomez  <[email protected]>
 
         Unreviewed, fixing GTK and WPE build with external holepunch enabled after r269907.

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (276706 => 276707)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2021-04-28 13:30:15 UTC (rev 276706)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2021-04-28 13:30:36 UTC (rev 276707)
@@ -2368,21 +2368,6 @@
     if (!localContainer)
         return adjustedRect;
     
-    // This code isn't necessary for in-flow RenderFragmentedFlows.
-    // Don't add the location of the fragment in the flow thread for absolute positioned
-    // elements because their absolute position already pushes them down through
-    // the fragments so adding this here and then adding the topLeft again would cause
-    // us to add the height twice.
-    // The same logic applies for elements flowed directly into the flow thread. Their topLeft member
-    // will already contain the portion rect of the fragment.
-    auto position = styleToUse.position();
-    if (localContainer->isOutOfFlowRenderFragmentedFlow() && position != PositionType::Absolute && containingBlock() != enclosingFragmentedFlow()) {
-        RenderFragmentContainer* firstFragment = nullptr;
-        RenderFragmentContainer* lastFragment = nullptr;
-        if (downcast<RenderFragmentedFlow>(*localContainer).getFragmentRangeForBox(this, firstFragment, lastFragment))
-            adjustedRect.moveBy(firstFragment->fragmentedFlowPortionRect().location());
-    }
-
     if (isWritingModeRoot()) {
         if (!isOutOfFlowPositioned() || !context.dirtyRectIsFlipped) {
             flipForWritingMode(adjustedRect);
@@ -2418,6 +2403,7 @@
 
     // We are now in our parent container's coordinate space. Apply our transform to obtain a bounding box
     // in the parent's coordinate space that encloses us.
+    auto position = styleToUse.position();
     if (hasLayer() && layer()->transform()) {
         context.hasPositionFixedDescendant = position == PositionType::Fixed;
         adjustedRect = LayoutRect(encloseRectToDevicePixels(layer()->transform()->mapRect(adjustedRect), document().deviceScaleFactor()));

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (276706 => 276707)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2021-04-28 13:30:15 UTC (rev 276706)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2021-04-28 13:30:36 UTC (rev 276707)
@@ -2645,18 +2645,6 @@
     if (!container)
         return;
     
-    // FIXME: This code is wrong for named flow threads since it only works for content in the first region.
-    // We also don't want to run it for multicolumn flow threads, since we can use our knowledge of column
-    // geometry to actually get a better result.
-    // The point inside a box that's inside a region has its coordinates relative to the region,
-    // not the FragmentedFlow that is its container in the RenderObject tree.
-    if (is<RenderBox>(*this) && container->isOutOfFlowRenderFragmentedFlow()) {
-        RenderFragmentContainer* startFragment = nullptr;
-        RenderFragmentContainer* endFragment = nullptr;
-        if (downcast<RenderFragmentedFlow>(*container).getFragmentRangeForBox(downcast<RenderBox>(this), startFragment, endFragment))
-            container = startFragment;
-    }
-
     container->mapAbsoluteToLocalPoint(mode, transformState);
 
     LayoutSize containerOffset = offsetFromContainer(*container, LayoutPoint());

Modified: trunk/Source/WebCore/rendering/RenderElement.h (276706 => 276707)


--- trunk/Source/WebCore/rendering/RenderElement.h	2021-04-28 13:30:15 UTC (rev 276706)
+++ trunk/Source/WebCore/rendering/RenderElement.h	2021-04-28 13:30:36 UTC (rev 276707)
@@ -431,8 +431,7 @@
         // FIXME: will-change should create containing blocks on inline boxes (bug 225035)
         || (isRenderBlock() && style().willChange() && style().willChange()->createsContainingBlockForOutOfFlowPositioned())
         || isSVGForeignObject()
-        || shouldApplyLayoutContainment(*this)
-        || isOutOfFlowRenderFragmentedFlow();
+        || shouldApplyLayoutContainment(*this);
 }
 
 inline bool RenderElement::canContainAbsolutelyPositionedObjects() const

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (276706 => 276707)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2021-04-28 13:30:15 UTC (rev 276706)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2021-04-28 13:30:36 UTC (rev 276707)
@@ -2275,11 +2275,6 @@
 
     if (position == PositionType::Fixed && fixedFragmentedFlowContainer) {
         ASSERT(ancestorLayer);
-        if (ancestorLayer->isOutOfFlowRenderFragmentedFlow()) {
-            location += toLayoutSize(layer->location());
-            return ancestorLayer;
-        }
-
         if (ancestorLayer == renderer.view().layer()) {
             // Add location in flow thread coordinates.
             location += toLayoutSize(layer->location());
@@ -2313,7 +2308,7 @@
 
         // We should not reach RenderView layer past the RenderFragmentedFlow layer for any
         // children of the RenderFragmentedFlow.
-        if (renderer.enclosingFragmentedFlow() && !layer->isOutOfFlowRenderFragmentedFlow())
+        if (renderer.enclosingFragmentedFlow())
             ASSERT(parentLayer != renderer.view().layer());
 
         if (foundAncestorFirst) {
@@ -4313,13 +4308,6 @@
     // the content in the layer has an element. So just walk up
     // the tree.
     if (!result.innerNode() || !result.innerNonSharedNode()) {
-        if (isOutOfFlowRenderFragmentedFlow()) {
-            // The flowthread doesn't have an enclosing element, so when hitting the layer of the
-            // flowthread (e.g. the descent area of the RootInlineBox for the image flowed alone
-            // inside the flow thread) we're letting the hit testing continue so it will hit the region.
-            return false;
-        }
-
         Element* e = enclosingElement();
         if (!result.innerNode())
             result.setInnerNode(e);
@@ -4563,11 +4551,6 @@
 
     LayoutSize offsetFromRootLocal = offsetFromRoot;
 
-    if (clipRectsContext.rootLayer->isOutOfFlowRenderFragmentedFlow()) {
-        LayoutPoint absPos = LayoutPoint(renderer().view().localToAbsolute(FloatPoint(), IsFixed));
-        offsetFromRootLocal += toLayoutSize(absPos);
-    }
-
     layerBounds = LayoutRect(toLayoutPoint(offsetFromRootLocal), size());
 
     foregroundRect = backgroundRect;

Modified: trunk/Source/WebCore/rendering/RenderLayer.h (276706 => 276707)


--- trunk/Source/WebCore/rendering/RenderLayer.h	2021-04-28 13:30:15 UTC (rev 276706)
+++ trunk/Source/WebCore/rendering/RenderLayer.h	2021-04-28 13:30:36 UTC (rev 276707)
@@ -827,7 +827,6 @@
     IndirectCompositingReason indirectCompositingReason() const { return static_cast<IndirectCompositingReason>(m_indirectCompositingReason); }
 
     bool isRenderFragmentedFlow() const { return renderer().isRenderFragmentedFlow(); }
-    bool isOutOfFlowRenderFragmentedFlow() const { return renderer().isOutOfFlowRenderFragmentedFlow(); }
     bool isInsideFragmentedFlow() const { return renderer().fragmentedFlowState() != RenderObject::NotInsideFragmentedFlow; }
     bool isDirtyRenderFragmentedFlow() const
     {

Modified: trunk/Source/WebCore/rendering/RenderObject.h (276706 => 276707)


--- trunk/Source/WebCore/rendering/RenderObject.h	2021-04-28 13:30:15 UTC (rev 276706)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2021-04-28 13:30:36 UTC (rev 276707)
@@ -262,7 +262,6 @@
 #endif
     virtual bool isRenderGrid() const { return false; }
     bool isInFlowRenderFragmentedFlow() const { return isRenderFragmentedFlow() && !isOutOfFlowPositioned(); }
-    bool isOutOfFlowRenderFragmentedFlow() const { return isRenderFragmentedFlow() && isOutOfFlowPositioned(); }
 
     virtual bool isMultiColumnBlockFlow() const { return false; }
     virtual bool isRenderMultiColumnSet() const { return false; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to