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

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

Issue 2721613003: [LayoutNG] Move remaining ng_units structs to their own files (Closed)
Patch Set: Don't export NGBoxStrut for now Created 3 years, 10 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.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc
index 9aa9f6b24d6f90f5802fcc6a862bf64be2f0cecf..bd17074260193efcf274904d86b04874098bd205 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc
@@ -17,8 +17,8 @@ namespace blink {
// - replaced calculations
// - Take scrollbars into account
-bool NeedMinAndMaxContentSizes(const NGConstraintSpace& constraint_space,
- const ComputedStyle& style) {
+bool NeedMinMaxContentSize(const NGConstraintSpace& constraint_space,
+ const ComputedStyle& style) {
// This check is technically too broad (fill-available does not need intrinsic
// size computation) but that's a rare case and only affects performance, not
// correctness.
@@ -28,8 +28,7 @@ bool NeedMinAndMaxContentSizes(const NGConstraintSpace& constraint_space,
style.logicalMaxWidth().isIntrinsic();
}
-bool NeedMinAndMaxContentSizesForContentContribution(
- const ComputedStyle& style) {
+bool NeedMinMaxContentSizeForContentContribution(const ComputedStyle& style) {
return style.logicalWidth().isIntrinsicOrAuto() ||
style.logicalMinWidth().isIntrinsic() ||
style.logicalMaxWidth().isIntrinsic();
@@ -38,7 +37,7 @@ bool NeedMinAndMaxContentSizesForContentContribution(
LayoutUnit ResolveInlineLength(
const NGConstraintSpace& constraint_space,
const ComputedStyle& style,
- const WTF::Optional<MinAndMaxContentSizes>& min_and_max,
+ const WTF::Optional<MinMaxContentSize>& min_and_max,
const Length& length,
LengthResolveType type) {
DCHECK(!length.isMaxSizeNone());
@@ -183,9 +182,9 @@ LayoutUnit ResolveBlockLength(const NGConstraintSpace& constraint_space,
}
}
-MinAndMaxContentSizes ComputeMinAndMaxContentContribution(
+MinMaxContentSize ComputeMinAndMaxContentContribution(
const ComputedStyle& style,
- const WTF::Optional<MinAndMaxContentSizes>& min_and_max) {
+ const WTF::Optional<MinMaxContentSize>& min_and_max) {
// Synthesize a zero-sized constraint space for passing to
// ResolveInlineLength.
NGWritingMode writing_mode = FromPlatformWritingMode(style.getWritingMode());
@@ -194,7 +193,7 @@ MinAndMaxContentSizes ComputeMinAndMaxContentContribution(
NGPhysicalSize{LayoutUnit(), LayoutUnit()});
NGConstraintSpace* space = builder.ToConstraintSpace(writing_mode);
- MinAndMaxContentSizes computed_sizes;
+ MinMaxContentSize computed_sizes;
Length inline_size = style.logicalWidth();
if (inline_size.isAuto()) {
CHECK(min_and_max.has_value());
@@ -234,7 +233,7 @@ MinAndMaxContentSizes ComputeMinAndMaxContentContribution(
LayoutUnit ComputeInlineSizeForFragment(
const NGConstraintSpace& space,
const ComputedStyle& style,
- const WTF::Optional<MinAndMaxContentSizes>& min_and_max) {
+ const WTF::Optional<MinMaxContentSize>& min_and_max) {
if (space.IsFixedSizeInline())
return space.AvailableSize().inline_size;
@@ -335,7 +334,7 @@ NGBoxStrut ComputeMargins(const NGConstraintSpace& constraint_space,
const NGWritingMode writing_mode,
const TextDirection direction) {
// We don't need these for margin computations
- MinAndMaxContentSizes empty_sizes;
+ MinMaxContentSize empty_sizes;
// Margins always get computed relative to the inline size:
// https://www.w3.org/TR/CSS2/box.html#value-def-margin-width
NGPhysicalBoxStrut physical_dim;
@@ -377,7 +376,7 @@ NGBoxStrut ComputePadding(const NGConstraintSpace& constraint_space,
return NGBoxStrut();
// We don't need these for padding computations
- MinAndMaxContentSizes empty_sizes;
+ MinMaxContentSize empty_sizes;
// Padding always gets computed relative to the inline size:
// https://www.w3.org/TR/CSS2/box.html#value-def-padding-width
NGBoxStrut padding;

Powered by Google App Engine
This is Rietveld 408576698