Diff
Modified: trunk/Source/WebCore/ChangeLog (118551 => 118552)
--- trunk/Source/WebCore/ChangeLog 2012-05-25 19:40:58 UTC (rev 118551)
+++ trunk/Source/WebCore/ChangeLog 2012-05-25 19:50:02 UTC (rev 118552)
@@ -1,3 +1,29 @@
+2012-05-25 David Hyatt <[email protected]>
+
+ https://bugs.webkit.org/show_bug.cgi?id=87525
+
+ For the new multi-column layout, create a flow thread and make sure the children get put inside it.
+
+ Reviewed by Eric Seidel.
+
+ * rendering/RenderMultiColumnBlock.cpp:
+ (WebCore::RenderMultiColumnBlock::RenderMultiColumnBlock):
+ (WebCore::RenderMultiColumnBlock::addChild):
+ (WebCore):
+ * rendering/RenderMultiColumnBlock.h:
+ (WebCore):
+ (RenderMultiColumnBlock):
+ (WebCore::RenderMultiColumnBlock::flowThread):
+ * rendering/RenderMultiColumnFlowThread.cpp:
+ (WebCore::RenderMultiColumnFlowThread::~RenderMultiColumnFlowThread):
+ (WebCore):
+ * rendering/RenderMultiColumnFlowThread.h:
+ (RenderMultiColumnFlowThread):
+ * rendering/RenderMultiColumnSet.h:
+ * rendering/RenderObject.h:
+ (RenderObject):
+ (WebCore::RenderObject::isRenderMultiColumnSet):
+
2012-05-25 Emil A Eklund <[email protected]>
Change RenderBoxModelObject to compute relativePositionOffset as size
Modified: trunk/Source/WebCore/rendering/RenderMultiColumnBlock.cpp (118551 => 118552)
--- trunk/Source/WebCore/rendering/RenderMultiColumnBlock.cpp 2012-05-25 19:40:58 UTC (rev 118551)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnBlock.cpp 2012-05-25 19:50:02 UTC (rev 118552)
@@ -25,6 +25,7 @@
#include "config.h"
#include "RenderMultiColumnBlock.h"
+#include "RenderMultiColumnFlowThread.h"
using namespace std;
@@ -32,6 +33,7 @@
RenderMultiColumnBlock::RenderMultiColumnBlock(Node* node)
: RenderBlock(node)
+ , m_flowThread(0)
, m_columnCount(1)
, m_columnWidth(0)
{
@@ -73,6 +75,22 @@
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())
Modified: trunk/Source/WebCore/rendering/RenderMultiColumnBlock.h (118551 => 118552)
--- trunk/Source/WebCore/rendering/RenderMultiColumnBlock.h 2012-05-25 19:40:58 UTC (rev 118551)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnBlock.h 2012-05-25 19:50:02 UTC (rev 118552)
@@ -31,6 +31,8 @@
namespace WebCore {
+class RenderMultiColumnFlowThread;
+
class RenderMultiColumnBlock : public RenderBlock {
public:
RenderMultiColumnBlock(Node*);
@@ -41,7 +43,13 @@
virtual bool recomputeLogicalWidth();
void computeColumnCountAndWidth();
+ virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) OVERRIDE;
+
+ RenderMultiColumnFlowThread* flowThread() const { return m_flowThread; }
+
private:
+ RenderMultiColumnFlowThread* m_flowThread;
+
unsigned m_columnCount; // The default column count/width that are based off our containing block width. These values represent only the default,
LayoutUnit m_columnWidth; // since a multi-column block that is split across variable width pages or regions will have different column counts and widths in each.
// These values will be cached (eventually) for multi-column blocks.
Modified: trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp (118551 => 118552)
--- trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp 2012-05-25 19:40:58 UTC (rev 118551)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp 2012-05-25 19:50:02 UTC (rev 118552)
@@ -33,6 +33,10 @@
{
}
+RenderMultiColumnFlowThread::~RenderMultiColumnFlowThread()
+{
+}
+
const char* RenderMultiColumnFlowThread::renderName() const
{
return "RenderMultiColumnFlowThread";
Modified: trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.h (118551 => 118552)
--- trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.h 2012-05-25 19:40:58 UTC (rev 118551)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.h 2012-05-25 19:50:02 UTC (rev 118552)
@@ -34,7 +34,8 @@
class RenderMultiColumnFlowThread : public RenderFlowThread {
public:
RenderMultiColumnFlowThread(Node*);
-
+ ~RenderMultiColumnFlowThread();
+
private:
virtual const char* renderName() const OVERRIDE;
};
Modified: trunk/Source/WebCore/rendering/RenderMultiColumnSet.h (118551 => 118552)
--- trunk/Source/WebCore/rendering/RenderMultiColumnSet.h 2012-05-25 19:40:58 UTC (rev 118551)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnSet.h 2012-05-25 19:50:02 UTC (rev 118552)
@@ -45,6 +45,8 @@
public:
RenderMultiColumnSet(Node*, RenderFlowThread*);
+ virtual bool isRenderMultiColumnSet() const OVERRIDE { return true; }
+
private:
virtual const char* renderName() const;
};
Modified: trunk/Source/WebCore/rendering/RenderObject.h (118551 => 118552)
--- trunk/Source/WebCore/rendering/RenderObject.h 2012-05-25 19:40:58 UTC (rev 118551)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2012-05-25 19:50:02 UTC (rev 118552)
@@ -360,6 +360,9 @@
virtual bool isRenderFlowThread() const { return false; }
virtual bool isRenderNamedFlowThread() const { return false; }
+
+ virtual bool isRenderMultiColumnSet() const { return false; }
+
virtual bool isRenderScrollbarPart() const { return false; }
bool canHaveRegionStyle() const { return isRenderBlock() && !isAnonymous() && !isRenderFlowThread(); }
Modified: trunk/Source/WebCore/rendering/RenderingAllInOne.cpp (118551 => 118552)
--- trunk/Source/WebCore/rendering/RenderingAllInOne.cpp 2012-05-25 19:40:58 UTC (rev 118551)
+++ trunk/Source/WebCore/rendering/RenderingAllInOne.cpp 2012-05-25 19:50:02 UTC (rev 118552)
@@ -75,6 +75,8 @@
#include "RenderMenuList.cpp"
#include "RenderMeter.cpp"
#include "RenderMultiColumnBlock.cpp"
+#include "RenderMultiColumnFlowThread.cpp"
+#include "RenderMultiColumnSet.cpp"
#include "RenderObject.cpp"
#include "RenderObjectChildList.cpp"
#include "RenderPart.cpp"