Index: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc |
index 96402b5f64b35d33df7bb8377a1409ecae153d5f..8156b40a2c42cb81f29fbafb559c9a6dc2e44f6c 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc |
@@ -229,11 +229,15 @@ static bool ShouldHandleByInlineContext(LayoutObject* child) { |
// Prefer inline formatting context because 1) floats/OOF at the beginning |
// and in the middle of inline should be handled in the same code, and 2) |
// it matches to the LayoutObject tree. |
- for (; child; child = child->NextSibling()) { |
- if (child->IsInline()) |
+ for (LayoutObject* child_runner = child; child_runner; |
+ child_runner = child_runner->NextSibling()) { |
+ if (child_runner->IsInline()) |
return true; |
- if (child->IsFloating() || child->IsOutOfFlowPositioned()) |
+ if (child_runner->IsFloating() || child_runner->IsOutOfFlowPositioned()) { |
+ if (child_runner == child) |
+ return false; |
continue; |
+ } |
return false; |
} |
// All children are either float or OOF. |