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

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

Issue 2852883003: [LayoutNG] Fix 'vertical-align' not to include metrics before alignment (Closed)
Patch Set: glebl nits 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
Index: third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm_test.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm_test.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm_test.cc
index 946359d25203cced24ece0f797abba11a7724cd9..9ff3226351041018c576698f7d055ee6c82f2db6 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm_test.cc
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm_test.cc
@@ -79,6 +79,31 @@ TEST_F(NGInlineLayoutAlgorithmTest, BreakToken) {
EXPECT_EQ(0u, wrapper2_break_token->ChildBreakTokens().size());
}
+TEST_F(NGInlineLayoutAlgorithmTest, VerticalAlignBottomReplaced) {
+ SetBodyInnerHTML(R"HTML(
+ <!DOCTYPE html>
+ <style>
+ html { font-size: 10px; }
+ img { vertical-align: bottom; }
+ </style>
+ <div id=container><img src="#" width="96" height="96"></div>
+ )HTML");
+ LayoutNGBlockFlow* block_flow =
+ ToLayoutNGBlockFlow(GetLayoutObjectByElementId("container"));
+ NGInlineNode* inline_node =
+ new NGInlineNode(block_flow->FirstChild(), block_flow);
+ RefPtr<NGConstraintSpace> space =
+ NGConstraintSpace::CreateFromLayoutObject(*block_flow);
+ RefPtr<NGLayoutResult> layout_result = inline_node->Layout(space.Get());
+ auto* wrapper =
+ ToNGPhysicalBoxFragment(layout_result->PhysicalFragment().Get());
+ EXPECT_EQ(1u, wrapper->Children().size());
+ auto* line = ToNGPhysicalLineBoxFragment(wrapper->Children()[0].Get());
+ EXPECT_EQ(LayoutUnit(96), line->Height());
+ auto* img = line->Children()[0].Get();
+ EXPECT_EQ(LayoutUnit(0), img->TopOffset());
+}
+
// Verifies that text can flow correctly around floats that were positioned
// before the inline block.
TEST_F(NGInlineLayoutAlgorithmTest, TextFloatsAroundFloatsBefore) {

Powered by Google App Engine
This is Rietveld 408576698