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

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

Issue 2336353002: Collapse bottom margins of a last child and its parent if parent's height=auto (Closed)
Patch Set: add CORE_EXPORT Created 4 years, 3 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 #include "core/layout/ng/ng_writing_mode.h" 7 #include "core/layout/ng/ng_writing_mode.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 void NGMarginStrut::AppendMarginBlockEnd(const LayoutUnit& value) { 73 void NGMarginStrut::AppendMarginBlockEnd(const LayoutUnit& value) {
74 if (value < 0) { 74 if (value < 0) {
75 negative_margin_block_end = 75 negative_margin_block_end =
76 -std::max(value.abs(), negative_margin_block_end.abs()); 76 -std::max(value.abs(), negative_margin_block_end.abs());
77 } else { 77 } else {
78 margin_block_end = std::max(value, margin_block_end); 78 margin_block_end = std::max(value, margin_block_end);
79 } 79 }
80 } 80 }
81 81
82 void NGMarginStrut::SetMarginBlockEnd(const LayoutUnit& value) {
83 if (value < 0) {
84 negative_margin_block_end = value;
85 } else {
86 margin_block_end = value;
87 }
88 }
89
82 String NGMarginStrut::ToString() const { 90 String NGMarginStrut::ToString() const {
83 return String::format( 91 return String::format(
84 "Start: (%d %d) End: (%d %d)", negative_margin_block_start.toInt(), 92 "Start: (%d %d) End: (%d %d)", negative_margin_block_start.toInt(),
85 margin_block_start.toInt(), negative_margin_block_end.toInt(), 93 margin_block_start.toInt(), negative_margin_block_end.toInt(),
86 margin_block_end.toInt()); 94 margin_block_end.toInt());
87 } 95 }
88 96
97 bool NGMarginStrut::operator==(const NGMarginStrut& other) const {
98 return std::tie(other.margin_block_start, other.margin_block_end,
99 other.negative_margin_block_start,
100 other.negative_margin_block_end) ==
101 std::tie(margin_block_start, margin_block_end,
102 negative_margin_block_start, negative_margin_block_end);
103 }
104
89 } // namespace blink 105 } // 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