Index: third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc |
index b4ae58f43bc67c83e86fbb1f6772918f155dc0d8..0fa47fe1a670b598eea30e486fbd51bb6a7112b6 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc |
@@ -77,23 +77,22 @@ Optional<MinMaxContentSize> NGBlockLayoutAlgorithm::ComputeMinMaxContentSize() |
for (NGLayoutInputNode* node = Node()->FirstChild(); node; |
node = node->NextSibling()) { |
MinMaxContentSize child_sizes; |
- if (node->Type() == NGLayoutInputNode::kLegacyInline) { |
+ if (node->IsInline()) { |
// From |NGBlockLayoutAlgorithm| perspective, we can handle |NGInlineNode| |
// almost the same as |NGBlockNode|, because an |NGInlineNode| includes |
// all inline nodes following |node| and their descendants, and produces |
// an anonymous box that contains all line boxes. |
// |NextSibling| returns the next block sibling, or nullptr, skipping all |
// following inline siblings and descendants. |
- child_sizes = toNGInlineNode(node)->ComputeMinMaxContentSize(); |
+ child_sizes = node->ComputeMinMaxContentSize(); |
} else { |
Optional<MinMaxContentSize> child_minmax; |
- NGBlockNode* block_child = toNGBlockNode(node); |
- if (NeedMinMaxContentSizeForContentContribution(block_child->Style())) { |
- child_minmax = block_child->ComputeMinMaxContentSize(); |
+ if (NeedMinMaxContentSizeForContentContribution(node->Style())) { |
+ child_minmax = node->ComputeMinMaxContentSize(); |
} |
- child_sizes = ComputeMinAndMaxContentContribution(block_child->Style(), |
- child_minmax); |
+ child_sizes = |
+ ComputeMinAndMaxContentContribution(node->Style(), child_minmax); |
} |
sizes.min_content = std::max(sizes.min_content, child_sizes.min_content); |
@@ -196,13 +195,12 @@ RefPtr<NGLayoutResult> NGBlockLayoutAlgorithm::Layout() { |
curr_bfc_offset_.block_offset += content_size_; |
while (child) { |
- if (child->Type() == NGLayoutInputNode::kLegacyBlock) { |
- NGBlockNode* current_block_child = toNGBlockNode(child); |
- EPosition position = current_block_child->Style().position(); |
+ if (child->IsBlock()) { |
+ EPosition position = child->Style().position(); |
if (position == EPosition::kAbsolute || position == EPosition::kFixed) { |
NGLogicalOffset offset = {border_and_padding_.inline_start, |
content_size_ + curr_margin_strut_.Sum()}; |
- builder_.AddOutOfFlowChildCandidate(current_block_child, offset); |
+ builder_.AddOutOfFlowChildCandidate(toNGBlockNode(child), offset); |
NGBlockChildIterator::Entry entry = child_iterator.NextChild(); |
child = entry.node; |
child_break_token = entry.token; |