Changeset 295030 in webkit


Ignore:
Timestamp:
May 30, 2022 9:44:45 AM (2 years ago)
Author:
Alan Bujtas
Message:

Add support for justify-content: space-around
https://bugs.webkit.org/show_bug.cgi?id=241084

Reviewed by Antti Koivisto.

Distribute items evenly. Items have a half-size space on either end.

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

(WebCore::Layout::FlexFormattingContext::justifyFlexItems):

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

File:
1 edited

Legend:

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

    r295027 r295030  
    475475        case ContentDistribution::SpaceBetween:
    476476            return LayoutUnit { };
     477        case ContentDistribution::SpaceAround:
     478            return (availableSpace - contentLogicalWidth) / logicalFlexItemList.size() / 2;
    477479        default:
    478480            ASSERT_NOT_IMPLEMENTED_YET();
     
    508510                return LayoutUnit { };
    509511            return (availableSpace - contentLogicalWidth) / (logicalFlexItemList.size() - 1);
     512        case ContentDistribution::SpaceAround:
     513            return (availableSpace - contentLogicalWidth) / logicalFlexItemList.size();
    510514        default:
    511515            ASSERT_NOT_IMPLEMENTED_YET();
Note: See TracChangeset for help on using the changeset viewer.