Chromium Code Reviews| 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 |