| <!DOCTYPE html> |
| <title>Test of interfaces</title> |
| <link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com"> |
| <link rel="help" href="https://html.spec.whatwg.org/multipage/"> |
| <link rel="help" href="https://heycam.github.io/webidl/#host-objects"> |
| <link rel="help" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf#page=96"> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script src=interfaces.js></script> |
| <div id="log"></div> |
| <script> |
| function do_test(local_name, iface) { |
| test(function() { |
| var e = document.createElement(local_name), i = "HTML" + iface + "Element"; |
| assert_class_string(e, i, |
| "Element " + local_name + " should have " + i + |
| " as its primary interface."); |
| assert_true(e instanceof window[i], |
| "Element " + local_name + " should implement " + i + "."); |
| assert_true(e instanceof HTMLElement, |
| "Element " + local_name + " should implement HTMLElement."); |
| assert_true(e instanceof Element, |
| "Element " + local_name + " should implement Element."); |
| assert_true(e instanceof Node, |
| "Element " + local_name + " should implement Node."); |
| }, "Interfaces for " + local_name); |
| } |
| |
| elements.forEach(function(a) { |
| do_test(a[0], a[1]); |
| do_test(a[0].toUpperCase(), a[1]); |
| }) |
| </script> |