summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/custom-elements/v0/registering/extensions-to-document-interface/custom-element-prototype.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/custom-elements/v0/registering/extensions-to-document-interface/custom-element-prototype.html')
-rw-r--r--testing/web-platform/tests/custom-elements/v0/registering/extensions-to-document-interface/custom-element-prototype.html27
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/web-platform/tests/custom-elements/v0/registering/extensions-to-document-interface/custom-element-prototype.html b/testing/web-platform/tests/custom-elements/v0/registering/extensions-to-document-interface/custom-element-prototype.html
new file mode 100644
index 000000000..de397aacd
--- /dev/null
+++ b/testing/web-platform/tests/custom-elements/v0/registering/extensions-to-document-interface/custom-element-prototype.html
@@ -0,0 +1,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>