Index: Source/WebCore/rendering/RenderObject.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderObject.cpp (revision 109407) |
+++ Source/WebCore/rendering/RenderObject.cpp (working copy) |
@@ -266,6 +266,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(); |
@@ -310,11 +320,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); |