| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "core/layout/ng/ng_physical_fragment_base.h" | |
| 6 | |
| 7 #include "core/layout/ng/ng_break_token.h" | |
| 8 #include "core/layout/ng/ng_physical_fragment.h" | |
| 9 #include "core/layout/ng/ng_physical_text_fragment.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 NGPhysicalFragmentBase::NGPhysicalFragmentBase( | |
| 14 NGPhysicalSize size, | |
| 15 NGPhysicalSize overflow, | |
| 16 NGFragmentType type, | |
| 17 HeapLinkedHashSet<WeakMember<NGBlockNode>>& out_of_flow_descendants, | |
| 18 Vector<NGStaticPosition> out_of_flow_positions, | |
| 19 NGBreakToken* break_token) | |
| 20 : size_(size), | |
| 21 overflow_(overflow), | |
| 22 break_token_(break_token), | |
| 23 type_(type), | |
| 24 has_been_placed_(false) { | |
| 25 out_of_flow_descendants_.swap(out_of_flow_descendants); | |
| 26 out_of_flow_positions_.swap(out_of_flow_positions); | |
| 27 } | |
| 28 | |
| 29 DEFINE_TRACE(NGPhysicalFragmentBase) { | |
| 30 if (Type() == kFragmentText) | |
| 31 static_cast<NGPhysicalTextFragment*>(this)->traceAfterDispatch(visitor); | |
| 32 else | |
| 33 static_cast<NGPhysicalFragment*>(this)->traceAfterDispatch(visitor); | |
| 34 } | |
| 35 | |
| 36 void NGPhysicalFragmentBase::finalizeGarbageCollectedObject() { | |
| 37 if (Type() == kFragmentText) | |
| 38 static_cast<NGPhysicalTextFragment*>(this)->~NGPhysicalTextFragment(); | |
| 39 else | |
| 40 static_cast<NGPhysicalFragment*>(this)->~NGPhysicalFragment(); | |
| 41 } | |
| 42 | |
| 43 DEFINE_TRACE_AFTER_DISPATCH(NGPhysicalFragmentBase) { | |
| 44 visitor->trace(out_of_flow_descendants_); | |
| 45 visitor->trace(break_token_); | |
| 46 } | |
| 47 | |
| 48 } // namespace blink | |
| OLD | NEW |