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

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

Issue 2555923002: Changed TextDirection to an enum class and renamed its members (Closed)
Patch Set: Rebase after reopen Created 3 years, 12 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(LTR) 31 .SetTextDirection(TextDirection::Ltr)
32 .ToConstraintSpace(); 32 .ToConstraintSpace();
33 rtl_space_ = builder.SetWritingMode(kHorizontalTopBottom) 33 rtl_space_ = builder.SetWritingMode(kHorizontalTopBottom)
34 .SetTextDirection(RTL) 34 .SetTextDirection(TextDirection::Rtl)
35 .ToConstraintSpace(); 35 .ToConstraintSpace();
36 vertical_lr_space_ = builder.SetWritingMode(kVerticalLeftRight) 36 vertical_lr_space_ = builder.SetWritingMode(kVerticalLeftRight)
37 .SetTextDirection(LTR) 37 .SetTextDirection(TextDirection::Ltr)
38 .ToConstraintSpace(); 38 .ToConstraintSpace();
39 vertical_rl_space_ = builder.SetWritingMode(kVerticalLeftRight) 39 vertical_rl_space_ = builder.SetWritingMode(kVerticalLeftRight)
40 .SetTextDirection(LTR) 40 .SetTextDirection(TextDirection::Ltr)
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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 SetVerticalStyle(top, margin_top, NGAuto, margin_bottom, bottom); 417 SetVerticalStyle(top, margin_top, NGAuto, margin_bottom, bottom);
418 EXPECT_EQ(AbsoluteNeedsChildBlockSize(*style_), false); 418 EXPECT_EQ(AbsoluteNeedsChildBlockSize(*style_), false);
419 auto_height.reset(); 419 auto_height.reset();
420 ComputeFullAbsoluteWithChildBlockSize(*ltr_space_, *style_, static_position, 420 ComputeFullAbsoluteWithChildBlockSize(*ltr_space_, *style_, static_position,
421 auto_height, &p); 421 auto_height, &p);
422 EXPECT_EQ(height, p.size.height); 422 EXPECT_EQ(height, p.size.height);
423 } 423 }
424 424
425 } // namespace 425 } // namespace
426 } // namespace blink 426 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698