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

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

Issue 2616093004: [ng_layout] Fix wrong percent_resolution_size (Closed)
Patch Set: size->logical_size Created 3 years, 11 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 | 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_constraint_space.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc
index 5af006f4649233d7cc55059be4c0fa0b5c8e8fce..56256ff489198c2eea435266aac86240c8a7157a 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc
@@ -52,6 +52,8 @@ NGConstraintSpace* NGConstraintSpace::CreateFromLayoutObject(
available_logical_height =
box.containingBlock()->availableLogicalHeightForPercentageComputation();
}
+ NGLogicalSize percentage_size = {available_logical_width,
+ available_logical_height};
// When we have an override size, the available_logical_{width,height} will be
// used as the final size of the box, so it has to include border and
// padding.
@@ -69,11 +71,12 @@ NGConstraintSpace* NGConstraintSpace::CreateFromLayoutObject(
bool is_new_fc =
box.isLayoutBlock() && toLayoutBlock(box).createsNewFormattingContext();
- NGLogicalSize size = {available_logical_width, available_logical_height};
+ NGLogicalSize logical_size = {available_logical_width,
cbiesinger 2017/01/10 22:00:50 available_size is better. But I also meant if you
atotic 2017/01/10 23:24:15 logical_size can't go right under percentage_size,
cbiesinger 2017/01/10 23:26:36 I'll send a followup patch once this lands, I thin
+ available_logical_height};
auto writing_mode = FromPlatformWritingMode(box.styleRef().getWritingMode());
return NGConstraintSpaceBuilder(writing_mode)
- .SetAvailableSize(size)
- .SetPercentageResolutionSize(size)
+ .SetAvailableSize(logical_size)
+ .SetPercentageResolutionSize(percentage_size)
.SetIsInlineDirectionTriggersScrollbar(
box.styleRef().overflowInlineDirection() == EOverflow::Auto)
.SetIsBlockDirectionTriggersScrollbar(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698