/
dom.webidl
76 lines (58 loc) · 1.78 KB
/
dom.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
interface Node {
readonly attribute Number nodeType;
void appendChild(Node node);
void removeChild(Node node);
void replaceChild(Node node, Node child);
void insertBefore(Node node, Node? child);
readonly attribute NodeList childNodes;
readonly attribute Node? parentNode;
readonly attribute Node? firstChild;
readonly attribute Node? lastChild;
readonly attribute Node? nextSibling;
getter any (String propertyName);
setter void (String propertyName, any value);
};
interface Event {
readonly attribute String type;
readonly attribute Element? target;
readonly attribute Element? srcElement;
getter String (String propertyName);
};
interface NodeList {
getter Node? (Number index);
readonly attribute Number length;
};
interface Element : Node {
readonly attribute String tagName;
attribute String id;
attribute String className;
String getAttribute(String name);
void setAttribute(String name, String value);
void removeAttribute(String name);
Boolean hasAttribute(String name);
Boolean matches(String selector);
readonly attribute Array attributes;
void addEventListener(String type, any listener, optional Boolean capture);
void removeEventListener(String type, any listener, optional Boolean capture);
};
interface HTMLIFrameElement : Element {
readonly attribute HTMLWindow contentWindow;
};
interface Text : Node {
readonly attribute String wholeText;
};
interface HTMLDocument {
Element createElement(String localName);
Text createTextNode(String data);
attribute Element body;
Element getElementById(String elementId);
Array getElementsByTagName(String tagName);
Boolean hasFocus();
};
[Global]
interface Window {
static readonly attribute HTMLDocument document;
};
interface HTMLWindow {
readonly attribute HTMLDocument document;
};