Title: [295030] trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp
Revision
295030
Author
za...@apple.com
Date
2022-05-30 09:44:45 -0700 (Mon, 30 May 2022)

Log 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

Modified Paths

Diff

Modified: trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp (295029 => 295030)


--- trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp	2022-05-30 15:20:07 UTC (rev 295029)
+++ trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp	2022-05-30 16:44:45 UTC (rev 295030)
@@ -474,6 +474,8 @@
             break;
         case ContentDistribution::SpaceBetween:
             return LayoutUnit { };
+        case ContentDistribution::SpaceAround:
+            return (availableSpace - contentLogicalWidth) / logicalFlexItemList.size() / 2; 
         default:
             ASSERT_NOT_IMPLEMENTED_YET();
             break;
@@ -507,6 +509,8 @@
             if (logicalFlexItemList.size() == 1)
                 return LayoutUnit { };
             return (availableSpace - contentLogicalWidth) / (logicalFlexItemList.size() - 1); 
+        case ContentDistribution::SpaceAround:
+            return (availableSpace - contentLogicalWidth) / logicalFlexItemList.size(); 
         default:
             ASSERT_NOT_IMPLEMENTED_YET();
             break;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to