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 NGFragment_h | 5 #ifndef NGFragment_h |
6 #define NGFragment_h | 6 #define NGFragment_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/ng/ng_fragment_base.h" |
9 #include "platform/LayoutUnit.h" | 10 #include "platform/LayoutUnit.h" |
10 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
11 #include "wtf/Vector.h" | 12 #include "wtf/Vector.h" |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 | 15 |
15 class CORE_EXPORT NGFragment final : public GarbageCollected<NGFragment> { | 16 class CORE_EXPORT NGFragment final : public NGFragmentBase { |
16 public: | 17 public: |
17 NGFragment(LayoutUnit inlineSize, | 18 NGFragment(LayoutUnit inlineSize, |
18 LayoutUnit blockSize, | 19 LayoutUnit blockSize, |
19 LayoutUnit inlineOverflow, | 20 LayoutUnit inlineOverflow, |
20 LayoutUnit blockOverflow); | 21 LayoutUnit blockOverflow) |
| 22 : NGFragmentBase(inlineSize, blockSize, inlineOverflow, blockOverflow) { |
| 23 m_isText = false; |
| 24 } |
21 | 25 |
22 // Returns the border-box size. | 26 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { |
23 LayoutUnit inlineSize() const { return m_inlineSize; } | 27 visitor->trace(m_children); |
24 LayoutUnit blockSize() const { return m_blockSize; } | 28 NGFragmentBase::traceAfterDispatch(visitor); |
25 | 29 } |
26 // Returns the total size, including the contents outside of the border-box. | |
27 LayoutUnit inlineOverflow() const { return m_inlineOverflow; } | |
28 LayoutUnit blockOverflow() const { return m_blockOverflow; } | |
29 | |
30 // Returns the offset relative to the parent fragement's content-box. | |
31 LayoutUnit inlineOffset() const { return m_inlineOffset; } | |
32 LayoutUnit blockOffset() const { return m_blockOffset; } | |
33 | |
34 // Should only be used by the parent fragement's layout. | |
35 void setOffset(LayoutUnit inlineOffset, LayoutUnit blockOffset); | |
36 | |
37 DECLARE_TRACE(); | |
38 | 30 |
39 private: | 31 private: |
40 LayoutUnit m_inlineSize; | 32 HeapVector<Member<const NGFragmentBase>> m_children; |
41 LayoutUnit m_blockSize; | 33 bool m_isText; |
42 | |
43 LayoutUnit m_inlineOverflow; | |
44 LayoutUnit m_blockOverflow; | |
45 | |
46 LayoutUnit m_inlineOffset; | |
47 LayoutUnit m_blockOffset; | |
48 | |
49 HeapVector<Member<const NGFragment>> m_children; | |
50 }; | 34 }; |
51 | 35 |
52 } // namespace blink | 36 } // namespace blink |
53 | 37 |
54 #endif // NGFragment_h | 38 #endif // NGFragment_h |
OLD | NEW |