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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_multi_column_layout_algorithm.h

Issue 2693193002: [LayoutNG] A different approach to multi-col. (Closed)
Patch Set: Created 3 years, 10 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/ng/ng_multi_column_layout_algorithm.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_multi_column_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_multi_column_layout_algorithm.h
new file mode 100644
index 0000000000000000000000000000000000000000..cd2811cb52669342bbcf6740326fd993b3e63b35
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_multi_column_layout_algorithm.h
@@ -0,0 +1,65 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NGMultiColumnLayoutAlgorithm_h
+#define NGMultiColumnLayoutAlgorithm_h
+
+#include "core/CoreExport.h"
+#include "core/layout/ng/ng_block_node.h"
+#include "core/layout/ng/ng_break_token.h"
+#include "core/layout/ng/ng_column_mapper.h"
+#include "core/layout/ng/ng_fragment_builder.h"
+#include "core/layout/ng/ng_layout_algorithm.h"
+#include "core/layout/ng/ng_units.h"
+#include "wtf/RefPtr.h"
+
+namespace blink {
+
+class ComputedStyle;
+class NGConstraintSpace;
+class NGConstraintSpaceBuilder;
+class NGPhysicalFragment;
+
+// A class for general block layout (e.g. a <div> with no special style).
+// Lays out the children in sequence.
+class CORE_EXPORT NGMultiColumnLayoutAlgorithm : public NGLayoutAlgorithm {
mstensho (USE GERRIT) 2017/02/15 21:12:23 I think "NGColumnLayoutAlgorithm" could work too.
ikilpatrick 2017/02/16 16:48:32 sgtm.
+ public:
+ // Default constructor.
+ // @param layout_object The layout object associated with this block.
+ // @param style Style reference of the block that is being laid out.
+ // @param first_child Our first child; the algorithm will use its NextSibling
+ // method to access all the children.
+ // @param space The constraint space which the algorithm should generate a
+ // fragment within.
+ NGMultiColumnLayoutAlgorithm(NGBlockNode* node,
+ NGConstraintSpace* space,
+ NGBreakToken* break_token = nullptr);
+
+ RefPtr<NGPhysicalFragment> Layout() override;
+ Optional<MinAndMaxContentSizes> ComputeMinAndMaxContentSizes() const override;
+
+ private:
+ const NGConstraintSpace& ConstraintSpace() const {
+ return *constraint_space_;
+ }
+
+ const ComputedStyle& Style() const { return node_->Style(); }
+
+ Persistent<NGBlockNode> node_;
+ Persistent<NGConstraintSpace> constraint_space_;
+
+ // The break token from which we are currently resuming layout.
+ Persistent<NGBreakToken> break_token_;
+
+ std::unique_ptr<NGFragmentBuilder> builder_;
+ Persistent<NGConstraintSpaceBuilder> space_builder_;
+
+ NGBoxStrut border_and_padding_;
+ LayoutUnit content_size_;
+ LayoutUnit max_inline_size_;
+};
+
+} // namespace blink
+
+#endif // NGBlockLayoutAlgorithm_h

Powered by Google App Engine
This is Rietveld 408576698