LibGC+Everywhere: Factor out a LibGC from LibJS

Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
This commit is contained in:
Shannon Booth 2024-11-15 04:01:23 +13:00 committed by Andreas Kling
parent ce23efc5f6
commit f87041bf3a
Notes: github-actions[bot] 2024-11-15 13:50:17 +00:00
1722 changed files with 9939 additions and 9906 deletions

View file

@ -15,9 +15,9 @@
namespace Web::CSS {
JS_DEFINE_ALLOCATOR(MediaQueryList);
GC_DEFINE_ALLOCATOR(MediaQueryList);
JS::NonnullGCPtr<MediaQueryList> MediaQueryList::create(DOM::Document& document, Vector<NonnullRefPtr<MediaQuery>>&& media)
GC::Ref<MediaQueryList> MediaQueryList::create(DOM::Document& document, Vector<NonnullRefPtr<MediaQuery>>&& media)
{
return document.realm().create<MediaQueryList>(document, move(media));
}
@ -80,7 +80,7 @@ bool MediaQueryList::evaluate()
}
// https://www.w3.org/TR/cssom-view/#dom-mediaquerylist-addlistener
void MediaQueryList::add_listener(JS::GCPtr<DOM::IDLEventListener> listener)
void MediaQueryList::add_listener(GC::Ptr<DOM::IDLEventListener> listener)
{
// 1. If listener is null, terminate these steps.
if (!listener)
@ -94,7 +94,7 @@ void MediaQueryList::add_listener(JS::GCPtr<DOM::IDLEventListener> listener)
}
// https://www.w3.org/TR/cssom-view/#dom-mediaquerylist-removelistener
void MediaQueryList::remove_listener(JS::GCPtr<DOM::IDLEventListener> listener)
void MediaQueryList::remove_listener(GC::Ptr<DOM::IDLEventListener> listener)
{
// 1. Remove an event listener from the associated list of event listeners, whose type is change, callback is listener, and capture is false.
// NOTE: While the spec doesn't technically use remove_event_listener and instead manipulates the list directly, every major engine uses remove_event_listener.