소스 검색

LibWeb: Don't include abspos children in containing block's auto width

Andreas Kling 2 년 전
부모
커밋
fb5879fdcc
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 2
      Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
  2. 3 2
      Userland/Libraries/LibWeb/Layout/FormattingContext.cpp

+ 3 - 2
Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp

@@ -807,8 +807,9 @@ float BlockFormattingContext::greatest_child_width(Box const& box)
             max_width = max(max_width, width_here);
         }
     } else {
-        box.for_each_child_of_type<Box>([&](auto& child) {
-            max_width = max(max_width, m_state.get(child).border_box_width());
+        box.for_each_child_of_type<Box>([&](Box const& child) {
+            if (!child.is_absolutely_positioned())
+                max_width = max(max_width, m_state.get(child).border_box_width());
         });
     }
     return max_width;

+ 3 - 2
Userland/Libraries/LibWeb/Layout/FormattingContext.cpp

@@ -189,8 +189,9 @@ float FormattingContext::greatest_child_width(Box const& box)
             max_width = max(max_width, line_box.width());
         }
     } else {
-        box.for_each_child_of_type<Box>([&](auto& child) {
-            max_width = max(max_width, m_state.get(child).border_box_width());
+        box.for_each_child_of_type<Box>([&](Box const& child) {
+            if (!child.is_absolutely_positioned())
+                max_width = max(max_width, m_state.get(child).border_box_width());
         });
     }
     return max_width;