Chromium Code Reviews| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 block_offset, | 93 block_offset, |
| 94 outer_size.height - inline_offset - inner_size.height); | 94 outer_size.height - inline_offset - inner_size.height); |
| 95 else | 95 else |
| 96 return NGPhysicalOffset(block_offset, inline_offset); | 96 return NGPhysicalOffset(block_offset, inline_offset); |
| 97 default: | 97 default: |
| 98 ASSERT_NOT_REACHED(); | 98 ASSERT_NOT_REACHED(); |
| 99 return NGPhysicalOffset(); | 99 return NGPhysicalOffset(); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool NGPhysicalOffset::operator==(const NGPhysicalOffset& other) const { | |
|
ikilpatrick
2017/02/16 17:27:38
.nit move to after NGPhysicalOffset::operator-= ?
Gleb Lanbin
2017/02/16 20:08:27
Done.
| |
| 104 return other.left == left && other.top == top; | |
| 105 } | |
| 106 | |
| 103 bool NGLogicalOffset::operator==(const NGLogicalOffset& other) const { | 107 bool NGLogicalOffset::operator==(const NGLogicalOffset& other) const { |
| 104 return std::tie(other.inline_offset, other.block_offset) == | 108 return std::tie(other.inline_offset, other.block_offset) == |
| 105 std::tie(inline_offset, block_offset); | 109 std::tie(inline_offset, block_offset); |
| 106 } | 110 } |
| 107 | 111 |
| 108 NGLogicalOffset NGLogicalOffset::operator+(const NGLogicalOffset& other) const { | 112 NGLogicalOffset NGLogicalOffset::operator+(const NGLogicalOffset& other) const { |
| 109 NGLogicalOffset result; | 113 NGLogicalOffset result; |
| 110 result.inline_offset = this->inline_offset + other.inline_offset; | 114 result.inline_offset = this->inline_offset + other.inline_offset; |
| 111 result.block_offset = this->block_offset + other.block_offset; | 115 result.block_offset = this->block_offset + other.block_offset; |
| 112 return result; | 116 return result; |
| (...skipping 168 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 |