Index: third_party/WebKit/Source/core/layout/ng/geometry/ng_margin_strut.h |
diff --git a/third_party/WebKit/Source/core/layout/ng/geometry/ng_margin_strut.h b/third_party/WebKit/Source/core/layout/ng/geometry/ng_margin_strut.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d67239d1c9c584bee163e0bdf9399e22daa41a12 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/layout/ng/geometry/ng_margin_strut.h |
@@ -0,0 +1,33 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef NGMarginStrut_h |
+#define NGMarginStrut_h |
+ |
+#include "core/CoreExport.h" |
+#include "platform/LayoutUnit.h" |
+ |
+namespace blink { |
+ |
+// This struct is used for the margin collapsing calculation. |
+struct CORE_EXPORT NGMarginStrut { |
+ LayoutUnit margin; |
+ LayoutUnit negative_margin; |
+ |
+ // Appends negative or positive value to the current margin strut. |
+ void Append(const LayoutUnit& value); |
+ |
+ // Sum up negative and positive margins of this strut. |
+ LayoutUnit Sum() const; |
+ |
+ bool operator==(const NGMarginStrut& other) const; |
+ |
+ String ToString() const; |
+}; |
+ |
+CORE_EXPORT std::ostream& operator<<(std::ostream&, const NGMarginStrut&); |
+ |
+} // namespace blink |
+ |
+#endif // NGMarginStrut_h |