Title: [295277] trunk/Source/WebCore/layout/formattingContexts/flex/FlexLayout.cpp
Revision
295277
Author
za...@apple.com
Date
2022-06-05 22:20:11 -0700 (Sun, 05 Jun 2022)

Log Message

Take align-self into account when computing flex item's logical height.
https://bugs.webkit.org/show_bug.cgi?id=241314

Reviewed by Antti Koivisto.

* Source/WebCore/layout/formattingContexts/flex/FlexLayout.cpp:
(WebCore::Layout::FlexLayout::computeLogicalHeightForFlexItems):

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/layout/formattingContexts/flex/FlexLayout.cpp (295276 => 295277)


--- trunk/Source/WebCore/layout/formattingContexts/flex/FlexLayout.cpp	2022-06-06 03:51:24 UTC (rev 295276)
+++ trunk/Source/WebCore/layout/formattingContexts/flex/FlexLayout.cpp	2022-06-06 05:20:11 UTC (rev 295277)
@@ -262,7 +262,7 @@
 
 void FlexLayout::computeLogicalHeightForFlexItems(LogicalFlexItems& flexItems, const LineRange& lineRange, LayoutUnit availableSpace)
 {
-    auto alignItems = flexBoxStyle().alignItems();
+    auto flexBoxAlignItems = flexBoxStyle().alignItems();
     auto lineHeight = LayoutUnit { };
 
     for (size_t index = lineRange.begin(); index < lineRange.end(); ++index) {
@@ -269,7 +269,9 @@
         auto& flexItem = flexItems[index];
         if (!flexItem.isHeightAuto())
             continue;
-        switch (alignItems.position()) {
+        auto& flexItemAlignSelf = flexItem.style().alignSelf();
+        auto alignValue = flexItemAlignSelf.position() != ItemPosition::Auto ? flexItemAlignSelf : flexBoxAlignItems;
+        switch (alignValue.position()) {
         case ItemPosition::Normal:
         case ItemPosition::Stretch:
             flexItem.setHeight(availableSpace);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to