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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.h

Issue 2646853006: [LayoutNG] Pull out of flow candidate loop into out of flow layout part. (Closed)
Patch Set: rebase 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 #ifndef NGOutOfFlowLayoutPart_h 5 #ifndef NGOutOfFlowLayoutPart_h
6 #define NGOutOfFlowLayoutPart_h 6 #define NGOutOfFlowLayoutPart_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 9
10 #include "core/layout/ng/ng_absolute_utils.h" 10 #include "core/layout/ng/ng_absolute_utils.h"
11 #include "core/layout/ng/ng_constraint_space.h" 11 #include "core/layout/ng/ng_constraint_space.h"
12 #include "core/layout/ng/ng_layout_algorithm.h" 12 #include "core/layout/ng/ng_layout_algorithm.h"
13 #include "core/layout/ng/ng_units.h" 13 #include "core/layout/ng/ng_units.h"
14 #include "platform/heap/Handle.h" 14 #include "platform/heap/Handle.h"
15 #include "wtf/Optional.h" 15 #include "wtf/Optional.h"
16 16
17 namespace blink { 17 namespace blink {
18 18
19 class ComputedStyle; 19 class ComputedStyle;
20 class NGBlockNode; 20 class NGBlockNode;
21 class NGFragment; 21 class NGFragment;
22 class NGFragmentBuilder;
22 class NGConstraintSpace; 23 class NGConstraintSpace;
23 24
24 // Helper class for positioning of out-of-flow blocks. 25 // Helper class for positioning of out-of-flow blocks.
25 // It should be used together with NGFragmentBuilder. 26 // It should be used together with NGFragmentBuilder.
26 // See NGFragmentBuilder::AddOutOfFlowChildCandidate documentation 27 // See NGFragmentBuilder::AddOutOfFlowChildCandidate documentation
27 // for example of using these classes together. 28 // for example of using these classes together.
28 class CORE_EXPORT NGOutOfFlowLayoutPart 29 class CORE_EXPORT NGOutOfFlowLayoutPart {
29 : public GarbageCollectedFinalized<NGOutOfFlowLayoutPart> { 30 STACK_ALLOCATED();
31
30 public: 32 public:
31 NGOutOfFlowLayoutPart(PassRefPtr<const ComputedStyle>, NGLogicalSize); 33 NGOutOfFlowLayoutPart(const ComputedStyle& container_style,
32 34 NGFragmentBuilder* container_builder);
33 void Layout(NGBlockNode&, NGStaticPosition, NGFragment**, NGLogicalOffset*); 35 void Run();
34
35 DECLARE_TRACE();
36 36
37 private: 37 private:
38 NGFragment* LayoutDescendant(NGBlockNode& descendant,
39 NGStaticPosition static_position,
40 NGLogicalOffset* offset);
41
38 NGFragment* GenerateFragment(NGBlockNode& node, 42 NGFragment* GenerateFragment(NGBlockNode& node,
39 const Optional<LayoutUnit>& block_estimate, 43 const Optional<LayoutUnit>& block_estimate,
40 const NGAbsolutePhysicalPosition node_position); 44 const NGAbsolutePhysicalPosition node_position);
41 45
42 NGLogicalOffset parent_border_offset_; 46 const ComputedStyle& container_style_;
43 NGPhysicalOffset parent_border_physical_offset_; 47 Member<NGFragmentBuilder> container_builder_;
44 Member<NGConstraintSpace> parent_space_; 48
49 NGLogicalOffset container_border_offset_;
50 NGPhysicalOffset container_border_physical_offset_;
51 Member<NGConstraintSpace> container_space_;
45 }; 52 };
46 53
47 } // namespace blink 54 } // namespace blink
48 55
49 #endif 56 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698