| 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 NGPhysicalFragment_h | 5 #ifndef NGPhysicalFragment_h |
| 6 #define NGPhysicalFragment_h | 6 #define NGPhysicalFragment_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/ng/ng_physical_fragment_base.h" | 9 #include "core/layout/ng/ng_physical_fragment_base.h" |
| 10 #include "core/layout/ng/ng_units.h" | 10 #include "core/layout/ng/ng_units.h" |
| 11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class NGBox; |
| 16 |
| 15 class CORE_EXPORT NGPhysicalFragment final : public NGPhysicalFragmentBase { | 17 class CORE_EXPORT NGPhysicalFragment final : public NGPhysicalFragmentBase { |
| 16 public: | 18 public: |
| 17 // This modifies the passed-in children vector. | 19 // This modifies the passed-in children vector. |
| 18 NGPhysicalFragment(NGPhysicalSize size, | 20 NGPhysicalFragment( |
| 19 NGPhysicalSize overflow, | 21 NGPhysicalSize size, |
| 20 HeapVector<Member<const NGPhysicalFragmentBase>>& children, | 22 NGPhysicalSize overflow, |
| 21 NGMarginStrut margin_strut); | 23 HeapVector<Member<const NGPhysicalFragmentBase>>& children, |
| 24 HeapLinkedHashSet<WeakMember<NGBox>>& out_of_flow_descendants, |
| 25 Vector<NGLogicalOffset> out_of_flow_offsets, |
| 26 NGMarginStrut margin_strut); |
| 22 | 27 |
| 23 const HeapVector<Member<const NGPhysicalFragmentBase>>& Children() const { | 28 const HeapVector<Member<const NGPhysicalFragmentBase>>& Children() const { |
| 24 return children_; | 29 return children_; |
| 25 } | 30 } |
| 26 | 31 |
| 32 const HeapLinkedHashSet<WeakMember<NGBox>>& OutOfFlowDescendants() const { |
| 33 return out_of_flow_descendants_; |
| 34 } |
| 35 |
| 36 const Vector<NGLogicalOffset>& OutOfFlowOffsets() const { |
| 37 return out_of_flow_offsets_; |
| 38 } |
| 39 |
| 27 NGMarginStrut MarginStrut() const { return margin_strut_; } | 40 NGMarginStrut MarginStrut() const { return margin_strut_; } |
| 28 | 41 |
| 29 DECLARE_TRACE_AFTER_DISPATCH(); | 42 DECLARE_TRACE_AFTER_DISPATCH(); |
| 30 | 43 |
| 31 private: | 44 private: |
| 32 HeapVector<Member<const NGPhysicalFragmentBase>> children_; | 45 HeapVector<Member<const NGPhysicalFragmentBase>> children_; |
| 33 | 46 HeapLinkedHashSet<WeakMember<NGBox>> out_of_flow_descendants_; |
| 47 Vector<NGLogicalOffset> out_of_flow_offsets_; |
| 34 NGMarginStrut margin_strut_; | 48 NGMarginStrut margin_strut_; |
| 35 }; | 49 }; |
| 36 | 50 |
| 37 WILL_NOT_BE_EAGERLY_TRACED_CLASS(NGPhysicalFragment); | 51 WILL_NOT_BE_EAGERLY_TRACED_CLASS(NGPhysicalFragment); |
| 38 | 52 |
| 39 DEFINE_TYPE_CASTS(NGPhysicalFragment, | 53 DEFINE_TYPE_CASTS(NGPhysicalFragment, |
| 40 NGPhysicalFragmentBase, | 54 NGPhysicalFragmentBase, |
| 41 fragment, | 55 fragment, |
| 42 fragment->Type() == NGPhysicalFragmentBase::FragmentBox, | 56 fragment->Type() == NGPhysicalFragmentBase::FragmentBox, |
| 43 fragment.Type() == NGPhysicalFragmentBase::FragmentBox); | 57 fragment.Type() == NGPhysicalFragmentBase::FragmentBox); |
| 44 | 58 |
| 45 } // namespace blink | 59 } // namespace blink |
| 46 | 60 |
| 47 #endif // NGPhysicalFragment_h | 61 #endif // NGPhysicalFragment_h |
| OLD | NEW |