Преглед изворни кода

LibWeb: Flexbox: Take parents' specified main size into account

Previously, if the parent of the container had a definite main size, it
would've been disregarded when calculating the main size of the
container if it had no definite size and neither min- nor max-main-size
constraints.
This patch fixes that behavior by additionally checking whether the main
size is not only not constrained but also infinite.
Tobias Christiansen пре 3 година
родитељ
комит
9af85881f5
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp

+ 1 - 1
Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp

@@ -410,7 +410,7 @@ void FlexFormattingContext::run(Box& box, LayoutMode)
     }
 
     // 4. Determine the main size of the flex container
-    if (!main_is_constrained || main_available_size == 0) {
+    if ((!main_is_constrained && main_size_is_infinite) || main_available_size == 0) {
         // Uses https://www.w3.org/TR/css-flexbox-1/#intrinsic-main-sizes
         // 9.9.1
         // 1.