blob: 49b04cd0ea746d617c0d4040726f8e4458d927f8 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/layout/ng/ng_layout_opportunity_tree_node.h"
namespace blink {
NGLayoutOpportunityTreeNode::NGLayoutOpportunityTreeNode(
const NGLogicalRect opportunity)
: opportunity(opportunity), exclusion(nullptr) {
exclusion_edge.start = opportunity.offset.inline_offset;
exclusion_edge.end = exclusion_edge.start + opportunity.size.inline_size;
}
NGLayoutOpportunityTreeNode::NGLayoutOpportunityTreeNode(
const NGLogicalRect opportunity,
NGEdge exclusion_edge)
: opportunity(opportunity),
exclusion_edge(exclusion_edge),
exclusion(nullptr) {}
String NGLayoutOpportunityTreeNode::ToString() const {
return String::format(
"Opportunity: '%s' Exclusion: '%s'",
opportunity.ToString().ascii().data(),
exclusion ? exclusion->ToString().ascii().data() : "null");
}
DEFINE_TRACE(NGLayoutOpportunityTreeNode) {
visitor->trace(left);
visitor->trace(bottom);
visitor->trace(right);
}
} // namespace blink