1 description("Test reflecting boolean attributes.");
7 [ "form", "noValidate" ],
8 [ "frame", "noResize" ],
10 [ "iframe", "allowFullscreen" ],
12 [ "input", "autofocus" ],
13 [ "input", "defaultChecked", "checked" ],
14 [ "input", "disabled" ],
15 [ "input", "formNoValidate" ],
16 [ "input", "multiple" ],
17 [ "input", "readOnly" ],
18 [ "input", "required" ],
19 [ "link", "disabled" ],
20 [ "menu", "compact" ],
21 [ "menuitem", "checked" ],
22 [ "menuitem", "default" ],
23 [ "menuitem", "disabled" ],
24 [ "object", "declare" ],
26 [ "option", "defaultSelected", "selected" ],
27 [ "script", "defer" ],
28 [ "select", "multiple" ],
31 [ "video", "autoplay" ],
32 [ "video", "controls" ],
38 return document
.createElement(tag
);
41 for (var i
= 0; i
< attributes
.length
; ++i
) {
42 var tag
= attributes
[i
][0];
43 var reflectingAttribute
= attributes
[i
][1];
44 var contentAttribute
= attributes
[i
][2] || reflectingAttribute
.toLowerCase();
45 shouldBe("e = make('" + tag
+ "'); "
46 + "e.removeAttribute('" + contentAttribute
+ "'); "
47 + "e." + reflectingAttribute
,
49 shouldBe("e = make('" + tag
+ "'); "
50 + "e.setAttribute('" + contentAttribute
+ "', ''); "
51 + "e." + reflectingAttribute
,
53 shouldBe("e = make('" + tag
+ "'); "
54 + "e.setAttribute('" + contentAttribute
+ "', 'x'); "
55 + "e." + reflectingAttribute
+ " = false; "
56 + "e.getAttribute('" + contentAttribute
+ "')",
58 shouldBe("e = make('" + tag
+ "'); "
59 + "e.setAttribute('" + contentAttribute
+ "', 'x'); "
60 + "e." + reflectingAttribute
+ " = true; "
61 + "e.getAttribute('" + contentAttribute
+ "')",