File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -196,4 +196,29 @@ fn element() {
196
196
request_fullscreen
197
197
request_pointer_lock
198
198
*/
199
+
200
+ let child = new_div ( ) ;
201
+ assert_eq ! (
202
+ element. get_elements_by_tag_name( "div" ) . length( ) ,
203
+ 0 ,
204
+ "Element should not contain any div child"
205
+ ) ;
206
+ element. append_child ( & child) . unwrap ( ) ;
207
+ assert_eq ! (
208
+ element. get_elements_by_tag_name( "div" ) . length( ) ,
209
+ 1 ,
210
+ "Element should contain one div child"
211
+ ) ;
212
+ assert_eq ! (
213
+ element. get_elements_by_class_name( "foo" ) . length( ) ,
214
+ 0 ,
215
+ "Element should not have childs with class foo"
216
+ ) ;
217
+ child. class_list ( ) . add_1 ( "foo" ) . unwrap ( ) ;
218
+ assert_eq ! (
219
+ element. get_elements_by_class_name( "foo" ) . length( ) ,
220
+ 1 ,
221
+ "Element should have one child with class foo"
222
+ ) ;
223
+ element. remove_child ( & child) . unwrap ( ) ;
199
224
}
Original file line number Diff line number Diff line change @@ -65,14 +65,12 @@ interface Element : Node {
65
65
[Throws, Pure, BinaryName="matches" ]
66
66
boolean webkitMatchesSelector(DOMString selector);
67
67
68
- /* TODO
69
68
[Pure]
70
69
HTMLCollection getElementsByTagName(DOMString localName);
71
70
[Throws, Pure]
72
71
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
73
72
[Pure]
74
73
HTMLCollection getElementsByClassName(DOMString classNames);
75
- */
76
74
[ChromeOnly, Pure]
77
75
sequence< Element> getElementsWithGrid();
78
76
You can’t perform that action at this time.
0 commit comments