Chromium Code Reviews| 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..c8e75790c90bc1451378e2f5acaf3391e0280daa |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/layout/ng/geometry/ng_margin_strut.h |
| @@ -0,0 +1,35 @@ |
| +// 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 { |
| + |
| +#define NGSizeIndefinite LayoutUnit(-1) |
|
mstensho (USE GERRIT)
2017/02/28 12:19:47
Also #defined in ng_logical_size.h
eae
2017/02/28 12:26:34
Opps, good catch!
|
| + |
| +// 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 |