Title: [117759] releases/WebKitGTK/webkit-1.8/Source/WebCore
Revision
117759
Author
[email protected]
Date
2012-05-21 03:48:40 -0700 (Mon, 21 May 2012)

Log Message

Merge 113497 - Virtualize createAnonymousBoxWithSameTypeAs. https://bugs.webkit.org/show_bug.cgi?id=83229

Reviewed by Julien Chaffraix.

This helps to use the same function to create anonymous
table parts and in the future extend to more classes
derived from RenderBox.

The current switch case situation was going to be messy as
we will need to mix cases that were very dependent on the
class, so it made sense to add a virtual function.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::splitAnonymousBlocksAroundChild):
(WebCore::RenderBlock::createAnonymousBoxWithSameTypeAs):
* rendering/RenderBlock.h:
(RenderBlock):
* rendering/RenderBox.h:
(WebCore::RenderBox::createAnonymousBoxWithSameTypeAs):
(RenderBox):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::splitFlow):
* rendering/RenderTable.h:
(WebCore::RenderTable::createAnonymousBoxWithSameTypeAs):
* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::createAnonymousBoxWithSameTypeAs):
* rendering/RenderTableRow.h:
(WebCore::RenderTableRow::createAnonymousBoxWithSameTypeAs):
* rendering/RenderTableSection.h:
(WebCore::RenderTableSection::createAnonymousBoxWithSameTypeAs):


Conflicts:

	Source/WebCore/rendering/RenderBox.h

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog (117758 => 117759)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog	2012-05-21 10:48:21 UTC (rev 117758)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog	2012-05-21 10:48:40 UTC (rev 117759)
@@ -1,3 +1,37 @@
+2012-04-06  Abhishek Arya  <[email protected]>
+
+        Virtualize createAnonymousBoxWithSameTypeAs.
+        https://bugs.webkit.org/show_bug.cgi?id=83229
+
+        Reviewed by Julien Chaffraix.
+
+        This helps to use the same function to create anonymous
+        table parts and in the future extend to more classes
+        derived from RenderBox.
+
+        The current switch case situation was going to be messy as
+        we will need to mix cases that were very dependent on the
+        class, so it made sense to add a virtual function.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::splitAnonymousBlocksAroundChild):
+        (WebCore::RenderBlock::createAnonymousBoxWithSameTypeAs):
+        * rendering/RenderBlock.h:
+        (RenderBlock):
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::createAnonymousBoxWithSameTypeAs):
+        (RenderBox):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::splitFlow):
+        * rendering/RenderTable.h:
+        (WebCore::RenderTable::createAnonymousBoxWithSameTypeAs):
+        * rendering/RenderTableCell.h:
+        (WebCore::RenderTableCell::createAnonymousBoxWithSameTypeAs):
+        * rendering/RenderTableRow.h:
+        (WebCore::RenderTableRow::createAnonymousBoxWithSameTypeAs):
+        * rendering/RenderTableSection.h:
+        (WebCore::RenderTableSection::createAnonymousBoxWithSameTypeAs):
+
 2012-04-04  Abhishek Arya  <[email protected]>
 
         Add helpers to create anonymous table parts.

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.cpp (117758 => 117759)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.cpp	2012-05-21 10:48:21 UTC (rev 117758)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.cpp	2012-05-21 10:48:40 UTC (rev 117759)
@@ -606,7 +606,7 @@
         RenderBlock* blockToSplit = toRenderBlock(beforeChild->parent());
         if (blockToSplit->firstChild() != beforeChild) {
             // We have to split the parentBlock into two blocks.
-            RenderBlock* post = createAnonymousBlockWithSameTypeAs(blockToSplit);
+            RenderBlock* post = toRenderBlock(blockToSplit->createAnonymousBoxWithSameTypeAs(this));
             post->setChildrenInline(blockToSplit->childrenInline());
             RenderBlock* parentBlock = toRenderBlock(blockToSplit->parent());
             parentBlock->children()->insertChildNode(parentBlock, post, blockToSplit->nextSibling());
@@ -6466,13 +6466,13 @@
         inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint(additionalOffset + inlineElementContinuation()->containingBlock()->location() - location()));
 }
 
-RenderBlock* RenderBlock::createAnonymousBlockWithSameTypeAs(RenderBlock* otherAnonymousBlock) const
+RenderBox* RenderBlock::createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const
 {
-    if (otherAnonymousBlock->isAnonymousColumnsBlock())
-        return createAnonymousColumnsBlock();
-    if (otherAnonymousBlock->isAnonymousColumnSpanBlock())
-        return createAnonymousColumnSpanBlock();
-    return createAnonymousBlock(otherAnonymousBlock->style()->display());
+    if (isAnonymousColumnsBlock())
+        return createAnonymousColumnsWithParentRenderer(parent);
+    if (isAnonymousColumnSpanBlock())
+        return createAnonymousColumnSpanWithParentRenderer(parent);
+    return createAnonymousWithParentRendererAndDisplay(parent, style()->display());
 }
 
 bool RenderBlock::hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule pageBoundaryRule) const

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.h (117758 => 117759)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.h	2012-05-21 10:48:21 UTC (rev 117758)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.h	2012-05-21 10:48:40 UTC (rev 117759)
@@ -227,7 +227,7 @@
     RenderBlock* createAnonymousColumnsBlock() const { return createAnonymousColumnsWithParentRenderer(this); }
     RenderBlock* createAnonymousColumnSpanBlock() const { return createAnonymousColumnSpanWithParentRenderer(this); }
 
-    RenderBlock* createAnonymousBlockWithSameTypeAs(RenderBlock* otherAnonymousBlock) const;
+    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE;
     
     static void appendRunsForObject(BidiRunList<BidiRun>&, int start, int end, RenderObject*, InlineBidiResolver&);
 

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBox.h (117758 => 117759)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBox.h	2012-05-21 10:48:21 UTC (rev 117758)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBox.h	2012-05-21 10:48:40 UTC (rev 117759)
@@ -445,6 +445,12 @@
     virtual bool needsPreferredWidthsRecalculation() const;
     virtual void computeIntrinsicRatioInformation(FloatSize& /* intrinsicSize */, double& /* intrinsicRatio */, bool& /* isPercentageIntrinsicSize */) const { }
 
+    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject*) const
+    {
+        ASSERT_NOT_REACHED();
+        return 0;
+    }
+
 protected:
     virtual void willBeDestroyed();
 

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderInline.cpp (117758 => 117759)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderInline.cpp	2012-05-21 10:48:21 UTC (rev 117758)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderInline.cpp	2012-05-21 10:48:40 UTC (rev 117759)
@@ -426,7 +426,7 @@
         madeNewBeforeBlock = true;
     }
 
-    RenderBlock* post = block->createAnonymousBlockWithSameTypeAs(pre);
+    RenderBlock* post = toRenderBlock(pre->createAnonymousBoxWithSameTypeAs(block));
 
     RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
     if (madeNewBeforeBlock)

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTable.h (117758 => 117759)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTable.h	2012-05-21 10:48:21 UTC (rev 117758)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTable.h	2012-05-21 10:48:40 UTC (rev 117759)
@@ -212,6 +212,10 @@
     }
 
     static RenderTable* createAnonymousWithParentRenderer(const RenderObject*);
+    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE
+    {
+        return createAnonymousWithParentRenderer(parent);
+    }
 
 protected:
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableCell.h (117758 => 117759)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableCell.h	2012-05-21 10:48:21 UTC (rev 117758)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableCell.h	2012-05-21 10:48:40 UTC (rev 117759)
@@ -137,6 +137,10 @@
     void setCellWidthChanged(bool b = true) { m_cellWidthChanged = b; }
 
     static RenderTableCell* createAnonymousWithParentRenderer(const RenderObject*);
+    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE
+    {
+        return createAnonymousWithParentRenderer(parent);
+    }
 
 protected:
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableRow.h (117758 => 117759)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableRow.h	2012-05-21 10:48:21 UTC (rev 117758)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableRow.h	2012-05-21 10:48:40 UTC (rev 117759)
@@ -43,6 +43,10 @@
     void paintOutlineForRowIfNeeded(PaintInfo&, const LayoutPoint&);
 
     static RenderTableRow* createAnonymousWithParentRenderer(const RenderObject*);
+    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE
+    {
+        return createAnonymousWithParentRenderer(parent);
+    }
 
 private:
     virtual RenderObjectChildList* virtualChildren() { return children(); }

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableSection.h (117758 => 117759)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableSection.h	2012-05-21 10:48:21 UTC (rev 117758)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableSection.h	2012-05-21 10:48:40 UTC (rev 117759)
@@ -142,6 +142,10 @@
     CollapsedBorderValue& cachedCollapsedBorder(const RenderTableCell*, CollapsedBorderSide);
 
     static RenderTableSection* createAnonymousWithParentRenderer(const RenderObject*);
+    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE
+    {
+        return createAnonymousWithParentRenderer(parent);
+    }
 
 protected:
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to