mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +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
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/HTMLMeterElementPrototype.h>
|
||||
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/ElementFactory.h>
|
||||
#include <LibWeb/DOM/ShadowRoot.h>
|
||||
@@ -177,6 +178,13 @@ void HTMLMeterElement::removed_from(DOM::Node*)
|
||||
set_shadow_root(nullptr);
|
||||
}
|
||||
|
||||
void HTMLMeterElement::adjust_computed_style(CSS::StyleProperties& style)
|
||||
{
|
||||
// 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)));
|
||||
}
|
||||
|
||||
void HTMLMeterElement::create_shadow_tree_if_needed()
|
||||
{
|
||||
if (shadow_root())
|
||||
|
||||
Reference in New Issue
Block a user