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

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

Issue 2770483002: CS of out-of-flow positioned objects should have is_new_fc == true (Closed)
Patch Set: update TestExpectations 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 4c8143b0da7fa63c5812017555a174c167f47114..d63d5e735af824d58c93b3ab1c90a835c1aa3770 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
@@ -19,11 +19,14 @@ WTF::Optional<T> OptionalMax(const WTF::Optional<T>& value1,
return value2;
}
+bool IsOutOfFlowPositioned(const EPosition& position) {
+ return position == EPosition::kAbsolute || position == EPosition::kFixed;
+}
+
} // namespace
-bool IsNewFormattingContextForInFlowBlockLevelChild(
- const NGConstraintSpace& space,
- const ComputedStyle& style) {
+bool IsNewFormattingContextForBlockLevelChild(const NGConstraintSpace& space,
+ const ComputedStyle& style) {
// TODO(layout-dev): This doesn't capture a few cases which can't be computed
// directly from style yet:
// - The child is a <fieldset>.
@@ -31,6 +34,9 @@ bool IsNewFormattingContextForInFlowBlockLevelChild(
// in a multi-col formatting context).
// (https://drafts.csswg.org/css-multicol-1/#valdef-column-span-all)
+ if (style.isFloating() || IsOutOfFlowPositioned(style.position()))
+ return true;
+
if (style.specifiesColumns() || style.containsPaint() ||
style.containsLayout())
return true;

Powered by Google App Engine
This is Rietveld 408576698