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

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

Issue 2840883002: Check if fragment's block size fits into a layout opportunity. (Closed)
Patch Set: git rebase-update 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.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) {
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698