1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-12 02:30:30 +09:00

LibWeb: Flex-items aren't affected by float nor clear

There are a few other things to notice, but they don't seem to be
implemented yet.
This commit is contained in:
Tobias Christiansen 2021-05-29 23:03:05 +02:00 committed by Ali Mohammad Pur
parent 7f81c8fba2
commit 72d5394b8c
Notes: sideshowbarker 2024-07-18 16:50:00 +09:00
2 changed files with 6 additions and 2 deletions

View file

@ -506,9 +506,10 @@ void BlockFormattingContext::place_block_level_non_replaced_element_in_normal_fl
}
};
if (computed_values.clear() == CSS::Clear::Left || computed_values.clear() == CSS::Clear::Both)
// Flex-items don't float and also don't clear.
if ((computed_values.clear() == CSS::Clear::Left || computed_values.clear() == CSS::Clear::Both) && !child_box.is_flex_item())
clear_floating_boxes(m_left_floating_boxes);
if (computed_values.clear() == CSS::Clear::Right || computed_values.clear() == CSS::Clear::Both)
if ((computed_values.clear() == CSS::Clear::Right || computed_values.clear() == CSS::Clear::Both) && !child_box.is_flex_item())
clear_floating_boxes(m_right_floating_boxes);
child_box.set_offset(x, y);

View file

@ -169,6 +169,9 @@ bool Node::is_floating() const
{
if (!has_style())
return false;
// flex-items don't float.
if (is_flex_item())
return false;
return computed_values().float_() != CSS::Float::None;
}