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

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

Issue 2451223003: Split SetFixedSize and SetDirectionTriggersScrollbar in multiple functions. (Closed)
Patch Set: Created 4 years, 1 month 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_constraint_space_builder.h ('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
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_constraint_space_builder.h" 5 #include "core/layout/ng/ng_constraint_space_builder.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 NGConstraintSpaceBuilder::NGConstraintSpaceBuilder(NGWritingMode writing_mode) 9 NGConstraintSpaceBuilder::NGConstraintSpaceBuilder(NGWritingMode writing_mode)
10 : writing_mode_(writing_mode) {} 10 : writing_mode_(writing_mode),
11 is_fixed_size_inline_(false),
12 is_fixed_size_block_(false),
13 is_inline_direction_triggers_scrollbar_(false),
14 is_block_direction_triggers_scrollbar_(false),
15 fragmentation_type_(NGFragmentationType::FragmentNone),
16 is_new_fc_(false) {}
11 17
12 NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetContainerSize( 18 NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetContainerSize(
13 NGLogicalSize container_size) { 19 NGLogicalSize container_size) {
14 container_size_ = container_size; 20 container_size_ = container_size;
15 return *this; 21 return *this;
16 } 22 }
17 23
18 NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetFixedSize( 24 NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetIsFixedSizeInline(
19 bool fixed_inline, 25 bool is_fixed_size_inline) {
20 bool fixed_block) { 26 is_fixed_size_inline_ = is_fixed_size_inline;
21 fixed_inline_ = fixed_inline; 27 return *this;
22 fixed_block_ = fixed_block; 28 }
29
30 NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetIsFixedSizeBlock(
31 bool is_fixed_size_block) {
32 is_fixed_size_block_ = is_fixed_size_block;
23 return *this; 33 return *this;
24 } 34 }
25 35
26 NGConstraintSpaceBuilder& 36 NGConstraintSpaceBuilder&
27 NGConstraintSpaceBuilder::SetOverflowTriggersScrollbar( 37 NGConstraintSpaceBuilder::SetIsInlineDirectionTriggersScrollbar(
28 bool inline_direction_triggers_scrollbar, 38 bool is_inline_direction_triggers_scrollbar) {
29 bool block_direction_triggers_scrollbar) { 39 is_inline_direction_triggers_scrollbar_ =
30 inline_direction_triggers_scrollbar_ = inline_direction_triggers_scrollbar; 40 is_inline_direction_triggers_scrollbar;
31 block_direction_triggers_scrollbar_ = block_direction_triggers_scrollbar;
32 return *this; 41 return *this;
33 } 42 }
34 43
44 NGConstraintSpaceBuilder&
45 NGConstraintSpaceBuilder::SetIsBlockDirectionTriggersScrollbar(
46 bool is_block_direction_triggers_scrollbar) {
47 is_block_direction_triggers_scrollbar_ =
48 is_block_direction_triggers_scrollbar;
49 return *this;
50 }
51
35 NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetFragmentationType( 52 NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetFragmentationType(
36 NGFragmentationType fragmentation_type) { 53 NGFragmentationType fragmentation_type) {
37 fragmentation_type_ = fragmentation_type; 54 fragmentation_type_ = fragmentation_type;
38 return *this; 55 return *this;
39 } 56 }
40 57
41 NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetIsNewFormattingContext( 58 NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetIsNewFormattingContext(
42 bool is_new_fc) { 59 bool is_new_fc) {
43 is_new_fc_ = is_new_fc; 60 is_new_fc_ = is_new_fc;
44 return *this; 61 return *this;
45 } 62 }
46 63
47 NGPhysicalConstraintSpace* NGConstraintSpaceBuilder::ToConstraintSpace() { 64 NGPhysicalConstraintSpace* NGConstraintSpaceBuilder::ToConstraintSpace() {
48 NGPhysicalSize container_size = container_size_.ConvertToPhysical( 65 NGPhysicalSize container_size = container_size_.ConvertToPhysical(
49 static_cast<NGWritingMode>(writing_mode_)); 66 static_cast<NGWritingMode>(writing_mode_));
50 if (writing_mode_ == HorizontalTopBottom) { 67 if (writing_mode_ == HorizontalTopBottom) {
51 return new NGPhysicalConstraintSpace( 68 return new NGPhysicalConstraintSpace(
52 container_size, fixed_inline_, fixed_block_, 69 container_size, is_fixed_size_inline_, is_fixed_size_block_,
53 inline_direction_triggers_scrollbar_, 70 is_inline_direction_triggers_scrollbar_,
54 block_direction_triggers_scrollbar_, FragmentNone, 71 is_block_direction_triggers_scrollbar_, FragmentNone,
55 static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_); 72 static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_);
56 } else { 73 } else {
57 return new NGPhysicalConstraintSpace( 74 return new NGPhysicalConstraintSpace(
58 container_size, fixed_block_, fixed_inline_, 75 container_size, is_fixed_size_block_, is_fixed_size_inline_,
59 block_direction_triggers_scrollbar_, 76 is_block_direction_triggers_scrollbar_,
60 inline_direction_triggers_scrollbar_, 77 is_inline_direction_triggers_scrollbar_,
61 static_cast<NGFragmentationType>(fragmentation_type_), FragmentNone, 78 static_cast<NGFragmentationType>(fragmentation_type_), FragmentNone,
62 is_new_fc_); 79 is_new_fc_);
63 } 80 }
64 } 81 }
65 82
66 } // namespace blink 83 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698