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

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.
This commit is contained in:
Andreas Kling 2022-02-28 11:35:37 +01:00
parent c9ab9e2c64
commit ee50a4e060

View file

@ -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;
}
}