OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NGLengthUtils_h |
| 6 #define NGLengthUtils_h |
| 7 |
| 8 #include "core/CoreExport.h" |
| 9 |
| 10 namespace blink { |
| 11 class ComputedStyle; |
| 12 class LayoutUnit; |
| 13 class Length; |
| 14 class NGConstraintSpace; |
| 15 |
| 16 enum class LengthResolveType { MinSize, MaxSize, ContentSize }; |
| 17 |
| 18 // Convert an inline-axis length to a layout unit using the given constraint |
| 19 // space. |
| 20 CORE_EXPORT LayoutUnit resolveInlineLength(LengthResolveType, |
| 21 const Length&, |
| 22 const NGConstraintSpace&); |
| 23 |
| 24 // Convert a block-axis length to a layout unit using the given constraint |
| 25 // space. |
| 26 CORE_EXPORT LayoutUnit resolveBlockLength(LengthResolveType, |
| 27 const Length&, |
| 28 const NGConstraintSpace&, |
| 29 LayoutUnit contentContribution); |
| 30 |
| 31 // Resolves the given length to a layout unit, constraining it by the min |
| 32 // logical width and max logical width properties from the ComputedStyle |
| 33 // object. |
| 34 CORE_EXPORT LayoutUnit computeInlineSizeForFragment(const NGConstraintSpace&, |
| 35 const ComputedStyle&); |
| 36 |
| 37 // Resolves the given length to a layout unit, constraining it by the min |
| 38 // logical height and max logical height properties from the ComputedStyle |
| 39 // object. |
| 40 CORE_EXPORT LayoutUnit |
| 41 computeBlockSizeForFragment(const NGConstraintSpace&, |
| 42 const ComputedStyle& style, |
| 43 LayoutUnit contentContribution); |
| 44 |
| 45 } // namespace blink |
| 46 |
| 47 #endif // NGLengthUtils_h |
OLD | NEW |