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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_space_utils_test.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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_space_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_space_utils_test.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_space_utils_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_space_utils_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..683e804648cff85d22a5721e50afd85834faa178
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_space_utils_test.cc
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/layout/ng/ng_space_utils.h"
+
+#include "core/layout/ng/ng_constraint_space.h"
+#include "core/layout/ng/ng_constraint_space_builder.h"
+#include "core/style/ComputedStyle.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+namespace {
+
+class NGSpaceUtilsTest : public ::testing::Test {
+ protected:
+ NGSpaceUtilsTest() : space_builder_(NGWritingMode::kHorizontalTopBottom) {}
+
+ void SetUp() override { style_ = ComputedStyle::create(); }
+ RefPtr<ComputedStyle> style_;
+ NGConstraintSpaceBuilder space_builder_;
+};
+
+// Verifies that IsNewFormattingContextForInFlowBlockLevelChild returnes true
+// if the child is out-of-flow, e.g. floating or abs-pos.
+TEST_F(NGSpaceUtilsTest, NewFormattingContextForOutOfFlowChild) {
+ auto run_test = [&](const ComputedStyle& style) {
+ RefPtr<NGConstraintSpace> not_used_space =
+ space_builder_.ToConstraintSpace(NGWritingMode::kHorizontalTopBottom);
+ EXPECT_TRUE(
+ IsNewFormattingContextForBlockLevelChild(*not_used_space.get(), style));
+ };
+ RefPtr<ComputedStyle> style = ComputedStyle::create();
+ style->setFloating(EFloat::kLeft);
+ run_test(*style.get());
+
+ style = ComputedStyle::create();
+ style->setPosition(EPosition::kAbsolute);
+ run_test(*style.get());
+
+ style = ComputedStyle::create();
+ style->setPosition(EPosition::kFixed);
+ run_test(*style.get());
+}
+
+} // namespace
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_space_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698