Index: third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc |
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc |
index 8e58a021c248e8e7abf81d8d62e75be3262f11e1..62492def2c190e7acddddfab2ace0f0df4d8788f 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc |
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc |
@@ -49,6 +49,11 @@ NGLogicalOffset GetOriginPointForFloats(const NGConstraintSpace& space, |
origin_point.block_offset += content_size; |
return origin_point; |
} |
+ |
+inline bool IsObjectReplacementCharacter(UChar character) { |
+ return character == kObjectReplacementCharacter; |
+} |
+ |
} // namespace |
NGInlineLayoutAlgorithm::NGInlineLayoutAlgorithm( |
@@ -474,7 +479,12 @@ bool NGInlineLayoutAlgorithm::PlaceItems( |
baseline = LayoutUnit(baseline.Round()); |
// Check if the line fits into the constraint space in block direction. |
- LayoutUnit line_bottom = baseline + line_box.Metrics().descent; |
+ LayoutUnit line_bottom = baseline; |
+ |
+ // See http://crrev.com/2840883002 |
+ if (!Node()->Text().IsAllSpecialCharacters<IsObjectReplacementCharacter>()) |
+ line_bottom += line_box.Metrics().descent; |
+ |
if (!container_builder_.Children().IsEmpty() && |
ConstraintSpace().AvailableSize().block_size != NGSizeIndefinite && |
line_bottom > ConstraintSpace().AvailableSize().block_size) { |