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