mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-23 01:39:55 +00:00
LibWeb: Compute display: contents as none for unusual elements
https://drafts.csswg.org/css-display-3/#unbox-html specifies certain elements that have their `display` style computed as `none` when specified as `contents`. This fixes at least one WPT test: http://wpt.live/css/css-display/display-contents-suppression-dynamic-001.html
This commit is contained in:
committed by
Andreas Kling
parent
eef9a53eec
commit
3b1d1d4582
@@ -135,6 +135,10 @@ void HTMLInputElement::adjust_computed_style(CSS::StyleProperties& style)
|
||||
if (type_state() == TypeAttributeState::Hidden || type_state() == TypeAttributeState::SubmitButton || type_state() == TypeAttributeState::Button || type_state() == TypeAttributeState::ResetButton || type_state() == TypeAttributeState::ImageButton || type_state() == TypeAttributeState::Checkbox || type_state() == TypeAttributeState::RadioButton)
|
||||
return;
|
||||
|
||||
// https://drafts.csswg.org/css-display-3/#unbox
|
||||
if (style.display().is_contents())
|
||||
style.set_property(CSS::PropertyID::Display, CSS::DisplayStyleValue::create(CSS::Display::from_short(CSS::Display::Short::None)));
|
||||
|
||||
// AD-HOC: We rewrite `display: inline` to `display: inline-block`.
|
||||
// This is required for the internal shadow tree to work correctly in layout.
|
||||
if (style.display().is_inline_outside() && style.display().is_flow_inside())
|
||||
|
||||
Reference in New Issue
Block a user