From ee50a4e060ce782870545ead1c5fc0e712980ec3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 28 Feb 2022 11:35:37 +0100 Subject: [PATCH] LibWeb: Don't blockify or inlinify boxes with already-correct type If something is already a block on the outside, we don't want to overwrite its inside display type. --- Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index 050d0ac08d..3107a03582 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -972,10 +972,12 @@ void StyleComputer::transform_box_type_if_needed(StyleProperties& style, DOM::El case BoxTypeTransformation::None: break; case BoxTypeTransformation::Blockify: - style.set_property(CSS::PropertyID::Display, IdentifierStyleValue::create(CSS::ValueID::Block)); + if (!display.is_block_outside()) + style.set_property(CSS::PropertyID::Display, IdentifierStyleValue::create(CSS::ValueID::Block)); break; case BoxTypeTransformation::Inlinify: - style.set_property(CSS::PropertyID::Display, IdentifierStyleValue::create(CSS::ValueID::Inline)); + if (!display.is_inline_outside()) + style.set_property(CSS::PropertyID::Display, IdentifierStyleValue::create(CSS::ValueID::Inline)); break; } }