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

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

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
Index: third_party/WebKit/Source/core/layout/ng/ng_units.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_units.h b/third_party/WebKit/Source/core/layout/ng/ng_units.h
index f2a5972ad045506ea1c6e327c37fc7f977d8f66c..b44aaa4a9035a0cddb12fa2e1a2b393d6021b59f 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_units.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_units.h
@@ -303,38 +303,17 @@ inline std::ostream& operator<<(std::ostream& stream, const NGBoxStrut& value) {
}
// This struct is used for the margin collapsing calculation.
-// TODO(glebl): Deprecated. It's being replaced by NGMarginStrut
-struct CORE_EXPORT NGDeprecatedMarginStrut {
- LayoutUnit margin_block_start;
- LayoutUnit margin_block_end;
-
- LayoutUnit negative_margin_block_start;
- LayoutUnit negative_margin_block_end;
-
- LayoutUnit BlockEndSum() const;
-
- void AppendMarginBlockStart(const LayoutUnit& value);
- void AppendMarginBlockEnd(const LayoutUnit& value);
- void SetMarginBlockStart(const LayoutUnit& value);
- void SetMarginBlockEnd(const LayoutUnit& value);
-
- bool IsEmpty() const;
-
- String ToString() const;
-
- bool operator==(const NGDeprecatedMarginStrut& other) const;
-};
-
-// This struct is used for the margin collapsing calculation.
struct CORE_EXPORT NGMarginStrut {
LayoutUnit margin;
LayoutUnit negative_margin;
- bool operator==(const NGMarginStrut& other) const;
-
+ // Appends negative or positive value to the current margin strut.
void Append(const LayoutUnit& value);
- LayoutUnit Collapse() const;
+ // Sum up negative and positive margins of this strut.
+ LayoutUnit Sum() const;
+
+ bool operator==(const NGMarginStrut& other) const;
String ToString() const;
};

Powered by Google App Engine
This is Rietveld 408576698