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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_length_utils.h

Issue 2243513003: [LayoutNG] Add tests for ng_length_utils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: .. Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 NGLengthUtils_h 5 #ifndef NGLengthUtils_h
6 #define NGLengthUtils_h 6 #define NGLengthUtils_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 9
10 namespace blink { 10 namespace blink {
11 class ComputedStyle; 11 class ComputedStyle;
12 class LayoutUnit; 12 class LayoutUnit;
13 class Length; 13 class Length;
14 class NGConstraintSpace; 14 class NGConstraintSpace;
15 15
16 enum class LengthResolveType { MinSize, MaxSize, ContentSize }; 16 enum class LengthResolveType { MinSize, MaxSize, ContentSize };
17 17
18 // Convert an inline-axis length to a layout unit using the given constraint 18 // Convert an inline-axis length to a layout unit using the given constraint
19 // space. 19 // space.
20 CORE_EXPORT LayoutUnit resolveInlineLength(LengthResolveType, 20 CORE_EXPORT LayoutUnit resolveInlineLength(const NGConstraintSpace&,
21 const Length&, 21 const Length&,
22 const NGConstraintSpace&); 22 LengthResolveType);
23 23
24 // Convert a block-axis length to a layout unit using the given constraint 24 // Convert a block-axis length to a layout unit using the given constraint
25 // space. 25 // space and content size.
26 CORE_EXPORT LayoutUnit resolveBlockLength(LengthResolveType, 26 CORE_EXPORT LayoutUnit resolveBlockLength(const NGConstraintSpace&,
27 const Length&, 27 const Length&,
28 const NGConstraintSpace&, 28 LayoutUnit contentSize,
29 LayoutUnit contentContribution); 29 LengthResolveType);
30 30
31 // Resolves the given length to a layout unit, constraining it by the min 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 32 // logical width and max logical width properties from the ComputedStyle
33 // object. 33 // object.
34 CORE_EXPORT LayoutUnit computeInlineSizeForFragment(const NGConstraintSpace&, 34 CORE_EXPORT LayoutUnit computeInlineSizeForFragment(const NGConstraintSpace&,
35 const ComputedStyle&); 35 const ComputedStyle&);
36 36
37 // Resolves the given length to a layout unit, constraining it by the min 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 38 // logical height and max logical height properties from the ComputedStyle
39 // object. 39 // object.
40 CORE_EXPORT LayoutUnit 40 CORE_EXPORT LayoutUnit computeBlockSizeForFragment(const NGConstraintSpace&,
41 computeBlockSizeForFragment(const NGConstraintSpace&, 41 const ComputedStyle& style,
42 const ComputedStyle& style, 42 LayoutUnit contentSize);
43 LayoutUnit contentContribution);
44 43
45 } // namespace blink 44 } // namespace blink
46 45
47 #endif // NGLengthUtils_h 46 #endif // NGLengthUtils_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698