diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-05-04 10:14:58 -0400 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-04 15:36:07 +0100 |
commit | 9a69b9112bcc1f6a497b6c3506d5a044b45b04b4 (patch) | |
tree | e9951048f3c1645a04b1c22d45b53aae1eba9ea9 /Userland | |
parent | 7d40a4a4e748d270b129ebdf0a9700d6f7fdf3ce (diff) | |
download | serenity-9a69b9112bcc1f6a497b6c3506d5a044b45b04b4.zip |
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.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/FormattingContext.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index 9595141599..e701e0d692 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/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)); } } |