| 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 NGPhysicalBoxFragment_h | 5 #ifndef NGPhysicalBoxFragment_h |
| 6 #define NGPhysicalBoxFragment_h | 6 #define NGPhysicalBoxFragment_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/ng/ng_physical_fragment.h" | 9 #include "core/layout/ng/ng_physical_fragment.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 #include "wtf/Optional.h" | 12 #include "wtf/Optional.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class NGBlockNode; | |
| 17 struct NGFloatingObject; | 16 struct NGFloatingObject; |
| 18 | 17 |
| 19 class CORE_EXPORT NGPhysicalBoxFragment final : public NGPhysicalFragment { | 18 class CORE_EXPORT NGPhysicalBoxFragment final : public NGPhysicalFragment { |
| 20 public: | 19 public: |
| 21 // This modifies the passed-in children vector. | 20 // This modifies the passed-in children vector. |
| 22 NGPhysicalBoxFragment( | 21 NGPhysicalBoxFragment( |
| 23 LayoutObject* layout_object, | 22 LayoutObject* layout_object, |
| 24 NGPhysicalSize size, | 23 NGPhysicalSize size, |
| 25 NGPhysicalSize overflow, | 24 NGPhysicalSize overflow, |
| 26 Vector<RefPtr<NGPhysicalFragment>>& children, | 25 Vector<RefPtr<NGPhysicalFragment>>& children, |
| 27 PersistentHeapLinkedHashSet<WeakMember<NGBlockNode>>& | |
| 28 out_of_flow_descendants, | |
| 29 Vector<NGStaticPosition>& out_of_flow_positions, | |
| 30 Vector<Persistent<NGFloatingObject>>& unpositioned_floats, | |
| 31 Vector<Persistent<NGFloatingObject>>& positioned_floats, | 26 Vector<Persistent<NGFloatingObject>>& positioned_floats, |
| 32 const WTF::Optional<NGLogicalOffset>& bfc_offset, | 27 const WTF::Optional<NGLogicalOffset>& bfc_offset, |
| 33 const NGMarginStrut& end_margin_strut, | 28 const NGMarginStrut& end_margin_strut, |
| 34 NGBreakToken* break_token = nullptr); | 29 NGBreakToken* break_token = nullptr); |
| 35 | 30 |
| 36 const Vector<RefPtr<NGPhysicalFragment>>& Children() const { | 31 const Vector<RefPtr<NGPhysicalFragment>>& Children() const { |
| 37 return children_; | 32 return children_; |
| 38 } | 33 } |
| 39 | 34 |
| 35 // List of positioned float that need to be copied to the old layout tree. |
| 36 // TODO(layout-ng): remove this once we change painting code to handle floats |
| 37 // differently. |
| 38 const Vector<Persistent<NGFloatingObject>>& PositionedFloats() const { |
| 39 return positioned_floats_; |
| 40 } |
| 41 |
| 40 const WTF::Optional<NGLogicalOffset>& BfcOffset() const { | 42 const WTF::Optional<NGLogicalOffset>& BfcOffset() const { |
| 41 return bfc_offset_; | 43 return bfc_offset_; |
| 42 } | 44 } |
| 43 | 45 |
| 44 const NGMarginStrut& EndMarginStrut() const { return end_margin_strut_; } | 46 const NGMarginStrut& EndMarginStrut() const { return end_margin_strut_; } |
| 45 | 47 |
| 46 private: | 48 private: |
| 47 Vector<RefPtr<NGPhysicalFragment>> children_; | 49 Vector<RefPtr<NGPhysicalFragment>> children_; |
| 50 Vector<Persistent<NGFloatingObject>> positioned_floats_; |
| 48 const WTF::Optional<NGLogicalOffset> bfc_offset_; | 51 const WTF::Optional<NGLogicalOffset> bfc_offset_; |
| 49 const NGMarginStrut end_margin_strut_; | 52 const NGMarginStrut end_margin_strut_; |
| 50 }; | 53 }; |
| 51 | 54 |
| 52 DEFINE_TYPE_CASTS(NGPhysicalBoxFragment, | 55 DEFINE_TYPE_CASTS(NGPhysicalBoxFragment, |
| 53 NGPhysicalFragment, | 56 NGPhysicalFragment, |
| 54 fragment, | 57 fragment, |
| 55 fragment->Type() == NGPhysicalFragment::kFragmentBox, | 58 fragment->Type() == NGPhysicalFragment::kFragmentBox, |
| 56 fragment.Type() == NGPhysicalFragment::kFragmentBox); | 59 fragment.Type() == NGPhysicalFragment::kFragmentBox); |
| 57 | 60 |
| 58 } // namespace blink | 61 } // namespace blink |
| 59 | 62 |
| 60 #endif // NGPhysicalBoxFragment_h | 63 #endif // NGPhysicalBoxFragment_h |
| OLD | NEW |