Index: Source/WebCore/rendering/RenderObject.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderObject.cpp (revision 109403) |
+++ Source/WebCore/rendering/RenderObject.cpp (working copy) |
@@ -283,6 +283,16 @@ |
return false; |
} |
+RenderTable* RenderObject::createAnonymousTable() const |
+{ |
+ RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style()); |
+ newStyle->setDisplay(TABLE); |
+ |
+ RenderTable* table = new (renderArena()) RenderTable(document() /* is anonymous */); |
+ table->setStyle(newStyle.release()); |
+ return table; |
+} |
+ |
void RenderObject::addChild(RenderObject* newChild, RenderObject* beforeChild) |
{ |
RenderObjectChildList* children = virtualChildren(); |
@@ -327,11 +337,7 @@ |
if (afterChild && afterChild->isAnonymous() && afterChild->isTable() && !afterChild->isBeforeContent()) |
table = toRenderTable(afterChild); |
else { |
- table = new (renderArena()) RenderTable(document() /* is anonymous */); |
- RefPtr<RenderStyle> newStyle = RenderStyle::create(); |
- newStyle->inheritFrom(style()); |
- newStyle->setDisplay(TABLE); |
- table->setStyle(newStyle.release()); |
+ table = createAnonymousTable(); |
addChild(table, beforeChild); |
} |
table->addChild(newChild); |