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

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

Issue 2840883002: Check if fragment's block size fits into a layout opportunity. (Closed)
Patch Set: git rebase-update 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc
index dce977f66cf0d72810937b5bab44cfa6a21c7473..5a7c8949542f92b7137233b6a8a93bf015b429b1 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc
@@ -271,10 +271,10 @@ NGLayoutOpportunity FindLayoutOpportunityForFragment(
NGLayoutOpportunity opportunity_candidate = opportunity_iter.Next();
while (!opportunity_candidate.IsEmpty()) {
opportunity = opportunity_candidate;
- // Checking opportunity's block size is not necessary as a float cannot be
- // positioned on top of another float inside of the same constraint space.
auto fragment_inline_size = fragment.InlineSize() + margins.InlineSum();
- if (opportunity.size.inline_size >= fragment_inline_size)
+ auto fragment_block_size = fragment.BlockSize() + margins.BlockSum();
+ if (opportunity.size.inline_size >= fragment_inline_size &&
+ opportunity.size.block_size >= fragment_block_size)
break;
opportunity_candidate = opportunity_iter.Next();
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698