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.
This commit is contained in:
Timothy Flynn 2021-05-04 10:14:58 -04:00 committed by Linus Groh
parent 7d40a4a4e7
commit 9a69b9112b

View file

@ -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));
}
}