Selaa lähdekoodia

LibWeb: Take already computed height for flex container's auto height

Similar to BlockFormattingContext, FlexFormatting context already
handles height:auto sizing correctly and sets the content_height
correspondingly.
Simon Wanner 3 vuotta sitten
vanhempi
commit
a57bfc2f8c
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. 4 0
      Userland/Libraries/LibWeb/Layout/FormattingContext.cpp

+ 4 - 0
Userland/Libraries/LibWeb/Layout/FormattingContext.cpp

@@ -204,6 +204,10 @@ float FormattingContext::compute_auto_height_for_block_level_element(FormattingS
 
     auto const& box_state = state.get(box);
 
+    auto display = box.computed_values().display();
+    if (display.is_flex_inside())
+        return box_state.content_height;
+
     // https://www.w3.org/TR/CSS22/visudet.html#normal-block
     // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'