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 c99af5ce609fdb19377b08686e1b8803c606ca16..ea3633725c56ac0eab547ab9e4d6acdb9db23325 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 |
@@ -4,6 +4,8 @@ |
#include "core/layout/ng/ng_constraint_space.h" |
+#include "core/layout/LayoutBlock.h" |
+#include "core/layout/LayoutView.h" |
#include "core/layout/ng/ng_units.h" |
namespace blink { |
@@ -54,9 +56,13 @@ NGConstraintSpace* NGConstraintSpace::CreateFromLayoutObject( |
// XXX for orthogonal writing mode this is not right |
LayoutUnit container_logical_width = |
std::max(LayoutUnit(), box.containingBlockLogicalWidthForContent()); |
- // XXX Make sure this height is correct |
- LayoutUnit container_logical_height = |
- box.containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding); |
+ LayoutUnit container_logical_height; |
+ if (!box.parent()) { |
+ container_logical_height = box.view()->viewLogicalHeightForPercentages(); |
+ } else if (box.containingBlock()) { |
+ container_logical_height = |
+ box.containingBlock()->availableLogicalHeightForPercentageComputation(); |
+ } |
if (box.hasOverrideLogicalContentWidth()) { |
container_logical_width = box.overrideLogicalContentWidth(); |
fixed_inline = true; |