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

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: normal-flow/max-width-110.xht fails on mac(layoutng and legacy) 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 c81a44a30c07ffce977f8e719aba85da6a328e90..5676fcbd73b759d0a700fb96d177394b092ad3a3 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(
@@ -469,7 +474,11 @@ 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;
+
+ if (!Node()->Text().IsAllSpecialCharacters<IsObjectReplacementCharacter>())
kojii 2017/04/26 00:51:34 This doesn't look correct, but I admit ascent/desc
+ 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