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

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

Issue 2816933003: Use Layout Opportunity Iterator to position new FC blocks. (Closed)
Patch Set: fix block-formatting-contexts-{005|007} Created 3 years, 8 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 NGLayoutOpportunityIterator_h 5 #ifndef NGLayoutOpportunityIterator_h
6 #define NGLayoutOpportunityIterator_h 6 #define NGLayoutOpportunityIterator_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/layout/ng/ng_exclusion.h" 9 #include "core/layout/ng/ng_exclusion.h"
10 #include "core/layout/ng/ng_fragment.h"
10 #include "core/layout/ng/ng_layout_opportunity_tree_node.h" 11 #include "core/layout/ng/ng_layout_opportunity_tree_node.h"
11 #include "platform/wtf/Vector.h" 12 #include "platform/wtf/Vector.h"
12 #include "platform/wtf/text/StringBuilder.h" 13 #include "platform/wtf/text/StringBuilder.h"
13 14
14 namespace blink { 15 namespace blink {
15 16
16 typedef NGLogicalRect NGLayoutOpportunity; 17 typedef NGLogicalRect NGLayoutOpportunity;
17 typedef Vector<NGLayoutOpportunity> NGLayoutOpportunities; 18 typedef Vector<NGLayoutOpportunity> NGLayoutOpportunities;
18 19
20 NGLayoutOpportunity FindLayoutOpportunityForFragment(
21 const NGExclusions* exclusions,
22 const NGLogicalSize& size,
23 const NGLogicalOffset& origin_point,
24 const NGBoxStrut& margins,
25 const NGFragment& fragment);
26
19 class CORE_EXPORT NGLayoutOpportunityIterator final { 27 class CORE_EXPORT NGLayoutOpportunityIterator final {
20 public: 28 public:
21 // Default constructor. 29 // Default constructor.
22 // 30 //
23 // @param exclusions List of exclusions that should be avoided by this 31 // @param exclusions List of exclusions that should be avoided by this
24 // iterator while generating layout opportunities. 32 // iterator while generating layout opportunities.
25 // @param available_size Available size that represents a rectangle where this 33 // @param available_size Available size that represents a rectangle where this
26 // iterator searches layout opportunities. 34 // iterator searches layout opportunities.
27 // @param offset Offset used as a default starting point for layout 35 // @param offset Offset used as a default starting point for layout
28 // opportunities. 36 // opportunities.
(...skipping 28 matching lines...) Expand all
57 65
58 NGLayoutOpportunities opportunities_; 66 NGLayoutOpportunities opportunities_;
59 NGLayoutOpportunities::const_iterator opportunity_iter_; 67 NGLayoutOpportunities::const_iterator opportunity_iter_;
60 std::unique_ptr<NGLayoutOpportunityTreeNode> opportunity_tree_root_; 68 std::unique_ptr<NGLayoutOpportunityTreeNode> opportunity_tree_root_;
61 NGLogicalOffset offset_; 69 NGLogicalOffset offset_;
62 }; 70 };
63 71
64 } // namespace blink 72 } // namespace blink
65 73
66 #endif // NGLayoutOpportunityIterator_h 74 #endif // NGLayoutOpportunityIterator_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698