Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/ng/ng_units.cc |
| diff --git a/third_party/WebKit/Source/core/layout/ng/ng_units.cc b/third_party/WebKit/Source/core/layout/ng/ng_units.cc |
| index e474911701ab1858b96f72bd608586d168ec9dcf..aece1e6e5cb04dffcc54eafe1fd36d1e0aa82d86 100644 |
| --- a/third_party/WebKit/Source/core/layout/ng/ng_units.cc |
| +++ b/third_party/WebKit/Source/core/layout/ng/ng_units.cc |
| @@ -206,62 +206,13 @@ NGBoxStrut NGPhysicalBoxStrut::ConvertToLogical(NGWritingMode writing_mode, |
| return strut; |
| } |
| -LayoutUnit NGDeprecatedMarginStrut::BlockEndSum() const { |
| - return margin_block_end + negative_margin_block_end; |
| -} |
| - |
| -void NGDeprecatedMarginStrut::AppendMarginBlockStart(const LayoutUnit& value) { |
| - if (value < 0) { |
| - negative_margin_block_start = |
| - -std::max(value.abs(), negative_margin_block_start.abs()); |
| - } else { |
| - margin_block_start = std::max(value, margin_block_start); |
| - } |
| -} |
| - |
| -void NGDeprecatedMarginStrut::AppendMarginBlockEnd(const LayoutUnit& value) { |
| - if (value < 0) { |
| - negative_margin_block_end = |
| - -std::max(value.abs(), negative_margin_block_end.abs()); |
| - } else { |
| - margin_block_end = std::max(value, margin_block_end); |
| - } |
| -} |
| - |
| -void NGDeprecatedMarginStrut::SetMarginBlockStart(const LayoutUnit& value) { |
| - if (value < 0) { |
| - negative_margin_block_start = value; |
| - } else { |
| - margin_block_start = value; |
| - } |
| -} |
| - |
| -void NGDeprecatedMarginStrut::SetMarginBlockEnd(const LayoutUnit& value) { |
| - if (value < 0) { |
| - negative_margin_block_end = value; |
| - } else { |
| - margin_block_end = value; |
| - } |
| -} |
| - |
| -String NGDeprecatedMarginStrut::ToString() const { |
| - return String::format("Start: (%d %d) End: (%d %d)", |
| - margin_block_start.toInt(), margin_block_end.toInt(), |
| - negative_margin_block_start.toInt(), |
| - negative_margin_block_end.toInt()); |
| -} |
| - |
| -bool NGDeprecatedMarginStrut::IsEmpty() const { |
| - return *this == NGDeprecatedMarginStrut(); |
| +LayoutUnit NGMarginStrut::Collapse() const { |
| + return margin + negative_margin; |
| } |
| -bool NGDeprecatedMarginStrut::operator==( |
| - const NGDeprecatedMarginStrut& other) const { |
| - return std::tie(other.margin_block_start, other.margin_block_end, |
| - other.negative_margin_block_start, |
| - other.negative_margin_block_end) == |
| - std::tie(margin_block_start, margin_block_end, |
| - negative_margin_block_start, negative_margin_block_end); |
| +bool NGMarginStrut::operator==(const NGMarginStrut& other) const { |
| + return std::tie(other.margin, other.negative_margin) == |
|
mstensho (USE GERRIT)
2017/01/26 09:19:08
What's the advantage with this over simply doing:
Gleb Lanbin
2017/01/31 00:25:01
done. thanks. you are right your variant is shorte
|
| + std::tie(margin, negative_margin); |
| } |
| void NGMarginStrut::Append(const LayoutUnit& value) { |
| @@ -272,19 +223,10 @@ void NGMarginStrut::Append(const LayoutUnit& value) { |
| } |
| } |
| -LayoutUnit NGMarginStrut::Collapse() const { |
| - return margin + negative_margin; |
| -} |
| - |
| String NGMarginStrut::ToString() const { |
| return String::format("%d %d", margin.toInt(), negative_margin.toInt()); |
| } |
| -bool NGMarginStrut::operator==(const NGMarginStrut& other) const { |
| - return std::tie(other.margin, other.negative_margin) == |
| - std::tie(margin, negative_margin); |
| -} |
| - |
| bool NGExclusion::operator==(const NGExclusion& other) const { |
| return std::tie(other.rect, other.type) == std::tie(rect, type); |
| } |