1 description("Test reflecting boolean attributes.");
7 [ "form", "noValidate" ],
8 [ "frame", "noResize" ],
11 [ "input", "autofocus" ],
12 [ "input", "defaultChecked", "checked" ],
13 [ "input", "disabled" ],
14 [ "input", "formNoValidate" ],
15 [ "input", "multiple" ],
16 [ "input", "readOnly" ],
17 [ "input", "required" ],
18 [ "link", "disabled" ],
19 [ "menu", "compact" ],
20 [ "object", "declare" ],
22 [ "option", "defaultSelected", "selected" ],
24 [ "script", "defer" ],
25 [ "select", "multiple" ],
28 [ "video", "autoplay" ],
29 [ "video", "controls" ],
35 return document.createElement(tag);
38 for (var i = 0; i < attributes.length; ++i) {
39 var tag = attributes[i][0];
40 var reflectingAttribute = attributes[i][1];
41 var contentAttribute = attributes[i][2] || reflectingAttribute.toLowerCase();
42 shouldBe("e = make('" + tag + "'); "
43 + "e.removeAttribute('" + contentAttribute + "'); "
44 + "e." + reflectingAttribute,
46 shouldBe("e = make('" + tag + "'); "
47 + "e.setAttribute('" + contentAttribute + "', ''); "
48 + "e." + reflectingAttribute,
50 shouldBe("e = make('" + tag + "'); "
51 + "e.setAttribute('" + contentAttribute + "', 'x'); "
52 + "e." + reflectingAttribute + " = false; "
53 + "e.getAttribute('" + contentAttribute + "')",
55 shouldBe("e = make('" + tag + "'); "
56 + "e.setAttribute('" + contentAttribute + "', 'x'); "
57 + "e." + reflectingAttribute + " = true; "
58 + "e.getAttribute('" + contentAttribute + "')",