mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05:00
LibWeb: Stub InputEvent.getTargetRanges()
We need this, because https://www.slatejs.org/ that is used by Discord checks this function to decide whether a browser has "beforeinput" event support. (cherry picked from commit 3e8b2454fbcb80891b902ef725dd9549f8880233)
This commit is contained in:
parent
647bfd63a5
commit
e0cc97d2a9
3 changed files with 12 additions and 0 deletions
|
@ -43,4 +43,10 @@ void InputEvent::initialize(JS::Realm& realm)
|
|||
WEB_SET_PROTOTYPE_FOR_INTERFACE(InputEvent);
|
||||
}
|
||||
|
||||
Vector<DOM::StaticRange> InputEvent::get_target_ranges() const
|
||||
{
|
||||
dbgln("FIXME: Implement InputEvent::get_target_ranges()");
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/DOM/StaticRange.h>
|
||||
#include <LibWeb/UIEvents/UIEvent.h>
|
||||
|
||||
namespace Web::UIEvents {
|
||||
|
@ -35,6 +36,8 @@ public:
|
|||
// https://w3c.github.io/uievents/#dom-inputevent-inputtype
|
||||
FlyString input_type() const { return m_input_type; }
|
||||
|
||||
Vector<DOM::StaticRange> get_target_ranges() const;
|
||||
|
||||
private:
|
||||
InputEvent(JS::Realm&, FlyString const& event_name, InputEventInit const&);
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#import <UIEvents/UIEvent.idl>
|
||||
#import <DOM/StaticRange.idl>
|
||||
|
||||
// https://w3c.github.io/uievents/#inputevent
|
||||
[Exposed=Window]
|
||||
|
@ -7,6 +8,8 @@ interface InputEvent : UIEvent {
|
|||
readonly attribute USVString? data;
|
||||
readonly attribute boolean isComposing;
|
||||
readonly attribute DOMString inputType;
|
||||
|
||||
sequence<StaticRange> getTargetRanges();
|
||||
};
|
||||
|
||||
// https://w3c.github.io/uievents/#dictdef-inputeventinit
|
||||
|
|
Loading…
Reference in a new issue