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

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

Issue 2274593002: [layoutng] Correctly resolve indefinite percentages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NGSizeIndefinite Created 4 years, 3 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 struct NGBoxMargins; 15 struct NGBoxMargins;
16 16
17 enum class LengthResolveType { MinSize, MaxSize, ContentSize, MarginSize }; 17 enum class LengthResolveType { MinSize, MaxSize, ContentSize, MarginSize };
18 18
19 #define NGSizeIndefinite LayoutUnit(-1)
20
19 // Convert an inline-axis length to a layout unit using the given constraint 21 // Convert an inline-axis length to a layout unit using the given constraint
20 // space. 22 // space.
21 CORE_EXPORT LayoutUnit resolveInlineLength(const NGConstraintSpace&, 23 CORE_EXPORT LayoutUnit resolveInlineLength(const NGConstraintSpace&,
22 const Length&, 24 const Length&,
23 LengthResolveType); 25 LengthResolveType);
24 26
25 // Convert a block-axis length to a layout unit using the given constraint 27 // Convert a block-axis length to a layout unit using the given constraint
26 // space and content size. 28 // space and content size.
27 CORE_EXPORT LayoutUnit resolveBlockLength(const NGConstraintSpace&, 29 CORE_EXPORT LayoutUnit resolveBlockLength(const NGConstraintSpace&,
28 const Length&, 30 const Length&,
(...skipping 12 matching lines...) Expand all
41 CORE_EXPORT LayoutUnit computeBlockSizeForFragment(const NGConstraintSpace&, 43 CORE_EXPORT LayoutUnit computeBlockSizeForFragment(const NGConstraintSpace&,
42 const ComputedStyle&, 44 const ComputedStyle&,
43 LayoutUnit contentSize); 45 LayoutUnit contentSize);
44 46
45 CORE_EXPORT NGBoxMargins computeMargins(const NGConstraintSpace&, 47 CORE_EXPORT NGBoxMargins computeMargins(const NGConstraintSpace&,
46 const ComputedStyle&); 48 const ComputedStyle&);
47 49
48 } // namespace blink 50 } // namespace blink
49 51
50 #endif // NGLengthUtils_h 52 #endif // NGLengthUtils_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698