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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutFlowThread.h

Issue 2231383002: Need to roll back the multicol machinery state when re-laying out a block child. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
Index: third_party/WebKit/Source/core/layout/LayoutFlowThread.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlowThread.h b/third_party/WebKit/Source/core/layout/LayoutFlowThread.h
index e0bf6709615f970bf692e256b4f9f1ab73a87b82..19a52b062223f24fe54f02fd61027ac892e36de7 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlowThread.h
+++ b/third_party/WebKit/Source/core/layout/LayoutFlowThread.h
@@ -41,6 +41,21 @@ class LayoutMultiColumnSet;
typedef ListHashSet<LayoutMultiColumnSet*> LayoutMultiColumnSetList;
+// Layout state for multicol. To be stored when laying out a block child, so that we can roll back
+// to the initial state if we need to re-lay out said block child.
+class MultiColumnLayoutState {
+ friend class LayoutMultiColumnFlowThread;
+
+public:
+ MultiColumnLayoutState() : m_columnSet(nullptr) { }
+
+private:
+ explicit MultiColumnLayoutState(LayoutMultiColumnSet* columnSet) : m_columnSet(columnSet) { }
+ LayoutMultiColumnSet* columnSet() const { return m_columnSet; }
+
+ LayoutMultiColumnSet* m_columnSet;
+};
+
// LayoutFlowThread is used to collect all the layout objects that participate in a flow thread. It
// will also help in doing the layout. However, it will not layout directly to screen. Instead,
// LayoutMultiColumnSet objects will redirect their paint and nodeAtPoint methods to this
@@ -88,6 +103,9 @@ public:
virtual void contentWasLaidOut(LayoutUnit logicalBottomInFlowThreadAfterPagination) = 0;
virtual bool canSkipLayout(const LayoutBox&) const = 0;
+ virtual MultiColumnLayoutState multiColumnLayoutState() const = 0;
+ virtual void restoreMultiColumnLayoutState(const MultiColumnLayoutState&) = 0;
+
// Find and return the next logical top after |flowThreadOffset| that can fit unbreakable
// content as tall as |contentLogicalHeight|. |flowThreadOffset| is expected to be at the exact
// top of a column that's known to not have enough space for |contentLogicalHeight|. This method

Powered by Google App Engine
This is Rietveld 408576698