webidl 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
data/README.md CHANGED
@@ -2,7 +2,8 @@ webidl
2
2
  ======
3
3
 
4
4
  This gem provides a pure-ruby parser and code generator for Web IDL, an interface description language for interfaces intended to be implemented in web browsers.
5
- The code generation will be used to generate part of the implementation of Watir 2.0, backed by WebDriver.
5
+
6
+ [![Build Status](https://secure.travis-ci.org/jarib/webidl.png)](http://travis-ci.org/jarib/webidl)
6
7
 
7
8
  Problems
8
9
  --------
@@ -10,15 +10,19 @@ require "webidl/parse_tree/attribute"
10
10
  require "webidl/parse_tree/typedef"
11
11
  require "webidl/parse_tree/inheritance"
12
12
  require "webidl/parse_tree/interface"
13
+ require "webidl/parse_tree/interface_members"
14
+ require "webidl/parse_tree/partial_interface"
13
15
  require "webidl/parse_tree/argument"
14
16
  require "webidl/parse_tree/argument_list"
17
+ require "webidl/parse_tree/dictionary"
18
+ require "webidl/parse_tree/dictionary_members"
19
+ require "webidl/parse_tree/dictionary_member"
15
20
  require "webidl/parse_tree/extended_attributes"
16
21
  require "webidl/parse_tree/relative_scoped_name"
17
22
  require "webidl/parse_tree/absolute_scoped_name"
18
23
  require "webidl/parse_tree/sequence_type"
19
24
  require "webidl/parse_tree/type_suffix"
20
25
  require "webidl/parse_tree/type"
21
- require "webidl/parse_tree/interface_members"
22
26
  require "webidl/parse_tree/operation"
23
27
  require "webidl/parse_tree/const"
24
28
  require "webidl/parse_tree/specials"
@@ -32,6 +36,8 @@ require "webidl/ast/node"
32
36
  require "webidl/ast/module"
33
37
  require "webidl/ast/typedef"
34
38
  require "webidl/ast/interface"
39
+ require "webidl/ast/dictionary"
40
+ require "webidl/ast/dictionary_member"
35
41
  require "webidl/ast/extended_attribute"
36
42
  require "webidl/ast/argument"
37
43
  require "webidl/ast/type"
@@ -10,6 +10,7 @@ module WebIDL
10
10
 
11
11
  @optional = !!opts[:optional]
12
12
  @variadic = !!opts[:variadic]
13
+ @extended_attributes = opts[:extended_attributes] || []
13
14
  end
14
15
 
15
16
  def optional?
@@ -0,0 +1,31 @@
1
+ module WebIDL
2
+ module Ast
3
+ class Dictionary < Node
4
+
5
+ def self.list
6
+ @list ||= {}
7
+ end
8
+
9
+ attr_reader :name
10
+ attr_accessor :extended_attributes,
11
+ :members,
12
+ :inherits
13
+
14
+ def initialize(parent, name)
15
+ super(parent)
16
+
17
+ @name = name
18
+ @members = []
19
+ @inherits = []
20
+ @implements = []
21
+ @extended_attributes = []
22
+ @partial = false
23
+ end
24
+
25
+ def partial?
26
+ @partial
27
+ end
28
+
29
+ end # Dictionary
30
+ end # Ast
31
+ end # WebIDL
@@ -0,0 +1,14 @@
1
+ module WebIDL
2
+ module Ast
3
+ class DictionaryMember < Node
4
+
5
+ attr_reader :type, :name, :default_value
6
+
7
+ def initialize(parent, type, name, default_value)
8
+ super(parent)
9
+ @type, @name, @default_value = type, name, default_value
10
+ end
11
+
12
+ end # Field
13
+ end # Ast
14
+ end # WebIDL
@@ -7,7 +7,11 @@ module WebIDL
7
7
  end
8
8
 
9
9
  attr_reader :name
10
- attr_accessor :extended_attributes, :members, :inherits, :implements
10
+ attr_accessor :extended_attributes,
11
+ :members,
12
+ :inherits,
13
+ :implements,
14
+ :partial
11
15
 
12
16
  def initialize(parent, name)
13
17
  super(parent)
@@ -17,8 +21,13 @@ module WebIDL
17
21
  @inherits = []
18
22
  @implements = []
19
23
  @extended_attributes = []
24
+ @partial = false
20
25
  end
21
26
 
22
- end
27
+ def partial?
28
+ @partial
29
+ end
30
+
31
+ end # Interface
23
32
  end # Ast
24
33
  end # WebIDL
@@ -35,8 +35,8 @@ module WebIDL
35
35
  @specials.include? 'deleter'
36
36
  end
37
37
 
38
- def caller?
39
- @specials.include? 'caller'
38
+ def legacycaller?
39
+ @specials.include? 'legacycaller'
40
40
  end
41
41
 
42
42
  def static?
@@ -3,15 +3,16 @@ module WebIDL
3
3
  class Argument < Treetop::Runtime::SyntaxNode
4
4
 
5
5
  def build(parent)
6
+ xattrs = eal.build(parent) unless eal.empty?
7
+
6
8
  arg = Ast::Argument.new(
7
9
  id.build,
8
10
  type.build(parent),
9
- :optional => optional.any?,
10
- :variadic => variadic.any?
11
+ :optional => optional.any?,
12
+ :variadic => variadic.any?,
13
+ :extended_attributes => xattrs
11
14
  )
12
15
 
13
- arg.extended_attributes = eal.build unless eal.empty?
14
-
15
16
  arg
16
17
  end
17
18
 
@@ -0,0 +1,21 @@
1
+ module WebIDL
2
+ module ParseTree
3
+ class Dictionary < Treetop::Runtime::SyntaxNode
4
+
5
+ def build(parent)
6
+ dict = Ast::Dictionary.new(parent, name.text_value)
7
+
8
+ unless members.empty?
9
+ members.build(dict)
10
+ end
11
+
12
+ unless inherits.empty?
13
+ dict.inherits = inherits.build(dict)
14
+ end
15
+
16
+ dict
17
+ end
18
+
19
+ end # Dictionary
20
+ end # ParseTree
21
+ end # WebIDL
@@ -0,0 +1,16 @@
1
+ module WebIDL
2
+ module ParseTree
3
+ class DictionaryMember < Treetop::Runtime::SyntaxNode
4
+
5
+ def build(parent)
6
+ debugger unless default.empty? or default.respond_to?(:build)
7
+
8
+ dm = Ast::DictionaryMember.new parent,
9
+ type.build(parent),
10
+ name.build,
11
+ default.build unless default.empty?
12
+ end
13
+
14
+ end # Attribute
15
+ end # ParseTree
16
+ end # WebIDL
@@ -0,0 +1,21 @@
1
+ module WebIDL
2
+ module ParseTree
3
+ class DictionaryMembers < Treetop::Runtime::SyntaxNode
4
+
5
+ def build(parent)
6
+ m = member.build(parent)
7
+ m.extended_attributes = eal.build(parent) unless eal.empty?
8
+
9
+ list = [m]
10
+ list += members.build(parent) unless members.empty?
11
+
12
+ if parent
13
+ parent.members = list
14
+ end
15
+
16
+ list
17
+ end
18
+
19
+ end # InterfaceMembers
20
+ end # ParseTree
21
+ end # WebIDL
@@ -17,5 +17,11 @@ module WebIDL
17
17
  end
18
18
 
19
19
  end # Interface
20
+
21
+ class PartialInterface < Interface
22
+ def partial?
23
+ true
24
+ end
25
+ end
20
26
  end # ParseTree
21
27
  end # WebIDL
@@ -0,0 +1,14 @@
1
+ module WebIDL
2
+ module ParseTree
3
+ class PartialInterface < Interface
4
+
5
+ def build(parent)
6
+ intf = super
7
+ intf.partial = true
8
+
9
+ intf
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -11,7 +11,9 @@ module WebIDL
11
11
  type.nullable = true
12
12
  end
13
13
 
14
- raise NotImplementedError, "TypeSuffix + TypeSuffix" if suffix.any?
14
+ if suffix.any?
15
+ suffix.apply(type)
16
+ end
15
17
  end
16
18
 
17
19
  end # TypeSuffix
@@ -11,6 +11,8 @@ module WebIDL
11
11
  rule Definition
12
12
  Module
13
13
  / Interface
14
+ / PartialInterface
15
+ / Dictionary
14
16
  / Exception
15
17
  / TypeDef
16
18
  / ImplementsStatement
@@ -24,6 +26,10 @@ module WebIDL
24
26
  "interface" ws name:identifier ws inherits:Inheritance ws "{" ws members:InterfaceMembers ws "}" ws ";" <ParseTree::Interface>
25
27
  end
26
28
 
29
+ rule PartialInterface
30
+ "partial" ws "interface" ws name:identifier ws inherits:Inheritance ws "{" ws members:InterfaceMembers ws "}" ws ";" <ParseTree::PartialInterface>
31
+ end
32
+
27
33
  rule Inheritance
28
34
  (":" ws names:ScopedNameList <ParseTree::Inheritance>)?
29
35
  end
@@ -37,6 +43,28 @@ module WebIDL
37
43
  Const / AttributeOrOperation
38
44
  end
39
45
 
46
+ # Dictionary → "dictionary" identifier Inheritance "{" DictionaryMembers "}" ";"
47
+ rule Dictionary
48
+ "dictionary" ws name:identifier ws inherits:Inheritance ws "{" ws members:DictionaryMembers ws "}" ws ";" <ParseTree::Dictionary>
49
+ end
50
+
51
+ # [11] DictionaryMembers → ExtendedAttributeList DictionaryMember DictionaryMembers
52
+ # | ε
53
+ rule DictionaryMembers
54
+ (eal:ExtendedAttributeList ws member:DictionaryMember ws members:DictionaryMembers <ParseTree::DictionaryMembers>)?
55
+ end
56
+
57
+ # [12] DictionaryMember → Type identifier DefaultValue ";"
58
+ rule DictionaryMember
59
+ type:Type ws name:identifier ws default:DefaultValue ws ";" <ParseTree::DictionaryMember>
60
+ end
61
+
62
+ # [13] DefaultValue → "=" ConstValue
63
+ # | ε
64
+ rule DefaultValue
65
+ ("=" ws const:ConstValue { def build() const.build end })?
66
+ end
67
+
40
68
  rule Exception
41
69
  "exception" ws name:identifier ws inherits:Inheritance ws "{" ws members:ExceptionMembers ws "}" ws ";" <ParseTree::Exception>
42
70
  end
@@ -55,10 +83,10 @@ module WebIDL
55
83
  end
56
84
 
57
85
  rule Const
58
- "const" ws type:Type ws name:identifier ws "=" ws const_expr:ConstExpr ws ";" <ParseTree::Const>
86
+ "const" ws type:Type ws name:identifier ws "=" ws const_expr:ConstValue ws ";" <ParseTree::Const>
59
87
  end
60
88
 
61
- rule ConstExpr
89
+ rule ConstValue
62
90
  BooleanLiteral / integer / float
63
91
  end
64
92
 
@@ -107,7 +135,7 @@ module WebIDL
107
135
  / "setter"
108
136
  / "creator"
109
137
  / "deleter"
110
- / "caller"
138
+ / "legacycaller"
111
139
  end
112
140
 
113
141
  rule OperationRest
@@ -1,3 +1,3 @@
1
1
  module WebIDL
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,18 +1,13 @@
1
- interface HTMLCollection {
2
- readonly attribute unsigned long length;
3
- caller getter Element? item(in unsigned long index);
4
- caller getter object? namedItem(in DOMString name); // only returns Element
5
- };
6
1
 
7
2
  interface HTMLAllCollection : HTMLCollection {
8
3
  // inherits length and item()
9
- caller getter object? namedItem(in DOMString name); // overrides inherited namedItem()
10
- HTMLAllCollection tags(in DOMString tagName);
4
+ legacycaller getter object? namedItem(DOMString name); // overrides inherited namedItem()
5
+ HTMLAllCollection tags(DOMString tagName);
11
6
  };
12
7
 
13
8
  interface HTMLFormControlsCollection : HTMLCollection {
14
9
  // inherits length and item()
15
- caller getter object? namedItem(in DOMString name); // overrides inherited namedItem()
10
+ legacycaller getter object? namedItem(DOMString name); // overrides inherited namedItem()
16
11
  };
17
12
 
18
13
  interface RadioNodeList : NodeList {
@@ -22,16 +17,19 @@ interface RadioNodeList : NodeList {
22
17
  interface HTMLOptionsCollection : HTMLCollection {
23
18
  // inherits item()
24
19
  attribute unsigned long length; // overrides inherited length
25
- caller getter object? namedItem(in DOMString name); // overrides inherited namedItem()
26
- void add(in HTMLElement element, in optional HTMLElement? before);
27
- void add(in HTMLElement element, in long before);
28
- void remove(in long index);
20
+ legacycaller getter object? namedItem(DOMString name); // overrides inherited namedItem()
21
+ setter creator void (unsigned long index, HTMLOptionElement option);
22
+ void add(HTMLOptionElement element, optional HTMLElement? before);
23
+ void add(HTMLOptGroupElement element, optional HTMLElement? before);
24
+ void add(HTMLOptionElement element, long before);
25
+ void add(HTMLOptGroupElement element, long before);
26
+ void remove(long index);
29
27
  attribute long selectedIndex;
30
28
  };
31
29
 
32
30
  interface HTMLPropertiesCollection : HTMLCollection {
33
31
  // inherits length and item()
34
- caller getter PropertyNodeList? namedItem(in DOMString name); // overrides inherited namedItem()
32
+ legacycaller getter PropertyNodeList? namedItem(DOMString name); // overrides inherited namedItem()
35
33
  readonly attribute DOMStringList names;
36
34
  };
37
35
 
@@ -41,45 +39,25 @@ interface PropertyNodeList : NodeList {
41
39
  PropertyValueArray getValues();
42
40
  };
43
41
 
44
- interface DOMTokenList {
45
- readonly attribute unsigned long length;
46
- getter DOMString? item(in unsigned long index);
47
- boolean contains(in DOMString token);
48
- void add(in DOMString token);
49
- void remove(in DOMString token);
50
- boolean toggle(in DOMString token);
51
- stringifier DOMString ();
52
- };
53
-
54
- interface DOMSettableTokenList : DOMTokenList {
55
- attribute DOMString value;
56
- };
57
-
58
- [NoInterfaceObject]
59
- interface Transferable { };
60
-
61
42
  interface DOMStringMap {
62
- getter DOMString (in DOMString name);
63
- setter void (in DOMString name, in DOMString value);
64
- creator void (in DOMString name, in DOMString value);
65
- deleter void (in DOMString name);
43
+ getter DOMString (DOMString name);
44
+ setter void (DOMString name, DOMString value);
45
+ creator void (DOMString name, DOMString value);
46
+ deleter void (DOMString name);
66
47
  };
67
48
 
68
49
  interface DOMElementMap {
69
- getter DOMString (in DOMString name);
70
- setter void (in DOMString name, in Element value);
71
- creator void (in DOMString name, in Element value);
72
- deleter void (in DOMString name);
50
+ getter Element (DOMString name);
51
+ setter void (DOMString name, Element value);
52
+ creator void (DOMString name, Element value);
53
+ deleter void (DOMString name);
73
54
  };
74
55
 
75
- [Supplemental] exception DOMException {
76
- const unsigned short URL_MISMATCH_ERR = 21;
77
- const unsigned short QUOTA_EXCEEDED_ERR = 22;
78
- const unsigned short DATA_CLONE_ERR = 25;
79
- };
56
+ [NoInterfaceObject]
57
+ interface Transferable { };
80
58
 
81
59
  [OverrideBuiltins]
82
- interface HTMLDocument {
60
+ partial interface Document {
83
61
  // resource metadata management
84
62
  [PutForwards=href] readonly attribute Location? location;
85
63
  readonly attribute DOMString URL;
@@ -87,14 +65,10 @@ interface HTMLDocument {
87
65
  readonly attribute DOMString referrer;
88
66
  attribute DOMString cookie;
89
67
  readonly attribute DOMString lastModified;
90
- readonly attribute DOMString compatMode;
91
- attribute DOMString charset;
92
- readonly attribute DOMString characterSet;
93
- readonly attribute DOMString defaultCharset;
94
68
  readonly attribute DOMString readyState;
95
69
 
96
70
  // DOM tree accessors
97
- getter any (in DOMString name);
71
+ getter object (DOMString name);
98
72
  attribute DOMString title;
99
73
  attribute DOMString dir;
100
74
  attribute HTMLElement? body;
@@ -105,114 +79,97 @@ interface HTMLDocument {
105
79
  readonly attribute HTMLCollection links;
106
80
  readonly attribute HTMLCollection forms;
107
81
  readonly attribute HTMLCollection scripts;
108
- NodeList getElementsByName(in DOMString elementName);
109
- NodeList getElementsByClassName(in DOMString classNames);
110
- NodeList getItems(in optional DOMString typeNames); // microdata
82
+ NodeList getElementsByName(DOMString elementName);
83
+ NodeList getItems(optional DOMString typeNames); // microdata
111
84
  readonly attribute DOMElementMap cssElementMap;
112
85
 
113
86
  // dynamic markup insertion
114
- attribute DOMString innerHTML;
115
- HTMLDocument open(in optional DOMString type, in optional DOMString replace);
116
- WindowProxy open(in DOMString url, in DOMString name, in DOMString features, in optional boolean replace);
87
+ Document open(optional DOMString type, optional DOMString replace);
88
+ WindowProxy open(DOMString url, DOMString name, DOMString features, optional boolean replace);
117
89
  void close();
118
- void write(in DOMString... text);
119
- void writeln(in DOMString... text);
90
+ void write(DOMString... text);
91
+ void writeln(DOMString... text);
120
92
 
121
93
  // user interaction
122
94
  readonly attribute WindowProxy? defaultView;
123
95
  readonly attribute Element? activeElement;
124
96
  boolean hasFocus();
125
97
  attribute DOMString designMode;
126
- boolean execCommand(in DOMString commandId);
127
- boolean execCommand(in DOMString commandId, in boolean showUI);
128
- boolean execCommand(in DOMString commandId, in boolean showUI, in DOMString value);
129
- boolean queryCommandEnabled(in DOMString commandId);
130
- boolean queryCommandIndeterm(in DOMString commandId);
131
- boolean queryCommandState(in DOMString commandId);
132
- boolean queryCommandSupported(in DOMString commandId);
133
- DOMString queryCommandValue(in DOMString commandId);
98
+ boolean execCommand(DOMString commandId);
99
+ boolean execCommand(DOMString commandId, boolean showUI);
100
+ boolean execCommand(DOMString commandId, boolean showUI, DOMString value);
101
+ boolean queryCommandEnabled(DOMString commandId);
102
+ boolean queryCommandIndeterm(DOMString commandId);
103
+ boolean queryCommandState(DOMString commandId);
104
+ boolean queryCommandSupported(DOMString commandId);
105
+ DOMString queryCommandValue(DOMString commandId);
134
106
  readonly attribute HTMLCollection commands;
135
107
 
136
108
  // event handler IDL attributes
137
- attribute Function? onabort;
138
- attribute Function? onblur;
139
- attribute Function? oncanplay;
140
- attribute Function? oncanplaythrough;
141
- attribute Function? onchange;
142
- attribute Function? onclick;
143
- attribute Function? oncontextmenu;
144
- attribute Function? oncuechange;
145
- attribute Function? ondblclick;
146
- attribute Function? ondrag;
147
- attribute Function? ondragend;
148
- attribute Function? ondragenter;
149
- attribute Function? ondragleave;
150
- attribute Function? ondragover;
151
- attribute Function? ondragstart;
152
- attribute Function? ondrop;
153
- attribute Function? ondurationchange;
154
- attribute Function? onemptied;
155
- attribute Function? onended;
156
- attribute Function? onerror;
157
- attribute Function? onfocus;
158
- attribute Function? oninput;
159
- attribute Function? oninvalid;
160
- attribute Function? onkeydown;
161
- attribute Function? onkeypress;
162
- attribute Function? onkeyup;
163
- attribute Function? onload;
164
- attribute Function? onloadeddata;
165
- attribute Function? onloadedmetadata;
166
- attribute Function? onloadstart;
167
- attribute Function? onmousedown;
168
- attribute Function? onmousemove;
169
- attribute Function? onmouseout;
170
- attribute Function? onmouseover;
171
- attribute Function? onmouseup;
172
- attribute Function? onmousewheel;
173
- attribute Function? onpause;
174
- attribute Function? onplay;
175
- attribute Function? onplaying;
176
- attribute Function? onprogress;
177
- attribute Function? onratechange;
178
- attribute Function? onreadystatechange;
179
- attribute Function? onreset;
180
- attribute Function? onscroll;
181
- attribute Function? onseeked;
182
- attribute Function? onseeking;
183
- attribute Function? onselect;
184
- attribute Function? onshow;
185
- attribute Function? onstalled;
186
- attribute Function? onsubmit;
187
- attribute Function? onsuspend;
188
- attribute Function? ontimeupdate;
189
- attribute Function? onvolumechange;
190
- attribute Function? onwaiting;
191
- };
192
- Document implements HTMLDocument;
193
-
194
- [Supplemental, NoInterfaceObject]
195
- interface DOMHTMLImplementation {
196
- Document createHTMLDocument(in DOMString title);
197
- };
198
- DOMImplementation implements DOMHTMLImplementation;
199
-
200
- [Supplemental, NoInterfaceObject]
201
- interface XMLDocumentLoader {
202
- boolean load(in DOMString url);
109
+ [TreatNonCallableAsNull] attribute Function? onabort;
110
+ [TreatNonCallableAsNull] attribute Function? onblur;
111
+ [TreatNonCallableAsNull] attribute Function? oncanplay;
112
+ [TreatNonCallableAsNull] attribute Function? oncanplaythrough;
113
+ [TreatNonCallableAsNull] attribute Function? onchange;
114
+ [TreatNonCallableAsNull] attribute Function? onclick;
115
+ [TreatNonCallableAsNull] attribute Function? oncontextmenu;
116
+ [TreatNonCallableAsNull] attribute Function? oncuechange;
117
+ [TreatNonCallableAsNull] attribute Function? ondblclick;
118
+ [TreatNonCallableAsNull] attribute Function? ondrag;
119
+ [TreatNonCallableAsNull] attribute Function? ondragend;
120
+ [TreatNonCallableAsNull] attribute Function? ondragenter;
121
+ [TreatNonCallableAsNull] attribute Function? ondragleave;
122
+ [TreatNonCallableAsNull] attribute Function? ondragover;
123
+ [TreatNonCallableAsNull] attribute Function? ondragstart;
124
+ [TreatNonCallableAsNull] attribute Function? ondrop;
125
+ [TreatNonCallableAsNull] attribute Function? ondurationchange;
126
+ [TreatNonCallableAsNull] attribute Function? onemptied;
127
+ [TreatNonCallableAsNull] attribute Function? onended;
128
+ [TreatNonCallableAsNull] attribute Function? onerror;
129
+ [TreatNonCallableAsNull] attribute Function? onfocus;
130
+ [TreatNonCallableAsNull] attribute Function? oninput;
131
+ [TreatNonCallableAsNull] attribute Function? oninvalid;
132
+ [TreatNonCallableAsNull] attribute Function? onkeydown;
133
+ [TreatNonCallableAsNull] attribute Function? onkeypress;
134
+ [TreatNonCallableAsNull] attribute Function? onkeyup;
135
+ [TreatNonCallableAsNull] attribute Function? onload;
136
+ [TreatNonCallableAsNull] attribute Function? onloadeddata;
137
+ [TreatNonCallableAsNull] attribute Function? onloadedmetadata;
138
+ [TreatNonCallableAsNull] attribute Function? onloadstart;
139
+ [TreatNonCallableAsNull] attribute Function? onmousedown;
140
+ [TreatNonCallableAsNull] attribute Function? onmousemove;
141
+ [TreatNonCallableAsNull] attribute Function? onmouseout;
142
+ [TreatNonCallableAsNull] attribute Function? onmouseover;
143
+ [TreatNonCallableAsNull] attribute Function? onmouseup;
144
+ [TreatNonCallableAsNull] attribute Function? onmousewheel;
145
+ [TreatNonCallableAsNull] attribute Function? onpause;
146
+ [TreatNonCallableAsNull] attribute Function? onplay;
147
+ [TreatNonCallableAsNull] attribute Function? onplaying;
148
+ [TreatNonCallableAsNull] attribute Function? onprogress;
149
+ [TreatNonCallableAsNull] attribute Function? onratechange;
150
+ [TreatNonCallableAsNull] attribute Function? onreset;
151
+ [TreatNonCallableAsNull] attribute Function? onscroll;
152
+ [TreatNonCallableAsNull] attribute Function? onseeked;
153
+ [TreatNonCallableAsNull] attribute Function? onseeking;
154
+ [TreatNonCallableAsNull] attribute Function? onselect;
155
+ [TreatNonCallableAsNull] attribute Function? onshow;
156
+ [TreatNonCallableAsNull] attribute Function? onstalled;
157
+ [TreatNonCallableAsNull] attribute Function? onsubmit;
158
+ [TreatNonCallableAsNull] attribute Function? onsuspend;
159
+ [TreatNonCallableAsNull] attribute Function? ontimeupdate;
160
+ [TreatNonCallableAsNull] attribute Function? onvolumechange;
161
+ [TreatNonCallableAsNull] attribute Function? onwaiting;
162
+
163
+ // special event handler IDL attributes that only apply to Document objects
164
+ [TreatNonCallableAsNull,LenientThis] attribute Function? onreadystatechange;
165
+ };
166
+
167
+ partial interface XMLDocument {
168
+ boolean load(DOMString url);
203
169
  };
204
170
 
205
171
  interface HTMLElement : Element {
206
- // DOM tree accessors
207
- NodeList getElementsByClassName(in DOMString classNames);
208
-
209
- // dynamic markup insertion
210
- attribute DOMString innerHTML;
211
- attribute DOMString outerHTML;
212
- void insertAdjacentHTML(in DOMString position, in DOMString text);
213
-
214
172
  // metadata attributes
215
- attribute DOMString id;
216
173
  attribute DOMString title;
217
174
  attribute DOMString lang;
218
175
  attribute DOMString dir;
@@ -222,7 +179,7 @@ interface HTMLElement : Element {
222
179
 
223
180
  // microdata
224
181
  attribute boolean itemScope;
225
- attribute DOMString itemType;
182
+ [PutForwards=value] readonly attribute DOMSettableTokenList itemType;
226
183
  attribute DOMString itemId;
227
184
  [PutForwards=value] readonly attribute DOMSettableTokenList itemRef;
228
185
  [PutForwards=value] readonly attribute DOMSettableTokenList itemProp;
@@ -256,60 +213,59 @@ interface HTMLElement : Element {
256
213
  readonly attribute CSSStyleDeclaration style;
257
214
 
258
215
  // event handler IDL attributes
259
- attribute Function? onabort;
260
- attribute Function? onblur;
261
- attribute Function? oncanplay;
262
- attribute Function? oncanplaythrough;
263
- attribute Function? onchange;
264
- attribute Function? onclick;
265
- attribute Function? oncontextmenu;
266
- attribute Function? oncuechange;
267
- attribute Function? ondblclick;
268
- attribute Function? ondrag;
269
- attribute Function? ondragend;
270
- attribute Function? ondragenter;
271
- attribute Function? ondragleave;
272
- attribute Function? ondragover;
273
- attribute Function? ondragstart;
274
- attribute Function? ondrop;
275
- attribute Function? ondurationchange;
276
- attribute Function? onemptied;
277
- attribute Function? onended;
278
- attribute Function? onerror;
279
- attribute Function? onfocus;
280
- attribute Function? oninput;
281
- attribute Function? oninvalid;
282
- attribute Function? onkeydown;
283
- attribute Function? onkeypress;
284
- attribute Function? onkeyup;
285
- attribute Function? onload;
286
- attribute Function? onloadeddata;
287
- attribute Function? onloadedmetadata;
288
- attribute Function? onloadstart;
289
- attribute Function? onmousedown;
290
- attribute Function? onmousemove;
291
- attribute Function? onmouseout;
292
- attribute Function? onmouseover;
293
- attribute Function? onmouseup;
294
- attribute Function? onmousewheel;
295
- attribute Function? onpause;
296
- attribute Function? onplay;
297
- attribute Function? onplaying;
298
- attribute Function? onprogress;
299
- attribute Function? onratechange;
300
- attribute Function? onreadystatechange;
301
- attribute Function? onreset;
302
- attribute Function? onscroll;
303
- attribute Function? onseeked;
304
- attribute Function? onseeking;
305
- attribute Function? onselect;
306
- attribute Function? onshow;
307
- attribute Function? onstalled;
308
- attribute Function? onsubmit;
309
- attribute Function? onsuspend;
310
- attribute Function? ontimeupdate;
311
- attribute Function? onvolumechange;
312
- attribute Function? onwaiting;
216
+ [TreatNonCallableAsNull] attribute Function? onabort;
217
+ [TreatNonCallableAsNull] attribute Function? onblur;
218
+ [TreatNonCallableAsNull] attribute Function? oncanplay;
219
+ [TreatNonCallableAsNull] attribute Function? oncanplaythrough;
220
+ [TreatNonCallableAsNull] attribute Function? onchange;
221
+ [TreatNonCallableAsNull] attribute Function? onclick;
222
+ [TreatNonCallableAsNull] attribute Function? oncontextmenu;
223
+ [TreatNonCallableAsNull] attribute Function? oncuechange;
224
+ [TreatNonCallableAsNull] attribute Function? ondblclick;
225
+ [TreatNonCallableAsNull] attribute Function? ondrag;
226
+ [TreatNonCallableAsNull] attribute Function? ondragend;
227
+ [TreatNonCallableAsNull] attribute Function? ondragenter;
228
+ [TreatNonCallableAsNull] attribute Function? ondragleave;
229
+ [TreatNonCallableAsNull] attribute Function? ondragover;
230
+ [TreatNonCallableAsNull] attribute Function? ondragstart;
231
+ [TreatNonCallableAsNull] attribute Function? ondrop;
232
+ [TreatNonCallableAsNull] attribute Function? ondurationchange;
233
+ [TreatNonCallableAsNull] attribute Function? onemptied;
234
+ [TreatNonCallableAsNull] attribute Function? onended;
235
+ [TreatNonCallableAsNull] attribute Function? onerror;
236
+ [TreatNonCallableAsNull] attribute Function? onfocus;
237
+ [TreatNonCallableAsNull] attribute Function? oninput;
238
+ [TreatNonCallableAsNull] attribute Function? oninvalid;
239
+ [TreatNonCallableAsNull] attribute Function? onkeydown;
240
+ [TreatNonCallableAsNull] attribute Function? onkeypress;
241
+ [TreatNonCallableAsNull] attribute Function? onkeyup;
242
+ [TreatNonCallableAsNull] attribute Function? onload;
243
+ [TreatNonCallableAsNull] attribute Function? onloadeddata;
244
+ [TreatNonCallableAsNull] attribute Function? onloadedmetadata;
245
+ [TreatNonCallableAsNull] attribute Function? onloadstart;
246
+ [TreatNonCallableAsNull] attribute Function? onmousedown;
247
+ [TreatNonCallableAsNull] attribute Function? onmousemove;
248
+ [TreatNonCallableAsNull] attribute Function? onmouseout;
249
+ [TreatNonCallableAsNull] attribute Function? onmouseover;
250
+ [TreatNonCallableAsNull] attribute Function? onmouseup;
251
+ [TreatNonCallableAsNull] attribute Function? onmousewheel;
252
+ [TreatNonCallableAsNull] attribute Function? onpause;
253
+ [TreatNonCallableAsNull] attribute Function? onplay;
254
+ [TreatNonCallableAsNull] attribute Function? onplaying;
255
+ [TreatNonCallableAsNull] attribute Function? onprogress;
256
+ [TreatNonCallableAsNull] attribute Function? onratechange;
257
+ [TreatNonCallableAsNull] attribute Function? onreset;
258
+ [TreatNonCallableAsNull] attribute Function? onscroll;
259
+ [TreatNonCallableAsNull] attribute Function? onseeked;
260
+ [TreatNonCallableAsNull] attribute Function? onseeking;
261
+ [TreatNonCallableAsNull] attribute Function? onselect;
262
+ [TreatNonCallableAsNull] attribute Function? onshow;
263
+ [TreatNonCallableAsNull] attribute Function? onstalled;
264
+ [TreatNonCallableAsNull] attribute Function? onsubmit;
265
+ [TreatNonCallableAsNull] attribute Function? onsuspend;
266
+ [TreatNonCallableAsNull] attribute Function? ontimeupdate;
267
+ [TreatNonCallableAsNull] attribute Function? onvolumechange;
268
+ [TreatNonCallableAsNull] attribute Function? onwaiting;
313
269
  };
314
270
 
315
271
  interface HTMLUnknownElement : HTMLElement { };
@@ -363,26 +319,24 @@ interface HTMLScriptElement : HTMLElement {
363
319
  };
364
320
 
365
321
  interface HTMLBodyElement : HTMLElement {
366
- attribute Function? onafterprint;
367
- attribute Function? onbeforeprint;
368
- attribute Function? onbeforeunload;
369
- attribute Function? onblur;
370
- attribute Function? onerror;
371
- attribute Function? onfocus;
372
- attribute Function? onhashchange;
373
- attribute Function? onload;
374
- attribute Function? onmessage;
375
- attribute Function? onoffline;
376
- attribute Function? ononline;
377
- attribute Function? onpopstate;
378
- attribute Function? onpagehide;
379
- attribute Function? onpageshow;
380
- attribute Function? onredo;
381
- attribute Function? onresize;
382
- attribute Function? onscroll;
383
- attribute Function? onstorage;
384
- attribute Function? onundo;
385
- attribute Function? onunload;
322
+ [TreatNonCallableAsNull] attribute Function? onafterprint;
323
+ [TreatNonCallableAsNull] attribute Function? onbeforeprint;
324
+ [TreatNonCallableAsNull] attribute Function? onbeforeunload;
325
+ [TreatNonCallableAsNull] attribute Function? onblur;
326
+ [TreatNonCallableAsNull] attribute Function? onerror;
327
+ [TreatNonCallableAsNull] attribute Function? onfocus;
328
+ [TreatNonCallableAsNull] attribute Function? onhashchange;
329
+ [TreatNonCallableAsNull] attribute Function? onload;
330
+ [TreatNonCallableAsNull] attribute Function? onmessage;
331
+ [TreatNonCallableAsNull] attribute Function? onoffline;
332
+ [TreatNonCallableAsNull] attribute Function? ononline;
333
+ [TreatNonCallableAsNull] attribute Function? onpopstate;
334
+ [TreatNonCallableAsNull] attribute Function? onpagehide;
335
+ [TreatNonCallableAsNull] attribute Function? onpageshow;
336
+ [TreatNonCallableAsNull] attribute Function? onresize;
337
+ [TreatNonCallableAsNull] attribute Function? onscroll;
338
+ [TreatNonCallableAsNull] attribute Function? onstorage;
339
+ [TreatNonCallableAsNull] attribute Function? onunload;
386
340
  };
387
341
 
388
342
  interface HTMLHeadingElement : HTMLElement {};
@@ -417,6 +371,7 @@ interface HTMLAnchorElement : HTMLElement {
417
371
  stringifier attribute DOMString href;
418
372
  attribute DOMString target;
419
373
 
374
+ attribute DOMString download;
420
375
  attribute DOMString ping;
421
376
 
422
377
  attribute DOMString rel;
@@ -437,10 +392,8 @@ interface HTMLAnchorElement : HTMLElement {
437
392
  attribute DOMString hash;
438
393
  };
439
394
 
440
- interface HTMLTimeElement : HTMLElement {
441
- attribute DOMString dateTime;
442
- attribute boolean pubDate;
443
- readonly attribute Date? valueAsDate;
395
+ interface HTMLDataElement : HTMLElement {
396
+ attribute DOMString value;
444
397
  };
445
398
 
446
399
  interface HTMLSpanElement : HTMLElement {};
@@ -453,8 +406,8 @@ interface HTMLModElement : HTMLElement {
453
406
  };
454
407
 
455
408
  [NamedConstructor=Image(),
456
- NamedConstructor=Image(in unsigned long width),
457
- NamedConstructor=Image(in unsigned long width, in unsigned long height)]
409
+ NamedConstructor=Image(unsigned long width),
410
+ NamedConstructor=Image(unsigned long width, unsigned long height)]
458
411
  interface HTMLImageElement : HTMLElement {
459
412
  attribute DOMString alt;
460
413
  attribute DOMString src;
@@ -503,7 +456,7 @@ interface HTMLObjectElement : HTMLElement {
503
456
  readonly attribute ValidityState validity;
504
457
  readonly attribute DOMString validationMessage;
505
458
  boolean checkValidity();
506
- void setCustomValidity(in DOMString error);
459
+ void setCustomValidity(DOMString error);
507
460
  };
508
461
 
509
462
  interface HTMLParamElement : HTMLElement {
@@ -520,7 +473,7 @@ interface HTMLVideoElement : HTMLMediaElement {
520
473
  };
521
474
 
522
475
  [NamedConstructor=Audio(),
523
- NamedConstructor=Audio(in DOMString src)]
476
+ NamedConstructor=Audio(DOMString src)]
524
477
  interface HTMLAudioElement : HTMLMediaElement {};
525
478
 
526
479
  interface HTMLSourceElement : HTMLElement {
@@ -536,6 +489,12 @@ interface HTMLTrackElement : HTMLElement {
536
489
  attribute DOMString label;
537
490
  attribute boolean default;
538
491
 
492
+ const unsigned short NONE = 0;
493
+ const unsigned short LOADING = 1;
494
+ const unsigned short LOADED = 2;
495
+ const unsigned short ERROR = 3;
496
+ readonly attribute unsigned short readyState;
497
+
539
498
  readonly attribute TextTrack track;
540
499
  };
541
500
 
@@ -556,7 +515,7 @@ interface HTMLMediaElement : HTMLElement {
556
515
  attribute DOMString preload;
557
516
  readonly attribute TimeRanges buffered;
558
517
  void load();
559
- DOMString canPlayType(in DOMString type);
518
+ DOMString canPlayType(DOMString type);
560
519
 
561
520
  // ready state
562
521
  const unsigned short HAVE_NOTHING = 0;
@@ -597,7 +556,7 @@ interface HTMLMediaElement : HTMLElement {
597
556
  readonly attribute AudioTrackList audioTracks;
598
557
  readonly attribute VideoTrackList videoTracks;
599
558
  readonly attribute TextTrackList textTracks;
600
- MutableTextTrack addTextTrack(in DOMString kind, in optional DOMString label, in optional DOMString language);
559
+ TextTrack addTextTrack(DOMString kind, optional DOMString label, optional DOMString language);
601
560
  };
602
561
 
603
562
  interface MediaError {
@@ -610,9 +569,11 @@ interface MediaError {
610
569
 
611
570
  interface AudioTrackList {
612
571
  readonly attribute unsigned long length;
613
- getter AudioTrack (in unsigned long index);
614
- AudioTrack? getTrackById(in DOMString id);
615
- attribute Function? onchange;
572
+ getter AudioTrack (unsigned long index);
573
+ AudioTrack? getTrackById(DOMString id);
574
+
575
+ [TreatNonCallableAsNull] attribute Function? onchange;
576
+ [TreatNonCallableAsNull] attribute Function? onaddtrack;
616
577
  };
617
578
 
618
579
  interface AudioTrack {
@@ -625,10 +586,12 @@ interface AudioTrack {
625
586
 
626
587
  interface VideoTrackList {
627
588
  readonly attribute unsigned long length;
628
- getter VideoTrack (in unsigned long index);
629
- VideoTrack? getTrackById(in DOMString id);
589
+ getter VideoTrack (unsigned long index);
590
+ VideoTrack? getTrackById(DOMString id);
630
591
  readonly attribute long selectedIndex;
631
- attribute Function? onchange;
592
+
593
+ [TreatNonCallableAsNull] attribute Function? onchange;
594
+ [TreatNonCallableAsNull] attribute Function? onaddtrack;
632
595
  };
633
596
 
634
597
  interface VideoTrack {
@@ -657,37 +620,36 @@ interface MediaController {
657
620
  attribute double volume;
658
621
  attribute boolean muted;
659
622
 
660
- attribute Function? onemptied;
661
- attribute Function? onloadedmetadata;
662
- attribute Function? onloadeddata;
663
- attribute Function? oncanplay;
664
- attribute Function? oncanplaythrough;
665
- attribute Function? onplaying;
666
- attribute Function? onended;
667
- attribute Function? onwaiting;
623
+ [TreatNonCallableAsNull] attribute Function? onemptied;
624
+ [TreatNonCallableAsNull] attribute Function? onloadedmetadata;
625
+ [TreatNonCallableAsNull] attribute Function? onloadeddata;
626
+ [TreatNonCallableAsNull] attribute Function? oncanplay;
627
+ [TreatNonCallableAsNull] attribute Function? oncanplaythrough;
628
+ [TreatNonCallableAsNull] attribute Function? onplaying;
629
+ [TreatNonCallableAsNull] attribute Function? onended;
630
+ [TreatNonCallableAsNull] attribute Function? onwaiting;
631
+
632
+ [TreatNonCallableAsNull] attribute Function? ondurationchange;
633
+ [TreatNonCallableAsNull] attribute Function? ontimeupdate;
634
+ [TreatNonCallableAsNull] attribute Function? onplay;
635
+ [TreatNonCallableAsNull] attribute Function? onpause;
636
+ [TreatNonCallableAsNull] attribute Function? onratechange;
637
+ [TreatNonCallableAsNull] attribute Function? onvolumechange;
638
+ };
639
+
640
+ interface TextTrackList {
641
+ readonly attribute unsigned long length;
642
+ getter TextTrack (unsigned long index);
668
643
 
669
- attribute Function? ondurationchange;
670
- attribute Function? ontimeupdate;
671
- attribute Function? onplay;
672
- attribute Function? onpause;
673
- attribute Function? onratechange;
674
- attribute Function? onvolumechange;
644
+ [TreatNonCallableAsNull] attribute Function? onaddtrack;
675
645
  };
676
646
 
677
- interface TextTrack {
647
+ interface TextTrack : EventTarget {
678
648
  readonly attribute DOMString kind;
679
649
  readonly attribute DOMString label;
680
650
  readonly attribute DOMString language;
681
651
 
682
- const unsigned short NONE = 0;
683
- const unsigned short LOADING = 1;
684
- const unsigned short LOADED = 2;
685
- const unsigned short ERROR = 3;
686
- readonly attribute unsigned short readyState;
687
- attribute Function? onload;
688
- attribute Function? onerror;
689
-
690
- const unsigned short OFF = 0;
652
+ const unsigned short DISABLED = 0;
691
653
  const unsigned short HIDDEN = 1;
692
654
  const unsigned short SHOWING = 2;
693
655
  attribute unsigned short mode;
@@ -695,66 +657,63 @@ interface TextTrack {
695
657
  readonly attribute TextTrackCueList? cues;
696
658
  readonly attribute TextTrackCueList? activeCues;
697
659
 
698
- attribute Function? oncuechange;
699
- };
700
- TextTrack implements EventTarget;
701
-
702
- typedef TextTrack[] TextTrackList;
660
+ void addCue(TextTrackCue cue);
661
+ void removeCue(TextTrackCue cue);
703
662
 
704
- interface MutableTextTrack : TextTrack {
705
- void addCue(in TextTrackCue cue);
706
- void removeCue(in TextTrackCue cue);
663
+ [TreatNonCallableAsNull] attribute Function? oncuechange;
707
664
  };
708
665
 
709
666
  interface TextTrackCueList {
710
667
  readonly attribute unsigned long length;
711
- getter TextTrackCue (in unsigned long index);
712
- TextTrackCue? getCueById(in DOMString id);
668
+ getter TextTrackCue (unsigned long index);
669
+ TextTrackCue? getCueById(DOMString id);
713
670
  };
714
671
 
715
672
 
716
-
717
- [Constructor(in DOMString id, in double startTime, in double endTime, in DOMString text, in optional DOMString settings, in optional boolean pauseOnExit)]
718
-
719
- interface TextTrackCue {
673
+ [Constructor(DOMString id, double startTime, double endTime, DOMString text, optional DOMString settings, optional boolean pauseOnExit)]
674
+ interface TextTrackCue : EventTarget {
720
675
  readonly attribute TextTrack? track;
721
- readonly attribute DOMString id;
722
-
723
- readonly attribute double startTime;
724
- readonly attribute double endTime;
725
- readonly attribute boolean pauseOnExit;
726
-
727
676
 
728
- readonly attribute DOMString direction;
729
- readonly attribute boolean snapToLines;
730
- readonly attribute long linePosition;
731
- readonly attribute long textPosition;
732
- readonly attribute long size;
733
- readonly attribute DOMString alignment;
734
-
735
-
736
- DOMString getCueAsSource();
677
+ attribute DOMString id;
678
+ attribute double startTime;
679
+ attribute double endTime;
680
+ attribute boolean pauseOnExit;
681
+ attribute DOMString direction;
682
+ attribute boolean snapToLines;
683
+ attribute long linePosition;
684
+ attribute long textPosition;
685
+ attribute long size;
686
+ attribute DOMString alignment;
687
+ attribute DOMString cueAsSource;
737
688
  DocumentFragment getCueAsHTML();
738
689
 
739
- attribute Function? onenter;
740
- attribute Function? onexit;
690
+ [TreatNonCallableAsNull] attribute Function? onenter;
691
+ [TreatNonCallableAsNull] attribute Function? onexit;
741
692
  };
742
- TextTrackCue implements EventTarget;
743
693
 
744
694
  interface TimeRanges {
745
695
  readonly attribute unsigned long length;
746
- double start(in unsigned long index);
747
- double end(in unsigned long index);
696
+ double start(unsigned long index);
697
+ double end(unsigned long index);
698
+ };
699
+
700
+ [Constructor(DOMString type, optional TrackEventInit eventInitDict)]
701
+ interface TrackEvent : Event {
702
+ readonly attribute object? track;
703
+ };
704
+
705
+ dictionary TrackEventInit : EventInit {
706
+ object? Track;
748
707
  };
749
708
 
750
709
  interface HTMLCanvasElement : HTMLElement {
751
710
  attribute unsigned long width;
752
711
  attribute unsigned long height;
753
712
 
754
- DOMString toDataURL(in optional DOMString type, in any... args);
755
- void toBlob(in FileCallback? callback, in optional DOMString type, in any... args);
713
+ DOMString toDataURL(optional DOMString type, any... args);
714
+ void toBlob(FileCallback? callback, optional DOMString type, any... args);
756
715
 
757
- object? getContext(in DOMString contextId, in any... args);
716
+ object? getContext(DOMString contextId, any... args);
758
717
  };
759
718
 
760
719
  interface CanvasRenderingContext2D {
@@ -767,11 +726,11 @@ interface CanvasRenderingContext2D {
767
726
  void restore(); // pop state stack and restore state
768
727
 
769
728
  // transformations (default transform is the identity matrix)
770
- void scale(in double x, in double y);
771
- void rotate(in double angle);
772
- void translate(in double x, in double y);
773
- void transform(in double a, in double b, in double c, in double d, in double e, in double f);
774
- void setTransform(in double a, in double b, in double c, in double d, in double e, in double f);
729
+ void scale(double x, double y);
730
+ void rotate(double angle);
731
+ void translate(double x, double y);
732
+ void transform(double a, double b, double c, double d, double e, double f);
733
+ void setTransform(double a, double b, double c, double d, double e, double f);
775
734
 
776
735
  // compositing
777
736
  attribute double globalAlpha; // (default 1.0)
@@ -780,11 +739,11 @@ interface CanvasRenderingContext2D {
780
739
  // colors and styles
781
740
  attribute any strokeStyle; // (default black)
782
741
  attribute any fillStyle; // (default black)
783
- CanvasGradient createLinearGradient(in double x0, in double y0, in double x1, in double y1);
784
- CanvasGradient createRadialGradient(in double x0, in double y0, in double r0, in double x1, in double y1, in double r1);
785
- CanvasPattern createPattern(in HTMLImageElement image, in DOMString repetition);
786
- CanvasPattern createPattern(in HTMLCanvasElement image, in DOMString repetition);
787
- CanvasPattern createPattern(in HTMLVideoElement image, in DOMString repetition);
742
+ CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
743
+ CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
744
+ CanvasPattern createPattern(HTMLImageElement image, DOMString repetition);
745
+ CanvasPattern createPattern(HTMLCanvasElement image, DOMString repetition);
746
+ CanvasPattern createPattern(HTMLVideoElement image, DOMString repetition);
788
747
 
789
748
  // line caps/joins
790
749
  attribute double lineWidth; // (default 1)
@@ -799,58 +758,58 @@ interface CanvasRenderingContext2D {
799
758
  attribute DOMString shadowColor; // (default transparent black)
800
759
 
801
760
  // rects
802
- void clearRect(in double x, in double y, in double w, in double h);
803
- void fillRect(in double x, in double y, in double w, in double h);
804
- void strokeRect(in double x, in double y, in double w, in double h);
761
+ void clearRect(double x, double y, double w, double h);
762
+ void fillRect(double x, double y, double w, double h);
763
+ void strokeRect(double x, double y, double w, double h);
805
764
 
806
765
  // path API
807
766
  void beginPath();
808
767
  void closePath();
809
- void moveTo(in double x, in double y);
810
- void lineTo(in double x, in double y);
811
- void quadraticCurveTo(in double cpx, in double cpy, in double x, in double y);
812
- void bezierCurveTo(in double cp1x, in double cp1y, in double cp2x, in double cp2y, in double x, in double y);
813
- void arcTo(in double x1, in double y1, in double x2, in double y2, in double radius);
814
- void rect(in double x, in double y, in double w, in double h);
815
- void arc(in double x, in double y, in double radius, in double startAngle, in double endAngle, in optional boolean anticlockwise);
768
+ void moveTo(double x, double y);
769
+ void lineTo(double x, double y);
770
+ void quadraticCurveTo(double cpx, double cpy, double x, double y);
771
+ void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
772
+ void arcTo(double x1, double y1, double x2, double y2, double radius);
773
+ void rect(double x, double y, double w, double h);
774
+ void arc(double x, double y, double radius, double startAngle, double endAngle, optional boolean anticlockwise);
816
775
  void fill();
817
776
  void stroke();
818
- void drawSystemFocusRing(in Element element);
819
- boolean drawCustomFocusRing(in Element element);
777
+ void drawSystemFocusRing(Element element);
778
+ boolean drawCustomFocusRing(Element element);
820
779
  void scrollPathIntoView();
821
780
  void clip();
822
- boolean isPointInPath(in double x, in double y);
781
+ boolean isPointInPath(double x, double y);
823
782
 
824
783
  // text
825
784
  attribute DOMString font; // (default 10px sans-serif)
826
785
  attribute DOMString textAlign; // "start", "end", "left", "right", "center" (default: "start")
827
786
  attribute DOMString textBaseline; // "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" (default: "alphabetic")
828
- void fillText(in DOMString text, in double x, in double y, in optional double maxWidth);
829
- void strokeText(in DOMString text, in double x, in double y, in optional double maxWidth);
830
- TextMetrics measureText(in DOMString text);
787
+ void fillText(DOMString text, double x, double y, optional double maxWidth);
788
+ void strokeText(DOMString text, double x, double y, optional double maxWidth);
789
+ TextMetrics measureText(DOMString text);
831
790
 
832
791
  // drawing images
833
- void drawImage(in HTMLImageElement image, in double dx, in double dy);
834
- void drawImage(in HTMLImageElement image, in double dx, in double dy, in double dw, in double dh);
835
- void drawImage(in HTMLImageElement image, in double sx, in double sy, in double sw, in double sh, in double dx, in double dy, in double dw, in double dh);
836
- void drawImage(in HTMLCanvasElement image, in double dx, in double dy);
837
- void drawImage(in HTMLCanvasElement image, in double dx, in double dy, in double dw, in double dh);
838
- void drawImage(in HTMLCanvasElement image, in double sx, in double sy, in double sw, in double sh, in double dx, in double dy, in double dw, in double dh);
839
- void drawImage(in HTMLVideoElement image, in double dx, in double dy);
840
- void drawImage(in HTMLVideoElement image, in double dx, in double dy, in double dw, in double dh);
841
- void drawImage(in HTMLVideoElement image, in double sx, in double sy, in double sw, in double sh, in double dx, in double dy, in double dw, in double dh);
792
+ void drawImage(HTMLImageElement image, double dx, double dy);
793
+ void drawImage(HTMLImageElement image, double dx, double dy, double dw, double dh);
794
+ void drawImage(HTMLImageElement image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
795
+ void drawImage(HTMLCanvasElement image, double dx, double dy);
796
+ void drawImage(HTMLCanvasElement image, double dx, double dy, double dw, double dh);
797
+ void drawImage(HTMLCanvasElement image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
798
+ void drawImage(HTMLVideoElement image, double dx, double dy);
799
+ void drawImage(HTMLVideoElement image, double dx, double dy, double dw, double dh);
800
+ void drawImage(HTMLVideoElement image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
842
801
 
843
802
  // pixel manipulation
844
- ImageData createImageData(in double sw, in double sh);
845
- ImageData createImageData(in ImageData imagedata);
846
- ImageData getImageData(in double sx, in double sy, in double sw, in double sh);
847
- void putImageData(in ImageData imagedata, in double dx, in double dy);
848
- void putImageData(in ImageData imagedata, in double dx, in double dy, in double dirtyX, in double dirtyY, in double dirtyWidth, in double dirtyHeight);
803
+ ImageData createImageData(double sw, double sh);
804
+ ImageData createImageData(ImageData imagedata);
805
+ ImageData getImageData(double sx, double sy, double sw, double sh);
806
+ void putImageData(ImageData imagedata, double dx, double dy);
807
+ void putImageData(ImageData imagedata, double dx, double dy, double dirtyX, double dirtyY, double dirtyWidth, double dirtyHeight);
849
808
  };
850
809
 
851
810
  interface CanvasGradient {
852
811
  // opaque object
853
- void addColorStop(in double offset, in DOMString color);
812
+ void addColorStop(double offset, DOMString color);
854
813
  };
855
814
 
856
815
  interface CanvasPattern {
@@ -864,13 +823,7 @@ interface TextMetrics {
864
823
  interface ImageData {
865
824
  readonly attribute unsigned long width;
866
825
  readonly attribute unsigned long height;
867
- readonly attribute CanvasPixelArray data;
868
- };
869
-
870
- interface CanvasPixelArray {
871
- readonly attribute unsigned long length;
872
- getter octet (in unsigned long index);
873
- setter void (in unsigned long index, in octet value);
826
+ readonly attribute Uint8ClampedArray data;
874
827
  };
875
828
 
876
829
  interface HTMLMapElement : HTMLElement {
@@ -886,6 +839,7 @@ interface HTMLAreaElement : HTMLElement {
886
839
  stringifier attribute DOMString href;
887
840
  attribute DOMString target;
888
841
 
842
+ attribute DOMString download;
889
843
  attribute DOMString ping;
890
844
 
891
845
  attribute DOMString rel;
@@ -917,8 +871,8 @@ interface HTMLTableElement : HTMLElement {
917
871
  readonly attribute HTMLCollection tBodies;
918
872
  HTMLElement createTBody();
919
873
  readonly attribute HTMLCollection rows;
920
- HTMLElement insertRow(in optional long index);
921
- void deleteRow(in long index);
874
+ HTMLElement insertRow(optional long index);
875
+ void deleteRow(long index);
922
876
  attribute DOMString border;
923
877
  };
924
878
 
@@ -930,16 +884,16 @@ interface HTMLTableColElement : HTMLElement {
930
884
 
931
885
  interface HTMLTableSectionElement : HTMLElement {
932
886
  readonly attribute HTMLCollection rows;
933
- HTMLElement insertRow(in optional long index);
934
- void deleteRow(in long index);
887
+ HTMLElement insertRow(optional long index);
888
+ void deleteRow(long index);
935
889
  };
936
890
 
937
891
  interface HTMLTableRowElement : HTMLElement {
938
892
  readonly attribute long rowIndex;
939
893
  readonly attribute long sectionRowIndex;
940
894
  readonly attribute HTMLCollection cells;
941
- HTMLElement insertCell(in optional long index);
942
- void deleteCell(in long index);
895
+ HTMLElement insertCell(optional long index);
896
+ void deleteCell(long index);
943
897
  };
944
898
 
945
899
  interface HTMLTableDataCellElement : HTMLTableCellElement {};
@@ -969,8 +923,8 @@ interface HTMLFormElement : HTMLElement {
969
923
 
970
924
  readonly attribute HTMLFormControlsCollection elements;
971
925
  readonly attribute long length;
972
- caller getter any (in unsigned long index);
973
- caller getter any (in DOMString name);
926
+ getter Element (unsigned long index);
927
+ getter object (DOMString name);
974
928
 
975
929
  void submit();
976
930
  void reset();
@@ -990,7 +944,7 @@ interface HTMLFieldSetElement : HTMLElement {
990
944
  readonly attribute ValidityState validity;
991
945
  readonly attribute DOMString validationMessage;
992
946
  boolean checkValidity();
993
- void setCustomValidity(in DOMString error);
947
+ void setCustomValidity(DOMString error);
994
948
  };
995
949
 
996
950
  interface HTMLLegendElement : HTMLElement {
@@ -1019,7 +973,7 @@ interface HTMLInputElement : HTMLElement {
1019
973
  attribute DOMString formMethod;
1020
974
  attribute boolean formNoValidate;
1021
975
  attribute DOMString formTarget;
1022
- attribute DOMString height;
976
+ attribute unsigned long height;
1023
977
  attribute boolean indeterminate;
1024
978
  readonly attribute HTMLElement? list;
1025
979
  attribute DOMString max;
@@ -1039,17 +993,16 @@ interface HTMLInputElement : HTMLElement {
1039
993
  attribute DOMString value;
1040
994
  attribute Date valueAsDate;
1041
995
  attribute double valueAsNumber;
1042
- readonly attribute HTMLOptionElement? selectedOption;
1043
- attribute DOMString width;
996
+ attribute unsigned long width;
1044
997
 
1045
- void stepUp(in optional long n);
1046
- void stepDown(in optional long n);
998
+ void stepUp(optional long n);
999
+ void stepDown(optional long n);
1047
1000
 
1048
1001
  readonly attribute boolean willValidate;
1049
1002
  readonly attribute ValidityState validity;
1050
1003
  readonly attribute DOMString validationMessage;
1051
1004
  boolean checkValidity();
1052
- void setCustomValidity(in DOMString error);
1005
+ void setCustomValidity(DOMString error);
1053
1006
 
1054
1007
  readonly attribute NodeList labels;
1055
1008
 
@@ -1057,7 +1010,7 @@ interface HTMLInputElement : HTMLElement {
1057
1010
  attribute unsigned long selectionStart;
1058
1011
  attribute unsigned long selectionEnd;
1059
1012
  attribute DOMString selectionDirection;
1060
- void setSelectionRange(in unsigned long start, in unsigned long end, in optional DOMString direction);
1013
+ void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
1061
1014
  };
1062
1015
 
1063
1016
  interface HTMLButtonElement : HTMLElement {
@@ -1067,7 +1020,7 @@ interface HTMLButtonElement : HTMLElement {
1067
1020
  attribute DOMString formAction;
1068
1021
  attribute DOMString formEnctype;
1069
1022
  attribute DOMString formMethod;
1070
- attribute DOMString formNoValidate;
1023
+ attribute boolean formNoValidate;
1071
1024
  attribute DOMString formTarget;
1072
1025
  attribute DOMString name;
1073
1026
  attribute DOMString type;
@@ -1077,7 +1030,7 @@ interface HTMLButtonElement : HTMLElement {
1077
1030
  readonly attribute ValidityState validity;
1078
1031
  readonly attribute DOMString validationMessage;
1079
1032
  boolean checkValidity();
1080
- void setCustomValidity(in DOMString error);
1033
+ void setCustomValidity(DOMString error);
1081
1034
 
1082
1035
  readonly attribute NodeList labels;
1083
1036
  };
@@ -1095,11 +1048,14 @@ interface HTMLSelectElement : HTMLElement {
1095
1048
 
1096
1049
  readonly attribute HTMLOptionsCollection options;
1097
1050
  attribute unsigned long length;
1098
- getter any item(in unsigned long index);
1099
- any namedItem(in DOMString name);
1100
- void add(in HTMLElement element, in optional HTMLElement? before);
1101
- void add(in HTMLElement element, in long before);
1102
- void remove(in long index);
1051
+ getter Element item(unsigned long index);
1052
+ object namedItem(DOMString name);
1053
+ void add(HTMLOptionElement element, optional HTMLElement? before);
1054
+ void add(HTMLOptGroupElement element, optional HTMLElement? before);
1055
+ void add(HTMLOptionElement element, long before);
1056
+ void add(HTMLOptGroupElement element, long before);
1057
+ void remove(long index);
1058
+ setter creator void (unsigned long index, HTMLOptionElement option);
1103
1059
 
1104
1060
  readonly attribute HTMLCollection selectedOptions;
1105
1061
  attribute long selectedIndex;
@@ -1109,7 +1065,7 @@ interface HTMLSelectElement : HTMLElement {
1109
1065
  readonly attribute ValidityState validity;
1110
1066
  readonly attribute DOMString validationMessage;
1111
1067
  boolean checkValidity();
1112
- void setCustomValidity(in DOMString error);
1068
+ void setCustomValidity(DOMString error);
1113
1069
 
1114
1070
  readonly attribute NodeList labels;
1115
1071
  };
@@ -1124,10 +1080,10 @@ interface HTMLOptGroupElement : HTMLElement {
1124
1080
  };
1125
1081
 
1126
1082
  [NamedConstructor=Option(),
1127
- NamedConstructor=Option(in DOMString text),
1128
- NamedConstructor=Option(in DOMString text, in DOMString value),
1129
- NamedConstructor=Option(in DOMString text, in DOMString value, in boolean defaultSelected),
1130
- NamedConstructor=Option(in DOMString text, in DOMString value, in boolean defaultSelected, in boolean selected)]
1083
+ NamedConstructor=Option(DOMString text),
1084
+ NamedConstructor=Option(DOMString text, DOMString value),
1085
+ NamedConstructor=Option(DOMString text, DOMString value, boolean defaultSelected),
1086
+ NamedConstructor=Option(DOMString text, DOMString value, boolean defaultSelected, boolean selected)]
1131
1087
  interface HTMLOptionElement : HTMLElement {
1132
1088
  attribute boolean disabled;
1133
1089
  readonly attribute HTMLFormElement? form;
@@ -1163,7 +1119,7 @@ interface HTMLTextAreaElement : HTMLElement {
1163
1119
  readonly attribute ValidityState validity;
1164
1120
  readonly attribute DOMString validationMessage;
1165
1121
  boolean checkValidity();
1166
- void setCustomValidity(in DOMString error);
1122
+ void setCustomValidity(DOMString error);
1167
1123
 
1168
1124
  readonly attribute NodeList labels;
1169
1125
 
@@ -1171,7 +1127,7 @@ interface HTMLTextAreaElement : HTMLElement {
1171
1127
  attribute unsigned long selectionStart;
1172
1128
  attribute unsigned long selectionEnd;
1173
1129
  attribute DOMString selectionDirection;
1174
- void setSelectionRange(in unsigned long start, in unsigned long end, in optional DOMString direction);
1130
+ void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
1175
1131
  };
1176
1132
 
1177
1133
  interface HTMLKeygenElement : HTMLElement {
@@ -1188,7 +1144,7 @@ interface HTMLKeygenElement : HTMLElement {
1188
1144
  readonly attribute ValidityState validity;
1189
1145
  readonly attribute DOMString validationMessage;
1190
1146
  boolean checkValidity();
1191
- void setCustomValidity(in DOMString error);
1147
+ void setCustomValidity(DOMString error);
1192
1148
 
1193
1149
  readonly attribute NodeList labels;
1194
1150
  };
@@ -1206,7 +1162,7 @@ interface HTMLOutputElement : HTMLElement {
1206
1162
  readonly attribute ValidityState validity;
1207
1163
  readonly attribute DOMString validationMessage;
1208
1164
  boolean checkValidity();
1209
- void setCustomValidity(in DOMString error);
1165
+ void setCustomValidity(DOMString error);
1210
1166
 
1211
1167
  readonly attribute NodeList labels;
1212
1168
  };
@@ -1259,16 +1215,16 @@ interface HTMLMenuElement : HTMLElement {
1259
1215
  };
1260
1216
 
1261
1217
  [ReplaceableNamedProperties]
1262
- interface Window {
1218
+ interface Window : EventTarget {
1263
1219
  // the current browsing context
1264
- readonly attribute WindowProxy window;
1265
- readonly attribute WindowProxy self;
1266
- readonly attribute Document document;
1220
+ [Unforgeable] readonly attribute WindowProxy window;
1221
+ [Replaceable] readonly attribute WindowProxy self;
1222
+ [Unforgeable] readonly attribute Document document;
1267
1223
  attribute DOMString name;
1268
- [PutForwards=href] readonly attribute Location location;
1224
+ [PutForwards=href, Unforgeable] readonly attribute Location location;
1269
1225
  readonly attribute History history;
1270
1226
 
1271
- readonly attribute UndoManager undoManager;
1227
+ boolean find(optional DOMString aString, optional boolean aCaseSensitive, optional boolean aBackwards, optional boolean aWrapAround, optional boolean aWholeWord, optional boolean aSearchInFrames, optional boolean aShowDialog);
1272
1228
 
1273
1229
  [Replaceable] readonly attribute BarProp locationbar;
1274
1230
  [Replaceable] readonly attribute BarProp menubar;
@@ -1285,13 +1241,13 @@ interface Window {
1285
1241
  // other browsing contexts
1286
1242
  [Replaceable] readonly attribute WindowProxy frames;
1287
1243
  [Replaceable] readonly attribute unsigned long length;
1288
- readonly attribute WindowProxy top;
1244
+ [Unforgeable] readonly attribute WindowProxy top;
1289
1245
  attribute WindowProxy opener;
1290
1246
  readonly attribute WindowProxy parent;
1291
1247
  readonly attribute Element? frameElement;
1292
- WindowProxy open(in optional DOMString url, in optional DOMString target, in optional DOMString features, in optional DOMString replace);
1293
- getter WindowProxy (in unsigned long index);
1294
- getter any (in DOMString name);
1248
+ WindowProxy open(optional DOMString url, optional DOMString target, optional DOMString features, optional boolean replace);
1249
+ getter WindowProxy (unsigned long index);
1250
+ getter object (DOMString name);
1295
1251
 
1296
1252
  // the user agent
1297
1253
  readonly attribute Navigator navigator;
@@ -1299,87 +1255,83 @@ interface Window {
1299
1255
  readonly attribute ApplicationCache applicationCache;
1300
1256
 
1301
1257
  // user prompts
1302
- void alert(in DOMString message);
1303
- boolean confirm(in DOMString message);
1304
- DOMString? prompt(in DOMString message, in optional DOMString default);
1258
+ void alert(DOMString message);
1259
+ boolean confirm(DOMString message);
1260
+ DOMString? prompt(DOMString message, optional DOMString default);
1305
1261
  void print();
1306
- any showModalDialog(in DOMString url, in optional any argument);
1262
+ any showModalDialog(DOMString url, optional any argument);
1307
1263
 
1308
1264
  // cross-document messaging
1309
- void postMessage(in any message, in DOMString targetOrigin, in optional sequence<Transferable> transfer);
1265
+ void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);
1310
1266
 
1311
1267
  // event handler IDL attributes
1312
- attribute Function? onabort;
1313
- attribute Function? onafterprint;
1314
- attribute Function? onbeforeprint;
1315
- attribute Function? onbeforeunload;
1316
- attribute Function? onblur;
1317
- attribute Function? oncanplay;
1318
- attribute Function? oncanplaythrough;
1319
- attribute Function? onchange;
1320
- attribute Function? onclick;
1321
- attribute Function? oncontextmenu;
1322
- attribute Function? oncuechange;
1323
- attribute Function? ondblclick;
1324
- attribute Function? ondrag;
1325
- attribute Function? ondragend;
1326
- attribute Function? ondragenter;
1327
- attribute Function? ondragleave;
1328
- attribute Function? ondragover;
1329
- attribute Function? ondragstart;
1330
- attribute Function? ondrop;
1331
- attribute Function? ondurationchange;
1332
- attribute Function? onemptied;
1333
- attribute Function? onended;
1334
- attribute Function? onerror;
1335
- attribute Function? onfocus;
1336
- attribute Function? onhashchange;
1337
- attribute Function? oninput;
1338
- attribute Function? oninvalid;
1339
- attribute Function? onkeydown;
1340
- attribute Function? onkeypress;
1341
- attribute Function? onkeyup;
1342
- attribute Function? onload;
1343
- attribute Function? onloadeddata;
1344
- attribute Function? onloadedmetadata;
1345
- attribute Function? onloadstart;
1346
- attribute Function? onmessage;
1347
- attribute Function? onmousedown;
1348
- attribute Function? onmousemove;
1349
- attribute Function? onmouseout;
1350
- attribute Function? onmouseover;
1351
- attribute Function? onmouseup;
1352
- attribute Function? onmousewheel;
1353
- attribute Function? onoffline;
1354
- attribute Function? ononline;
1355
- attribute Function? onpause;
1356
- attribute Function? onplay;
1357
- attribute Function? onplaying;
1358
- attribute Function? onpagehide;
1359
- attribute Function? onpageshow;
1360
- attribute Function? onpopstate;
1361
- attribute Function? onprogress;
1362
- attribute Function? onratechange;
1363
- attribute Function? onreadystatechange;
1364
- attribute Function? onredo;
1365
- attribute Function? onreset;
1366
- attribute Function? onresize;
1367
- attribute Function? onscroll;
1368
- attribute Function? onseeked;
1369
- attribute Function? onseeking;
1370
- attribute Function? onselect;
1371
- attribute Function? onshow;
1372
- attribute Function? onstalled;
1373
- attribute Function? onstorage;
1374
- attribute Function? onsubmit;
1375
- attribute Function? onsuspend;
1376
- attribute Function? ontimeupdate;
1377
- attribute Function? onundo;
1378
- attribute Function? onunload;
1379
- attribute Function? onvolumechange;
1380
- attribute Function? onwaiting;
1381
- };
1382
- Window implements EventTarget;
1268
+ [TreatNonCallableAsNull] attribute Function? onabort;
1269
+ [TreatNonCallableAsNull] attribute Function? onafterprint;
1270
+ [TreatNonCallableAsNull] attribute Function? onbeforeprint;
1271
+ [TreatNonCallableAsNull] attribute Function? onbeforeunload;
1272
+ [TreatNonCallableAsNull] attribute Function? onblur;
1273
+ [TreatNonCallableAsNull] attribute Function? oncanplay;
1274
+ [TreatNonCallableAsNull] attribute Function? oncanplaythrough;
1275
+ [TreatNonCallableAsNull] attribute Function? onchange;
1276
+ [TreatNonCallableAsNull] attribute Function? onclick;
1277
+ [TreatNonCallableAsNull] attribute Function? oncontextmenu;
1278
+ [TreatNonCallableAsNull] attribute Function? oncuechange;
1279
+ [TreatNonCallableAsNull] attribute Function? ondblclick;
1280
+ [TreatNonCallableAsNull] attribute Function? ondrag;
1281
+ [TreatNonCallableAsNull] attribute Function? ondragend;
1282
+ [TreatNonCallableAsNull] attribute Function? ondragenter;
1283
+ [TreatNonCallableAsNull] attribute Function? ondragleave;
1284
+ [TreatNonCallableAsNull] attribute Function? ondragover;
1285
+ [TreatNonCallableAsNull] attribute Function? ondragstart;
1286
+ [TreatNonCallableAsNull] attribute Function? ondrop;
1287
+ [TreatNonCallableAsNull] attribute Function? ondurationchange;
1288
+ [TreatNonCallableAsNull] attribute Function? onemptied;
1289
+ [TreatNonCallableAsNull] attribute Function? onended;
1290
+ [TreatNonCallableAsNull] attribute Function? onerror;
1291
+ [TreatNonCallableAsNull] attribute Function? onfocus;
1292
+ [TreatNonCallableAsNull] attribute Function? onhashchange;
1293
+ [TreatNonCallableAsNull] attribute Function? oninput;
1294
+ [TreatNonCallableAsNull] attribute Function? oninvalid;
1295
+ [TreatNonCallableAsNull] attribute Function? onkeydown;
1296
+ [TreatNonCallableAsNull] attribute Function? onkeypress;
1297
+ [TreatNonCallableAsNull] attribute Function? onkeyup;
1298
+ [TreatNonCallableAsNull] attribute Function? onload;
1299
+ [TreatNonCallableAsNull] attribute Function? onloadeddata;
1300
+ [TreatNonCallableAsNull] attribute Function? onloadedmetadata;
1301
+ [TreatNonCallableAsNull] attribute Function? onloadstart;
1302
+ [TreatNonCallableAsNull] attribute Function? onmessage;
1303
+ [TreatNonCallableAsNull] attribute Function? onmousedown;
1304
+ [TreatNonCallableAsNull] attribute Function? onmousemove;
1305
+ [TreatNonCallableAsNull] attribute Function? onmouseout;
1306
+ [TreatNonCallableAsNull] attribute Function? onmouseover;
1307
+ [TreatNonCallableAsNull] attribute Function? onmouseup;
1308
+ [TreatNonCallableAsNull] attribute Function? onmousewheel;
1309
+ [TreatNonCallableAsNull] attribute Function? onoffline;
1310
+ [TreatNonCallableAsNull] attribute Function? ononline;
1311
+ [TreatNonCallableAsNull] attribute Function? onpause;
1312
+ [TreatNonCallableAsNull] attribute Function? onplay;
1313
+ [TreatNonCallableAsNull] attribute Function? onplaying;
1314
+ [TreatNonCallableAsNull] attribute Function? onpagehide;
1315
+ [TreatNonCallableAsNull] attribute Function? onpageshow;
1316
+ [TreatNonCallableAsNull] attribute Function? onpopstate;
1317
+ [TreatNonCallableAsNull] attribute Function? onprogress;
1318
+ [TreatNonCallableAsNull] attribute Function? onratechange;
1319
+ [TreatNonCallableAsNull] attribute Function? onreset;
1320
+ [TreatNonCallableAsNull] attribute Function? onresize;
1321
+ [TreatNonCallableAsNull] attribute Function? onscroll;
1322
+ [TreatNonCallableAsNull] attribute Function? onseeked;
1323
+ [TreatNonCallableAsNull] attribute Function? onseeking;
1324
+ [TreatNonCallableAsNull] attribute Function? onselect;
1325
+ [TreatNonCallableAsNull] attribute Function? onshow;
1326
+ [TreatNonCallableAsNull] attribute Function? onstalled;
1327
+ [TreatNonCallableAsNull] attribute Function? onstorage;
1328
+ [TreatNonCallableAsNull] attribute Function? onsubmit;
1329
+ [TreatNonCallableAsNull] attribute Function? onsuspend;
1330
+ [TreatNonCallableAsNull] attribute Function? ontimeupdate;
1331
+ [TreatNonCallableAsNull] attribute Function? onunload;
1332
+ [TreatNonCallableAsNull] attribute Function? onvolumechange;
1333
+ [TreatNonCallableAsNull] attribute Function? onwaiting;
1334
+ };
1383
1335
 
1384
1336
  interface BarProp {
1385
1337
  attribute boolean visible;
@@ -1388,17 +1340,17 @@ interface BarProp {
1388
1340
  interface History {
1389
1341
  readonly attribute long length;
1390
1342
  readonly attribute any state;
1391
- void go(in optional long delta);
1343
+ void go(optional long delta);
1392
1344
  void back();
1393
1345
  void forward();
1394
- void pushState(in any data, in DOMString title, in optional DOMString url);
1395
- void replaceState(in any data, in DOMString title, in optional DOMString url);
1346
+ void pushState(any data, DOMString title, optional DOMString url);
1347
+ void replaceState(any data, DOMString title, optional DOMString url);
1396
1348
  };
1397
1349
 
1398
1350
  interface Location {
1399
1351
  stringifier attribute DOMString href;
1400
- void assign(in DOMString url);
1401
- void replace(in DOMString url);
1352
+ void assign(DOMString url);
1353
+ void replace(DOMString url);
1402
1354
  void reload();
1403
1355
 
1404
1356
  // URL decomposition IDL attributes
@@ -1409,32 +1361,42 @@ interface Location {
1409
1361
  attribute DOMString pathname;
1410
1362
  attribute DOMString search;
1411
1363
  attribute DOMString hash;
1412
-
1413
- // resolving relative URLs
1414
- DOMString resolveURL(in DOMString url);
1415
1364
  };
1416
1365
 
1366
+ [Constructor(DOMString type, optional PopStateEventInit eventInitDict)]
1417
1367
  interface PopStateEvent : Event {
1418
1368
  readonly attribute any state;
1419
- void initPopStateEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any stateArg);
1420
1369
  };
1421
1370
 
1371
+ dictionary PopStateEventInit : EventInit {
1372
+ any state;
1373
+ };
1374
+
1375
+ [Constructor(DOMString type, optional HashChangeEventInit eventInitDict)]
1422
1376
  interface HashChangeEvent : Event {
1423
1377
  readonly attribute DOMString oldURL;
1424
1378
  readonly attribute DOMString newURL;
1425
- void initHashChangeEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString oldURLArg, in DOMString newURLArg);
1426
1379
  };
1427
1380
 
1381
+ dictionary HashChangeEventInit : EventInit {
1382
+ DOMString oldURL;
1383
+ DOMString newURL;
1384
+ };
1385
+
1386
+ [Constructor(DOMString type, optional PageTransitionEventInit eventInitDict)]
1428
1387
  interface PageTransitionEvent : Event {
1429
1388
  readonly attribute boolean persisted;
1430
- void initPageTransitionEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in boolean persistedArg);
1389
+ };
1390
+
1391
+ dictionary PageTransitionEventInit : EventInit {
1392
+ boolean persisted;
1431
1393
  };
1432
1394
 
1433
1395
  interface BeforeUnloadEvent : Event {
1434
1396
  attribute DOMString returnValue;
1435
1397
  };
1436
1398
 
1437
- interface ApplicationCache {
1399
+ interface ApplicationCache : EventTarget {
1438
1400
 
1439
1401
  // update status
1440
1402
  const unsigned short UNCACHED = 0;
@@ -1447,43 +1409,45 @@ interface ApplicationCache {
1447
1409
 
1448
1410
  // updates
1449
1411
  void update();
1412
+ void abort();
1450
1413
  void swapCache();
1451
1414
 
1452
1415
  // events
1453
- attribute Function? onchecking;
1454
- attribute Function? onerror;
1455
- attribute Function? onnoupdate;
1456
- attribute Function? ondownloading;
1457
- attribute Function? onprogress;
1458
- attribute Function? onupdateready;
1459
- attribute Function? oncached;
1460
- attribute Function? onobsolete;
1416
+ [TreatNonCallableAsNull] attribute Function? onchecking;
1417
+ [TreatNonCallableAsNull] attribute Function? onerror;
1418
+ [TreatNonCallableAsNull] attribute Function? onnoupdate;
1419
+ [TreatNonCallableAsNull] attribute Function? ondownloading;
1420
+ [TreatNonCallableAsNull] attribute Function? onprogress;
1421
+ [TreatNonCallableAsNull] attribute Function? onupdateready;
1422
+ [TreatNonCallableAsNull] attribute Function? oncached;
1423
+ [TreatNonCallableAsNull] attribute Function? onobsolete;
1461
1424
  };
1462
- ApplicationCache implements EventTarget;
1463
1425
 
1464
- [Supplemental, NoInterfaceObject]
1426
+ [NoInterfaceObject]
1465
1427
  interface NavigatorOnLine {
1466
1428
  readonly attribute boolean onLine;
1467
1429
  };
1468
1430
 
1469
1431
  [Callback=FunctionOnly, NoInterfaceObject]
1470
1432
  interface Function {
1471
- any call(in any... arguments);
1433
+ any call(any... arguments);
1472
1434
  };
1473
1435
 
1474
- [Supplemental, NoInterfaceObject]
1436
+ [NoInterfaceObject]
1475
1437
  interface WindowBase64 {
1476
- DOMString btoa(in DOMString btoa);
1477
- DOMString atob(in DOMString atob);
1438
+ DOMString btoa(DOMString btoa);
1439
+ DOMString atob(DOMString atob);
1478
1440
  };
1479
1441
  Window implements WindowBase64;
1480
1442
 
1481
- [Supplemental, NoInterfaceObject]
1443
+ [NoInterfaceObject]
1482
1444
  interface WindowTimers {
1483
- long setTimeout(in any handler, in optional any timeout, in any... args);
1484
- void clearTimeout(in long handle);
1485
- long setInterval(in any handler, in optional any timeout, in any... args);
1486
- void clearInterval(in long handle);
1445
+ long setTimeout(Function handler, optional long timeout, any... args);
1446
+ long setTimeout([AllowAny] DOMString handler, optional long timeout, any... args);
1447
+ void clearTimeout(long handle);
1448
+ long setInterval(Function handler, optional long timeout, any... args);
1449
+ long setInterval([AllowAny] DOMString handler, optional long timeout, any... args);
1450
+ void clearInterval(long handle);
1487
1451
  };
1488
1452
  Window implements WindowTimers;
1489
1453
 
@@ -1500,7 +1464,7 @@ Navigator implements NavigatorOnLine;
1500
1464
  Navigator implements NavigatorContentUtils;
1501
1465
  Navigator implements NavigatorStorageUtils;
1502
1466
 
1503
- [Supplemental, NoInterfaceObject]
1467
+ [NoInterfaceObject]
1504
1468
  interface NavigatorID {
1505
1469
  readonly attribute DOMString appName;
1506
1470
  readonly attribute DOMString appVersion;
@@ -1508,21 +1472,25 @@ interface NavigatorID {
1508
1472
  readonly attribute DOMString userAgent;
1509
1473
  };
1510
1474
 
1511
- [Supplemental, NoInterfaceObject]
1475
+ [NoInterfaceObject]
1512
1476
  interface NavigatorContentUtils {
1513
1477
  // content handler registration
1514
- void registerProtocolHandler(in DOMString scheme, in DOMString url, in DOMString title);
1515
- void registerContentHandler(in DOMString mimeType, in DOMString url, in DOMString title);
1478
+ void registerProtocolHandler(DOMString scheme, DOMString url, DOMString title);
1479
+ void registerContentHandler(DOMString mimeType, DOMString url, DOMString title);
1480
+ DOMString isProtocolHandlerRegistered(DOMString scheme, DOMString url);
1481
+ DOMString isContentHandlerRegistered(DOMString mimeType, DOMString url);
1482
+ void unregisterProtocolHandler(DOMString scheme, DOMString url);
1483
+ void unregisterContentHandler(DOMString mimeType, DOMString url);
1516
1484
  };
1517
1485
 
1518
- [Supplemental, NoInterfaceObject]
1486
+ [NoInterfaceObject]
1519
1487
  interface NavigatorStorageUtils {
1520
1488
  void yieldForStorageUpdates();
1521
1489
  };
1522
1490
 
1523
1491
  interface External {
1524
- void AddSearchProvider(in DOMString engineURL);
1525
- unsigned long IsSearchProviderInstalled(in DOMString engineURL);
1492
+ void AddSearchProvider(DOMString engineURL);
1493
+ unsigned long IsSearchProviderInstalled(DOMString engineURL);
1526
1494
  };
1527
1495
 
1528
1496
  interface DataTransfer {
@@ -1531,69 +1499,57 @@ interface DataTransfer {
1531
1499
 
1532
1500
  readonly attribute DataTransferItemList items;
1533
1501
 
1534
- void setDragImage(in Element image, in long x, in long y);
1535
- void addElement(in Element element);
1502
+ void setDragImage(Element image, long x, long y);
1503
+ void addElement(Element element);
1536
1504
 
1537
1505
  /* old interface */
1538
1506
  readonly attribute DOMStringList types;
1539
- DOMString getData(in DOMString format);
1540
- void setData(in DOMString format, in DOMString data);
1541
- void clearData(in optional DOMString format);
1507
+ DOMString getData(DOMString format);
1508
+ void setData(DOMString format, DOMString data);
1509
+ void clearData(optional DOMString format);
1542
1510
  readonly attribute FileList files;
1543
1511
  };
1544
1512
 
1545
1513
  interface DataTransferItemList {
1546
1514
  readonly attribute unsigned long length;
1547
- getter DataTransferItem (in unsigned long index);
1548
- deleter void (in unsigned long index);
1515
+ getter DataTransferItem (unsigned long index);
1516
+ deleter void (unsigned long index);
1549
1517
  void clear();
1550
1518
 
1551
- DataTransferItem? add(in DOMString data, in DOMString type);
1552
- DataTransferItem? add(in File data);
1519
+ DataTransferItem? add(DOMString data, DOMString type);
1520
+ DataTransferItem? add(File data);
1553
1521
  };
1554
1522
 
1555
1523
  interface DataTransferItem {
1556
- readonly attribute DOMString kind;
1557
- readonly attribute DOMString type;
1558
- void getAsString(in FunctionStringCallback? callback);
1559
- File? getAsFile();
1524
+ readonly attribute DOMString kind;
1525
+ readonly attribute DOMString type;
1526
+ void getAsString(FunctionStringCallback? callback);
1527
+ File? getAsFile();
1560
1528
  };
1561
1529
 
1562
1530
  [Callback=FunctionOnly, NoInterfaceObject]
1563
1531
  interface FunctionStringCallback {
1564
- void handleEvent(in DOMString data);
1532
+ void handleEvent(DOMString data);
1565
1533
  };
1566
1534
 
1535
+ [Constructor(DOMString type, optional DragEventInit eventInitDict)]
1567
1536
  interface DragEvent : MouseEvent {
1568
1537
  readonly attribute DataTransfer? dataTransfer;
1569
-
1570
- void initDragEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any dummyArg, in long detailArg, in long screenXArg, in long screenYArg, in long clientXArg, in long clientYArg, in boolean ctrlKeyArg, in boolean altKeyArg, in boolean shiftKeyArg, in boolean metaKeyArg, in unsigned short buttonArg, in EventTarget relatedTargetArg, in DataTransfer? dataTransferArg);
1571
- };
1572
-
1573
- interface UndoManager {
1574
- readonly attribute unsigned long length;
1575
- getter any item(in unsigned long index);
1576
- readonly attribute unsigned long position;
1577
- unsigned long add(in any data, in DOMString title);
1578
- void remove(in unsigned long index);
1579
- void clearUndo();
1580
- void clearRedo();
1581
1538
  };
1582
1539
 
1583
- interface UndoManagerEvent : Event {
1584
- readonly attribute any data;
1585
- void initUndoManagerEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any dataArg);
1540
+ dictionary DragEventInit : MouseEventInit {
1541
+ DataTransfer? dataTransfer;
1586
1542
  };
1587
1543
 
1588
- [Supplemental, NoInterfaceObject]
1544
+ [NoInterfaceObject]
1589
1545
  interface NavigatorUserMedia {
1590
- void getUserMedia(in DOMString options, in NavigatorUserMediaSuccessCallback? successCallback, in optional NavigatorUserMediaErrorCallback? errorCallback);
1546
+ void getUserMedia(DOMString options, NavigatorUserMediaSuccessCallback? successCallback, optional NavigatorUserMediaErrorCallback? errorCallback);
1591
1547
  };
1592
1548
  Navigator implements NavigatorUserMedia;
1593
1549
 
1594
1550
  [Callback=FunctionOnly, NoInterfaceObject]
1595
1551
  interface NavigatorUserMediaSuccessCallback {
1596
- void handleEvent(in LocalMediaStream stream);
1552
+ void handleEvent(LocalMediaStream stream);
1597
1553
  };
1598
1554
 
1599
1555
  [NoInterfaceObject]
@@ -1604,29 +1560,26 @@ interface NavigatorUserMediaError {
1604
1560
 
1605
1561
  [Callback=FunctionOnly, NoInterfaceObject]
1606
1562
  interface NavigatorUserMediaErrorCallback {
1607
- void handleEvent(in NavigatorUserMediaError error);
1563
+ void handleEvent(NavigatorUserMediaError error);
1608
1564
  };
1609
1565
 
1610
- [Constructor(in MediaStream parentStream)]
1611
- interface MediaStream {
1566
+ [Constructor(MediaStream parentStream)]
1567
+ interface MediaStream : EventTarget {
1612
1568
  readonly attribute DOMString label;
1613
- readonly attribute MediaStreamTrackList tracks;
1569
+ readonly attribute MediaStreamTrack[] tracks;
1614
1570
 
1615
1571
  MediaStreamRecorder record();
1616
1572
 
1617
1573
  const unsigned short LIVE = 1;
1618
1574
  const unsigned short ENDED = 2;
1619
1575
  readonly attribute unsigned short readyState;
1620
- attribute Function? onended;
1576
+ [TreatNonCallableAsNull] attribute Function? onended;
1621
1577
  };
1622
- MediaStream implements EventTarget;
1623
1578
 
1624
1579
  interface LocalMediaStream : MediaStream {
1625
1580
  void stop();
1626
1581
  };
1627
1582
 
1628
- typedef MediaStreamTrack[] MediaStreamTrackList;
1629
-
1630
1583
  interface MediaStreamTrack {
1631
1584
  readonly attribute DOMString kind;
1632
1585
  readonly attribute DOMString label;
@@ -1634,22 +1587,21 @@ interface MediaStreamTrack {
1634
1587
  };
1635
1588
 
1636
1589
  interface MediaStreamRecorder {
1637
- void getRecordedData(in BlobCallback? callback);
1590
+ void getRecordedData(BlobCallback? callback);
1638
1591
  };
1639
1592
 
1640
1593
  [Callback=FunctionOnly, NoInterfaceObject]
1641
1594
  interface BlobCallback {
1642
- void handleEvent(in Blob blob);
1595
+ void handleEvent(Blob blob);
1643
1596
  };
1644
1597
 
1645
- [Supplemental]
1646
- interface URL {
1647
- static DOMString createObjectURL(in MediaStream stream);
1598
+ partial interface URL {
1599
+ static DOMString createObjectURL(MediaStream stream);
1648
1600
  };
1649
1601
 
1650
- [Constructor(in DOMString configuration, in SignalingCallback signalingCallback)]
1651
- interface PeerConnection {
1652
- void processSignalingMessage(in DOMString message);
1602
+ [Constructor(DOMString serverConfiguration, SignalingCallback signalingCallback)]
1603
+ interface PeerConnection : EventTarget {
1604
+ void processSignalingMessage(DOMString message);
1653
1605
 
1654
1606
  const unsigned short NEW = 0;
1655
1607
  const unsigned short NEGOTIATING = 1;
@@ -1657,40 +1609,195 @@ interface PeerConnection {
1657
1609
  const unsigned short CLOSED = 3;
1658
1610
  readonly attribute unsigned short readyState;
1659
1611
 
1660
- void send(in DOMString text);
1661
- void addStream(in MediaStream stream);
1662
- void removeStream(in MediaStream stream);
1612
+ void send(DOMString text);
1613
+ void addStream(MediaStream stream);
1614
+ void removeStream(MediaStream stream);
1663
1615
  readonly attribute MediaStream[] localStreams;
1664
1616
  readonly attribute MediaStream[] remoteStreams;
1665
1617
 
1666
1618
  void close();
1667
1619
 
1668
1620
  // connection quality information
1669
- attribute Function? onconnecting;
1670
- attribute Function? onopen;
1671
- attribute Function? onmessage;
1672
- attribute Function? onaddstream;
1673
- attribute Function? onremovestream;
1621
+ [TreatNonCallableAsNull] attribute Function? onconnecting;
1622
+ [TreatNonCallableAsNull] attribute Function? onopen;
1623
+ [TreatNonCallableAsNull] attribute Function? onmessage;
1624
+ [TreatNonCallableAsNull] attribute Function? onaddstream;
1625
+ [TreatNonCallableAsNull] attribute Function? onremovestream;
1674
1626
  };
1675
- PeerConnection implements EventTarget;
1676
1627
 
1677
1628
  [Callback=FunctionOnly, NoInterfaceObject]
1678
1629
  interface SignalingCallback {
1679
- void handleEvent(in DOMString message, in PeerConnection source);
1630
+ void handleEvent(DOMString message, PeerConnection source);
1680
1631
  };
1681
1632
 
1682
- interface StreamEvent : Event {
1633
+ [Constructor(DOMString type, optional MediaStreamEventInit eventInitDict)]
1634
+ interface MediaStreamEvent : Event {
1683
1635
  readonly attribute MediaStream? stream;
1684
- void initStreamEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in MediaStream? streamArg);
1685
1636
  };
1686
1637
 
1638
+ dictionary MediaStreamEventInit : EventInit {
1639
+ // DOMString MediaStream? stream;
1640
+ };
1641
+
1642
+ interface WorkerGlobalScope : EventTarget {
1643
+ readonly attribute WorkerGlobalScope self;
1644
+ readonly attribute WorkerLocation location;
1645
+
1646
+ void close();
1647
+ [TreatNonCallableAsNull] attribute Function? onerror;
1648
+ [TreatNonCallableAsNull] attribute Function? onoffline;
1649
+ [TreatNonCallableAsNull] attribute Function? ononline;
1650
+ };
1651
+ WorkerGlobalScope implements WorkerUtils;
1652
+
1653
+ [Supplemental, NoInterfaceObject]
1654
+ interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
1655
+ void postMessage(any message, optional sequence<Transferable> transfer);
1656
+ [TreatNonCallableAsNull] attribute Function? onmessage;
1657
+ };
1658
+
1659
+ [Supplemental, NoInterfaceObject]
1660
+ interface SharedWorkerGlobalScope : WorkerGlobalScope {
1661
+ readonly attribute DOMString name;
1662
+ readonly attribute ApplicationCache applicationCache;
1663
+ [TreatNonCallableAsNull] attribute Function? onconnect;
1664
+ };
1665
+
1666
+ [Constructor(DOMString type, optional ErrorEventInit eventInitDict)]
1667
+ interface ErrorEvent : Event {
1668
+ readonly attribute DOMString message;
1669
+ readonly attribute DOMString filename;
1670
+ readonly attribute unsigned long lineno;
1671
+ };
1672
+
1673
+ dictionary ErrorEventInit : EventInit {
1674
+ DOMString message;
1675
+ DOMString filename;
1676
+ unsigned long lineno;
1677
+ };
1678
+
1679
+ [Supplemental, NoInterfaceObject]
1680
+ interface AbstractWorker : EventTarget {
1681
+ [TreatNonCallableAsNull] attribute Function? onerror;
1682
+
1683
+ };
1684
+
1685
+ [Constructor(DOMString scriptURL)]
1686
+ interface Worker : AbstractWorker {
1687
+ void terminate();
1688
+
1689
+ void postMessage(any message, optional sequence<Transferable> transfer);
1690
+ [TreatNonCallableAsNull] attribute Function? onmessage;
1691
+ };
1692
+
1693
+ [Constructor(DOMString scriptURL, optional DOMString name)]
1694
+ interface SharedWorker : AbstractWorker {
1695
+ readonly attribute MessagePort port;
1696
+ };
1697
+
1698
+ [NoInterfaceObject]
1699
+ interface WorkerUtils {
1700
+ void importScripts(DOMString... urls);
1701
+ readonly attribute WorkerNavigator navigator;
1702
+ };
1703
+ WorkerUtils implements WindowTimers;
1704
+ WorkerUtils implements WindowBase64;
1705
+
1706
+ interface WorkerNavigator {};
1707
+ WorkerNavigator implements NavigatorID;
1708
+ WorkerNavigator implements NavigatorOnLine;
1709
+
1710
+ interface WorkerLocation {
1711
+ // URL decomposition IDL attributes
1712
+ stringifier readonly attribute DOMString href;
1713
+ readonly attribute DOMString protocol;
1714
+ readonly attribute DOMString host;
1715
+ readonly attribute DOMString hostname;
1716
+ readonly attribute DOMString port;
1717
+ readonly attribute DOMString pathname;
1718
+ readonly attribute DOMString search;
1719
+ readonly attribute DOMString hash;
1720
+ };
1721
+
1722
+ [Constructor(DOMString type, optional MessageEventInit eventInitDict)]
1687
1723
  interface MessageEvent : Event {
1688
1724
  readonly attribute any data;
1689
1725
  readonly attribute DOMString origin;
1690
1726
  readonly attribute DOMString lastEventId;
1691
1727
  readonly attribute WindowProxy? source;
1692
- readonly attribute MessagePort[] ports;
1693
- void initMessageEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any dataArg, in DOMString originArg, in DOMString lastEventIdArg, in WindowProxy? sourceArg, in sequence<MessagePort> portsArg);
1728
+ readonly attribute MessagePort[]? ports;
1729
+ };
1730
+
1731
+ dictionary MessageEventInit : EventInit {
1732
+ any data;
1733
+ DOMString origin;
1734
+ DOMString lastEventId;
1735
+ WindowProxy? source;
1736
+ MessagePort[]? ports;
1737
+ };
1738
+
1739
+ [Constructor(DOMString url, optional EventSourceInit eventSourceInitDict)]
1740
+ interface EventSource : EventTarget {
1741
+ readonly attribute DOMString url;
1742
+ readonly attribute boolean withCredentials;
1743
+
1744
+ // ready state
1745
+ const unsigned short CONNECTING = 0;
1746
+ const unsigned short OPEN = 1;
1747
+ const unsigned short CLOSED = 2;
1748
+ readonly attribute unsigned short readyState;
1749
+
1750
+ // networking
1751
+ [TreatNonCallableAsNull] attribute Function? onopen;
1752
+ [TreatNonCallableAsNull] attribute Function? onmessage;
1753
+ [TreatNonCallableAsNull] attribute Function? onerror;
1754
+ void close();
1755
+ };
1756
+
1757
+ dictionary EventSourceInit {
1758
+ boolean withCredentials = false;
1759
+ };
1760
+
1761
+ [Constructor(DOMString url, optional DOMString protocols),
1762
+ Constructor(DOMString url, optional DOMString[] protocols)]
1763
+ interface WebSocket : EventTarget {
1764
+ readonly attribute DOMString url;
1765
+
1766
+ // ready state
1767
+ const unsigned short CONNECTING = 0;
1768
+ const unsigned short OPEN = 1;
1769
+ const unsigned short CLOSING = 2;
1770
+ const unsigned short CLOSED = 3;
1771
+ readonly attribute unsigned short readyState;
1772
+ readonly attribute unsigned long bufferedAmount;
1773
+
1774
+ // networking
1775
+ [TreatNonCallableAsNull] attribute Function? onopen;
1776
+ [TreatNonCallableAsNull] attribute Function? onerror;
1777
+ [TreatNonCallableAsNull] attribute Function? onclose;
1778
+ readonly attribute DOMString extensions;
1779
+ readonly attribute DOMString protocol;
1780
+ void close([Clamp] optional unsigned short code, optional DOMString reason);
1781
+
1782
+ // messaging
1783
+ [TreatNonCallableAsNull] attribute Function? onmessage;
1784
+ attribute DOMString binaryType;
1785
+ void send(DOMString data);
1786
+ void send(ArrayBuffer data);
1787
+ void send(Blob data);
1788
+ };
1789
+
1790
+ [Constructor(DOMString type, optional CloseEventInit eventInitDict)]
1791
+ interface CloseEvent : Event {
1792
+ readonly attribute boolean wasClean;
1793
+ readonly attribute unsigned short code;
1794
+ readonly attribute DOMString reason;
1795
+ };
1796
+
1797
+ dictionary CloseEventInit : EventInit {
1798
+ boolean wasClean;
1799
+ unsigned short code;
1800
+ DOMString reason;
1694
1801
  };
1695
1802
 
1696
1803
  [Constructor]
@@ -1699,17 +1806,54 @@ interface MessageChannel {
1699
1806
  readonly attribute MessagePort port2;
1700
1807
  };
1701
1808
 
1702
- interface MessagePort {
1703
- void postMessage(in any message, in optional sequence<Transferable> transfer);
1809
+ interface MessagePort : EventTarget {
1810
+ void postMessage(any message, optional sequence<Transferable> transfer);
1704
1811
  void start();
1705
1812
  void close();
1706
1813
 
1707
1814
  // event handlers
1708
- attribute Function? onmessage;
1815
+ [TreatNonCallableAsNull] attribute Function? onmessage;
1709
1816
  };
1710
- MessagePort implements EventTarget;
1711
1817
  MessagePort implements Transferable;
1712
1818
 
1819
+ interface Storage {
1820
+ readonly attribute unsigned long length;
1821
+ DOMString? key(unsigned long index);
1822
+ getter DOMString getItem(DOMString key);
1823
+ setter creator void setItem(DOMString key, DOMString value);
1824
+ deleter void removeItem(DOMString key);
1825
+ void clear();
1826
+ };
1827
+
1828
+ [NoInterfaceObject]
1829
+ interface WindowSessionStorage {
1830
+ readonly attribute Storage sessionStorage;
1831
+ };
1832
+ Window implements WindowSessionStorage;
1833
+
1834
+ [NoInterfaceObject]
1835
+ interface WindowLocalStorage {
1836
+ readonly attribute Storage localStorage;
1837
+ };
1838
+ Window implements WindowLocalStorage;
1839
+
1840
+ [Constructor(DOMString type, optional StorageEventInit eventInitDict)]
1841
+ interface StorageEvent : Event {
1842
+ readonly attribute DOMString key;
1843
+ readonly attribute DOMString? oldValue;
1844
+ readonly attribute DOMString? newValue;
1845
+ readonly attribute DOMString url;
1846
+ readonly attribute Storage? storageArea;
1847
+ };
1848
+
1849
+ dictionary StorageEventInit : EventInit {
1850
+ DOMString key;
1851
+ DOMString? oldValue;
1852
+ DOMString? newValue;
1853
+ DOMString url;
1854
+ Storage? storageArea;
1855
+ };
1856
+
1713
1857
  interface HTMLAppletElement : HTMLElement {
1714
1858
  attribute DOMString align;
1715
1859
  attribute DOMString alt;
@@ -1737,9 +1881,9 @@ interface HTMLMarqueeElement : HTMLElement {
1737
1881
  attribute unsigned long vspace;
1738
1882
  attribute DOMString width;
1739
1883
 
1740
- attribute Function? onbounce;
1741
- attribute Function? onfinish;
1742
- attribute Function? onstart;
1884
+ [TreatNonCallableAsNull] attribute Function? onbounce;
1885
+ [TreatNonCallableAsNull] attribute Function? onfinish;
1886
+ [TreatNonCallableAsNull] attribute Function? onstart;
1743
1887
 
1744
1888
  void start();
1745
1889
  void stop();
@@ -1748,43 +1892,41 @@ interface HTMLMarqueeElement : HTMLElement {
1748
1892
  interface HTMLFrameSetElement : HTMLElement {
1749
1893
  attribute DOMString cols;
1750
1894
  attribute DOMString rows;
1751
- attribute Function? onafterprint;
1752
- attribute Function? onbeforeprint;
1753
- attribute Function? onbeforeunload;
1754
- attribute Function? onblur;
1755
- attribute Function? onerror;
1756
- attribute Function? onfocus;
1757
- attribute Function? onhashchange;
1758
- attribute Function? onload;
1759
- attribute Function? onmessage;
1760
- attribute Function? onoffline;
1761
- attribute Function? ononline;
1762
- attribute Function? onpagehide;
1763
- attribute Function? onpageshow;
1764
- attribute Function? onpopstate;
1765
- attribute Function? onredo;
1766
- attribute Function? onresize;
1767
- attribute Function? onscroll;
1768
- attribute Function? onstorage;
1769
- attribute Function? onundo;
1770
- attribute Function? onunload;
1895
+ [TreatNonCallableAsNull] attribute Function? onafterprint;
1896
+ [TreatNonCallableAsNull] attribute Function? onbeforeprint;
1897
+ [TreatNonCallableAsNull] attribute Function? onbeforeunload;
1898
+ [TreatNonCallableAsNull] attribute Function? onblur;
1899
+ [TreatNonCallableAsNull] attribute Function? onerror;
1900
+ [TreatNonCallableAsNull] attribute Function? onfocus;
1901
+ [TreatNonCallableAsNull] attribute Function? onhashchange;
1902
+ [TreatNonCallableAsNull] attribute Function? onload;
1903
+ [TreatNonCallableAsNull] attribute Function? onmessage;
1904
+ [TreatNonCallableAsNull] attribute Function? onoffline;
1905
+ [TreatNonCallableAsNull] attribute Function? ononline;
1906
+ [TreatNonCallableAsNull] attribute Function? onpagehide;
1907
+ [TreatNonCallableAsNull] attribute Function? onpageshow;
1908
+ [TreatNonCallableAsNull] attribute Function? onpopstate;
1909
+ [TreatNonCallableAsNull] attribute Function? onresize;
1910
+ [TreatNonCallableAsNull] attribute Function? onscroll;
1911
+ [TreatNonCallableAsNull] attribute Function? onstorage;
1912
+ [TreatNonCallableAsNull] attribute Function? onunload;
1771
1913
  };
1772
1914
 
1773
1915
  interface HTMLFrameElement : HTMLElement {
1774
- attribute DOMString frameBorder;
1775
- attribute DOMString longDesc;
1776
- attribute DOMString marginHeight;
1777
- attribute DOMString marginWidth;
1778
1916
  attribute DOMString name;
1779
- attribute boolean noResize;
1780
1917
  attribute DOMString scrolling;
1781
1918
  attribute DOMString src;
1919
+ attribute DOMString frameBorder;
1920
+ attribute DOMString longDesc;
1921
+ attribute boolean noResize;
1782
1922
  readonly attribute Document? contentDocument;
1783
1923
  readonly attribute WindowProxy? contentWindow;
1924
+
1925
+ [TreatNullAs=EmptyString] attribute DOMString marginHeight;
1926
+ [TreatNullAs=EmptyString] attribute DOMString marginWidth;
1784
1927
  };
1785
1928
 
1786
- [Supplemental]
1787
- interface HTMLAnchorElement {
1929
+ partial interface HTMLAnchorElement {
1788
1930
  attribute DOMString coords;
1789
1931
  attribute DOMString charset;
1790
1932
  attribute DOMString name;
@@ -1792,8 +1934,7 @@ interface HTMLAnchorElement {
1792
1934
  attribute DOMString shape;
1793
1935
  };
1794
1936
 
1795
- [Supplemental]
1796
- interface HTMLAreaElement {
1937
+ partial interface HTMLAreaElement {
1797
1938
  attribute boolean noHref;
1798
1939
  };
1799
1940
 
@@ -1803,28 +1944,24 @@ interface HTMLBaseFontElement : HTMLElement {
1803
1944
  attribute long size;
1804
1945
  };
1805
1946
 
1806
- [Supplemental]
1807
- interface HTMLBodyElement {
1808
- attribute DOMString text;
1809
- attribute DOMString bgColor;
1810
- attribute DOMString background;
1811
- attribute DOMString link;
1812
- attribute DOMString vLink;
1813
- attribute DOMString aLink;
1947
+ partial interface HTMLBodyElement {
1948
+ [TreatNullAs=EmptyString] attribute DOMString text;
1949
+ [TreatNullAs=EmptyString] attribute DOMString link;
1950
+ [TreatNullAs=EmptyString] attribute DOMString vLink;
1951
+ [TreatNullAs=EmptyString] attribute DOMString aLink;
1952
+ [TreatNullAs=EmptyString] attribute DOMString bgColor;
1953
+ attribute DOMString background;
1814
1954
  };
1815
1955
 
1816
- [Supplemental]
1817
- interface HTMLBRElement {
1956
+ partial interface HTMLBRElement {
1818
1957
  attribute DOMString clear;
1819
1958
  };
1820
1959
 
1821
- [Supplemental]
1822
- interface HTMLTableCaptionElement {
1960
+ partial interface HTMLTableCaptionElement {
1823
1961
  attribute DOMString align;
1824
1962
  };
1825
1963
 
1826
- [Supplemental]
1827
- interface HTMLTableColElement {
1964
+ partial interface HTMLTableColElement {
1828
1965
  attribute DOMString align;
1829
1966
  attribute DOMString ch;
1830
1967
  attribute DOMString chOff;
@@ -1836,35 +1973,30 @@ interface HTMLDirectoryElement : HTMLElement {
1836
1973
  attribute boolean compact;
1837
1974
  };
1838
1975
 
1839
- [Supplemental]
1840
- interface HTMLDivElement {
1976
+ partial interface HTMLDivElement {
1841
1977
  attribute DOMString align;
1842
1978
  };
1843
1979
 
1844
- [Supplemental]
1845
- interface HTMLDListElement {
1980
+ partial interface HTMLDListElement {
1846
1981
  attribute boolean compact;
1847
1982
  };
1848
1983
 
1849
- [Supplemental]
1850
- interface HTMLEmbedElement {
1984
+ partial interface HTMLEmbedElement {
1851
1985
  attribute DOMString align;
1852
1986
  attribute DOMString name;
1853
1987
  };
1854
1988
 
1855
1989
  interface HTMLFontElement : HTMLElement {
1856
- attribute DOMString color;
1857
- attribute DOMString face;
1858
- attribute DOMString size;
1990
+ [TreatNullAs=EmptyString] attribute DOMString color;
1991
+ attribute DOMString face;
1992
+ attribute DOMString size;
1859
1993
  };
1860
1994
 
1861
- [Supplemental]
1862
- interface HTMLHeadingElement {
1995
+ partial interface HTMLHeadingElement {
1863
1996
  attribute DOMString align;
1864
1997
  };
1865
1998
 
1866
- [Supplemental]
1867
- interface HTMLHRElement {
1999
+ partial interface HTMLHRElement {
1868
2000
  attribute DOMString align;
1869
2001
  attribute DOMString color;
1870
2002
  attribute boolean noShade;
@@ -1872,161 +2004,147 @@ interface HTMLHRElement {
1872
2004
  attribute DOMString width;
1873
2005
  };
1874
2006
 
1875
- [Supplemental]
1876
- interface HTMLHtmlElement {
2007
+ partial interface HTMLHtmlElement {
1877
2008
  attribute DOMString version;
1878
2009
  };
1879
2010
 
1880
- [Supplemental]
1881
- interface HTMLIFrameElement {
2011
+ partial interface HTMLIFrameElement {
1882
2012
  attribute DOMString align;
2013
+ attribute DOMString scrolling;
1883
2014
  attribute DOMString frameBorder;
1884
2015
  attribute DOMString longDesc;
1885
- attribute DOMString marginHeight;
1886
- attribute DOMString marginWidth;
1887
- attribute DOMString scrolling;
2016
+
2017
+ [TreatNullAs=EmptyString] attribute DOMString marginHeight;
2018
+ [TreatNullAs=EmptyString] attribute DOMString marginWidth;
1888
2019
  };
1889
2020
 
1890
- [Supplemental]
1891
- interface HTMLImageElement {
2021
+ partial interface HTMLImageElement {
1892
2022
  attribute DOMString name;
1893
2023
  attribute DOMString align;
1894
- attribute DOMString border;
1895
2024
  attribute unsigned long hspace;
1896
- attribute DOMString longDesc;
1897
2025
  attribute unsigned long vspace;
2026
+ attribute DOMString longDesc;
2027
+
2028
+ [TreatNullAs=EmptyString] attribute DOMString border;
1898
2029
  };
1899
2030
 
1900
- [Supplemental]
1901
- interface HTMLInputElement {
2031
+ partial interface HTMLInputElement {
1902
2032
  attribute DOMString align;
1903
2033
  attribute DOMString useMap;
1904
2034
  };
1905
2035
 
1906
- [Supplemental]
1907
- interface HTMLLegendElement {
2036
+ partial interface HTMLLegendElement {
1908
2037
  attribute DOMString align;
1909
2038
  };
1910
2039
 
1911
- [Supplemental]
1912
- interface HTMLLIElement {
2040
+ partial interface HTMLLIElement {
1913
2041
  attribute DOMString type;
1914
2042
  };
1915
2043
 
1916
- [Supplemental]
1917
- interface HTMLLinkElement {
2044
+ partial interface HTMLLinkElement {
1918
2045
  attribute DOMString charset;
1919
2046
  attribute DOMString rev;
1920
2047
  attribute DOMString target;
1921
2048
  };
1922
2049
 
1923
- [Supplemental]
1924
- interface HTMLMenuElement {
2050
+ partial interface HTMLMenuElement {
1925
2051
  attribute boolean compact;
1926
2052
  };
1927
2053
 
1928
- [Supplemental]
1929
- interface HTMLMetaElement {
2054
+ partial interface HTMLMetaElement {
1930
2055
  attribute DOMString scheme;
1931
2056
  };
1932
2057
 
1933
- [Supplemental]
1934
- interface HTMLObjectElement {
2058
+ partial interface HTMLObjectElement {
1935
2059
  attribute DOMString align;
1936
2060
  attribute DOMString archive;
1937
- attribute DOMString border;
1938
2061
  attribute DOMString code;
1939
- attribute DOMString codeBase;
1940
- attribute DOMString codeType;
1941
2062
  attribute boolean declare;
1942
2063
  attribute unsigned long hspace;
1943
2064
  attribute DOMString standby;
1944
2065
  attribute unsigned long vspace;
2066
+ attribute DOMString codeBase;
2067
+ attribute DOMString codeType;
2068
+
2069
+ [TreatNullAs=EmptyString] attribute DOMString border;
1945
2070
  };
1946
2071
 
1947
- [Supplemental]
1948
- interface HTMLOListElement {
2072
+ partial interface HTMLOListElement {
1949
2073
  attribute boolean compact;
1950
2074
  };
1951
2075
 
1952
- [Supplemental]
1953
- interface HTMLParagraphElement {
2076
+ partial interface HTMLParagraphElement {
1954
2077
  attribute DOMString align;
1955
2078
  };
1956
2079
 
1957
- [Supplemental]
1958
- interface HTMLParamElement {
2080
+ partial interface HTMLParamElement {
1959
2081
  attribute DOMString type;
1960
2082
  attribute DOMString valueType;
1961
2083
  };
1962
2084
 
1963
- [Supplemental]
1964
- interface HTMLPreElement {
1965
- attribute unsigned long width;
2085
+ partial interface HTMLPreElement {
2086
+ attribute long width;
1966
2087
  };
1967
2088
 
1968
- [Supplemental]
1969
- interface HTMLScriptElement {
2089
+ partial interface HTMLScriptElement {
1970
2090
  attribute DOMString event;
1971
2091
  attribute DOMString htmlFor;
1972
2092
  };
1973
2093
 
1974
- [Supplemental]
1975
- interface HTMLTableElement {
2094
+ partial interface HTMLTableElement {
1976
2095
  attribute DOMString align;
1977
- attribute DOMString bgColor;
1978
- attribute DOMString cellPadding;
1979
- attribute DOMString cellSpacing;
1980
2096
  attribute DOMString frame;
1981
2097
  attribute DOMString rules;
1982
2098
  attribute DOMString summary;
1983
2099
  attribute DOMString width;
2100
+
2101
+ [TreatNullAs=EmptyString] attribute DOMString bgColor;
2102
+ [TreatNullAs=EmptyString] attribute DOMString cellPadding;
2103
+ [TreatNullAs=EmptyString] attribute DOMString cellSpacing;
1984
2104
  };
1985
2105
 
1986
- [Supplemental]
1987
- interface HTMLTableSectionElement {
2106
+ partial interface HTMLTableSectionElement {
1988
2107
  attribute DOMString align;
1989
2108
  attribute DOMString ch;
1990
2109
  attribute DOMString chOff;
1991
2110
  attribute DOMString vAlign;
1992
2111
  };
1993
2112
 
1994
- [Supplemental]
1995
- interface HTMLTableCellElement {
2113
+ partial interface HTMLTableCellElement {
1996
2114
  attribute DOMString abbr;
1997
2115
  attribute DOMString align;
1998
2116
  attribute DOMString axis;
1999
- attribute DOMString bgColor;
2117
+ attribute DOMString height;
2118
+ attribute DOMString width;
2119
+
2000
2120
  attribute DOMString ch;
2001
2121
  attribute DOMString chOff;
2002
- attribute DOMString height;
2003
2122
  attribute boolean noWrap;
2004
2123
  attribute DOMString vAlign;
2005
- attribute DOMString width;
2124
+
2125
+ [TreatNullAs=EmptyString] attribute DOMString bgColor;
2006
2126
  };
2007
2127
 
2008
- [Supplemental]
2009
- interface HTMLTableRowElement {
2128
+ partial interface HTMLTableRowElement {
2010
2129
  attribute DOMString align;
2011
- attribute DOMString bgColor;
2012
2130
  attribute DOMString ch;
2013
2131
  attribute DOMString chOff;
2014
2132
  attribute DOMString vAlign;
2133
+
2134
+ [TreatNullAs=EmptyString] attribute DOMString bgColor;
2015
2135
  };
2016
2136
 
2017
- [Supplemental]
2018
- interface HTMLUListElement {
2137
+ partial interface HTMLUListElement {
2019
2138
  attribute boolean compact;
2020
2139
  attribute DOMString type;
2021
2140
  };
2022
2141
 
2023
- [Supplemental]
2024
- interface HTMLDocument {
2025
- attribute DOMString fgColor;
2026
- attribute DOMString bgColor;
2027
- attribute DOMString linkColor;
2028
- attribute DOMString vlinkColor;
2029
- attribute DOMString alinkColor;
2142
+ partial interface Document {
2143
+ [TreatNullAs=EmptyString] attribute DOMString fgColor;
2144
+ [TreatNullAs=EmptyString] attribute DOMString linkColor;
2145
+ [TreatNullAs=EmptyString] attribute DOMString vlinkColor;
2146
+ [TreatNullAs=EmptyString] attribute DOMString alinkColor;
2147
+ [TreatNullAs=EmptyString] attribute DOMString bgColor;
2030
2148
 
2031
2149
  readonly attribute HTMLCollection anchors;
2032
2150
  readonly attribute HTMLCollection applets;