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

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

Issue 2755143003: [LayoutNG] Make NGLineBuilder work with inline floats (Closed)
Patch Set: make setIsInPlacedTree to be available for LayoutNG Created 3 years, 9 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/ng_space_utils.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_space_utils.cc b/third_party/WebKit/Source/core/layout/ng/ng_space_utils.cc
index 98ecc61f2ff93e7a3f385b83e735a3d4efcc8128..4c8143b0da7fa63c5812017555a174c167f47114 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_space_utils.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_space_utils.cc
@@ -79,4 +79,17 @@ WTF::Optional<LayoutUnit> GetClearanceOffset(
return WTF::nullopt;
}
+bool ShouldShrinkToFit(const NGConstraintSpace& parent_space,
+ const ComputedStyle& style) {
+ NGWritingMode child_writing_mode =
+ FromPlatformWritingMode(style.getWritingMode());
+ // Whether the child and the containing block are parallel to each other.
+ // Example: vertical-rl and vertical-lr
+ bool is_in_parallel_flow =
+ IsParallelWritingMode(parent_space.WritingMode(), child_writing_mode);
+
+ return style.display() == EDisplay::kInlineBlock || style.isFloating() ||
+ !is_in_parallel_flow;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698