blob: ab0fd8589c31bc88afa5d995ba8beabd8dfae25e [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Custom element prototype is the prototype object specified in element definition</title>
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
<meta name="assert" content="Custom element prototype is the prototype object specified in element definition">
<link rel="help" href="http://www.w3.org/TR/custom-elements/#instantiating-custom-elements">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../testcommon.js"></script>
<link rel="stylesheet" href="/resources/testharness.css">
</head>
<body>
<div id="log"></div>
<script>
test(function() {
var doc = newHTMLDocument();
var proto = Object.create(SVGElement.prototype);
var GeneratedConstructor = doc.registerElement('x-a', {
prototype: proto,
extends: 'p'
});
var customElement = new GeneratedConstructor();
assert_true(Object.getPrototypeOf(customElement) === proto,
'Custom element instance must have the prototype specified in registerElement()');
}, 'If custom element type is registered with prototype, the custom element ' +
'instance should have the prototype specified in registerElement() call');
</script>
</body>
</html>