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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc

Issue 2838673005: Do not use inline context for the first float child. (Closed)
Patch Set: Created 3 years, 8 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_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.
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/layout/ng/ng_block_node_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698