Przeglądaj źródła

LibWeb: Compute intrinsic height of absolute replaced elements

Previously, the method for computing the height of absolutely positioned
replaced elements only invoked the method for non-replaced elements.
That method is now implemented fully enough that it sometimes computed a
height of 0 for replaced elements. This implements section 10.6.5 rule 1
of the CSS spec to avoid that behavior.
Timothy Flynn 4 lat temu
rodzic
commit
9a69b9112b

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

@@ -619,8 +619,9 @@ void FormattingContext::layout_absolutely_positioned_element(Box& box)
 
 void FormattingContext::compute_height_for_absolutely_positioned_replaced_element(ReplacedBox& box)
 {
-    // FIXME: Implement this.
-    return compute_height_for_absolutely_positioned_non_replaced_element(box);
+    // 10.6.5 Absolutely positioned, replaced elements
+    // The used value of 'height' is determined as for inline replaced elements.
+    box.set_height(compute_height_for_replaced_element(box));
 }
 
 }