OLD | NEW |
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.h" | 5 #include "core/layout/ng/ng_constraint_space.h" |
6 | 6 |
7 #include "core/layout/LayoutBlock.h" | 7 #include "core/layout/LayoutBlock.h" |
8 #include "core/layout/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
9 #include "core/layout/ng/ng_constraint_space.h" | 9 #include "core/layout/ng/ng_constraint_space.h" |
10 #include "core/layout/ng/ng_constraint_space_builder.h" | 10 #include "core/layout/ng/ng_constraint_space_builder.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 NGLogicalSize NGConstraintSpace::AvailableSize() const { | 96 NGLogicalSize NGConstraintSpace::AvailableSize() const { |
97 return physical_space_->available_size_.ConvertToLogical( | 97 return physical_space_->available_size_.ConvertToLogical( |
98 static_cast<NGWritingMode>(writing_mode_)); | 98 static_cast<NGWritingMode>(writing_mode_)); |
99 } | 99 } |
100 | 100 |
101 bool NGConstraintSpace::IsNewFormattingContext() const { | 101 bool NGConstraintSpace::IsNewFormattingContext() const { |
102 return physical_space_->is_new_fc_; | 102 return physical_space_->is_new_fc_; |
103 } | 103 } |
104 | 104 |
105 bool NGConstraintSpace::InlineTriggersScrollbar() const { | 105 bool NGConstraintSpace::InlineTriggersScrollbar() const { |
106 return writing_mode_ == HorizontalTopBottom | 106 return writing_mode_ == kHorizontalTopBottom |
107 ? physical_space_->width_direction_triggers_scrollbar_ | 107 ? physical_space_->width_direction_triggers_scrollbar_ |
108 : physical_space_->height_direction_triggers_scrollbar_; | 108 : physical_space_->height_direction_triggers_scrollbar_; |
109 } | 109 } |
110 | 110 |
111 bool NGConstraintSpace::BlockTriggersScrollbar() const { | 111 bool NGConstraintSpace::BlockTriggersScrollbar() const { |
112 return writing_mode_ == HorizontalTopBottom | 112 return writing_mode_ == kHorizontalTopBottom |
113 ? physical_space_->height_direction_triggers_scrollbar_ | 113 ? physical_space_->height_direction_triggers_scrollbar_ |
114 : physical_space_->width_direction_triggers_scrollbar_; | 114 : physical_space_->width_direction_triggers_scrollbar_; |
115 } | 115 } |
116 | 116 |
117 bool NGConstraintSpace::FixedInlineSize() const { | 117 bool NGConstraintSpace::FixedInlineSize() const { |
118 return writing_mode_ == HorizontalTopBottom ? physical_space_->fixed_width_ | 118 return writing_mode_ == kHorizontalTopBottom ? physical_space_->fixed_width_ |
119 : physical_space_->fixed_height_; | 119 : physical_space_->fixed_height_; |
120 } | 120 } |
121 | 121 |
122 bool NGConstraintSpace::FixedBlockSize() const { | 122 bool NGConstraintSpace::FixedBlockSize() const { |
123 return writing_mode_ == HorizontalTopBottom ? physical_space_->fixed_height_ | 123 return writing_mode_ == kHorizontalTopBottom ? physical_space_->fixed_height_ |
124 : physical_space_->fixed_width_; | 124 : physical_space_->fixed_width_; |
125 } | 125 } |
126 | 126 |
127 NGFragmentationType NGConstraintSpace::BlockFragmentationType() const { | 127 NGFragmentationType NGConstraintSpace::BlockFragmentationType() const { |
128 return static_cast<NGFragmentationType>( | 128 return static_cast<NGFragmentationType>( |
129 writing_mode_ == HorizontalTopBottom | 129 writing_mode_ == kHorizontalTopBottom |
130 ? physical_space_->height_direction_fragmentation_type_ | 130 ? physical_space_->height_direction_fragmentation_type_ |
131 : physical_space_->width_direction_fragmentation_type_); | 131 : physical_space_->width_direction_fragmentation_type_); |
132 } | 132 } |
133 | 133 |
134 void NGConstraintSpace::Subtract(const NGFragment*) { | 134 void NGConstraintSpace::Subtract(const NGFragment*) { |
135 // TODO(layout-ng): Implement. | 135 // TODO(layout-ng): Implement. |
136 } | 136 } |
137 | 137 |
138 NGLayoutOpportunityIterator* NGConstraintSpace::LayoutOpportunities( | 138 NGLayoutOpportunityIterator* NGConstraintSpace::LayoutOpportunities( |
139 unsigned clear, | 139 unsigned clear, |
(...skipping 10 matching lines...) Expand all Loading... |
150 | 150 |
151 String NGConstraintSpace::ToString() const { | 151 String NGConstraintSpace::ToString() const { |
152 return String::format("%s,%s %sx%s", | 152 return String::format("%s,%s %sx%s", |
153 offset_.inline_offset.toString().ascii().data(), | 153 offset_.inline_offset.toString().ascii().data(), |
154 offset_.block_offset.toString().ascii().data(), | 154 offset_.block_offset.toString().ascii().data(), |
155 AvailableSize().inline_size.toString().ascii().data(), | 155 AvailableSize().inline_size.toString().ascii().data(), |
156 AvailableSize().block_size.toString().ascii().data()); | 156 AvailableSize().block_size.toString().ascii().data()); |
157 } | 157 } |
158 | 158 |
159 } // namespace blink | 159 } // namespace blink |
OLD | NEW |