1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

LibWeb: Make sure replaced elements never create a BFC

This commit is contained in:
Andreas Kling 2022-10-06 17:29:05 +02:00
parent 829ba4afb9
commit 5ff1fc4347

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.