ladybird/Libraries/LibWeb/HTML/HTMLAudioElement.h
Andreas Kling 7c06c3fd14 LibWeb: Make computed style data refcounted
Move ComputedProperties and CascadedProperties out of the GC. They no
longer contain strong references to GC-managed data.

Keep computed styles alive from DOM elements and animation updates with
RefPtr. Pass style into layout constructors by reference, since layout
only copies the values it needs while building nodes.

Use GC::Weak for cascade source links, so entries no longer keep the
style declaration or shadow root alive.
2026-06-06 23:29:48 +02:00

35 lines
817 B
C++

/*
* Copyright (c) 2020, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/HTML/HTMLMediaElement.h>
namespace Web::HTML {
class HTMLAudioElement final : public HTMLMediaElement {
WEB_PLATFORM_OBJECT(HTMLAudioElement, HTMLMediaElement);
GC_DECLARE_ALLOCATOR(HTMLAudioElement);
public:
virtual ~HTMLAudioElement() override;
virtual void adjust_computed_style(CSS::ComputedProperties& style) override;
Layout::AudioBox* layout_node();
Layout::AudioBox const* layout_node() const;
bool should_paint() const;
private:
HTMLAudioElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
virtual GC::Ptr<Layout::Node> create_layout_node(CSS::ComputedProperties const&) override;
};
}