Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / imported / web-platform-tests / custom-elements / registering-custom-elements / extensions-to-document-interface / custom-element-prototype.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Test prototype object of a custom element</title>
5 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
6 <meta name="assert" content="If PROTOTYPE is null, let PROTOTYPE be the result of invoking Object.create with HTMLElement's interface prototype object as only argument">
7 <link rel="help" href="http://www.w3.org/TR/custom-elements/#extensions-to-document-interface-to-register">
8 <script src="../../../../../resources/testharness.js"></script>
9 <script src="../../../../../resources/testharnessreport.js"></script>
10 <script src="../../testcommon.js"></script>
11 <link rel="stylesheet" href="../../../../../resources/testharness.css">
12 </head>
13 <body>
14 <div id="log"></div>
15 <script>
16 test(function() {
17     var doc = newHTMLDocument();
18     var GeneratedConstructor = doc.registerElement('x-a');
19     var customElement = new GeneratedConstructor();
20
21     assert_class_string(customElement, 'HTMLElement',
22         'Custom element should be a HTMLElement, ' +
23         'if its type is registered without prototype');
24 }, 'Custom element should have HTMLElement prototype, ' +
25     'if its type is registered without prototype');
26 </script>
27 </body>
28 </html>