mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-06-18 15:52:21 +00:00
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.
35 lines
817 B
C++
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;
|
|
};
|
|
|
|
}
|