-
Notifications
You must be signed in to change notification settings - Fork 10
/
editcontext.webidl
84 lines (75 loc) · 2.3 KB
/
editcontext.webidl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Proposed webidl
[Exposed=Window]
interface EditContextTextRange {
attribute long start;
attribute long end;
};
[Exposed=Window]
interface TextUpdateEvent : Event {
readonly attribute EditContextTextRange updateRange;
readonly attribute DOMString updateText;
readonly attribute EditContextTextRange newSelection;
};
[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;
};
enum EditContextInputMode {
"text",
"decimal",
"password",
"search",
"email",
"numeric",
"tel",
"url"
};
enum EditContextInputAction {
"enter",
"done",
"go",
"next",
"previous",
"search",
"send"
};
enum EditContextInputPolicy {
"auto",
"manual"
};
dictionary EditContextInit {
DOMString text;
EditContextTextRange selection;
EditContextInputMode inputMode;
EditContextInputPolicy inputPolicy;
EditContextInputAction action;
};
/// @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"
/// @event name="compositionend", type="CompositionEvent"
[Exposed=Window]
[Constructor(optional EditContextInit options)]
interface EditContext : EventTarget {
void focus();
void blur();
void updateSelection(unsigned long start, unsigned long end);
void updateLayout(DOMRect controlBounds, DOMRect selectionBounds);
void updateText(unsigned long start, unsigned long end, DOMString updateText);
readonly attribute DOMString text;
readonly attribute EditContextTextRange selection;
readonly attribute EditContextInputMode inputMode;
readonly attribute EditContextInputPolicy inputPolicy
readonly attribute EditContextInputAction action;
// Event handler attributes
attribute EventHandler ontextupdate;
attribute EventHandler ontextformatupdate;
attribute EventHandler oncompositionstart;
attribute EventHandler oncompositionend;
};