summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-10-06 17:29:05 +0200
committerAndreas Kling <kling@serenityos.org>2022-10-06 18:29:52 +0200
commit5ff1fc4347ca953607b5882d14b802c5d10505fa (patch)
tree17c0ea4419e4b4eee3250a8c7b6f1c1fce402101 /Userland/Libraries/LibWeb
parent829ba4afb9d318e7b4bc9701cbe7c2df47e57df4 (diff)
downloadserenity-5ff1fc4347ca953607b5882d14b802c5d10505fa.zip
LibWeb: Make sure replaced elements never create a BFC
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/Layout/FormattingContext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp
index 6d7c3c5f3b..3404897537 100644
--- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp
@@ -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.