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.h" | 5 #include "core/layout/ng/ng_physical_fragment.h" |
6 | 6 |
7 #include "core/layout/ng/ng_break_token.h" | 7 #include "core/layout/ng/ng_break_token.h" |
8 #include "core/layout/ng/ng_physical_box_fragment.h" | 8 #include "core/layout/ng/ng_physical_box_fragment.h" |
9 #include "core/layout/ng/ng_physical_text_fragment.h" | 9 #include "core/layout/ng/ng_physical_text_fragment.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 NGPhysicalFragment::NGPhysicalFragment(LayoutObject* layout_object, | 13 NGPhysicalFragment::NGPhysicalFragment(LayoutObject* layout_object, |
14 NGPhysicalSize size, | 14 NGPhysicalSize size, |
15 NGPhysicalSize overflow, | 15 NGPhysicalSize overflow, |
16 NGFragmentType type, | 16 NGFragmentType type, |
17 NGBreakToken* break_token) | 17 RefPtr<NGBreakToken> break_token) |
18 : layout_object_(layout_object), | 18 : layout_object_(layout_object), |
19 size_(size), | 19 size_(size), |
20 overflow_(overflow), | 20 overflow_(overflow), |
21 break_token_(break_token), | 21 break_token_(std::move(break_token)), |
22 type_(type), | 22 type_(type), |
23 is_placed_(false) {} | 23 is_placed_(false) {} |
24 | 24 |
25 void NGPhysicalFragment::destroy() const { | 25 void NGPhysicalFragment::destroy() const { |
26 if (Type() == kFragmentText) | 26 if (Type() == kFragmentText) |
27 delete static_cast<const NGPhysicalTextFragment*>(this); | 27 delete static_cast<const NGPhysicalTextFragment*>(this); |
28 else | 28 else |
29 delete static_cast<const NGPhysicalBoxFragment*>(this); | 29 delete static_cast<const NGPhysicalBoxFragment*>(this); |
30 } | 30 } |
31 | 31 |
32 const ComputedStyle& NGPhysicalFragment::Style() const { | 32 const ComputedStyle& NGPhysicalFragment::Style() const { |
33 DCHECK(layout_object_); | 33 DCHECK(layout_object_); |
34 return layout_object_->styleRef(); | 34 return layout_object_->styleRef(); |
35 } | 35 } |
36 | 36 |
37 } // namespace blink | 37 } // namespace blink |
OLD | NEW |