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

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

Issue 2801053004: Let floats to use all available size if opportunity is infinite (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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h » ('j') | 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_floats_utils.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc b/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc
index 123efd1d75ff8929fa4a54b211d66745c9054684..7eea9c52ca863396c53434393f74e831c802f935 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_floats_utils.cc
@@ -127,9 +127,19 @@ NGLogicalOffset PositionFloat(NGFloatingObject* floating_object,
toNGPhysicalBoxFragment(floating_object->fragment.get()));
// Find a layout opportunity that will fit our float.
- const NGLayoutOpportunity opportunity = FindLayoutOpportunityForFragment(
+ NGLayoutOpportunity opportunity = FindLayoutOpportunityForFragment(
new_parent_space, float_fragment, floating_object);
- DCHECK(!opportunity.IsEmpty()) << "Opportunity is empty but it shouldn't be";
+
+ // TODO(glebl): This should check for infinite opportunity instead.
+ if (opportunity.IsEmpty()) {
+ // Because of the implementation specific of the layout opportunity iterator
+ // an empty opportunity can mean 2 things:
+ // - search for layout opportunities is exhausted.
+ // - opportunity has an infinite size. That's because CS is infinite.
+ opportunity = NGLayoutOpportunity(
+ NGLogicalOffset(),
+ NGLogicalSize(float_fragment.InlineSize(), float_fragment.BlockSize()));
+ }
// Calculate the float offset if needed.
LayoutUnit float_offset;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698