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

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

Issue 2568743005: Place the out of flow positioned blocks (Closed)
Patch Set: skip failing tests Created 3 years, 11 months 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_units.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_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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 NGPhysicalOffset NGPhysicalOffset::operator+( 140 NGPhysicalOffset NGPhysicalOffset::operator+(
141 const NGPhysicalOffset& other) const { 141 const NGPhysicalOffset& other) const {
142 return NGPhysicalOffset{this->left + other.left, this->top + other.top}; 142 return NGPhysicalOffset{this->left + other.left, this->top + other.top};
143 } 143 }
144 144
145 NGPhysicalOffset& NGPhysicalOffset::operator+=(const NGPhysicalOffset& other) { 145 NGPhysicalOffset& NGPhysicalOffset::operator+=(const NGPhysicalOffset& other) {
146 *this = *this + other; 146 *this = *this + other;
147 return *this; 147 return *this;
148 } 148 }
149 149
150 NGPhysicalOffset NGPhysicalOffset::operator-(
151 const NGPhysicalOffset& other) const {
152 return NGPhysicalOffset{this->left - other.left, this->top - other.top};
153 }
154
155 NGPhysicalOffset& NGPhysicalOffset::operator-=(const NGPhysicalOffset& other) {
156 *this = *this - other;
157 return *this;
158 }
159
150 bool NGBoxStrut::IsEmpty() const { 160 bool NGBoxStrut::IsEmpty() const {
151 return *this == NGBoxStrut(); 161 return *this == NGBoxStrut();
152 } 162 }
153 163
154 bool NGBoxStrut::operator==(const NGBoxStrut& other) const { 164 bool NGBoxStrut::operator==(const NGBoxStrut& other) const {
155 return std::tie(other.inline_start, other.inline_end, other.block_start, 165 return std::tie(other.inline_start, other.inline_end, other.block_start,
156 other.block_end) == 166 other.block_end) ==
157 std::tie(inline_start, inline_end, block_start, block_end); 167 std::tie(inline_start, inline_end, block_start, block_end);
158 } 168 }
159 169
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 break; 295 break;
286 case kSidewaysLeftRight: 296 case kSidewaysLeftRight:
287 position.type = 297 position.type =
288 (direction == TextDirection::Ltr) ? kBottomLeft : kTopLeft; 298 (direction == TextDirection::Ltr) ? kBottomLeft : kTopLeft;
289 break; 299 break;
290 } 300 }
291 return position; 301 return position;
292 } 302 }
293 303
294 } // namespace blink 304 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_units.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698