LibWeb: Move video/audio adjust_computed_style to HTMLMediaElement

These are the same code, so we may as well move them up the chain. This
becomes useful in a later commit, where it will be used to rewrite
inline-flow to inline-block for layout of shadow DOM.
This commit is contained in:
Zaggy1024
2026-02-20 19:20:20 -06:00
committed by Alexander Kalenik
parent 5a615009ff
commit ab0a358a98
Notes: github-actions[bot] 2026-02-23 06:29:22 +00:00
6 changed files with 15 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
/*
* Copyright (c) 2020, the SerenityOS developers.
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
* Copyright (c) 2026, Gregory Bertilson <gregory@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -68,13 +69,6 @@ GC::Ptr<Layout::Node> HTMLVideoElement::create_layout_node(GC::Ref<CSS::Computed
return heap().allocate<Layout::VideoBox>(document(), *this, style);
}
void HTMLVideoElement::adjust_computed_style(CSS::ComputedProperties& 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)));
}
Layout::VideoBox* HTMLVideoElement::layout_node()
{
return static_cast<Layout::VideoBox*>(Node::layout_node());