[New Multicolumn] Don't destroy all the renderers when a multi-column block stops...
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jan 2014 22:52:41 +0000 (22:52 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jan 2014 22:52:41 +0000 (22:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127584

Make the logic for when you need columns and when you don't shared between the
old multi-column code and the new multi-column code. Make sure that the flow thread
and sets get created lazily and destroyed on-demand when whether or not we should
have multiple columns changes.

Reviewed by Beth Dakin.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateLogicalWidthAndColumnWidth):
No longer virtual. The new column code now uses this function too.

(WebCore::RenderBlock::availableLogicalWidth):
Renamed desiredColumnWidth() to computedColumnWidth().

(WebCore::RenderBlock::computeColumnCountAndWidth):
Renamed calcColumnWidth to computeColumnCountAndWidth.

(WebCore::RenderBlock::setComputedColumnCountAndWidth):
Rename setDesiredColumnCountAndWidth to computed.

(WebCore::RenderBlock::computedColumnWidth):
(WebCore::RenderBlock::computedColumnCount):
Renamed desiredColumnWidth/Count to computedColumnWidth/Count and made them virtual.

(WebCore::RenderBlock::updateFirstLetterStyle):
desired -> computed rename.

* rendering/RenderBlock.h:
Renames and made a few functions virtual so that RenderBlockFlow can override.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::RenderBlockFlow):
Don't create the flow thread at construction time any longer.

(WebCore::RenderBlockFlow::createMultiColumnFlowThread):
(WebCore::RenderBlockFlow::destroyMultiColumnFlowThread):
The methods to create and destroy flow threads. These work at any time now and will
fix up the render tree accordingly.

(WebCore::RenderBlockFlow::setComputedColumnCountAndWidth):
Virtual override that creates/destroys the new multi-column information as needed.

(WebCore::RenderBlockFlow::computedColumnWidth):
(WebCore::RenderBlockFlow::computedColumnCount):
Overrides to return the cached column width and count from the flow thread.

* rendering/RenderBlockFlow.h:
Has overrides of the virtual functions needed to turn multi-column state on/off and
to hand back computed count/width information.

* rendering/RenderMultiColumnFlowThread.cpp:
* rendering/RenderMultiColumnFlowThread.h:
Removed the algorithm to compute column count and width, since this has been combined
with the old multi-column layout code.

* rendering/RenderView.cpp:
(WebCore::RenderView::computeColumnCountAndWidth):
Renamed desired -> computed.

* rendering/RenderView.h:
Renamed desired -> computed.

* style/StyleResolveTree.cpp:
(WebCore::Style::determineChange):
(WebCore::Style::resolveLocal):
(WebCore::Style::resolveTree):
* style/StyleResolveTree.h:
The Settings argument is no longer needed now that we don't destroy and re-create
the renderer for a block flow if it stops being (or becomes) multi-column.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162726 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockFlow.h
Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
Source/WebCore/rendering/RenderMultiColumnFlowThread.h
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebCore/style/StyleResolveTree.cpp
Source/WebCore/style/StyleResolveTree.h

index b08e126..5c5ec4f 100644 (file)
@@ -1,3 +1,78 @@
+2014-01-24  David Hyatt  <hyatt@apple.com>
+
+        [New Multicolumn] Don't destroy all the renderers when a multi-column block stops being multi-column (and vice versa)
+        https://bugs.webkit.org/show_bug.cgi?id=127584
+
+        Make the logic for when you need columns and when you don't shared between the
+        old multi-column code and the new multi-column code. Make sure that the flow thread
+        and sets get created lazily and destroyed on-demand when whether or not we should
+        have multiple columns changes.
+
+        Reviewed by Beth Dakin.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::updateLogicalWidthAndColumnWidth):
+        No longer virtual. The new column code now uses this function too.
+
+        (WebCore::RenderBlock::availableLogicalWidth):
+        Renamed desiredColumnWidth() to computedColumnWidth().
+
+        (WebCore::RenderBlock::computeColumnCountAndWidth):
+        Renamed calcColumnWidth to computeColumnCountAndWidth.
+
+        (WebCore::RenderBlock::setComputedColumnCountAndWidth):
+        Rename setDesiredColumnCountAndWidth to computed.
+
+        (WebCore::RenderBlock::computedColumnWidth):
+        (WebCore::RenderBlock::computedColumnCount):
+        Renamed desiredColumnWidth/Count to computedColumnWidth/Count and made them virtual.
+
+        (WebCore::RenderBlock::updateFirstLetterStyle):
+        desired -> computed rename.
+
+        * rendering/RenderBlock.h:
+        Renames and made a few functions virtual so that RenderBlockFlow can override.
+
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::RenderBlockFlow):
+        Don't create the flow thread at construction time any longer.
+
+        (WebCore::RenderBlockFlow::createMultiColumnFlowThread):
+        (WebCore::RenderBlockFlow::destroyMultiColumnFlowThread):
+        The methods to create and destroy flow threads. These work at any time now and will
+        fix up the render tree accordingly.
+
+        (WebCore::RenderBlockFlow::setComputedColumnCountAndWidth):
+        Virtual override that creates/destroys the new multi-column information as needed.
+
+        (WebCore::RenderBlockFlow::computedColumnWidth):
+        (WebCore::RenderBlockFlow::computedColumnCount):
+        Overrides to return the cached column width and count from the flow thread.
+
+        * rendering/RenderBlockFlow.h:
+        Has overrides of the virtual functions needed to turn multi-column state on/off and
+        to hand back computed count/width information.
+
+        * rendering/RenderMultiColumnFlowThread.cpp:
+        * rendering/RenderMultiColumnFlowThread.h:
+        Removed the algorithm to compute column count and width, since this has been combined
+        with the old multi-column layout code.
+
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::computeColumnCountAndWidth):
+        Renamed desired -> computed.
+
+        * rendering/RenderView.h:
+        Renamed desired -> computed.
+
+        * style/StyleResolveTree.cpp:
+        (WebCore::Style::determineChange):
+        (WebCore::Style::resolveLocal):
+        (WebCore::Style::resolveTree):
+        * style/StyleResolveTree.h:
+        The Settings argument is no longer needed now that we don't destroy and re-create
+        the renderer for a block flow if it stops being (or becomes) multi-column.
+
 2014-01-24  Anders Carlsson  <andersca@apple.com>
 
         Fix 32-bit build.
index 595081b..21bfba9 100644 (file)
@@ -1547,15 +1547,15 @@ void RenderBlock::prepareShapesAndPaginationBeforeBlockLayout(bool& relayoutChil
 bool RenderBlock::updateLogicalWidthAndColumnWidth()
 {
     LayoutUnit oldWidth = logicalWidth();
-    LayoutUnit oldColumnWidth = desiredColumnWidth();
+    LayoutUnit oldColumnWidth = computedColumnWidth();
 
     updateLogicalWidth();
-    calcColumnWidth();
+    computeColumnCountAndWidth();
 
     bool hasBorderOrPaddingLogicalWidthChanged = m_hasBorderOrPaddingLogicalWidthChanged;
     m_hasBorderOrPaddingLogicalWidthChanged = false;
 
-    return oldWidth != logicalWidth() || oldColumnWidth != desiredColumnWidth() || hasBorderOrPaddingLogicalWidthChanged;
+    return oldWidth != logicalWidth() || oldColumnWidth != computedColumnWidth() || hasBorderOrPaddingLogicalWidthChanged;
 }
 
 void RenderBlock::layoutBlock(bool, LayoutUnit)
@@ -3631,7 +3631,7 @@ LayoutUnit RenderBlock::availableLogicalWidth() const
 {
     // If we have multiple columns, then the available logical width is reduced to our column width.
     if (hasColumns())
-        return desiredColumnWidth();
+        return computedColumnWidth();
     return RenderBox::availableLogicalWidth();
 }
 
@@ -3642,11 +3642,8 @@ int RenderBlock::columnGap() const
     return static_cast<int>(style().columnGap());
 }
 
-void RenderBlock::calcColumnWidth()
+void RenderBlock::computeColumnCountAndWidth()
 {   
-    if (document().regionBasedColumnsEnabled())
-        return;
-
     // Calculate our column width and column count.
     // FIXME: Can overflow on fast/block/float/float-not-removed-from-next-sibling4.html, see https://bugs.webkit.org/show_bug.cgi?id=68744
     unsigned desiredColumnCount = 1;
@@ -3654,7 +3651,7 @@ void RenderBlock::calcColumnWidth()
     
     // For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination.
     if (document().paginated() || (style().hasAutoColumnCount() && style().hasAutoColumnWidth()) || !style().hasInlineColumnAxis()) {
-        setDesiredColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
+        setComputedColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
         return;
     }
         
@@ -3673,7 +3670,7 @@ void RenderBlock::calcColumnWidth()
         desiredColumnCount = std::max<LayoutUnit>(std::min<LayoutUnit>(colCount, (availWidth + colGap) / (colWidth + colGap)), 1);
         desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap;
     }
-    setDesiredColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
+    setComputedColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
 }
 
 bool RenderBlock::requiresColumns(int desiredColumnCount) const
@@ -3688,7 +3685,7 @@ bool RenderBlock::requiresColumns(int desiredColumnCount) const
         && !firstChild()->isAnonymousColumnSpanBlock();
 }
 
-void RenderBlock::setDesiredColumnCountAndWidth(int count, LayoutUnit width)
+void RenderBlock::setComputedColumnCountAndWidth(int count, LayoutUnit width)
 {
     bool destroyColumns = !requiresColumns(count);
     if (destroyColumns) {
@@ -3740,14 +3737,14 @@ void RenderBlock::updateColumnInfoFromStyle(RenderStyle* style)
         setNeedsLayoutAndPrefWidthsRecalc();
 }
 
-LayoutUnit RenderBlock::desiredColumnWidth() const
+LayoutUnit RenderBlock::computedColumnWidth() const
 {
     if (!hasColumns())
         return contentLogicalWidth();
     return gColumnInfoMap->get(this)->desiredColumnWidth();
 }
 
-unsigned RenderBlock::desiredColumnCount() const
+unsigned RenderBlock::computedColumnCount() const
 {
     if (!hasColumns())
         return 1;
@@ -4832,7 +4829,7 @@ void RenderBlock::updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderO
     RenderStyle* pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer);
     ASSERT(firstLetter->isFloating() || firstLetter->isInline());
 
-    if (Style::determineChange(&firstLetter->style(), pseudoStyle, &frame().settings()) == Style::Detach) {
+    if (Style::determineChange(&firstLetter->style(), pseudoStyle) == Style::Detach) {
         // The first-letter renderer needs to be replaced. Create a new renderer of the right type.
         RenderBoxModelObject* newFirstLetter;
         if (pseudoStyle->display() == INLINE)
index cfb0209..49f5652 100644 (file)
@@ -416,7 +416,8 @@ protected:
     bool simplifiedLayout();
     virtual void simplifiedNormalFlowLayout();
 
-    void setDesiredColumnCountAndWidth(int, LayoutUnit);
+    // FIXME: Can de-virtualize this once old columns go away.
+    virtual void setComputedColumnCountAndWidth(int, LayoutUnit);
 
 public:
     virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats = false);
@@ -542,8 +543,9 @@ private:
     virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const override;
     virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
 
-    LayoutUnit desiredColumnWidth() const;
-    unsigned desiredColumnCount() const;
+    // FIXME: Can de-virtualize once old columns go away.
+    virtual LayoutUnit computedColumnWidth() const;
+    virtual unsigned computedColumnCount() const;
 
     void paintContinuationOutlines(PaintInfo&, const LayoutPoint&);
 
@@ -554,7 +556,7 @@ private:
     // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
     virtual VisiblePosition positionForPointWithInlineChildren(const LayoutPoint&);
 
-    virtual void calcColumnWidth();
+    virtual void computeColumnCountAndWidth();
     void makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlock* newBlockBox, RenderObject* newChild);
 
     bool expandsToEncloseOverhangingFloats() const;
@@ -586,9 +588,9 @@ protected:
     // Adjust from painting offsets to the local coords of this renderer
     void offsetForContents(LayoutPoint&) const;
 
-    virtual bool requiresColumns(int desiredColumnCount) const;
+    virtual bool requiresColumns(int computedColumnCount) const;
 
-    virtual bool updateLogicalWidthAndColumnWidth();
+    bool updateLogicalWidthAndColumnWidth();
 
     virtual bool canCollapseAnonymousBlockChild() const { return true; }
 
index fe4e52f..f4f7137 100644 (file)
@@ -103,7 +103,6 @@ RenderBlockFlow::RenderBlockFlow(Element& element, PassRef<RenderStyle> style)
 #endif
 {
     setChildrenInline(true);
-    createMultiColumnFlowThreadIfNeeded();
 }
 
 RenderBlockFlow::RenderBlockFlow(Document& document, PassRef<RenderStyle> style)
@@ -114,25 +113,39 @@ RenderBlockFlow::RenderBlockFlow(Document& document, PassRef<RenderStyle> style)
 #endif
 {
     setChildrenInline(true);
-    createMultiColumnFlowThreadIfNeeded();
 }
 
 RenderBlockFlow::~RenderBlockFlow()
 {
 }
 
-void RenderBlockFlow::createMultiColumnFlowThreadIfNeeded()
+void RenderBlockFlow::createMultiColumnFlowThread()
 {
-    if ((style().hasAutoColumnCount() && style().hasAutoColumnWidth()) || !document().regionBasedColumnsEnabled())
-        return;
-    
-    setChildrenInline(false);
     RenderMultiColumnFlowThread* flowThread = new RenderMultiColumnFlowThread(document(), RenderStyle::createAnonymousStyleWithDisplay(&style(), BLOCK));
     flowThread->initializeStyle();
+    moveAllChildrenTo(flowThread, true);
     RenderBlock::addChild(flowThread);
     setMultiColumnFlowThread(flowThread);
 }
 
+void RenderBlockFlow::destroyMultiColumnFlowThread()
+{
+    // Get the flow thread out of our list.
+    multiColumnFlowThread()->removeFromParent();
+    
+    // Destroy all the multicolumn sets.
+    destroyLeftoverChildren();
+    
+    // Move all the children of the flow thread into our block.
+    multiColumnFlowThread()->moveAllChildrenTo(this, true);
+    
+    // Now destroy the flow thread.
+    multiColumnFlowThread()->destroy();
+    
+    // Clear the multi-column flow thread pointer.
+    setMultiColumnFlowThread(nullptr);
+}
+
 void RenderBlockFlow::insertedIntoTree()
 {
     RenderBlock::insertedIntoTree();
@@ -3519,16 +3532,6 @@ RenderObject* RenderBlockFlow::layoutSpecialExcludedChild(bool relayoutChildren)
     return multiColumnFlowThread();
 }
 
-
-bool RenderBlockFlow::updateLogicalWidthAndColumnWidth()
-{
-    bool relayoutChildren = RenderBlock::updateLogicalWidthAndColumnWidth();
-    if (multiColumnFlowThread() && multiColumnFlowThread()->computeColumnCountAndWidth())
-        relayoutChildren = true;
-    return relayoutChildren;
-}
-
-
 void RenderBlockFlow::addChild(RenderObject* newChild, RenderObject* beforeChild)
 {
     if (multiColumnFlowThread())
@@ -3536,7 +3539,6 @@ void RenderBlockFlow::addChild(RenderObject* newChild, RenderObject* beforeChild
     RenderBlock::addChild(newChild, beforeChild);
 }
 
-
 void RenderBlockFlow::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight)
 {
     // If we don't use either of the two column implementations or a flow thread, then bail.
@@ -3578,5 +3580,42 @@ void RenderBlockFlow::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogi
     }
 }
 
+void RenderBlockFlow::setComputedColumnCountAndWidth(int count, LayoutUnit width)
+{
+    if (!document().regionBasedColumnsEnabled())
+        return RenderBlock::setComputedColumnCountAndWidth(count, width);
+    
+    bool destroyColumns = !requiresColumns(count);
+    if (destroyColumns) {
+        if (multiColumnFlowThread())
+            destroyMultiColumnFlowThread();
+    } else {
+        if (!multiColumnFlowThread())
+            createMultiColumnFlowThread();
+        multiColumnFlowThread()->setColumnCountAndWidth(count, width);
+    }
+}
+
+LayoutUnit RenderBlockFlow::computedColumnWidth() const
+{
+    if (!document().regionBasedColumnsEnabled())
+        return RenderBlock::computedColumnWidth();
+    
+    if (multiColumnFlowThread())
+        return multiColumnFlowThread()->computedColumnWidth();
+    return contentLogicalWidth();
+}
+
+unsigned RenderBlockFlow::computedColumnCount() const
+{
+    if (!document().regionBasedColumnsEnabled())
+        return RenderBlock::computedColumnCount();
+    
+    if (multiColumnFlowThread())
+        return multiColumnFlowThread()->computedColumnCount();
+    
+    return 1;
+}
+
 }
 // namespace WebCore
index 61c0cbc..4a149a8 100644 (file)
@@ -376,7 +376,8 @@ public:
 
     void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) override;
     
-    void createMultiColumnFlowThreadIfNeeded();
+    void createMultiColumnFlowThread();
+    void destroyMultiColumnFlowThread();
     
 protected:
     // A page break is required at some offset due to space shortage in the current fragmentainer.
@@ -431,11 +432,14 @@ protected:
 
     virtual int firstLineBaseline() const override;
     virtual int inlineBlockBaseline(LineDirectionMode) const override;
-    
-    bool updateLogicalWidthAndColumnWidth() override;
 
     virtual bool isMultiColumnBlockFlow() const override { return multiColumnFlowThread(); }
     
+    virtual void setComputedColumnCountAndWidth(int, LayoutUnit) override;
+    
+    virtual LayoutUnit computedColumnWidth() const override;
+    virtual unsigned computedColumnCount() const override;
+
 private:
     // Called to lay out the legend for a fieldset or the ruby text of a ruby run. Also used by multi-column layout to handle
     // the flow thread child.
index c9e5c54..2a94126 100644 (file)
@@ -62,40 +62,6 @@ LayoutUnit RenderMultiColumnFlowThread::initialLogicalWidth() const
     return columnWidth();
 }
 
-bool RenderMultiColumnFlowThread::computeColumnCountAndWidth()
-{
-    RenderBlock* columnBlock = toRenderBlock(parent());
-    
-    LayoutUnit oldColumnWidth = m_columnWidth;
-    
-    // Calculate our column width and column count.
-    // FIXME: Can overflow on fast/block/float/float-not-removed-from-next-sibling4.html, see https://bugs.webkit.org/show_bug.cgi?id=68744
-    m_columnCount = 1;
-    m_columnWidth = columnBlock->contentLogicalWidth();
-    
-    const RenderStyle& columnStyle = columnBlock->style();
-    
-    ASSERT(!columnStyle.hasAutoColumnCount() || !columnStyle.hasAutoColumnWidth());
-
-    LayoutUnit availWidth = m_columnWidth;
-    LayoutUnit colGap = columnBlock->columnGap();
-    LayoutUnit colWidth = std::max<LayoutUnit>(1, LayoutUnit(columnStyle.columnWidth()));
-    int colCount = std::max<int>(1, columnStyle.columnCount());
-
-    if (columnStyle.hasAutoColumnWidth() && !columnStyle.hasAutoColumnCount()) {
-        m_columnCount = colCount;
-        m_columnWidth = std::max<LayoutUnit>(0, (availWidth - ((m_columnCount - 1) * colGap)) / m_columnCount);
-    } else if (!columnStyle.hasAutoColumnWidth() && columnStyle.hasAutoColumnCount()) {
-        m_columnCount = std::max<LayoutUnit>(1, (availWidth + colGap) / (colWidth + colGap));
-        m_columnWidth = ((availWidth + colGap) / m_columnCount) - colGap;
-    } else {
-        m_columnCount = std::max<LayoutUnit>(std::min<LayoutUnit>(colCount, (availWidth + colGap) / (colWidth + colGap)), 1);
-        m_columnWidth = ((availWidth + colGap) / m_columnCount) - colGap;
-    }
-    
-    return m_columnWidth != oldColumnWidth;
-}
-
 void RenderMultiColumnFlowThread::autoGenerateRegionsToBlockOffset(LayoutUnit /*offset*/)
 {
     // This function ensures we have the correct column set information at all times.
index 1de8a32..56df679 100644 (file)
@@ -44,13 +44,17 @@ public:
     void setInBalancingPass(bool balancing) { m_inBalancingPass = balancing; }
     bool needsRebalancing() const { return m_needsRebalancing; }
     void setNeedsRebalancing(bool balancing) { m_needsRebalancing = balancing; }
-
-    bool computeColumnCountAndWidth();
     
     bool shouldRelayoutForPagination() const { return !m_inBalancingPass && m_needsRebalancing; }
     
     bool requiresBalancing() const { return !columnHeightAvailable() || parent()->style().columnFill() == ColumnFillBalance; }
 
+    void setColumnCountAndWidth(unsigned count, LayoutUnit width)
+    {
+        m_columnCount = count;
+        m_columnWidth = width;
+    }
+
 private:
     virtual const char* renderName() const override;
     virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const override;
index bbf8aa0..6233b3d 100644 (file)
@@ -461,14 +461,14 @@ bool RenderView::requiresColumns(int) const
     return frameView().pagination().mode != Pagination::Unpaginated;
 }
 
-void RenderView::calcColumnWidth()
+void RenderView::computeColumnCountAndWidth()
 {
     int columnWidth = contentLogicalWidth();
     if (style().hasInlineColumnAxis()) {
         if (int pageLength = frameView().pagination().pageLength)
             columnWidth = pageLength;
     }
-    setDesiredColumnCountAndWidth(1, columnWidth);
+    setComputedColumnCountAndWidth(1, columnWidth);
 }
 
 ColumnInfo::PaginationUnit RenderView::paginationUnit() const
index 2aeeeb1..da05a29 100644 (file)
@@ -243,7 +243,7 @@ protected:
 private:
     bool initializeLayoutState(LayoutState&);
 
-    virtual void calcColumnWidth() override;
+    virtual void computeColumnCountAndWidth() override;
     virtual ColumnInfo::PaginationUnit paginationUnit() const override;
 
     bool shouldRepaint(const LayoutRect&) const;
index 2f7a8d4..f0d4a8d 100644 (file)
@@ -65,7 +65,7 @@ static void attachTextRenderer(Text&);
 static void detachRenderTree(Element&, DetachType);
 static void resolveTree(Element&, Change);
 
-Change determineChange(const RenderStyle* s1, const RenderStyle* s2, Settings* settings)
+Change determineChange(const RenderStyle* s1, const RenderStyle* s2)
 {
     if (!s1 || !s2)
         return Detach;
@@ -77,12 +77,6 @@ Change determineChange(const RenderStyle* s1, const RenderStyle* s2, Settings* s
     // typically won't contain much content.
     if (s1->columnSpan() != s2->columnSpan())
         return Detach;
-    if (settings->regionBasedColumnsEnabled()) {
-        bool specifiesColumns1 = !s1->hasAutoColumnCount() || !s1->hasAutoColumnWidth();
-        bool specifiesColumns2 = !s2->hasAutoColumnCount() || !s2->hasAutoColumnWidth();
-        if (specifiesColumns1 != specifiesColumns2)
-            return Detach;
-    }
     if (!s1->contentDataEquivalent(s2))
         return Detach;
     // When text-combine property has been changed, we need to prepare a separate renderer object.
@@ -676,7 +670,7 @@ static Change resolveLocal(Element& current, Change inheritedChange)
     Document& document = current.document();
     if (currentStyle && current.styleChangeType() != ReconstructRenderTree) {
         newStyle = current.styleForRenderer();
-        localChange = determineChange(currentStyle.get(), newStyle.get(), document.settings());
+        localChange = determineChange(currentStyle.get(), newStyle.get());
     }
     if (localChange == Detach) {
         if (current.renderer() || current.inNamedFlow())
@@ -897,7 +891,7 @@ void resolveTree(Document& document, Change change)
                 documentStyle.get().font().update(styleResolver->fontSelector());
         }
 
-        Style::Change documentChange = determineChange(&documentStyle.get(), &document.renderView()->style(), document.settings());
+        Style::Change documentChange = determineChange(&documentStyle.get(), &document.renderView()->style());
         if (documentChange != NoChange)
             document.renderView()->setStyle(std::move(documentStyle));
         else
index a9afaac..55aad05 100644 (file)
@@ -45,7 +45,7 @@ void detachTextRenderer(Text&);
 
 void updateTextRendererAfterContentChange(Text&, unsigned offsetOfReplacedData, unsigned lengthOfReplacedData);
 
-Change determineChange(const RenderStyle*, const RenderStyle*, Settings*);
+Change determineChange(const RenderStyle*, const RenderStyle*);
 
 }