Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc

Issue 2702403003: [layoutng] Split NGLayoutResult out of NGPhysicalFragment (Closed)
Patch Set: rebased Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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( 13 NGPhysicalFragment::NGPhysicalFragment(LayoutObject* layout_object,
14 LayoutObject* layout_object, 14 NGPhysicalSize size,
15 NGPhysicalSize size, 15 NGPhysicalSize overflow,
16 NGPhysicalSize overflow, 16 NGFragmentType type,
17 NGFragmentType type, 17 NGBreakToken* break_token)
18 PersistentHeapLinkedHashSet<WeakMember<NGBlockNode>>&
19 out_of_flow_descendants,
20 Vector<NGStaticPosition> out_of_flow_positions,
21 Vector<Persistent<NGFloatingObject>>& unpositioned_floats,
22 Vector<Persistent<NGFloatingObject>>& positioned_floats,
23 NGBreakToken* break_token)
24 : layout_object_(layout_object), 18 : layout_object_(layout_object),
25 size_(size), 19 size_(size),
26 overflow_(overflow), 20 overflow_(overflow),
27 break_token_(break_token), 21 break_token_(break_token),
28 type_(type), 22 type_(type),
29 is_placed_(false) { 23 is_placed_(false) {}
30 out_of_flow_descendants_.swap(out_of_flow_descendants);
31 out_of_flow_positions_.swap(out_of_flow_positions);
32 unpositioned_floats_.swap(unpositioned_floats);
33 positioned_floats_.swap(positioned_floats);
34 }
35 24
36 void NGPhysicalFragment::destroy() const { 25 void NGPhysicalFragment::destroy() const {
37 if (Type() == kFragmentText) 26 if (Type() == kFragmentText)
38 delete static_cast<const NGPhysicalTextFragment*>(this); 27 delete static_cast<const NGPhysicalTextFragment*>(this);
39 else 28 else
40 delete static_cast<const NGPhysicalBoxFragment*>(this); 29 delete static_cast<const NGPhysicalBoxFragment*>(this);
41 } 30 }
42 31
43 } // namespace blink 32 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698