mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 17:52:26 -05:00
LibWeb: Consider floating children when computing auto-height
The case for computing auto-height of block elements which have block- level children was erroneously skipping some children: 1. If the block element itself is absolute or floating, all children were skipped due to a likely typo ("box" vs. "child_box" inside the for-each loop). 2. Floating children should only be skipped if the block element's 'overflow' property computes to 'visible', per section 10.6.3 of the CSS height property spec. If the property computes to another value, section 10.6.7 only indicates that absolutely positioned children should be skipped.
This commit is contained in:
parent
f018100d21
commit
03990fcb89
Notes:
sideshowbarker
2024-07-18 21:04:07 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/03990fcb89d Pull-request: https://github.com/SerenityOS/serenity/pull/5965
1 changed files with 3 additions and 1 deletions
|
@ -290,7 +290,9 @@ float BlockFormattingContext::compute_auto_height_for_block_level_element(const
|
|||
// the top margin-edge of the topmost block-level child box
|
||||
// and the bottom margin-edge of the bottommost block-level child box.
|
||||
box.for_each_child_of_type<Box>([&](Layout::Box& child_box) {
|
||||
if (box.is_absolutely_positioned() || box.is_floating())
|
||||
if (child_box.is_absolutely_positioned())
|
||||
return IterationDecision::Continue;
|
||||
if ((box.computed_values().overflow_y() == CSS::Overflow::Visible) && child_box.is_floating())
|
||||
return IterationDecision::Continue;
|
||||
|
||||
float child_box_top = child_box.effective_offset().y() - child_box.box_model().margin_box().top;
|
||||
|
|
Loading…
Add table
Reference in a new issue