Changeset 294996 in webkit


Ignore:
Timestamp:
May 28, 2022 6:21:48 AM (2 years ago)
Author:
Alan Bujtas
Message:

Use flex-basis when shrinking flex items
https://bugs.webkit.org/show_bug.cgi?id=241046

Reviewed by Antti Koivisto.

  • Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:

(WebCore::Layout::FlexFormattingContext::computeLogicalWidthForShrinkingFlexItems):

Canonical link: https://commits.webkit.org/251096@main

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp

    r294995 r294996  
    227227        for (size_t index = 0; index < logicalFlexItemList.size(); ++index) {
    228228            auto& flexItem = logicalFlexItemList[index];
    229             auto baseSize = flexItem.rect.width();
    230             if (auto shrinkValue = flexItem.layoutBox->style().flexShrink()) {
     229            auto& style = flexItem.layoutBox->style();
     230            auto baseSize = style.flexBasis().isFixed() ? LayoutUnit { style.flexBasis().value() } : flexItem.rect.width();
     231            if (auto shrinkValue = style.flexShrink()) {
    231232                auto flexShrink = shrinkValue * baseSize;
    232233                shrinkingItems.append({ flexShrink, formattingState.intrinsicWidthConstraintsForBox(*flexItem.layoutBox)->minimum, baseSize, flexItem, { } });
Note: See TracChangeset for help on using the changeset viewer.