Index: third_party/WebKit/Source/core/layout/ng/ng_length_utils_test.cc |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_length_utils_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_length_utils_test.cc |
index 93ea4e504dcdbcc954206d042dd9b3d8c221dcf1..e05e419b27faf72d78149448116e77c0cafc99ff 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_length_utils_test.cc |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_length_utils_test.cc |
@@ -159,6 +159,21 @@ TEST_F(NGLengthUtilsTest, testComputeBlockSizeForFragment) { |
// TODO(layout-ng): test {min,max}-content on max-height. |
} |
+TEST_F(NGLengthUtilsTest, testIndefinitePercentages) { |
+ style_->setMinHeight(Length(20, Fixed)); |
+ style_->setHeight(Length(20, Percent)); |
+ |
+ EXPECT_EQ(NGSizeIndefinite, |
+ computeBlockSizeForFragment(constructConstraintSpace(200, -1), |
+ LayoutUnit(-1))); |
+ EXPECT_EQ(LayoutUnit(20), |
+ computeBlockSizeForFragment(constructConstraintSpace(200, -1), |
+ LayoutUnit(10))); |
+ EXPECT_EQ(LayoutUnit(120), |
+ computeBlockSizeForFragment(constructConstraintSpace(200, -1), |
+ LayoutUnit(120))); |
+} |
+ |
TEST_F(NGLengthUtilsTest, testMargins) { |
style_->setMarginTop(Length(10, Percent)); |
style_->setMarginRight(Length(52, Fixed)); |