Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / w3c / web-platform-tests / custom-elements / registering-custom-elements / definition-construction-algorithm-no-interface-for-name.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>If element interface for name doesn't exists then error must be thrown</title>
5 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
6 <meta name="assert" content="If NAME was provided and is not null and if element interface for the name and namespace does not exist or is an interface for a custom element, set ERROR to InvalidName and stop">
7 <link rel="help" href="http://www.w3.org/TR/custom-elements/#registering-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     doc.registerElement('x-a');
19     assert_throws('NotSupportedError', function() {
20         doc.registerElement('x-b', {extends: 'x-a'});
21     }, 'Exception should be thrown in case of attempt to register ' +
22         'a custom element which extends another custom element');
23 }, 'Exception should be thrown in case of attempt to register ' +
24     'a custom element which extends another custom element');
25 </script>
26 </body>
27 </html>