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

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

Issue 2700683002: [LayoutNG] Fix incorrectly positioned empty blocks inside of new BFC (Closed)
Patch Set: Fix comments and some crashes in FloatingObjects Created 3 years, 10 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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