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

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

Issue 2346403002: [layoutng] Create correct constraint spaces for children (Closed)
Patch Set: fix assert failures Created 4 years, 3 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_length_utils.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_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 e5347e2102ff6f6bad6b1f856af09a1537e668ba..41c576a89a94c6dbc49bf7de784b08b63f993a7a 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
@@ -134,6 +134,15 @@ TEST_F(NGLengthUtilsTest, testComputeInlineSizeForFragment) {
style_->setBoxSizing(BoxSizingBorderBox);
EXPECT_EQ(LayoutUnit(100), computeInlineSizeForFragment());
+ // Content size should never be below zero, even with box-sizing: border-box
+ // and a large padding...
+ style_->setPaddingLeft(Length(400, Fixed));
+ EXPECT_EQ(LayoutUnit(400), computeInlineSizeForFragment());
+
+ // ...and the same goes for fill-available with a large padding.
+ style_->setLogicalWidth(Length(FillAvailable));
+ EXPECT_EQ(LayoutUnit(400), computeInlineSizeForFragment());
+
// TODO(layout-ng): test {min,max}-content on max-width.
}
@@ -184,6 +193,15 @@ TEST_F(NGLengthUtilsTest, testComputeBlockSizeForFragment) {
style_->setBoxSizing(BoxSizingBorderBox);
EXPECT_EQ(LayoutUnit(100), computeBlockSizeForFragment());
+ // Content size should never be below zero, even with box-sizing: border-box
+ // and a large padding...
+ style_->setPaddingBottom(Length(400, Fixed));
+ EXPECT_EQ(LayoutUnit(400), computeBlockSizeForFragment());
+
+ // ...and the same goes for fill-available with a large padding.
+ style_->setLogicalHeight(Length(FillAvailable));
+ EXPECT_EQ(LayoutUnit(400), computeBlockSizeForFragment());
+
// TODO(layout-ng): test {min,max}-content on max-height.
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698