diff options
Diffstat (limited to 'testing/web-platform/tests/custom-elements/v0/instantiating/custom-element-prototype.html')
-rw-r--r-- | testing/web-platform/tests/custom-elements/v0/instantiating/custom-element-prototype.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/web-platform/tests/custom-elements/v0/instantiating/custom-element-prototype.html b/testing/web-platform/tests/custom-elements/v0/instantiating/custom-element-prototype.html new file mode 100644 index 000000000..2b298ea74 --- /dev/null +++ b/testing/web-platform/tests/custom-elements/v0/instantiating/custom-element-prototype.html @@ -0,0 +1,30 @@ +<!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> +</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> |