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

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

Issue 712553003: [New Multicolumn] Actual support for layout of column-span:all. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Let containingBlock() on a spanner return the multicol container. Created 6 years, 1 month 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
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index ed9585fe0f2c3cdeaff5780f28c637af60d38eae..d3f43f044dc394c6e4c5ef4ce771aa30d110dee7 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -57,7 +57,6 @@
#include "core/rendering/RenderCounter.h"
#include "core/rendering/RenderDeprecatedFlexibleBox.h"
#include "core/rendering/RenderFlexibleBox.h"
-#include "core/rendering/RenderFlowThread.h"
#include "core/rendering/RenderGeometryMap.h"
#include "core/rendering/RenderGrid.h"
#include "core/rendering/RenderImage.h"
@@ -65,6 +64,7 @@
#include "core/rendering/RenderInline.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderListItem.h"
+#include "core/rendering/RenderMultiColumnFlowThread.h"
#include "core/rendering/RenderObjectInlines.h"
#include "core/rendering/RenderPart.h"
#include "core/rendering/RenderScrollbarPart.h"
@@ -325,6 +325,13 @@ bool RenderObject::requiresAnonymousTableWrappers(const RenderObject* newChild)
return false;
}
+bool RenderObject::isValidColumnSpanAll() const
+{
+ ASSERT(style()->columnSpan() == ColumnSpanAll);
+ RenderFlowThread* flowThread = flowThreadContainingBlock();
+ return flowThread && flowThread->isColumnSpanner(this);
+}
+
void RenderObject::addChild(RenderObject* newChild, RenderObject* beforeChild)
{
ASSERT(isAllowedToModifyRenderTreeStructure(document()));
@@ -634,7 +641,7 @@ RenderFlowThread* RenderObject::locateFlowThreadContainingBlock() const
while (curr) {
if (curr->isRenderFlowThread())
return toRenderFlowThread(curr);
- curr = curr->containingBlock();
+ curr = curr->container();
Julien - ping for review 2014/11/19 17:54:34 Is this really correct? The main difference betwee
mstensho (USE GERRIT) 2014/11/21 15:39:24 Now that containingBlock() may end up calling this
}
return 0;
}
@@ -834,6 +841,8 @@ RenderBlock* RenderObject::containingBlock() const
while (o && o->isAnonymousBlock())
o = o->containingBlock();
+ } else if (isColumnSpanAll()) {
+ o = toRenderMultiColumnFlowThread(flowThreadContainingBlock())->multiColumnBlockFlow();
Julien - ping for review 2014/11/19 17:54:34 If you update containingBlock(), you should also u
mstensho (USE GERRIT) 2014/11/21 15:39:24 If I do that, I also have to deal with changed beh
mstensho (USE GERRIT) 2014/12/10 13:48:19 To follow up here: I tried this (make container()
} else {
while (o && ((o->isInline() && !o->isReplaced()) || !o->isRenderBlock()))
o = o->parent();
@@ -2418,6 +2427,9 @@ void RenderObject::removeFromRenderFlowThreadRecursive(RenderFlowThread* renderF
for (RenderObject* child = children->firstChild(); child; child = child->nextSibling())
child->removeFromRenderFlowThreadRecursive(renderFlowThread);
}
+
+ if (renderFlowThread && renderFlowThread != this)
+ renderFlowThread->flowThreadDescendantWillBeRemoved(this);
setFlowThreadState(NotInsideFlowThread);
}

Powered by Google App Engine
This is Rietveld 408576698