| Index: third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html b/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html
|
| index 64b88f30cbf246b814dd4430aa2e7da239786625..b62a38c3c477d8a0a1ad140258ca5ae15d9dafb2 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html
|
| @@ -4,6 +4,70 @@
|
| <script src="../../resources/js-test.js"></script>
|
| </head>
|
| <body>
|
| -<script src="script-tests/boolean-attribute-reflection.js"></script>
|
| +<script>
|
| +description("Test reflecting boolean attributes.");
|
| +
|
| +var attributes = [
|
| + [ "area", "noHref" ],
|
| + [ "dir", "compact" ],
|
| + [ "dl", "compact" ],
|
| + [ "form", "noValidate" ],
|
| + [ "frame", "noResize" ],
|
| + [ "hr", "noShade" ],
|
| + [ "iframe", "allowFullscreen" ],
|
| + [ "img", "isMap" ],
|
| + [ "input", "autofocus" ],
|
| + [ "input", "defaultChecked", "checked" ],
|
| + [ "input", "disabled" ],
|
| + [ "input", "formNoValidate" ],
|
| + [ "input", "multiple" ],
|
| + [ "input", "readOnly" ],
|
| + [ "input", "required" ],
|
| + [ "link", "disabled" ],
|
| + [ "menu", "compact" ],
|
| + [ "menuitem", "checked" ],
|
| + [ "menuitem", "default" ],
|
| + [ "menuitem", "disabled" ],
|
| + [ "object", "declare" ],
|
| + [ "ol", "compact" ],
|
| + [ "option", "defaultSelected", "selected" ],
|
| + [ "script", "defer" ],
|
| + [ "select", "multiple" ],
|
| + [ "td", "noWrap" ],
|
| + [ "ul", "compact" ],
|
| + [ "video", "autoplay" ],
|
| + [ "video", "controls" ],
|
| + [ "video", "loop" ],
|
| +];
|
| +
|
| +function make(tag)
|
| +{
|
| + return document.createElement(tag);
|
| +}
|
| +
|
| +for (var i = 0; i < attributes.length; ++i) {
|
| + var tag = attributes[i][0];
|
| + var reflectingAttribute = attributes[i][1];
|
| + var contentAttribute = attributes[i][2] || reflectingAttribute.toLowerCase();
|
| + shouldBe("e = make('" + tag + "'); "
|
| + + "e.removeAttribute('" + contentAttribute + "'); "
|
| + + "e." + reflectingAttribute,
|
| + "false");
|
| + shouldBe("e = make('" + tag + "'); "
|
| + + "e.setAttribute('" + contentAttribute + "', ''); "
|
| + + "e." + reflectingAttribute,
|
| + "true");
|
| + shouldBe("e = make('" + tag + "'); "
|
| + + "e.setAttribute('" + contentAttribute + "', 'x'); "
|
| + + "e." + reflectingAttribute + " = false; "
|
| + + "e.getAttribute('" + contentAttribute + "')",
|
| + "null");
|
| + shouldBe("e = make('" + tag + "'); "
|
| + + "e.setAttribute('" + contentAttribute + "', 'x'); "
|
| + + "e." + reflectingAttribute + " = true; "
|
| + + "e.getAttribute('" + contentAttribute + "')",
|
| + "''");
|
| +}
|
| +</script>
|
| </body>
|
| </html>
|
|
|