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

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

Issue 2655783006: Top down version of algorithm to position margins and floats in LayoutNG (Closed)
Patch Set: git rebase-update 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..68c50314d995c920476c492b0fa3bb3d65ac5b74 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,12 @@ 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::Sum() 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 margin == other.margin && negative_margin == other.negative_margin;
}
void NGMarginStrut::Append(const LayoutUnit& value) {
@@ -272,19 +222,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);
}
« 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