Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/ng/ng_floating_object.h |
| diff --git a/third_party/WebKit/Source/core/layout/ng/ng_floating_object.h b/third_party/WebKit/Source/core/layout/ng/ng_floating_object.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a9854aa0e2951ce048acf70649fb99963eedf7c8 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/layout/ng/ng_floating_object.h |
| @@ -0,0 +1,48 @@ |
| +// 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 NGFloatingObject_h |
| +#define NGFloatingObject_h |
| + |
| +#include "core/layout/ng/ng_block_node.h" |
| +#include "core/layout/ng/ng_constraint_space.h" |
| +#include "core/layout/ng/ng_units.h" |
| +#include "core/style/ComputedStyle.h" |
| +#include "core/style/ComputedStyleConstants.h" |
| +#include "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +class NGPhysicalFragment; |
| + |
| +// Struct that keeps all information needed to position floats in LayoutNG. |
| +struct CORE_EXPORT NGFloatingObject |
|
ikilpatrick
2017/01/20 00:03:17
NGFloatingNode a better name?
(assuming a future
Gleb Lanbin
2017/01/20 00:45:27
I wanted to keep this name to be consistent with l
|
| + : public GarbageCollected<NGFloatingObject> { |
| + NGFloatingObject(NGPhysicalFragment* fragment, |
| + NGConstraintSpace* space, |
| + NGBlockNode* node, |
| + const ComputedStyle& style) |
| + : fragment(fragment), space(space), node(node) { |
| + exclusion_type = NGExclusion::kFloatLeft; |
| + if (style.floating() == EFloat::kRight) |
| + exclusion_type = NGExclusion::kFloatRight; |
| + clear_type = style.clear(); |
| + } |
| + |
| + Member<NGPhysicalFragment> fragment; |
|
ikilpatrick
2017/01/20 00:03:17
Maybe add a note we have to layout after we know t
Gleb Lanbin
2017/01/20 00:45:27
Acknowledged.
|
| + Member<NGConstraintSpace> space; |
|
ikilpatrick
2017/01/20 00:03:17
const NGConstraintSpace
Gleb Lanbin
2017/01/20 00:45:27
Done.
|
| + Member<NGBlockNode> node; |
|
ikilpatrick
2017/01/20 00:03:17
TODO(ikilpatrick): remove this.
Gleb Lanbin
2017/01/20 00:45:27
Done.
|
| + NGExclusion::Type exclusion_type; |
| + EClear clear_type; |
| + |
| + DEFINE_INLINE_TRACE() { |
| + visitor->trace(fragment); |
| + visitor->trace(space); |
| + visitor->trace(node); |
| + } |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // NGFloatingObject_h |