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 #include "core/layout/ng/ng_physical_fragment_base.h" | 5 #include "core/layout/ng/ng_physical_fragment_base.h" |
6 | 6 |
7 #include "core/layout/ng/ng_physical_fragment.h" | 7 #include "core/layout/ng/ng_physical_fragment.h" |
8 #include "core/layout/ng/ng_physical_text_fragment.h" | 8 #include "core/layout/ng/ng_physical_text_fragment.h" |
| 9 #include "core/style/ComputedStyle.h" |
9 | 10 |
10 namespace blink { | 11 namespace blink { |
11 | 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 |
12 DEFINE_TRACE(NGPhysicalFragmentBase) { | 29 DEFINE_TRACE(NGPhysicalFragmentBase) { |
13 if (Type() == kFragmentText) | 30 if (Type() == kFragmentText) |
14 static_cast<NGPhysicalTextFragment*>(this)->traceAfterDispatch(visitor); | 31 static_cast<NGPhysicalTextFragment*>(this)->traceAfterDispatch(visitor); |
15 else | 32 else |
16 static_cast<NGPhysicalFragment*>(this)->traceAfterDispatch(visitor); | 33 static_cast<NGPhysicalFragment*>(this)->traceAfterDispatch(visitor); |
17 } | 34 } |
18 | 35 |
19 void NGPhysicalFragmentBase::finalizeGarbageCollectedObject() { | 36 void NGPhysicalFragmentBase::finalizeGarbageCollectedObject() { |
20 if (Type() == kFragmentText) | 37 if (Type() == kFragmentText) |
21 static_cast<NGPhysicalTextFragment*>(this)->~NGPhysicalTextFragment(); | 38 static_cast<NGPhysicalTextFragment*>(this)->~NGPhysicalTextFragment(); |
22 else | 39 else |
23 static_cast<NGPhysicalFragment*>(this)->~NGPhysicalFragment(); | 40 static_cast<NGPhysicalFragment*>(this)->~NGPhysicalFragment(); |
24 } | 41 } |
25 | 42 |
| 43 DEFINE_TRACE_AFTER_DISPATCH(NGPhysicalFragmentBase) { |
| 44 visitor->trace(out_of_flow_descendants_); |
| 45 visitor->trace(break_token_); |
| 46 } |
| 47 |
26 } // namespace blink | 48 } // namespace blink |
OLD | NEW |