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

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

Issue 2237473003: [layoutng] Add helper functions to compute lengths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format 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 side-by-side diff with in-line comments
Download patch
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
new file mode 100644
index 0000000000000000000000000000000000000000..c5956db2ae1db8b6b73c30ac5f8de5e9bbd14dbc
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h
@@ -0,0 +1,47 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NGLengthUtils_h
+#define NGLengthUtils_h
+
+#include "core/CoreExport.h"
+
+namespace blink {
+class ComputedStyle;
+class LayoutUnit;
+class Length;
+class NGConstraintSpace;
+
+enum class LengthResolveType { MinSize, MaxSize, ContentSize };
+
+// Convert an inline-axis length to a layout unit using the given constraint
+// space.
+CORE_EXPORT LayoutUnit resolveInlineLength(LengthResolveType,
+ const Length&,
+ const NGConstraintSpace&);
+
+// Convert a block-axis length to a layout unit using the given constraint
+// space.
+CORE_EXPORT LayoutUnit resolveBlockLength(LengthResolveType,
+ const Length&,
+ const NGConstraintSpace&,
+ LayoutUnit contentContribution);
+
+// Resolves the given length to a layout unit, constraining it by the min
+// logical width and max logical width properties from the ComputedStyle
+// object.
+CORE_EXPORT LayoutUnit computeInlineSizeForFragment(const NGConstraintSpace&,
+ const ComputedStyle&);
+
+// Resolves the given length to a layout unit, constraining it by the min
+// logical height and max logical height properties from the ComputedStyle
+// object.
+CORE_EXPORT LayoutUnit
+computeBlockSizeForFragment(const NGConstraintSpace&,
+ const ComputedStyle& style,
+ LayoutUnit contentContribution);
+
+} // namespace blink
+
+#endif // NGLengthUtils_h

Powered by Google App Engine
This is Rietveld 408576698