LibWeb: Make sure replaced elements never create a BFC

This commit is contained in:
Andreas Kling 2022-10-06 17:29:05 +02:00
commit 5ff1fc4347
Notes: sideshowbarker 2024-07-17 06:14:55 +09:00

View file

@ -33,6 +33,10 @@ FormattingContext::~FormattingContext() = default;
// https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
bool FormattingContext::creates_block_formatting_context(Box const& box)
{
// NOTE: Replaced elements never create a BFC.
if (box.is_replaced_box())
return false;
// NOTE: This function uses MDN as a reference, not because it's authoritative,
// but because they've gathered all the conditions in one convenient location.