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

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

Issue 2583063004: [layoutng] Add a function to compute the min- and max-content contribution (Closed)
Patch Set: include margins Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_length_utils.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h
index 6d5eb70227e7762e0341bf10659fbe31b3faae52..9e67b620f09f9607457d2873379ce274d4a1daee 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h
@@ -35,6 +35,11 @@ enum class LengthResolveType {
// MinAndMaxContentSizes struct to those functions.
CORE_EXPORT bool NeedMinAndMaxContentSizes(const ComputedStyle&);
+// Like NeedMinAndMaxContentSizes, but for use when calling
+// ComputeMinAndMaxContentContribution.
+CORE_EXPORT bool NeedMinAndMaxContentSizesForContentContribution(
+ const ComputedStyle&);
+
// Convert an inline-axis length to a layout unit using the given constraint
// space.
CORE_EXPORT LayoutUnit
@@ -52,6 +57,17 @@ CORE_EXPORT LayoutUnit ResolveBlockLength(const NGConstraintSpace&,
LayoutUnit content_size,
LengthResolveType);
+// For the given style and min/max content sizes, computes the min and max
+// content contribution (https://drafts.csswg.org/css-sizing/#contributions).
+// This is similar to ComputeInlineSizeForFragment except that it does not
+// require a constraint space (percentage sizes as well as auto margins compute
+// to zero) and that an auto inline size resolves to the respective min/max
+// content size.
+// Also, the min/max contribution does include the inline margins as well.
+CORE_EXPORT MinAndMaxContentSizes ComputeMinAndMaxContentContribution(
+ const ComputedStyle&,
+ const WTF::Optional<MinAndMaxContentSizes>&);
+
// Resolves the given length to a layout unit, constraining it by the min
// logical width and max logical width properties from the ComputedStyle
// object.
« no previous file with comments | « no previous file | 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