Skip to content

Commit

Permalink
[FFC][Integration] flex-basis: auto retrieves the value of the main s…
Browse files Browse the repository at this point in the history
…ize property as the used flex-basis

https://bugs.webkit.org/show_bug.cgi?id=258747

Reviewed by Antti Koivisto.

* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::convertFlexItemsToLogicalSpace):

Canonical link: https://commits.webkit.org/265693@main
  • Loading branch information
alanbaradlay committed Jul 2, 2023
1 parent c76b4eb commit 6816789
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ FlexLayout::LogicalFlexItems FlexFormattingContext::convertFlexItemsToLogicalSpa
switch (direction) {
case FlexDirection::Row:
case FlexDirection::RowReverse: {
if (!style.flexBasis().isAuto())
if (style.flexBasis().isAuto()) {
// Auto keyword retrieves the value of the main size property as the used flex-basis.
// If that value is itself auto, then the used value is content.
if (!style.width().isAuto())
mainAxis.definiteFlexBasis = valueForLength(style.width(), constraints.horizontal().logicalWidth);
} else if (!style.flexBasis().isContent())
mainAxis.definiteFlexBasis = valueForLength(style.flexBasis(), constraints.horizontal().logicalWidth);
if (style.maxWidth().isSpecified())
mainAxis.maximumSize = valueForLength(style.maxWidth(), constraints.horizontal().logicalWidth);
Expand Down

0 comments on commit 6816789

Please sign in to comment.