LibWeb: Do not return a GC::Root from HTMLTrackElement's track getter

There's no need to create a root each time the getter is called. We
should also allocate it in the `initialize` overload rather than the
constructor.
This commit is contained in:
Timothy Flynn 2025-06-12 07:56:37 -04:00 committed by Tim Flynn
parent 642dd751cf
commit c6a94fe513
Notes: github-actions[bot] 2025-06-12 16:27:10 +00:00
2 changed files with 3 additions and 2 deletions

View file

@ -21,7 +21,7 @@ public:
WebIDL::UnsignedShort ready_state();
GC::Root<TextTrack> track() { return m_track; }
GC::Ref<TextTrack> track() { return *m_track; }
private:
HTMLTrackElement(DOM::Document&, DOM::QualifiedName);