| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 NGPhysicalOffset NGPhysicalOffset::operator+( | 135 NGPhysicalOffset NGPhysicalOffset::operator+( |
| 136 const NGPhysicalOffset& other) const { | 136 const NGPhysicalOffset& other) const { |
| 137 return NGPhysicalOffset{this->left + other.left, this->top + other.top}; | 137 return NGPhysicalOffset{this->left + other.left, this->top + other.top}; |
| 138 } | 138 } |
| 139 | 139 |
| 140 NGPhysicalOffset& NGPhysicalOffset::operator+=(const NGPhysicalOffset& other) { | 140 NGPhysicalOffset& NGPhysicalOffset::operator+=(const NGPhysicalOffset& other) { |
| 141 *this = *this + other; | 141 *this = *this + other; |
| 142 return *this; | 142 return *this; |
| 143 } | 143 } |
| 144 | 144 |
| 145 NGPhysicalOffset NGPhysicalOffset::operator-( |
| 146 const NGPhysicalOffset& other) const { |
| 147 return NGPhysicalOffset{this->left - other.left, this->top - other.top}; |
| 148 } |
| 149 |
| 150 NGPhysicalOffset& NGPhysicalOffset::operator-=(const NGPhysicalOffset& other) { |
| 151 *this = *this - other; |
| 152 return *this; |
| 153 } |
| 154 |
| 145 bool NGBoxStrut::IsEmpty() const { | 155 bool NGBoxStrut::IsEmpty() const { |
| 146 return *this == NGBoxStrut(); | 156 return *this == NGBoxStrut(); |
| 147 } | 157 } |
| 148 | 158 |
| 149 bool NGBoxStrut::operator==(const NGBoxStrut& other) const { | 159 bool NGBoxStrut::operator==(const NGBoxStrut& other) const { |
| 150 return std::tie(other.inline_start, other.inline_end, other.block_start, | 160 return std::tie(other.inline_start, other.inline_end, other.block_start, |
| 151 other.block_end) == | 161 other.block_end) == |
| 152 std::tie(inline_start, inline_end, block_start, block_end); | 162 std::tie(inline_start, inline_end, block_start, block_end); |
| 153 } | 163 } |
| 154 | 164 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 position.type = (direction == LTR) ? kTopLeft : kBottomLeft; | 287 position.type = (direction == LTR) ? kTopLeft : kBottomLeft; |
| 278 break; | 288 break; |
| 279 case kSidewaysLeftRight: | 289 case kSidewaysLeftRight: |
| 280 position.type = (direction == LTR) ? kBottomLeft : kTopLeft; | 290 position.type = (direction == LTR) ? kBottomLeft : kTopLeft; |
| 281 break; | 291 break; |
| 282 } | 292 } |
| 283 return position; | 293 return position; |
| 284 } | 294 } |
| 285 | 295 |
| 286 } // namespace blink | 296 } // namespace blink |
| OLD | NEW |