소스 검색

LibWeb: Generate a BlockContainer box for display:inline-flex

We were previously generating an InlineNode, which is not a Box. We need
some type of Box to do flex layout, so let's just make a BlockContainer.
Andreas Kling 2 년 전
부모
커밋
c7d592dd01
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      Userland/Libraries/LibWeb/DOM/Element.cpp

+ 2 - 1
Userland/Libraries/LibWeb/DOM/Element.cpp

@@ -308,7 +308,8 @@ RefPtr<Layout::Node> Element::create_layout_node_for_display_type(DOM::Document&
             return adopt_ref(*new Layout::BlockContainer(document, element, move(style)));
         if (display.is_flow_inside())
             return adopt_ref(*new Layout::InlineNode(document, element, move(style)));
-
+        if (display.is_flex_inside())
+            return adopt_ref(*new Layout::BlockContainer(document, element, move(style)));
         dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Support display: {}", display.to_string());
         return adopt_ref(*new Layout::InlineNode(document, element, move(style)));
     }