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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/layout/ng/ng_space_utils.h"
6
7 #include "core/layout/ng/ng_constraint_space.h"
8 #include "core/layout/ng/ng_constraint_space_builder.h"
9 #include "core/style/ComputedStyle.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 namespace blink {
13 namespace {
14
15 class NGSpaceUtilsTest : public ::testing::Test {
16 protected:
17 NGSpaceUtilsTest() : space_builder_(NGWritingMode::kHorizontalTopBottom) {}
18
19 void SetUp() override { style_ = ComputedStyle::create(); }
20 RefPtr<ComputedStyle> style_;
21 NGConstraintSpaceBuilder space_builder_;
22 };
23
24 // Verifies that IsNewFormattingContextForInFlowBlockLevelChild returnes true
25 // if the child is out-of-flow, e.g. floating or abs-pos.
26 TEST_F(NGSpaceUtilsTest, NewFormattingContextForOutOfFlowChild) {
27 auto run_test = [&](const ComputedStyle& style) {
28 RefPtr<NGConstraintSpace> not_used_space =
29 space_builder_.ToConstraintSpace(NGWritingMode::kHorizontalTopBottom);
30 EXPECT_TRUE(
31 IsNewFormattingContextForBlockLevelChild(*not_used_space.get(), style));
32 };
33 RefPtr<ComputedStyle> style = ComputedStyle::create();
34 style->setFloating(EFloat::kLeft);
35 run_test(*style.get());
36
37 style = ComputedStyle::create();
38 style->setPosition(EPosition::kAbsolute);
39 run_test(*style.get());
40
41 style = ComputedStyle::create();
42 style->setPosition(EPosition::kFixed);
43 run_test(*style.get());
44 }
45
46 } // namespace
47 } // namespace blink
OLDNEW
« 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