Commit be36462f authored by mstensho@opera.com's avatar mstensho@opera.com

[New Multicolumn] Faster and more direct RenderMultiColumnSet::multiColumnFlowThread().

No need to go via the parent block to get the flow thread.

Review URL: https://codereview.chromium.org/254883003

git-svn-id: svn://svn.chromium.org/blink/trunk@173025 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6d1a55e4
...@@ -58,6 +58,7 @@ public: ...@@ -58,6 +58,7 @@ public:
virtual ~RenderFlowThread() { }; virtual ~RenderFlowThread() { };
virtual bool isRenderFlowThread() const OVERRIDE FINAL { return true; } virtual bool isRenderFlowThread() const OVERRIDE FINAL { return true; }
virtual bool isRenderMultiColumnFlowThread() const { return false; }
virtual void layout() OVERRIDE FINAL; virtual void layout() OVERRIDE FINAL;
......
...@@ -56,6 +56,8 @@ public: ...@@ -56,6 +56,8 @@ public:
static RenderMultiColumnFlowThread* createAnonymous(Document&, RenderStyle* parentStyle); static RenderMultiColumnFlowThread* createAnonymous(Document&, RenderStyle* parentStyle);
virtual bool isRenderMultiColumnFlowThread() const OVERRIDE FINAL { return true; }
RenderBlockFlow* multiColumnBlockFlow() const { return toRenderBlockFlow(parent()); } RenderBlockFlow* multiColumnBlockFlow() const { return toRenderBlockFlow(parent()); }
RenderMultiColumnSet* firstMultiColumnSet() const; RenderMultiColumnSet* firstMultiColumnSet() const;
......
...@@ -261,7 +261,7 @@ void RenderMultiColumnSet::prepareForLayout() ...@@ -261,7 +261,7 @@ void RenderMultiColumnSet::prepareForLayout()
// Set box width. // Set box width.
updateLogicalWidth(); updateLogicalWidth();
if (multicolBlock->multiColumnFlowThread()->requiresBalancing()) { if (multiColumnFlowThread()->requiresBalancing()) {
// Set maximum column height. We will not stretch beyond this. // Set maximum column height. We will not stretch beyond this.
m_maxColumnHeight = RenderFlowThread::maxLogicalHeight(); m_maxColumnHeight = RenderFlowThread::maxLogicalHeight();
if (!multicolStyle->logicalHeight().isAuto()) { if (!multicolStyle->logicalHeight().isAuto()) {
...@@ -277,7 +277,7 @@ void RenderMultiColumnSet::prepareForLayout() ...@@ -277,7 +277,7 @@ void RenderMultiColumnSet::prepareForLayout()
m_maxColumnHeight = heightAdjustedForSetOffset(m_maxColumnHeight); m_maxColumnHeight = heightAdjustedForSetOffset(m_maxColumnHeight);
m_computedColumnHeight = 0; // Restart balancing. m_computedColumnHeight = 0; // Restart balancing.
} else { } else {
setAndConstrainColumnHeight(heightAdjustedForSetOffset(multicolBlock->multiColumnFlowThread()->columnHeightAvailable())); setAndConstrainColumnHeight(heightAdjustedForSetOffset(multiColumnFlowThread()->columnHeightAvailable()));
} }
clearForcedBreaks(); clearForcedBreaks();
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#ifndef RenderMultiColumnSet_h #ifndef RenderMultiColumnSet_h
#define RenderMultiColumnSet_h #define RenderMultiColumnSet_h
#include "core/rendering/RenderMultiColumnFlowThread.h"
#include "core/rendering/RenderRegionSet.h" #include "core/rendering/RenderRegionSet.h"
#include "wtf/Vector.h" #include "wtf/Vector.h"
...@@ -56,7 +57,11 @@ public: ...@@ -56,7 +57,11 @@ public:
virtual bool isRenderMultiColumnSet() const OVERRIDE { return true; } virtual bool isRenderMultiColumnSet() const OVERRIDE { return true; }
RenderBlockFlow* multiColumnBlockFlow() const { return toRenderBlockFlow(parent()); } RenderBlockFlow* multiColumnBlockFlow() const { return toRenderBlockFlow(parent()); }
RenderMultiColumnFlowThread* multiColumnFlowThread() const { return multiColumnBlockFlow()->multiColumnFlowThread(); } RenderMultiColumnFlowThread* multiColumnFlowThread() const
{
ASSERT_WITH_SECURITY_IMPLICATION(!flowThread() || flowThread()->isRenderMultiColumnFlowThread());
return static_cast<RenderMultiColumnFlowThread*>(flowThread());
}
RenderMultiColumnSet* nextSiblingMultiColumnSet() const; RenderMultiColumnSet* nextSiblingMultiColumnSet() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment