2019-04-27 00:48:41 +03:00
|
|
|
// Proposed webidl
|
2019-08-16 03:10:24 +03:00
|
|
|
[Exposed=Window]
|
2019-04-27 00:48:41 +03:00
|
|
|
interface EditContextTextRange {
|
2019-08-16 03:10:24 +03:00
|
|
|
attribute long start;
|
|
|
|
attribute long end;
|
2019-04-27 00:48:41 +03:00
|
|
|
};
|
|
|
|
|
2019-08-16 03:10:24 +03:00
|
|
|
[Exposed=Window]
|
|
|
|
interface TextUpdateEvent : Event {
|
2019-04-27 00:48:41 +03:00
|
|
|
readonly attribute EditContextTextRange updateRange;
|
2019-08-16 03:10:24 +03:00
|
|
|
readonly attribute DOMString updateText;
|
2019-04-27 00:48:41 +03:00
|
|
|
readonly attribute EditContextTextRange newSelection;
|
|
|
|
};
|
|
|
|
|
2019-08-16 03:10:24 +03:00
|
|
|
[Exposed=Window]
|
|
|
|
interface TextFormatUpdateEvent : Event {
|
|
|
|
readonly attribute EditContextTextRange formatRange;
|
|
|
|
readonly attribute DOMString underlineColor;
|
|
|
|
readonly attribute DOMString backgroundColor;
|
|
|
|
readonly attribute DOMString textDecorationColor;
|
|
|
|
readonly attribute DOMString textUnderlineStyle;
|
2019-04-27 00:48:41 +03:00
|
|
|
};
|
|
|
|
|
2019-08-30 01:29:31 +03:00
|
|
|
enum EditContextInputMode {
|
|
|
|
"text",
|
|
|
|
"decimal",
|
|
|
|
"password",
|
|
|
|
"search",
|
|
|
|
"email",
|
|
|
|
"numeric",
|
|
|
|
"tel",
|
|
|
|
"url"
|
2019-04-27 00:48:41 +03:00
|
|
|
};
|
|
|
|
|
2019-08-16 03:10:24 +03:00
|
|
|
enum EditContextInputAction {
|
|
|
|
"enter",
|
|
|
|
"done",
|
|
|
|
"go",
|
|
|
|
"next",
|
|
|
|
"previous",
|
|
|
|
"search",
|
|
|
|
"send"
|
|
|
|
};
|
|
|
|
|
2019-08-30 01:29:31 +03:00
|
|
|
enum EditContextInputPolicy {
|
|
|
|
"auto",
|
|
|
|
"manual"
|
|
|
|
};
|
|
|
|
|
2019-08-16 03:10:24 +03:00
|
|
|
dictionary EditContextInit {
|
|
|
|
DOMString text;
|
|
|
|
EditContextTextRange selection;
|
2019-08-30 01:29:31 +03:00
|
|
|
EditContextInputMode inputMode;
|
|
|
|
EditContextInputPolicy inputPolicy;
|
2019-08-16 03:10:24 +03:00
|
|
|
EditContextInputAction action;
|
|
|
|
};
|
2019-04-27 00:48:41 +03:00
|
|
|
|
|
|
|
/// @event name="textupdate", type="TextUpdateEvent"
|
|
|
|
/// @event name="textformatupdate", type="TextFormatUpdateEvent"
|
|
|
|
/// @event name="focus", type="FocusEvent"
|
|
|
|
/// @event name="blur", type="FocusEvent"
|
|
|
|
/// @event name="compositionstart", type="CompositionEvent"
|
2019-08-16 03:10:24 +03:00
|
|
|
/// @event name="compositionend", type="CompositionEvent"
|
|
|
|
[Exposed=Window]
|
|
|
|
[Constructor(optional EditContextInit options)]
|
2019-04-27 00:48:41 +03:00
|
|
|
interface EditContext : EventTarget {
|
|
|
|
void focus();
|
|
|
|
void blur();
|
2019-08-16 03:10:24 +03:00
|
|
|
void updateSelection(unsigned long start, unsigned long end);
|
|
|
|
void updateLayout(DOMRect controlBounds, DOMRect selectionBounds);
|
|
|
|
void updateText(unsigned long start, unsigned long end, DOMString updateText);
|
2019-04-27 00:48:41 +03:00
|
|
|
|
2019-08-16 03:10:24 +03:00
|
|
|
readonly attribute DOMString text;
|
|
|
|
readonly attribute EditContextTextRange selection;
|
2019-08-30 01:29:31 +03:00
|
|
|
readonly attribute EditContextInputMode inputMode;
|
|
|
|
readonly attribute EditContextInputPolicy inputPolicy
|
2019-08-16 03:10:24 +03:00
|
|
|
readonly attribute EditContextInputAction action;
|
|
|
|
|
|
|
|
// Event handler attributes
|
|
|
|
attribute EventHandler ontextupdate;
|
|
|
|
attribute EventHandler ontextformatupdate;
|
|
|
|
attribute EventHandler oncompositionstart;
|
|
|
|
attribute EventHandler oncompositionend;
|
|
|
|
};
|