| 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 NGFloatsUtils_h | 5 #ifndef NGFloatsUtils_h |
| 6 #define NGFloatsUtils_h | 6 #define NGFloatsUtils_h |
| 7 | 7 |
| 8 #include "core/layout/ng/geometry/ng_logical_offset.h" | 8 #include "core/layout/ng/geometry/ng_logical_offset.h" |
| 9 #include "core/layout/ng/ng_constraint_space.h" | 9 #include "core/layout/ng/ng_constraint_space.h" |
| 10 #include "core/layout/ng/ng_fragment_builder.h" | 10 #include "core/layout/ng/ng_fragment_builder.h" |
| 11 #include "core/layout/ng/ng_positioned_float.h" | 11 #include "core/layout/ng/ng_positioned_float.h" |
| 12 #include "core/layout/ng/ng_unpositioned_float.h" | 12 #include "core/layout/ng/ng_unpositioned_float.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 // Returns the inline size (relative to {@code parent_space}) of the | 16 // Returns the inline size (relative to {@code parent_space}) of the |
| 17 // unpositioned float. If the float is in a different writing mode, this will | 17 // unpositioned float. If the float is in a different writing mode, this will |
| 18 // perform a layout. | 18 // perform a layout. |
| 19 CORE_EXPORT LayoutUnit | 19 CORE_EXPORT LayoutUnit |
| 20 ComputeInlineSizeForUnpositionedFloat(NGConstraintSpace* parent_space, | 20 ComputeInlineSizeForUnpositionedFloat(NGConstraintSpace* parent_space, |
| 21 NGUnpositionedFloat* unpositioned_float); | 21 NGUnpositionedFloat* unpositioned_float); |
| 22 | 22 |
| 23 // Positions {@code unpositioned_float} into {@code new_parent_space}. | 23 // Positions {@code unpositioned_float} into {@code new_parent_space}. |
| 24 // @returns A positioned float. | 24 // @returns A positioned float. |
| 25 CORE_EXPORT NGPositionedFloat | 25 CORE_EXPORT NGPositionedFloat |
| 26 PositionFloat(NGUnpositionedFloat*, NGConstraintSpace* new_parent_space); | 26 PositionFloat(LayoutUnit origin_block_offset, |
| 27 LayoutUnit parent_bfc_block_offset, |
| 28 NGUnpositionedFloat*, |
| 29 NGConstraintSpace* new_parent_space); |
| 27 | 30 |
| 28 // Positions the list of {@code unpositioned_floats}. Adds them as exclusions to | 31 // Positions the list of {@code unpositioned_floats}. Adds them as exclusions to |
| 29 // {@code space}. | 32 // {@code space}. |
| 30 CORE_EXPORT const Vector<NGPositionedFloat> PositionFloats( | 33 CORE_EXPORT const Vector<NGPositionedFloat> PositionFloats( |
| 31 LayoutUnit origin_block_offset, | 34 LayoutUnit origin_block_offset, |
| 32 LayoutUnit from_block_offset, | |
| 33 LayoutUnit container_block_offset, | 35 LayoutUnit container_block_offset, |
| 34 const Vector<RefPtr<NGUnpositionedFloat>>& unpositioned_floats, | 36 const Vector<RefPtr<NGUnpositionedFloat>>& unpositioned_floats, |
| 35 NGConstraintSpace* space); | 37 NGConstraintSpace* space); |
| 36 | 38 |
| 37 } // namespace blink | 39 } // namespace blink |
| 38 | 40 |
| 39 #endif // NGFloatsUtils_h | 41 #endif // NGFloatsUtils_h |
| OLD | NEW |