Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NGMultiColumnLayoutAlgorithm_h | |
| 6 #define NGMultiColumnLayoutAlgorithm_h | |
| 7 | |
| 8 #include "core/CoreExport.h" | |
| 9 #include "core/layout/ng/ng_block_node.h" | |
| 10 #include "core/layout/ng/ng_break_token.h" | |
| 11 #include "core/layout/ng/ng_column_mapper.h" | |
| 12 #include "core/layout/ng/ng_fragment_builder.h" | |
| 13 #include "core/layout/ng/ng_layout_algorithm.h" | |
| 14 #include "core/layout/ng/ng_units.h" | |
| 15 #include "wtf/RefPtr.h" | |
| 16 | |
| 17 namespace blink { | |
| 18 | |
| 19 class ComputedStyle; | |
| 20 class NGConstraintSpace; | |
| 21 class NGConstraintSpaceBuilder; | |
| 22 class NGPhysicalFragment; | |
| 23 | |
| 24 // A class for general block layout (e.g. a <div> with no special style). | |
| 25 // Lays out the children in sequence. | |
| 26 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.
| |
| 27 public: | |
| 28 // Default constructor. | |
| 29 // @param layout_object The layout object associated with this block. | |
| 30 // @param style Style reference of the block that is being laid out. | |
| 31 // @param first_child Our first child; the algorithm will use its NextSibling | |
| 32 // method to access all the children. | |
| 33 // @param space The constraint space which the algorithm should generate a | |
| 34 // fragment within. | |
| 35 NGMultiColumnLayoutAlgorithm(NGBlockNode* node, | |
| 36 NGConstraintSpace* space, | |
| 37 NGBreakToken* break_token = nullptr); | |
| 38 | |
| 39 RefPtr<NGPhysicalFragment> Layout() override; | |
| 40 Optional<MinAndMaxContentSizes> ComputeMinAndMaxContentSizes() const override; | |
| 41 | |
| 42 private: | |
| 43 const NGConstraintSpace& ConstraintSpace() const { | |
| 44 return *constraint_space_; | |
| 45 } | |
| 46 | |
| 47 const ComputedStyle& Style() const { return node_->Style(); } | |
| 48 | |
| 49 Persistent<NGBlockNode> node_; | |
| 50 Persistent<NGConstraintSpace> constraint_space_; | |
| 51 | |
| 52 // The break token from which we are currently resuming layout. | |
| 53 Persistent<NGBreakToken> break_token_; | |
| 54 | |
| 55 std::unique_ptr<NGFragmentBuilder> builder_; | |
| 56 Persistent<NGConstraintSpaceBuilder> space_builder_; | |
| 57 | |
| 58 NGBoxStrut border_and_padding_; | |
| 59 LayoutUnit content_size_; | |
| 60 LayoutUnit max_inline_size_; | |
| 61 }; | |
| 62 | |
| 63 } // namespace blink | |
| 64 | |
| 65 #endif // NGBlockLayoutAlgorithm_h | |
| OLD | NEW |