summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/custom-elements/v0/registering/extensions-to-document-interface/custom-element-prototype.html
blob: de397aacd8d676c2a663846611676fb213e54cd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html>
<head>
<title>Test prototype object of a custom element</title>
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
<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">
<link rel="help" href="http://www.w3.org/TR/custom-elements/#extensions-to-document-interface-to-register">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script>
test(function() {
    var doc = newHTMLDocument();
    var GeneratedConstructor = doc.registerElement('x-a');
    var customElement = new GeneratedConstructor();

    assert_class_string(customElement, 'HTMLElement',
        'Custom element should be a HTMLElement, ' +
        'if its type is registered without prototype');
}, 'Custom element should have HTMLElement prototype, ' +
    'if its type is registered without prototype');
</script>
</body>
</html>