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

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

Issue 2646853006: [LayoutNG] Pull out of flow candidate loop into out of flow layout part. (Closed)
Patch Set: Created 3 years, 11 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 NGFragmentBuilder_h 5 #ifndef NGFragmentBuilder_h
6 #define NGFragmentBuilder_h 6 #define NGFragmentBuilder_h
7 7
8 #include "core/layout/ng/ng_physical_fragment.h" 8 #include "core/layout/ng/ng_physical_fragment.h"
9 #include "core/layout/ng/ng_units.h" 9 #include "core/layout/ng/ng_units.h"
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // are stored inside builder. 45 // are stored inside builder.
46 // 46 //
47 // for (child : children) 47 // for (child : children)
48 // if (child->position == (Absolute or Fixed)) 48 // if (child->position == (Absolute or Fixed))
49 // builder->AddOutOfFlowChildCandidate(child); 49 // builder->AddOutOfFlowChildCandidate(child);
50 // else 50 // else
51 // fragment = child->Layout() 51 // fragment = child->Layout()
52 // builder->AddChild(fragment) 52 // builder->AddChild(fragment)
53 // end 53 // end
54 // 54 //
55 // Part 2: layout algorithm positions out-of-flow descendants. 55 // builder->SetInlineSize/SetBlockSize
56 // 56 //
57 // builder->SetInlineSize/SetBlockSize 57 // Part 2: Out-of-flow layout part positions out-of-flow descendants.
58 // builder->GetAndClearOutOfFlowDescendantCandidates(oof_candidates); 58 //
59 // NGOutOfFlowLayoutPart out_of_flow_layout(container_style, 59 // NGOutOfFlowLayoutPart(container_style, builder).Run();
60 // builder->Size()); 60 //
61 // while (oof_candidates.size() > 0) 61 // See layout part for builder interaction.
62 // {
63 // candidate = oof_candidates.shift();
64 // if (IsContainingBlockForAbsoluteChild(style, candidate_style)) {
65 // NGFragmentBase* fragment;
66 // NGLogicalOffset* fragment_offset;
67 // out_of_flow_layout.Layout(candidate, &fragment, &offset);
68 // builder->AddChild(fragment);
69 // builder->GetAndClearOutOfFlowDescendantCandidates(child_oof_candidates) ;
70 // oof_candidates.prepend(child_oof_candidates);
ikilpatrick 2017/01/20 23:48:30 So the code in ng_block_algorithm never did this,
atotic 2017/01/23 07:37:56 No. Good catch. This was code that was trying to s
ikilpatrick 2017/01/24 19:11:32 Is there any reason for the GetAndClear method now
atotic 2017/01/24 20:48:34 Miscommunication: I was referring to the last two
71 // } else {
72 // builder->AddOutOfFlowDescendant();
73 // }
74 // }
75 NGFragmentBuilder& AddOutOfFlowChildCandidate(NGBlockNode*, NGLogicalOffset); 62 NGFragmentBuilder& AddOutOfFlowChildCandidate(NGBlockNode*, NGLogicalOffset);
76 63
77 void GetAndClearOutOfFlowDescendantCandidates(WeakBoxList*, 64 void GetAndClearOutOfFlowDescendantCandidates(WeakBoxList*,
78 Vector<NGStaticPosition>*); 65 Vector<NGStaticPosition>*);
79 66
80 NGFragmentBuilder& AddOutOfFlowDescendant(NGBlockNode*, 67 NGFragmentBuilder& AddOutOfFlowDescendant(NGBlockNode*,
81 const NGStaticPosition&); 68 const NGStaticPosition&);
82 69
83 void SetBreakToken(NGBreakToken* token) { 70 void SetBreakToken(NGBreakToken* token) {
84 DCHECK(!break_token_); 71 DCHECK(!break_token_);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 124
138 WeakBoxList out_of_flow_descendants_; 125 WeakBoxList out_of_flow_descendants_;
139 Vector<NGStaticPosition> out_of_flow_positions_; 126 Vector<NGStaticPosition> out_of_flow_positions_;
140 127
141 Member<NGBreakToken> break_token_; 128 Member<NGBreakToken> break_token_;
142 }; 129 };
143 130
144 } // namespace blink 131 } // namespace blink
145 132
146 #endif // NGFragmentBuilder 133 #endif // NGFragmentBuilder
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698