mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-26 04:35:41 +03: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: https://github.com/SerenityOS/serenity/commit/7121539576 Pull-request: https://github.com/SerenityOS/serenity/pull/23606
@ -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…
Reference in New Issue
Block a user