mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibWeb: Rewrite audio elements without controls to display:none
This is part of the rendering spec, but we had neglected to do this before. It causes one WPT check to fail, but other browsers get the same result on that check, so I guess we can call that a win. :^)
This commit is contained in:
committed by
Alexander Kalenik
parent
7bc9824578
commit
bc60768cb0
Notes:
github-actions[bot]
2026-02-23 06:29:01 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/bc60768cb03 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8056 Reviewed-by: https://github.com/kalenikaliaksandr ✅ Reviewed-by: https://github.com/konradekk
@@ -28,6 +28,15 @@ void HTMLAudioElement::initialize(JS::Realm& realm)
|
||||
Base::initialize(realm);
|
||||
}
|
||||
|
||||
void HTMLAudioElement::adjust_computed_style(CSS::ComputedProperties& style)
|
||||
{
|
||||
Base::adjust_computed_style(style);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/rendering.html#embedded-content-rendering-rules
|
||||
if (!has_attribute(AttributeNames::controls))
|
||||
style.set_property(CSS::PropertyID::Display, CSS::DisplayStyleValue::create(CSS::Display::from_short(CSS::Display::Short::None)));
|
||||
}
|
||||
|
||||
GC::Ptr<Layout::Node> HTMLAudioElement::create_layout_node(GC::Ref<CSS::ComputedProperties> style)
|
||||
{
|
||||
return heap().allocate<Layout::AudioBox>(document(), *this, style);
|
||||
|
||||
Reference in New Issue
Block a user