Title: [206049] trunk/Source/WebCore
Revision
206049
Author
an...@apple.com
Date
2016-09-16 14:39:28 -0700 (Fri, 16 Sep 2016)

Log Message

Tighten region style map to use RenderElement instead of RenderObject
https://bugs.webkit.org/show_bug.cgi?id=162064

Reviewed by Zalan Bujtas.

RenderTexts don't have styles of their own so the map can operate on RenderElements.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::willBeRemovedFromTree):
(WebCore::RenderElement::removeFromRenderFlowThread):
(WebCore::RenderElement::removeFromRenderFlowThreadIncludingDescendants):
(WebCore::RenderElement::invalidateFlowThreadContainingBlockIncludingDescendants):
* rendering/RenderElement.h:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::removeFlowChildInfo):
* rendering/RenderFlowThread.h:
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::computeChildrenStyleInRegion):
(WebCore::RenderNamedFlowFragment::setRendererStyleInRegion):
(WebCore::RenderNamedFlowFragment::clearObjectStyleInRegion):
(WebCore::RenderNamedFlowFragment::setRegionObjectsRegionStyle):
(WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle):
(WebCore::RenderNamedFlowFragment::setObjectStyleInRegion): Deleted.
* rendering/RenderNamedFlowFragment.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::clearRenderObjectCustomStyle):
(WebCore::RenderNamedFlowThread::removeFlowChildInfo):
* rendering/RenderNamedFlowThread.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::willBeRemovedFromTree):
(WebCore::RenderObject::removeFromRenderFlowThread): Deleted.
(WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants): Deleted.
(WebCore::RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants): Deleted.

    These can now move to RenderElement.

* rendering/RenderObject.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206048 => 206049)


--- trunk/Source/WebCore/ChangeLog	2016-09-16 21:20:23 UTC (rev 206048)
+++ trunk/Source/WebCore/ChangeLog	2016-09-16 21:39:28 UTC (rev 206049)
@@ -1,3 +1,43 @@
+2016-09-16  Antti Koivisto  <an...@apple.com>
+
+        Tighten region style map to use RenderElement instead of RenderObject
+        https://bugs.webkit.org/show_bug.cgi?id=162064
+
+        Reviewed by Zalan Bujtas.
+
+        RenderTexts don't have styles of their own so the map can operate on RenderElements.
+
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::willBeRemovedFromTree):
+        (WebCore::RenderElement::removeFromRenderFlowThread):
+        (WebCore::RenderElement::removeFromRenderFlowThreadIncludingDescendants):
+        (WebCore::RenderElement::invalidateFlowThreadContainingBlockIncludingDescendants):
+        * rendering/RenderElement.h:
+        * rendering/RenderFlowThread.cpp:
+        (WebCore::RenderFlowThread::removeFlowChildInfo):
+        * rendering/RenderFlowThread.h:
+        * rendering/RenderNamedFlowFragment.cpp:
+        (WebCore::RenderNamedFlowFragment::computeChildrenStyleInRegion):
+        (WebCore::RenderNamedFlowFragment::setRendererStyleInRegion):
+        (WebCore::RenderNamedFlowFragment::clearObjectStyleInRegion):
+        (WebCore::RenderNamedFlowFragment::setRegionObjectsRegionStyle):
+        (WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle):
+        (WebCore::RenderNamedFlowFragment::setObjectStyleInRegion): Deleted.
+        * rendering/RenderNamedFlowFragment.h:
+        * rendering/RenderNamedFlowThread.cpp:
+        (WebCore::RenderNamedFlowThread::clearRenderObjectCustomStyle):
+        (WebCore::RenderNamedFlowThread::removeFlowChildInfo):
+        * rendering/RenderNamedFlowThread.h:
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::willBeRemovedFromTree):
+        (WebCore::RenderObject::removeFromRenderFlowThread): Deleted.
+        (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants): Deleted.
+        (WebCore::RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants): Deleted.
+
+            These can now move to RenderElement.
+
+        * rendering/RenderObject.h:
+
 2016-09-16  Brent Fulgham  <bfulg...@apple.com>
 
         CaptionUserPreferences's use of the PageGroup's page map is incorrect

Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (206048 => 206049)


--- trunk/Source/WebCore/rendering/RenderElement.cpp	2016-09-16 21:20:23 UTC (rev 206048)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp	2016-09-16 21:39:28 UTC (rev 206049)
@@ -1087,6 +1087,8 @@
     if (auto* containerFlowThread = parent()->renderNamedFlowThreadWrapper())
         containerFlowThread->removeFlowChild(*this);
 
+    removeFromRenderFlowThread();
+
     RenderObject::willBeRemovedFromTree();
 }
 
@@ -2204,6 +2206,78 @@
     return (frame().settings().shouldRespectImageOrientation() && is<HTMLImageElement>(element())) ? RespectImageOrientation : DoNotRespectImageOrientation;
 }
 
+void RenderElement::removeFromRenderFlowThread()
+{
+    if (flowThreadState() == NotInsideFlowThread)
+        return;
+
+    // Sometimes we remove the element from the flow, but it's not destroyed at that time.
+    // It's only until later when we actually destroy it and remove all the children from it.
+    // Currently, that happens for firstLetter elements and list markers.
+    // Pass in the flow thread so that we don't have to look it up for all the children.
+    removeFromRenderFlowThreadIncludingDescendants(true);
+}
+
+void RenderElement::removeFromRenderFlowThreadIncludingDescendants(bool shouldUpdateState)
+{
+    // Once we reach another flow thread we don't need to update the flow thread state
+    // but we have to continue cleanup the flow thread info.
+    if (isRenderFlowThread())
+        shouldUpdateState = false;
+
+    for (auto& child : childrenOfType<RenderObject>(*this)) {
+        if (is<RenderElement>(child)) {
+            downcast<RenderElement>(child).removeFromRenderFlowThreadIncludingDescendants(shouldUpdateState);
+            continue;
+        }
+        if (shouldUpdateState)
+            child.setFlowThreadState(NotInsideFlowThread);
+    }
+
+    // We have to ask for our containing flow thread as it may be above the removed sub-tree.
+    RenderFlowThread* flowThreadContainingBlock = this->flowThreadContainingBlock();
+    while (flowThreadContainingBlock) {
+        flowThreadContainingBlock->removeFlowChildInfo(this);
+
+        if (flowThreadContainingBlock->flowThreadState() == NotInsideFlowThread)
+            break;
+        auto* parent = flowThreadContainingBlock->parent();
+        if (!parent)
+            break;
+        flowThreadContainingBlock = parent->flowThreadContainingBlock();
+    }
+    if (is<RenderBlock>(*this))
+        downcast<RenderBlock>(*this).setCachedFlowThreadContainingBlockNeedsUpdate();
+
+    if (shouldUpdateState)
+        setFlowThreadState(NotInsideFlowThread);
+}
+
+void RenderElement::invalidateFlowThreadContainingBlockIncludingDescendants(RenderFlowThread* flowThread)
+{
+    if (flowThreadState() == NotInsideFlowThread)
+        return;
+
+    if (is<RenderBlock>(*this)) {
+        RenderBlock& block = downcast<RenderBlock>(*this);
+
+        if (block.cachedFlowThreadContainingBlockNeedsUpdate())
+            return;
+
+        flowThread = block.cachedFlowThreadContainingBlock();
+        block.setCachedFlowThreadContainingBlockNeedsUpdate();
+    }
+
+    if (flowThread)
+        flowThread->removeFlowChildInfo(this);
+
+    if (!is<RenderElement>(*this))
+        return;
+
+    for (auto& child : childrenOfType<RenderElement>(*this))
+        child.invalidateFlowThreadContainingBlockIncludingDescendants(flowThread);
+}
+
 #if ENABLE(IOS_TEXT_AUTOSIZING)
 static RenderObject::BlockContentHeightType includeNonFixedHeight(const RenderObject& renderer)
 {

Modified: trunk/Source/WebCore/rendering/RenderElement.h (206048 => 206049)


--- trunk/Source/WebCore/rendering/RenderElement.h	2016-09-16 21:20:23 UTC (rev 206048)
+++ trunk/Source/WebCore/rendering/RenderElement.h	2016-09-16 21:39:28 UTC (rev 206049)
@@ -229,6 +229,9 @@
 
     RespectImageOrientationEnum shouldRespectImageOrientation() const;
 
+    void removeFromRenderFlowThread();
+    void invalidateFlowThreadContainingBlockIncludingDescendants(RenderFlowThread* = nullptr);
+
 protected:
     enum BaseTypeFlag {
         RenderLayerModelObjectFlag  = 1 << 0,
@@ -284,6 +287,8 @@
     void paintOutline(PaintInfo&, const LayoutRect&);
     void updateOutlineAutoAncestor(bool hasOutlineAuto);
 
+    void removeFromRenderFlowThreadIncludingDescendants(bool shouldUpdateState);
+
 private:
     RenderElement(ContainerNode&, RenderStyle&&, BaseTypeFlags);
     void node() const = delete;

Modified: trunk/Source/WebCore/rendering/RenderFlowThread.cpp (206048 => 206049)


--- trunk/Source/WebCore/rendering/RenderFlowThread.cpp	2016-09-16 21:20:23 UTC (rev 206048)
+++ trunk/Source/WebCore/rendering/RenderFlowThread.cpp	2016-09-16 21:39:28 UTC (rev 206049)
@@ -92,7 +92,7 @@
         invalidateRegions();
 }
 
-void RenderFlowThread::removeFlowChildInfo(RenderObject* child)
+void RenderFlowThread::removeFlowChildInfo(RenderElement* child)
 {
     if (is<RenderBlockFlow>(*child))
         removeLineRegionInfo(downcast<RenderBlockFlow>(child));

Modified: trunk/Source/WebCore/rendering/RenderFlowThread.h (206048 => 206049)


--- trunk/Source/WebCore/rendering/RenderFlowThread.h	2016-09-16 21:20:23 UTC (rev 206048)
+++ trunk/Source/WebCore/rendering/RenderFlowThread.h	2016-09-16 21:39:28 UTC (rev 206049)
@@ -60,7 +60,7 @@
 public:
     virtual ~RenderFlowThread() { }
 
-    virtual void removeFlowChildInfo(RenderObject*);
+    virtual void removeFlowChildInfo(RenderElement*);
 #ifndef NDEBUG
     bool hasChildInfo(RenderObject* child) const { return is<RenderBox>(child) && m_regionRangeMap.contains(downcast<RenderBox>(child)); }
 #endif

Modified: trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp (206048 => 206049)


--- trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp	2016-09-16 21:20:23 UTC (rev 206048)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp	2016-09-16 21:39:28 UTC (rev 206049)
@@ -359,62 +359,56 @@
 
 void RenderNamedFlowFragment::computeChildrenStyleInRegion(RenderElement& renderer)
 {
-    for (auto& child : childrenOfType<RenderObject>(renderer)) {
+    for (auto& child : childrenOfType<RenderElement>(renderer)) {
+        auto it = m_rendererRegionStyle.find(&child);
 
-        auto it = m_renderObjectRegionStyle.find(&child);
-
         std::unique_ptr<RenderStyle> childStyleInRegion;
         bool objectRegionStyleCached = false;
-        if (it != m_renderObjectRegionStyle.end()) {
+        if (it != m_rendererRegionStyle.end()) {
             childStyleInRegion = RenderStyle::clonePtr(*it->value.style);
             objectRegionStyleCached = true;
         } else {
             if (child.isAnonymous() || child.isInFlowRenderFlowThread())
                 childStyleInRegion =  std::make_unique<RenderStyle>(RenderStyle::createAnonymousStyleWithDisplay(renderer.style(), child.style().display()));
-            else if (is<RenderText>(child))
-                childStyleInRegion = RenderStyle::clonePtr(renderer.style());
             else
-                childStyleInRegion = computeStyleInRegion(downcast<RenderElement>(child), renderer.style());
+                childStyleInRegion = computeStyleInRegion(child, renderer.style());
         }
 
-        setObjectStyleInRegion(&child, WTFMove(childStyleInRegion), objectRegionStyleCached);
-
-        if (is<RenderElement>(child))
-            computeChildrenStyleInRegion(downcast<RenderElement>(child));
+        setRendererStyleInRegion(child, WTFMove(childStyleInRegion), objectRegionStyleCached);
+        computeChildrenStyleInRegion(child);
     }
 }
 
-void RenderNamedFlowFragment::setObjectStyleInRegion(RenderObject* object, std::unique_ptr<RenderStyle> styleInRegion, bool objectRegionStyleCached)
+void RenderNamedFlowFragment::setRendererStyleInRegion(RenderElement& renderer, std::unique_ptr<RenderStyle> styleInRegion, bool objectRegionStyleCached)
 {
-    ASSERT(object->flowThreadContainingBlock());
+    ASSERT(renderer.flowThreadContainingBlock());
 
-    std::unique_ptr<RenderStyle> objectOriginalStyle = RenderStyle::clonePtr(object->style());
-    if (is<RenderElement>(*object))
-        downcast<RenderElement>(*object).setStyleInternal(WTFMove(*styleInRegion));
+    std::unique_ptr<RenderStyle> objectOriginalStyle = RenderStyle::clonePtr(renderer.style());
+    renderer.setStyleInternal(WTFMove(*styleInRegion));
 
-    if (is<RenderBoxModelObject>(*object) && !object->hasVisibleBoxDecorations()) {
-        bool hasVisibleBoxDecorations = is<RenderTableCell>(*object)
-        || object->style().hasBackground()
-        || object->style().hasVisibleBorder()
-        || object->style().hasAppearance()
-        || object->style().boxShadow();
-        object->setHasVisibleBoxDecorations(hasVisibleBoxDecorations);
+    if (is<RenderBoxModelObject>(renderer) && !renderer.hasVisibleBoxDecorations()) {
+        bool hasVisibleBoxDecorations = is<RenderTableCell>(renderer)
+        || renderer.style().hasBackground()
+        || renderer.style().hasVisibleBorder()
+        || renderer.style().hasAppearance()
+        || renderer.style().boxShadow();
+        renderer.setHasVisibleBoxDecorations(hasVisibleBoxDecorations);
     }
 
     ObjectRegionStyleInfo styleInfo;
     styleInfo.style = WTFMove(objectOriginalStyle);
     styleInfo.cached = objectRegionStyleCached;
-    m_renderObjectRegionStyle.set(object, WTFMove(styleInfo));
+    m_rendererRegionStyle.set(&renderer, WTFMove(styleInfo));
 }
 
-void RenderNamedFlowFragment::clearObjectStyleInRegion(const RenderObject* object)
+void RenderNamedFlowFragment::clearObjectStyleInRegion(const RenderElement* object)
 {
     ASSERT(object);
-    m_renderObjectRegionStyle.remove(object);
+    m_rendererRegionStyle.remove(object);
 
     // Clear the style for the children of this object.
-    for (RenderObject* child = object->firstChildSlow(); child; child = child->nextSibling())
-        clearObjectStyleInRegion(child);
+    for (auto& child : childrenOfType<RenderElement>(*object))
+        clearObjectStyleInRegion(&child);
 }
 
 void RenderNamedFlowFragment::setRegionObjectsRegionStyle()
@@ -431,27 +425,27 @@
         // The list of content nodes contains also the nodes with display:none.
         if (!element->renderer())
             continue;
+        auto& renderer = *element->renderer();
 
-        RenderElement* object = element->renderer();
         // If the content node does not flow any of its children in this region,
         // we do not compute any style for them in this region.
-        if (!flowThread()->objectInFlowRegion(object, this))
+        if (!flowThread()->objectInFlowRegion(&renderer, this))
             continue;
 
         // If the object has style in region, use that instead of computing a new one.
-        auto it = m_renderObjectRegionStyle.find(object);
+        auto it = m_rendererRegionStyle.find(&renderer);
         std::unique_ptr<RenderStyle> objectStyleInRegion;
         bool objectRegionStyleCached = false;
-        if (it != m_renderObjectRegionStyle.end()) {
+        if (it != m_rendererRegionStyle.end()) {
             objectStyleInRegion = RenderStyle::clonePtr(*it->value.style);
             ASSERT(it->value.cached);
             objectRegionStyleCached = true;
         } else
-            objectStyleInRegion = computeStyleInRegion(*object, style());
+            objectStyleInRegion = computeStyleInRegion(renderer, style());
 
-        setObjectStyleInRegion(object, WTFMove(objectStyleInRegion), objectRegionStyleCached);
+        setRendererStyleInRegion(renderer, WTFMove(objectStyleInRegion), objectRegionStyleCached);
 
-        computeChildrenStyleInRegion(*object);
+        computeChildrenStyleInRegion(renderer);
     }
 }
 
@@ -460,9 +454,9 @@
     if (!hasCustomRegionStyle())
         return;
 
-    RenderObjectRegionStyleMap temp;
-    for (auto& objectPair : m_renderObjectRegionStyle) {
-        RenderObject* object = const_cast<RenderObject*>(objectPair.key);
+    RendererRegionStyleMap temp;
+    for (auto& objectPair : m_rendererRegionStyle) {
+        auto* object = const_cast<RenderElement*>(objectPair.key);
         std::unique_ptr<RenderStyle> objectRegionStyle = RenderStyle::clonePtr(object->style());
         std::unique_ptr<RenderStyle> objectOriginalStyle = RenderStyle::clonePtr(*objectPair.value.style);
 
@@ -480,11 +474,10 @@
             styleInfo.cached = true;
             temp.set(object, WTFMove(styleInfo));
         }
-        if (is<RenderElement>(*object))
-            downcast<RenderElement>(*object).setStyleInternal(WTFMove(*objectOriginalStyle));
+        object->setStyleInternal(WTFMove(*objectOriginalStyle));
     }
 
-    m_renderObjectRegionStyle.swap(temp);
+    m_rendererRegionStyle.swap(temp);
 }
 
 RenderNamedFlowThread* RenderNamedFlowFragment::namedFlowThread() const

Modified: trunk/Source/WebCore/rendering/RenderNamedFlowFragment.h (206048 => 206049)


--- trunk/Source/WebCore/rendering/RenderNamedFlowFragment.h	2016-09-16 21:20:23 UTC (rev 206048)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowFragment.h	2016-09-16 21:39:28 UTC (rev 206049)
@@ -79,7 +79,7 @@
     RenderLayerModelObject& layerOwner() const { return downcast<RenderLayerModelObject>(*parent()); }
 
     bool hasCustomRegionStyle() const { return m_hasCustomRegionStyle; }
-    void clearObjectStyleInRegion(const RenderObject*);
+    void clearObjectStyleInRegion(const RenderElement*);
 
     void setRegionObjectsRegionStyle();
     void restoreRegionObjectsOriginalStyle();
@@ -125,7 +125,7 @@
 
     std::unique_ptr<RenderStyle> computeStyleInRegion(RenderElement&, const RenderStyle& parentStyle) const;
     void computeChildrenStyleInRegion(RenderElement&);
-    void setObjectStyleInRegion(RenderObject*, std::unique_ptr<RenderStyle>, bool objectRegionStyleCached);
+    void setRendererStyleInRegion(RenderElement&, std::unique_ptr<RenderStyle>, bool objectRegionStyleCached);
 
     void checkRegionStyle();
     void setHasCustomRegionStyle(bool hasCustomRegionStyle) { m_hasCustomRegionStyle = hasCustomRegionStyle; }
@@ -153,8 +153,8 @@
         bool cached;
     };
 
-    typedef HashMap<const RenderObject*, ObjectRegionStyleInfo > RenderObjectRegionStyleMap;
-    RenderObjectRegionStyleMap m_renderObjectRegionStyle;
+    using RendererRegionStyleMap = HashMap<const RenderElement*, ObjectRegionStyleInfo>;
+    RendererRegionStyleMap m_rendererRegionStyle;
 
     bool m_hasCustomRegionStyle : 1;
     bool m_hasAutoLogicalHeight : 1;

Modified: trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp (206048 => 206049)


--- trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp	2016-09-16 21:20:23 UTC (rev 206048)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp	2016-09-16 21:39:28 UTC (rev 206049)
@@ -812,7 +812,7 @@
     m_hasRegionsWithStyling = hasRegionsWithStyling;
 }
 
-void RenderNamedFlowThread::clearRenderObjectCustomStyle(const RenderObject* object)
+void RenderNamedFlowThread::clearRenderObjectCustomStyle(const RenderElement* object)
 {
     // Clear the styles for the object in the regions.
     // FIXME: Region styling is not computed only for the region range of the object so this is why we need to walk the whole chain.
@@ -820,7 +820,7 @@
         downcast<RenderNamedFlowFragment>(*region).clearObjectStyleInRegion(object);
 }
 
-void RenderNamedFlowThread::removeFlowChildInfo(RenderObject* child)
+void RenderNamedFlowThread::removeFlowChildInfo(RenderElement* child)
 {
     RenderFlowThread::removeFlowChildInfo(child);
     clearRenderObjectCustomStyle(child);

Modified: trunk/Source/WebCore/rendering/RenderNamedFlowThread.h (206048 => 206049)


--- trunk/Source/WebCore/rendering/RenderNamedFlowThread.h	2016-09-16 21:20:23 UTC (rev 206048)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowThread.h	2016-09-16 21:39:28 UTC (rev 206049)
@@ -91,9 +91,9 @@
     bool hasRegionsWithStyling() const { return m_hasRegionsWithStyling; }
     void checkRegionsWithStyling();
 
-    void clearRenderObjectCustomStyle(const RenderObject*);
+    void clearRenderObjectCustomStyle(const RenderElement*);
 
-    void removeFlowChildInfo(RenderObject*) override;
+    void removeFlowChildInfo(RenderElement*) override;
 
     LayoutUnit flowContentBottom() const { return m_flowContentBottom; }
     void dispatchNamedFlowEvents();

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (206048 => 206049)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2016-09-16 21:20:23 UTC (rev 206048)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2016-09-16 21:39:28 UTC (rev 206049)
@@ -1426,79 +1426,12 @@
 {
     // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removals which would need to be fixed first.
 
-    removeFromRenderFlowThread();
+    setFlowThreadState(NotInsideFlowThread);
 
     // Update cached boundaries in SVG renderers, if a child is removed.
     parent()->setNeedsBoundariesUpdate();
 }
 
-void RenderObject::removeFromRenderFlowThread()
-{
-    if (flowThreadState() == NotInsideFlowThread)
-        return;
-
-    // Sometimes we remove the element from the flow, but it's not destroyed at that time.
-    // It's only until later when we actually destroy it and remove all the children from it.
-    // Currently, that happens for firstLetter elements and list markers.
-    // Pass in the flow thread so that we don't have to look it up for all the children.
-    removeFromRenderFlowThreadIncludingDescendants(true);
-}
-
-void RenderObject::removeFromRenderFlowThreadIncludingDescendants(bool shouldUpdateState)
-{
-    // Once we reach another flow thread we don't need to update the flow thread state
-    // but we have to continue cleanup the flow thread info.
-    if (isRenderFlowThread())
-        shouldUpdateState = false;
-
-    if (is<RenderElement>(*this)) {
-        for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*this)))
-            child.removeFromRenderFlowThreadIncludingDescendants(shouldUpdateState);
-    }
-
-    // We have to ask for our containing flow thread as it may be above the removed sub-tree.
-    RenderFlowThread* flowThreadContainingBlock = this->flowThreadContainingBlock();
-    while (flowThreadContainingBlock) {
-        flowThreadContainingBlock->removeFlowChildInfo(this);
-        if (flowThreadContainingBlock->flowThreadState() == NotInsideFlowThread)
-            break;
-        RenderObject* parent = flowThreadContainingBlock->parent();
-        if (!parent)
-            break;
-        flowThreadContainingBlock = parent->flowThreadContainingBlock();
-    }
-    if (is<RenderBlock>(*this))
-        downcast<RenderBlock>(*this).setCachedFlowThreadContainingBlockNeedsUpdate();
-
-    if (shouldUpdateState)
-        setFlowThreadState(NotInsideFlowThread);
-}
-
-void RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants(RenderFlowThread* flowThread)
-{
-    if (flowThreadState() == NotInsideFlowThread)
-        return;
-
-    if (is<RenderBlock>(*this)) {
-        RenderBlock& block = downcast<RenderBlock>(*this);
-
-        if (block.cachedFlowThreadContainingBlockNeedsUpdate())
-            return;
-
-        flowThread = block.cachedFlowThreadContainingBlock();
-        block.setCachedFlowThreadContainingBlockNeedsUpdate();
-    }
-
-    if (flowThread)
-        flowThread->removeFlowChildInfo(this);
-
-    if (!is<RenderElement>(*this))
-        return;
-
-    for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*this)))
-        child.invalidateFlowThreadContainingBlockIncludingDescendants(flowThread);
-}
-
 void RenderObject::destroyAndCleanupAnonymousWrappers()
 {
     // If the tree is destroyed, there is no need for a clean-up phase.

Modified: trunk/Source/WebCore/rendering/RenderObject.h (206048 => 206049)


--- trunk/Source/WebCore/rendering/RenderObject.h	2016-09-16 21:20:23 UTC (rev 206048)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2016-09-16 21:39:28 UTC (rev 206049)
@@ -816,7 +816,6 @@
     void setNeedsSimplifiedNormalFlowLayoutBit(bool b) { m_bitfields.setNeedsSimplifiedNormalFlowLayout(b); }
 
     virtual RenderFlowThread* locateFlowThreadContainingBlock() const;
-    void invalidateFlowThreadContainingBlockIncludingDescendants(RenderFlowThread* = nullptr);
     static void calculateBorderStyleColor(const EBorderStyle&, const BoxSide&, Color&);
 
 private:
@@ -829,8 +828,6 @@
     void setLayerNeedsFullRepaint();
     void setLayerNeedsFullRepaintForPositionedMovementLayout();
 
-    void removeFromRenderFlowThread();
-    void removeFromRenderFlowThreadIncludingDescendants(bool);
     Node* generatingPseudoHostElement() const;
 
     void propagateRepaintToParentWithOutlineAutoIfNeeded(const RenderLayerModelObject& repaintContainer, const LayoutRect& repaintRect) const;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to