mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
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:
committed by
Andreas Kling
parent
ce23efc5f6
commit
f87041bf3a
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user