| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NGPositionedFloat_h | 5 #ifndef NGPositionedFloat_h |
| 6 #define NGPositionedFloat_h | 6 #define NGPositionedFloat_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/ng/ng_physical_fragment.h" | 9 #include "core/layout/ng/ng_physical_fragment.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 // Contains the information necessary for copying back data to a FloatingObject. | 13 // Contains the information necessary for copying back data to a FloatingObject. |
| 14 struct CORE_EXPORT NGPositionedFloat { | 14 struct CORE_EXPORT NGPositionedFloat { |
| 15 NGPositionedFloat(RefPtr<NGPhysicalFragment> fragment, | 15 NGPositionedFloat(RefPtr<NGPhysicalFragment> fragment, |
| 16 NGLogicalOffset offset, | 16 const NGLogicalOffset& logical_offset, |
| 17 LayoutUnit left_offset) | 17 const NGPhysicalOffset& paint_offset) |
| 18 : fragment(fragment), offset(offset), left_offset(left_offset) {} | 18 : fragment(fragment), |
| 19 logical_offset(logical_offset), |
| 20 paint_offset(paint_offset) {} |
| 19 | 21 |
| 20 RefPtr<NGPhysicalFragment> fragment; | 22 RefPtr<NGPhysicalFragment> fragment; |
| 21 NGLogicalOffset offset; | 23 NGLogicalOffset logical_offset; |
| 22 | 24 |
| 23 // In the case where a legacy FloatingObject is attached to not its own | 25 // In the case where a legacy FloatingObject is attached to not its own |
| 24 // parent, e.g. a float surrounded by a bunch of nested empty divs, | 26 // parent, e.g. a float surrounded by a bunch of nested empty divs, |
| 25 // NG float fragment's LeftOffset() cannot be used as legacy FloatingObject's | 27 // NG float fragment's LeftOffset() cannot be used as legacy FloatingObject's |
| 26 // left offset because that offset should be relative to the original float | 28 // left offset because that offset should be relative to the original float |
| 27 // parent. | 29 // parent. |
| 28 // {@code left_offset} is calculated when we know to which parent this float | 30 // {@code paint_offset} is calculated when we know to which parent this float |
| 29 // would be attached. | 31 // would be attached. |
| 30 LayoutUnit left_offset; | 32 NGPhysicalOffset paint_offset; |
| 31 }; | 33 }; |
| 32 | 34 |
| 33 } // namespace blink | 35 } // namespace blink |
| 34 | 36 |
| 35 #endif // NGPositionedFloat_h | 37 #endif // NGPositionedFloat_h |
| OLD | NEW |