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_units.h" | 5 #include "core/layout/ng/ng_units.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 LayoutUnit MinAndMaxContentSizes::ShrinkToFit(LayoutUnit available_size) const { | 9 LayoutUnit MinAndMaxContentSizes::ShrinkToFit(LayoutUnit available_size) const { |
10 DCHECK_GE(max_content, min_content); | 10 DCHECK_GE(max_content, min_content); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 NGPhysicalOffset NGPhysicalOffset::operator-( | 164 NGPhysicalOffset NGPhysicalOffset::operator-( |
165 const NGPhysicalOffset& other) const { | 165 const NGPhysicalOffset& other) const { |
166 return NGPhysicalOffset{this->left - other.left, this->top - other.top}; | 166 return NGPhysicalOffset{this->left - other.left, this->top - other.top}; |
167 } | 167 } |
168 | 168 |
169 NGPhysicalOffset& NGPhysicalOffset::operator-=(const NGPhysicalOffset& other) { | 169 NGPhysicalOffset& NGPhysicalOffset::operator-=(const NGPhysicalOffset& other) { |
170 *this = *this - other; | 170 *this = *this - other; |
171 return *this; | 171 return *this; |
172 } | 172 } |
173 | 173 |
| 174 bool NGPhysicalOffset::operator==(const NGPhysicalOffset& other) const { |
| 175 return other.left == left && other.top == top; |
| 176 } |
| 177 |
174 bool NGBoxStrut::IsEmpty() const { | 178 bool NGBoxStrut::IsEmpty() const { |
175 return *this == NGBoxStrut(); | 179 return *this == NGBoxStrut(); |
176 } | 180 } |
177 | 181 |
178 bool NGBoxStrut::operator==(const NGBoxStrut& other) const { | 182 bool NGBoxStrut::operator==(const NGBoxStrut& other) const { |
179 return std::tie(other.inline_start, other.inline_end, other.block_start, | 183 return std::tie(other.inline_start, other.inline_end, other.block_start, |
180 other.block_end) == | 184 other.block_end) == |
181 std::tie(inline_start, inline_end, block_start, block_end); | 185 std::tie(inline_start, inline_end, block_start, block_end); |
182 } | 186 } |
183 | 187 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 break; | 285 break; |
282 case kSidewaysLeftRight: | 286 case kSidewaysLeftRight: |
283 position.type = | 287 position.type = |
284 (direction == TextDirection::kLtr) ? kBottomLeft : kTopLeft; | 288 (direction == TextDirection::kLtr) ? kBottomLeft : kTopLeft; |
285 break; | 289 break; |
286 } | 290 } |
287 return position; | 291 return position; |
288 } | 292 } |
289 | 293 |
290 } // namespace blink | 294 } // namespace blink |
OLD | NEW |