Index: Source/WebCore/rendering/RenderTable.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderTable.cpp (revision 115614) |
+++ Source/WebCore/rendering/RenderTable.cpp (working copy) |
@@ -191,11 +191,8 @@ |
if (beforeChild && !beforeChild->isTableSection() && beforeChild->style()->display() != TABLE_CAPTION && beforeChild->style()->display() != TABLE_COLUMN_GROUP) |
beforeChild = 0; |
- RenderTableSection* section = new (renderArena()) RenderTableSection(document() /* anonymous */); |
- RefPtr<RenderStyle> newStyle = RenderStyle::create(); |
- newStyle->inheritFrom(style()); |
- newStyle->setDisplay(TABLE_ROW_GROUP); |
- section->setStyle(newStyle.release()); |
+ |
+ RenderTableSection* section = RenderTableSection::createAnonymousWithParentRenderer(this); |
addChild(section, beforeChild); |
section->addChild(child); |
} |
@@ -1284,4 +1281,14 @@ |
return false; |
} |
+RenderTable* RenderTable::createAnonymousWithParentRenderer(const RenderObject* parent) |
+{ |
+ RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); |
+ newStyle->setDisplay(TABLE); |
+ |
+ RenderTable* newTable = new (parent->renderArena()) RenderTable(parent->document() /* is anonymous */); |
+ newTable->setStyle(newStyle.release()); |
+ return newTable; |
} |
+ |
+} |