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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_absolute_utils_test.cc

Issue 2614883007: Change computed style enums to be prefixed with 'k'. (Closed)
Patch Set: Rebase on ToT. Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/ng/ng_absolute_utils.h" 5 #include "core/layout/ng/ng_absolute_utils.h"
6 6
7 #include "core/layout/ng/ng_constraint_space_builder.h" 7 #include "core/layout/ng/ng_constraint_space_builder.h"
8 #include "core/layout/ng/ng_length_utils.h" 8 #include "core/layout/ng/ng_length_utils.h"
9 #include "core/style/ComputedStyle.h" 9 #include "core/style/ComputedStyle.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 10 matching lines...) Expand all
21 // If not set, border widths will always be 0. 21 // If not set, border widths will always be 0.
22 style_->setBorderLeftStyle(EBorderStyle::BorderStyleSolid); 22 style_->setBorderLeftStyle(EBorderStyle::BorderStyleSolid);
23 style_->setBorderRightStyle(EBorderStyle::BorderStyleSolid); 23 style_->setBorderRightStyle(EBorderStyle::BorderStyleSolid);
24 style_->setBorderTopStyle(EBorderStyle::BorderStyleSolid); 24 style_->setBorderTopStyle(EBorderStyle::BorderStyleSolid);
25 style_->setBorderBottomStyle(EBorderStyle::BorderStyleSolid); 25 style_->setBorderBottomStyle(EBorderStyle::BorderStyleSolid);
26 style_->setBoxSizing(EBoxSizing::BoxSizingBorderBox); 26 style_->setBoxSizing(EBoxSizing::BoxSizingBorderBox);
27 container_size_ = NGLogicalSize(LayoutUnit(200), LayoutUnit(300)); 27 container_size_ = NGLogicalSize(LayoutUnit(200), LayoutUnit(300));
28 NGConstraintSpaceBuilder builder(kHorizontalTopBottom); 28 NGConstraintSpaceBuilder builder(kHorizontalTopBottom);
29 builder.SetAvailableSize(container_size_); 29 builder.SetAvailableSize(container_size_);
30 ltr_space_ = builder.SetWritingMode(kHorizontalTopBottom) 30 ltr_space_ = builder.SetWritingMode(kHorizontalTopBottom)
31 .SetTextDirection(TextDirection::Ltr) 31 .SetTextDirection(TextDirection::kLtr)
32 .ToConstraintSpace(); 32 .ToConstraintSpace();
33 rtl_space_ = builder.SetWritingMode(kHorizontalTopBottom) 33 rtl_space_ = builder.SetWritingMode(kHorizontalTopBottom)
34 .SetTextDirection(TextDirection::Rtl) 34 .SetTextDirection(TextDirection::kRtl)
35 .ToConstraintSpace(); 35 .ToConstraintSpace();
36 vertical_lr_space_ = builder.SetWritingMode(kVerticalLeftRight) 36 vertical_lr_space_ = builder.SetWritingMode(kVerticalLeftRight)
37 .SetTextDirection(TextDirection::Ltr) 37 .SetTextDirection(TextDirection::kLtr)
38 .ToConstraintSpace(); 38 .ToConstraintSpace();
39 vertical_rl_space_ = builder.SetWritingMode(kVerticalLeftRight) 39 vertical_rl_space_ = builder.SetWritingMode(kVerticalLeftRight)
40 .SetTextDirection(TextDirection::Ltr) 40 .SetTextDirection(TextDirection::kLtr)
41 .ToConstraintSpace(); 41 .ToConstraintSpace();
42 } 42 }
43 43
44 void SetHorizontalStyle(LayoutUnit left, 44 void SetHorizontalStyle(LayoutUnit left,
45 LayoutUnit margin_left, 45 LayoutUnit margin_left,
46 LayoutUnit width, 46 LayoutUnit width,
47 LayoutUnit margin_right, 47 LayoutUnit margin_right,
48 LayoutUnit right) { 48 LayoutUnit right) {
49 style_->setLeft(left == NGAuto ? Length(LengthType::Auto) 49 style_->setLeft(left == NGAuto ? Length(LengthType::Auto)
50 : Length(left.toInt(), LengthType::Fixed)); 50 : Length(left.toInt(), LengthType::Fixed));
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 SetVerticalStyle(top, margin_top, NGAuto, margin_bottom, bottom); 418 SetVerticalStyle(top, margin_top, NGAuto, margin_bottom, bottom);
419 EXPECT_EQ(AbsoluteNeedsChildBlockSize(*style_), false); 419 EXPECT_EQ(AbsoluteNeedsChildBlockSize(*style_), false);
420 auto_height.reset(); 420 auto_height.reset();
421 ComputeFullAbsoluteWithChildBlockSize(*ltr_space_, *style_, static_position, 421 ComputeFullAbsoluteWithChildBlockSize(*ltr_space_, *style_, static_position,
422 auto_height, &p); 422 auto_height, &p);
423 EXPECT_EQ(height, p.size.height); 423 EXPECT_EQ(height, p.size.height);
424 } 424 }
425 425
426 } // namespace 426 } // namespace
427 } // namespace blink 427 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698