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

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

Issue 2642823008: Introduce NGFloatingObject (Closed)
Patch Set: Update TestExpectations 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_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..c32a93152c63648b99036ce25c3981c33d749875
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_floating_object.h
@@ -0,0 +1,50 @@
+// 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
+ : public GarbageCollected<NGFloatingObject> {
+ NGFloatingObject(NGPhysicalFragment* fragment,
+ const NGConstraintSpace* space,
+ NGBlockNode* node,
+ const ComputedStyle& style,
+ const NGBoxStrut& margins)
+ : fragment(fragment), space(space), node(node), margins(margins) {
+ exclusion_type = NGExclusion::kFloatLeft;
+ if (style.floating() == EFloat::kRight)
+ exclusion_type = NGExclusion::kFloatRight;
+ clear_type = style.clear();
+ }
+
+ Member<NGPhysicalFragment> fragment;
+ Member<const NGConstraintSpace> space;
+ Member<NGBlockNode> node;
+ NGExclusion::Type exclusion_type;
+ EClear clear_type;
+ NGBoxStrut margins;
+
+ DEFINE_INLINE_TRACE() {
+ visitor->trace(fragment);
+ visitor->trace(space);
+ visitor->trace(node);
+ }
+};
+
+} // namespace blink
+
+#endif // NGFloatingObject_h

Powered by Google App Engine
This is Rietveld 408576698