Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / w3c / web-platform-tests / custom-elements / instantiating-custom-elements / custom-element-prototype.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Custom element prototype is the prototype object specified in element definition</title>
5 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
6 <meta name="assert" content="Custom element prototype is the prototype object specified in element definition">
7 <link rel="help" href="http://www.w3.org/TR/custom-elements/#instantiating-custom-elements">
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 proto = Object.create(SVGElement.prototype);
19     var GeneratedConstructor = doc.registerElement('x-a', {
20         prototype: proto,
21         extends: 'p'
22     });
23     var customElement = new GeneratedConstructor();
24
25     assert_true(Object.getPrototypeOf(customElement) === proto,
26         'Custom element instance must have the prototype specified in registerElement()');
27 }, 'If custom element type is registered with prototype, the custom element ' +
28     'instance should have the prototype specified in registerElement() call');
29 </script>
30 </body>
31 </html>