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

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

Issue 2872593003: [LayoutNG] Introduce NGPositionedFloat. (Closed)
Patch Set: address comments. Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_positioned_float.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_positioned_float.h b/third_party/WebKit/Source/core/layout/ng/ng_positioned_float.h
new file mode 100644
index 0000000000000000000000000000000000000000..8443fa0746a60bcad997ae98c663004f8015e4dd
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_positioned_float.h
@@ -0,0 +1,35 @@
+// Copyright 2017 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 NGPositionedFloat_h
+#define NGPositionedFloat_h
+
+#include "core/CoreExport.h"
+#include "core/layout/ng/ng_physical_fragment.h"
+
+namespace blink {
+
+// Contains the information necessary for copying back data to a FloatingObject.
+struct CORE_EXPORT NGPositionedFloat {
+ NGPositionedFloat(RefPtr<NGPhysicalFragment> fragment,
+ NGLogicalOffset offset,
+ LayoutUnit left_offset)
+ : fragment(fragment), offset(offset), left_offset(left_offset) {}
+
+ RefPtr<NGPhysicalFragment> fragment;
+ NGLogicalOffset offset;
+
+ // In the case where a legacy FloatingObject is attached to not its own
+ // parent, e.g. a float surrounded by a bunch of nested empty divs,
+ // NG float fragment's LeftOffset() cannot be used as legacy FloatingObject's
+ // left offset because that offset should be relative to the original float
+ // parent.
+ // {@code left_offset} is calculated when we know to which parent this float
+ // would be attached.
+ LayoutUnit left_offset;
+};
+
+} // namespace blink
+
+#endif // NGPositionedFloat_h
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698