Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: Source/WebCore/rendering/RenderObject.cpp

Issue 9568032: Merge 108127 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « Source/WebCore/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698