summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-10-01 00:46:04 +0200
committerAndreas Kling <kling@serenityos.org>2022-10-02 21:14:02 +0200
commitd1d99fda326989eb19eba6e940076bc66ccea0bc (patch)
tree85082e6d25036239b35c32740266d9cea620dc70
parent9c44634ca58fc940d0661f8c9427043fa5ff3194 (diff)
downloadserenity-d1d99fda326989eb19eba6e940076bc66ccea0bc.zip
LibWeb: Vertical % margins are relative to containing block width
We were messing this up on absolutely positioned elements by using the containing block height instead.
-rw-r--r--Userland/Libraries/LibWeb/Layout/FormattingContext.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp
index 3db024b717..da545cbb18 100644
--- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp
@@ -749,9 +749,9 @@ void FormattingContext::layout_absolutely_positioned_element(Box const& box, Ava
compute_height_for_absolutely_positioned_element(box, available_space);
box_state.margin_left = box.computed_values().margin().left().resolved(box, width_of_containing_block_as_length).to_px(box);
- box_state.margin_top = box.computed_values().margin().top().resolved(box, height_of_containing_block_as_length).to_px(box);
+ box_state.margin_top = box.computed_values().margin().top().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.margin_right = box.computed_values().margin().right().resolved(box, width_of_containing_block_as_length).to_px(box);
- box_state.margin_bottom = box.computed_values().margin().bottom().resolved(box, height_of_containing_block_as_length).to_px(box);
+ box_state.margin_bottom = box.computed_values().margin().bottom().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.border_left = box.computed_values().border_left().width;
box_state.border_right = box.computed_values().border_right().width;