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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_tree_node.h

Issue 2438313003: [LayoutNG] Remove derived constraint spaces from opportunity iterator. (Closed)
Patch Set: address comments? Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_tree_node.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_tree_node.h b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_tree_node.h
index e3947244818cd5d27deb316034b61d55fa5e3552..fc8587e4bd7c1bb746c6a80a0817254bb59503ad 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_tree_node.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_tree_node.h
@@ -18,20 +18,19 @@ struct NGLayoutOpportunityTreeNode
// Default constructor.
// Creates a Layout Opportunity tree node that is limited by it's own edge
// from above.
- // @param space Constraint space associated with this node.
- NGLayoutOpportunityTreeNode(const NGConstraintSpace* space) : space(space) {
- exclusion_edge.start = space->Offset().inline_offset;
- exclusion_edge.end = exclusion_edge.start + space->Size().inline_size;
+ // @param opportunity The layout opportunity for this node.
+ NGLayoutOpportunityTreeNode(const NGLogicalRect opportunity)
+ : opportunity(opportunity) {
+ exclusion_edge.start = opportunity.offset.inline_offset;
+ exclusion_edge.end = exclusion_edge.start + opportunity.size.inline_size;
}
// Constructor that creates a node with explicitly set exclusion edge.
// @param space Constraint space associated with this node.
// @param exclusion_edge Edge that limits this node's space from above.
- NGLayoutOpportunityTreeNode(NGConstraintSpace* space, NGEdge exclusion_edge)
- : space(space), exclusion_edge(exclusion_edge) {}
-
- // Constraint space that is associated with this node.
- Member<const NGConstraintSpace> space;
+ NGLayoutOpportunityTreeNode(const NGLogicalRect opportunity,
+ NGEdge exclusion_edge)
+ : opportunity(opportunity), exclusion_edge(exclusion_edge) {}
// Children of the node.
Member<NGLayoutOpportunityTreeNode> left;
@@ -41,15 +40,17 @@ struct NGLayoutOpportunityTreeNode
// Exclusion that split apart this layout opportunity.
Member<const NGExclusion> exclusion;
+ // The top layout opportunity associated with this node.
+ NGLogicalRect opportunity;
+
// Edge that limits this layout opportunity from above.
NGEdge exclusion_edge;
// Whether this node is a leaf node.
- // The node is a leaf if it doen't have an exclusion that splits it apart.
+ // The node is a leaf if it doesn't have an exclusion that splits it apart.
bool IsLeafNode() const { return !exclusion; }
DEFINE_INLINE_TRACE() {
- visitor->trace(space);
visitor->trace(left);
visitor->trace(bottom);
visitor->trace(right);

Powered by Google App Engine
This is Rietveld 408576698