mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb/HTML: Store TrackEvent track as Ref not Root
This commit is contained in:
Notes:
github-actions[bot]
2026-02-17 14:20:40 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/0656f2f3348 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7914 Reviewed-by: https://github.com/trflynn89
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
||||
* Copyright (c) 2026, Sam Atkins <sam@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
@@ -28,14 +29,19 @@ public:
|
||||
static WebIDL::ExceptionOr<GC::Ref<TrackEvent>> construct_impl(JS::Realm&, FlyString const& event_name, TrackEventInit);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/media.html#dom-trackevent-track
|
||||
Variant<Empty, GC::Root<VideoTrack>, GC::Root<AudioTrack>, GC::Root<TextTrack>> track() const;
|
||||
using TrackReturnType = Variant<Empty, GC::Root<VideoTrack>, GC::Root<AudioTrack>, GC::Root<TextTrack>>;
|
||||
TrackReturnType track() const;
|
||||
|
||||
private:
|
||||
TrackEvent(JS::Realm&, FlyString const& event_name, TrackEventInit event_init);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
TrackEventInit::TrackType m_track;
|
||||
using TrackTypeInternal = Variant<Empty, GC::Ref<VideoTrack>, GC::Ref<AudioTrack>, GC::Ref<TextTrack>>;
|
||||
static TrackTypeInternal to_track_type_internal(TrackEventInit::TrackType const&);
|
||||
|
||||
TrackTypeInternal m_track;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user