mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +00:00
LibWeb: Allocate AnimationFrameCallbackDriver on the JS heap
This avoids needing to creating root handles for each heap-allocated object captured in the animation callback. An upcoming commit would add several of these.
This commit is contained in:
parent
144907f5bd
commit
d9e5ae66a7
Notes:
github-actions[bot]
2024-10-31 02:40:42 +00:00
Author: https://github.com/trflynn89
Commit: d9e5ae66a7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2071
Reviewed-by: https://github.com/tcl3 ✅
7 changed files with 88 additions and 44 deletions
|
@ -16,7 +16,6 @@
|
|||
#include <LibWeb/Bindings/WindowGlobalMixin.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/HTML/AnimationFrameCallbackDriver.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/CrossOriginPropertyDescriptorMap.h>
|
||||
#include <LibWeb/HTML/GlobalEventHandlers.h>
|
||||
#include <LibWeb/HTML/MimeType.h>
|
||||
|
@ -110,8 +109,6 @@ public:
|
|||
};
|
||||
WebIDL::ExceptionOr<OpenedWindow> window_open_steps_internal(StringView url, StringView target, StringView features);
|
||||
|
||||
bool has_animation_frame_callbacks() const { return m_animation_frame_callback_driver.has_callbacks(); }
|
||||
|
||||
DOM::Event* current_event() { return m_current_event.ptr(); }
|
||||
DOM::Event const* current_event() const { return m_current_event.ptr(); }
|
||||
void set_current_event(DOM::Event* event);
|
||||
|
@ -125,8 +122,6 @@ public:
|
|||
|
||||
void start_an_idle_period();
|
||||
|
||||
AnimationFrameCallbackDriver& animation_frame_callback_driver() { return m_animation_frame_callback_driver; }
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/interaction.html#sticky-activation
|
||||
bool has_sticky_activation() const;
|
||||
|
||||
|
@ -211,7 +206,10 @@ public:
|
|||
i32 outer_height() const;
|
||||
double device_pixel_ratio() const;
|
||||
|
||||
WebIDL::UnsignedLong request_animation_frame(WebIDL::CallbackType&);
|
||||
AnimationFrameCallbackDriver& animation_frame_callback_driver();
|
||||
bool has_animation_frame_callbacks();
|
||||
|
||||
WebIDL::UnsignedLong request_animation_frame(JS::NonnullGCPtr<WebIDL::CallbackType>);
|
||||
void cancel_animation_frame(WebIDL::UnsignedLong handle);
|
||||
|
||||
u32 request_idle_callback(WebIDL::CallbackType&, RequestIdleCallback::IdleRequestOptions const&);
|
||||
|
@ -289,7 +287,7 @@ private:
|
|||
// Each Window object is associated with a unique instance of a CustomElementRegistry object, allocated when the Window object is created.
|
||||
JS::GCPtr<CustomElementRegistry> m_custom_element_registry;
|
||||
|
||||
AnimationFrameCallbackDriver m_animation_frame_callback_driver;
|
||||
JS::GCPtr<AnimationFrameCallbackDriver> m_animation_frame_callback_driver;
|
||||
|
||||
// https://w3c.github.io/requestidlecallback/#dfn-list-of-idle-request-callbacks
|
||||
Vector<NonnullRefPtr<IdleCallback>> m_idle_request_callbacks;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue