Browse Source

LibWeb: Make flex-box ignore out-of-flow child boxes

Previously, out-of-flow children still took up space inside a flex-box
container, leaving an odd gap. Now they don't! :^)
Sam Atkins 3 years ago
parent
commit
ee671a20cc
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp

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

@@ -238,6 +238,10 @@ void FlexFormattingContext::run(Box& box, LayoutMode)
                 return IterationDecision::Continue;
                 return IterationDecision::Continue;
         }
         }
 
 
+        // Skip any "out-of-flow" children
+        if (child_box.is_out_of_flow(*this))
+            return IterationDecision::Continue;
+
         child_box.set_flex_item(true);
         child_box.set_flex_item(true);
         flex_items.append({ child_box });
         flex_items.append({ child_box });
         return IterationDecision::Continue;
         return IterationDecision::Continue;