mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 09:18:52 +00:00
LibWeb: Layout absolutely positioned children *after* computing height
This is required for CSS "bottom" to work correctly on absolutely positioned elements.
This commit is contained in:
parent
8b9f2c41fa
commit
d1479aef56
Notes:
sideshowbarker
2024-07-19 00:53:07 +09:00
Author: https://github.com/awesomekling
Commit: d1479aef56
1 changed files with 10 additions and 4 deletions
|
@ -71,8 +71,16 @@ void BlockFormattingContext::run(Box& box, LayoutMode layout_mode)
|
|||
layout_block_level_children(box, layout_mode);
|
||||
}
|
||||
|
||||
if (layout_mode == LayoutMode::Default)
|
||||
if (layout_mode == LayoutMode::Default) {
|
||||
compute_height(box);
|
||||
|
||||
box.for_each_child_of_type<Box>([&](auto& child_box) {
|
||||
if (child_box.is_absolutely_positioned()) {
|
||||
layout_absolutely_positioned_child(child_box);
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void BlockFormattingContext::compute_width(Box& box)
|
||||
|
@ -451,10 +459,8 @@ void BlockFormattingContext::layout_block_level_children(Box& box, LayoutMode la
|
|||
float content_width = 0;
|
||||
|
||||
box.for_each_child_of_type<Box>([&](auto& child_box) {
|
||||
if (child_box.is_absolutely_positioned()) {
|
||||
layout_absolutely_positioned_child(child_box);
|
||||
if (child_box.is_absolutely_positioned())
|
||||
return IterationDecision::Continue;
|
||||
}
|
||||
|
||||
if (child_box.is_floating()) {
|
||||
layout_floating_child(child_box, box);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue