OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 NGFragmentBuilder_h |
| 6 #define NGFragmentBuilder_h |
| 7 |
| 8 #include "core/layout/ng/ng_fragment.h" |
| 9 #include "core/layout/ng/ng_units.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 class CORE_EXPORT NGFragmentBuilder final { |
| 14 public: |
| 15 NGFragmentBuilder(NGFragmentBase::NGFragmentType); |
| 16 |
| 17 NGFragmentBuilder& SetWritingMode(NGWritingMode); |
| 18 NGFragmentBuilder& SetDirection(NGDirection); |
| 19 |
| 20 NGFragmentBuilder& SetInlineSize(LayoutUnit); |
| 21 NGFragmentBuilder& SetBlockSize(LayoutUnit); |
| 22 |
| 23 NGFragmentBuilder& SetInlineOverflow(LayoutUnit); |
| 24 NGFragmentBuilder& SetBlockOverflow(LayoutUnit); |
| 25 |
| 26 NGFragmentBuilder& AddChild(const NGFragment*); |
| 27 |
| 28 // Offsets are not supposed to be set during fragment construction, so we |
| 29 // do not provide a setter here. |
| 30 |
| 31 // Creates the fragment. Can only be called once. |
| 32 NGFragment* ToFragment(); |
| 33 |
| 34 private: |
| 35 NGFragmentBase::NGFragmentType type_; |
| 36 NGWritingMode writing_mode_; |
| 37 NGDirection direction_; |
| 38 |
| 39 NGLogicalSize size_; |
| 40 NGLogicalSize overflow_; |
| 41 |
| 42 PersistentHeapVector<Member<const NGFragmentBase>> children_; |
| 43 }; |
| 44 |
| 45 } // namespace blink |
| 46 |
| 47 #endif // NGFragmentBuilder |
OLD | NEW |