mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 12:06:07 +00:00
LibWeb: Add fast_is<T> for UIEvents::MouseEvent
This commit is contained in:
parent
c0d7f748ed
commit
7121539576
Notes:
sideshowbarker
2024-07-17 06:35:16 +09:00
Author: https://github.com/awesomekling
Commit: 7121539576
Pull-request: https://github.com/SerenityOS/serenity/pull/23606
2 changed files with 14 additions and 0 deletions
|
@ -144,6 +144,11 @@ public:
|
|||
|
||||
Vector<JS::Handle<EventTarget>> composed_path() const;
|
||||
|
||||
template<typename T>
|
||||
bool fast_is() const = delete;
|
||||
|
||||
virtual bool is_mouse_event() const { return false; }
|
||||
|
||||
protected:
|
||||
void initialize_event(String const&, bool, bool);
|
||||
|
||||
|
|
|
@ -71,6 +71,8 @@ protected:
|
|||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
private:
|
||||
virtual bool is_mouse_event() const override { return true; }
|
||||
|
||||
void set_event_characteristics();
|
||||
|
||||
double m_screen_x { 0 };
|
||||
|
@ -102,3 +104,10 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
template<>
|
||||
inline bool Event::fast_is<UIEvents::MouseEvent>() const { return is_mouse_event(); }
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue