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 6e2c913b6db0183d521b75d459f548bb528ee63c..037768f7aec805c08696d732d1bcb84b20de2106 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 |
@@ -16,7 +16,7 @@ namespace blink { |
// layout opportunity after the parent spatial rectangle is split by the |
// exclusion rectangle. |
struct CORE_EXPORT NGLayoutOpportunityTreeNode |
- : public GarbageCollected<NGLayoutOpportunityTreeNode> { |
+ : public GarbageCollectedFinalized<NGLayoutOpportunityTreeNode> { |
public: |
// Default constructor. |
// Creates a Layout Opportunity tree node that is limited by it's own edge |
@@ -41,15 +41,31 @@ struct CORE_EXPORT NGLayoutOpportunityTreeNode |
// Edge that limits this layout opportunity from above. |
NGEdge exclusion_edge; |
- // Exclusion that splits apart this layout opportunity. |
- const NGExclusion* exclusion; // Not owned. |
+ // Exclusions that splits apart this layout opportunity. |
+ Vector<const NGExclusion*> exclusions; // Not owned. |
+ |
+ // Exclusion that represent all combined exclusions that |
+ // split this node. |
+ std::unique_ptr<NGExclusion> combined_exclusion; |
// Whether this node is a leaf node. |
- // The node is a leaf if it doesn't have an exclusion that splits it apart. |
- bool IsLeafNode() const { return !exclusion; } |
+ // The node is a leaf if it doesn't have exclusions that split it apart. |
+ bool IsLeafNode() const { return exclusions.isEmpty(); } |
+ |
+ String ToString() const; |
DECLARE_TRACE(); |
}; |
+inline std::ostream& operator<<(std::ostream& stream, |
+ const NGLayoutOpportunityTreeNode& value) { |
+ return stream << value.ToString(); |
+} |
+ |
+inline std::ostream& operator<<(std::ostream& out, |
+ const NGLayoutOpportunityTreeNode* value) { |
+ return out << (value ? value->ToString() : "(null)"); |
+} |
+ |
} // namespace blink |
#endif // NGLayoutOpportunityTreeNode_h |