mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
LibWeb: Account for containing block padding when placing abspos boxes
Unlike the other positioning schemes, absolute positioning is relative to the *padding* edge of the containing block.
This commit is contained in:
parent
d27136fcb0
commit
35a9a2fbb2
Notes:
sideshowbarker
2024-07-17 07:10:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/35a9a2fbb2
|
@ -802,6 +802,9 @@ void FormattingContext::layout_absolutely_positioned_element(Box const& box)
|
|||
used_offset.set_y(y_offset);
|
||||
}
|
||||
|
||||
// NOTE: Absolutely positioned boxes are relative to the *padding edge* of the containing block.
|
||||
used_offset.translate_by(-containing_block_state.padding_left, -containing_block_state.padding_top);
|
||||
|
||||
box_state.offset = used_offset;
|
||||
|
||||
if (independent_formatting_context)
|
||||
|
|
Loading…
Reference in a new issue