mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
LibWeb: Add constructor for WheelEvent
This makes https://profiler.firefox.com/ progress much further in loading :^)
This commit is contained in:
parent
0c799b23cb
commit
42e3ba409e
Notes:
sideshowbarker
2024-07-17 02:21:14 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/42e3ba409e Pull-request: https://github.com/SerenityOS/serenity/pull/24294
|
@ -33,6 +33,11 @@ void WheelEvent::initialize(JS::Realm& realm)
|
|||
WEB_SET_PROTOTYPE_FOR_INTERFACE(WheelEvent);
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<WheelEvent> WheelEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, WheelEventInit const& wheel_event_init)
|
||||
{
|
||||
return create(realm, event_name, wheel_event_init);
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<WheelEvent> WheelEvent::create(JS::Realm& realm, FlyString const& event_name, WheelEventInit const& event_init, double page_x, double page_y, double offset_x, double offset_y)
|
||||
{
|
||||
return realm.heap().allocate<WheelEvent>(realm, realm, event_name, event_init, page_x, page_y, offset_x, offset_y);
|
||||
|
|
|
@ -31,7 +31,9 @@ class WheelEvent final : public MouseEvent {
|
|||
JS_DECLARE_ALLOCATOR(WheelEvent);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static JS::NonnullGCPtr<WheelEvent> create(JS::Realm&, FlyString const& event_name, WheelEventInit const& event_init = {}, double page_x = 0, double page_y = 0, double offset_x = 0, double offset_y = 0);
|
||||
[[nodiscard]] static JS::NonnullGCPtr<WheelEvent> create(JS::Realm&, FlyString const& event_name, WheelEventInit const& = {}, double page_x = 0, double page_y = 0, double offset_x = 0, double offset_y = 0);
|
||||
[[nodiscard]] static JS::NonnullGCPtr<WheelEvent> construct_impl(JS::Realm&, FlyString const& event_name, WheelEventInit const& = {});
|
||||
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<WheelEvent>> create_from_platform_event(JS::Realm&, FlyString const& event_name, CSSPixelPoint screen, CSSPixelPoint page, CSSPixelPoint client, CSSPixelPoint offset, double delta_x, double delta_y, unsigned button, unsigned buttons, unsigned modifiers);
|
||||
|
||||
virtual ~WheelEvent() override;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// https://www.w3.org/TR/uievents/#idl-wheelevent
|
||||
[Exposed=Window]
|
||||
interface WheelEvent : MouseEvent {
|
||||
constructor(DOMString type, optional WheelEventInit eventInitDict = {});
|
||||
|
||||
// DeltaModeCode
|
||||
const unsigned long DOM_DELTA_PIXEL = 0x00;
|
||||
const unsigned long DOM_DELTA_LINE = 0x01;
|
||||
|
|
Loading…
Reference in a new issue