OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NGFragmentBuilder_h | 5 #ifndef NGFragmentBuilder_h |
6 #define NGFragmentBuilder_h | 6 #define NGFragmentBuilder_h |
7 | 7 |
8 #include "core/layout/ng/ng_fragment.h" | 8 #include "core/layout/ng/ng_fragment.h" |
9 #include "core/layout/ng/ng_units.h" | 9 #include "core/layout/ng/ng_units.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class CORE_EXPORT NGFragmentBuilder final | 13 class CORE_EXPORT NGFragmentBuilder final |
14 : public GarbageCollected<NGFragmentBuilder> { | 14 : public GarbageCollectedFinalized<NGFragmentBuilder> { |
15 public: | 15 public: |
16 NGFragmentBuilder(NGFragmentBase::NGFragmentType); | 16 NGFragmentBuilder(NGPhysicalFragmentBase::NGFragmentType); |
17 | 17 |
18 NGFragmentBuilder& SetWritingMode(NGWritingMode); | 18 NGFragmentBuilder& SetWritingMode(NGWritingMode); |
19 NGFragmentBuilder& SetDirection(NGDirection); | 19 NGFragmentBuilder& SetDirection(NGDirection); |
20 | 20 |
21 NGFragmentBuilder& SetInlineSize(LayoutUnit); | 21 NGFragmentBuilder& SetInlineSize(LayoutUnit); |
22 NGFragmentBuilder& SetBlockSize(LayoutUnit); | 22 NGFragmentBuilder& SetBlockSize(LayoutUnit); |
23 | 23 |
24 NGFragmentBuilder& SetInlineOverflow(LayoutUnit); | 24 NGFragmentBuilder& SetInlineOverflow(LayoutUnit); |
25 NGFragmentBuilder& SetBlockOverflow(LayoutUnit); | 25 NGFragmentBuilder& SetBlockOverflow(LayoutUnit); |
26 | 26 |
27 NGFragmentBuilder& AddChild(const NGFragment*); | 27 NGFragmentBuilder& AddChild(NGFragment*, NGLogicalOffset); |
28 | 28 |
29 // Offsets are not supposed to be set during fragment construction, so we | 29 // Offsets are not supposed to be set during fragment construction, so we |
30 // do not provide a setter here. | 30 // do not provide a setter here. |
31 | 31 |
32 // Creates the fragment. Can only be called once. | 32 // Creates the fragment. Can only be called once. |
33 NGFragment* ToFragment(); | 33 NGPhysicalFragment* ToFragment(); |
34 | 34 |
35 DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(children_); } | 35 DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(children_); } |
36 | 36 |
37 private: | 37 private: |
38 NGFragmentBase::NGFragmentType type_; | 38 NGPhysicalFragmentBase::NGFragmentType type_; |
39 NGWritingMode writing_mode_; | 39 NGWritingMode writing_mode_; |
40 NGDirection direction_; | 40 NGDirection direction_; |
41 | 41 |
42 NGLogicalSize size_; | 42 NGLogicalSize size_; |
43 NGLogicalSize overflow_; | 43 NGLogicalSize overflow_; |
44 | 44 |
45 HeapVector<Member<const NGFragmentBase>> children_; | 45 HeapVector<Member<NGPhysicalFragmentBase>> children_; |
| 46 Vector<NGLogicalOffset> offsets_; |
46 }; | 47 }; |
47 | 48 |
48 } // namespace blink | 49 } // namespace blink |
49 | 50 |
50 #endif // NGFragmentBuilder | 51 #endif // NGFragmentBuilder |
OLD | NEW |