Sfoglia il codice sorgente

LibWeb: CSS display:position does not imply definite size

Per css-sizing-3:

    Additionally, the size of the containing block of an absolutely
    positioned element is always definite with respect to that element.

As I understand this, it doesn't mean that all absolutely positioned
boxes have definite size, but that the containing block of an absolutely
positioned descendant has definite size from the perspective of the
descendant.
Andreas Kling 3 anni fa
parent
commit
439721f38c
1 ha cambiato i file con 1 aggiunte e 6 eliminazioni
  1. 1 6
      Userland/Libraries/LibWeb/Layout/Node.cpp

+ 1 - 6
Userland/Libraries/LibWeb/Layout/Node.cpp

@@ -276,13 +276,8 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& specified_style)
         computed_values.set_align_items(align_items.value());
 
     auto position = specified_style.position();
-    if (position.has_value()) {
+    if (position.has_value())
         computed_values.set_position(position.value());
-        if (position.value() == CSS::Position::Absolute) {
-            m_has_definite_width = true;
-            m_has_definite_height = true;
-        }
-    }
 
     auto text_align = specified_style.text_align();
     if (text_align.has_value())