summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderMultiColumnBlock.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-27 21:51:42 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-27 21:51:42 +0200
commitbe01689f43cf6882cf670d33df49ead1f570c53a (patch)
tree4bb2161d8983b38e3e7ed37b4a50303bfd5e2e85 /Source/WebCore/rendering/RenderMultiColumnBlock.cpp
parenta89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (diff)
downloadqtwebkit-be01689f43cf6882cf670d33df49ead1f570c53a.tar.gz
Imported WebKit commit 8d6c5efc74f0222dfc7bcce8d845d4a2707ed9e6 (http://svn.webkit.org/repository/webkit/trunk@118629)
Diffstat (limited to 'Source/WebCore/rendering/RenderMultiColumnBlock.cpp')
-rw-r--r--Source/WebCore/rendering/RenderMultiColumnBlock.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/WebCore/rendering/RenderMultiColumnBlock.cpp b/Source/WebCore/rendering/RenderMultiColumnBlock.cpp
index d29055e68..d7f43ff50 100644
--- a/Source/WebCore/rendering/RenderMultiColumnBlock.cpp
+++ b/Source/WebCore/rendering/RenderMultiColumnBlock.cpp
@@ -25,6 +25,7 @@
#include "config.h"
#include "RenderMultiColumnBlock.h"
+#include "RenderMultiColumnFlowThread.h"
using namespace std;
@@ -32,6 +33,7 @@ namespace WebCore {
RenderMultiColumnBlock::RenderMultiColumnBlock(Node* node)
: RenderBlock(node)
+ , m_flowThread(0)
, m_columnCount(1)
, m_columnWidth(0)
{
@@ -73,6 +75,22 @@ bool RenderMultiColumnBlock::recomputeLogicalWidth()
return relayoutChildren;
}
+void RenderMultiColumnBlock::addChild(RenderObject* newChild, RenderObject* beforeChild)
+{
+ if (!m_flowThread) {
+ m_flowThread = new (renderArena()) RenderMultiColumnFlowThread(document());
+ m_flowThread->setStyle(RenderStyle::createAnonymousStyleWithDisplay(style(), BLOCK));
+ RenderBlock::addChild(m_flowThread); // Always put the flow thread at the end.
+ }
+
+ // Column sets are siblings of the flow thread. All children designed to be in the columns, however, are part
+ // of the flow thread itself.
+ if (newChild->isRenderMultiColumnSet())
+ RenderBlock::addChild(newChild, beforeChild);
+ else
+ m_flowThread->addChild(newChild, beforeChild);
+}
+
const char* RenderMultiColumnBlock::renderName() const
{
if (isFloating())