Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / imported / web-platform-tests / custom-elements / registering-custom-elements / unresolved-elements-interface-svg-element.html
blob9a99d4e5bca4e00a16164b169b65e2e2fbc659fe
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Unresolved element interface must be SVGElement, if the namespace is SVG Namespace</title>
5 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
6 <meta name="author" title="Vasiliy Degtyarev" href="mailto:vasya@unipro.ru">
7 <meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
8 <meta name="assert" content="When an unresolved element is created, it's element interface must be SVGElement if the namespace is SVG Namespace">
9 <link rel="help" href="http://www.w3.org/TR/custom-elements/#registering-custom-elements">
10 <script src="../../../../resources/testharness.js"></script>
11 <script src="../../../../resources/testharnessreport.js"></script>
12 <script src="../testcommon.js"></script>
13 <link rel="stylesheet" href="../../../../resources/testharness.css">
14 </head>
15 <body>
16 <div id="log"></div>
17 <script>
18 test(function() {
19 var doc = newHTMLDocument();
20 var xsvg = doc.createElementNS(SVG_NAMESPACE, 'x-svg');
22 assert_class_string(xsvg, 'SVGElement', 'Unresolved custom element must be a SVG element');
23 }, 'Test interface of unresolved element with valid name, created by Document.createElementNS()');
26 test(function() {
27 var doc = newHTMLDocument();
28 doc.body.innerHTML =
29 '<svg xmlns=' + SVG_NAMESPACE + ' version="1.1">' +
30 '<x-svg-a id="x-svg"></x-svg-a>' +
31 '</svg>';
32 var xsvg = doc.querySelector('#x-svg');
34 assert_class_string(xsvg, 'SVGElement', 'Unresolved custom element must be a SVG element');
35 }, 'Test interface of unresolved element with valid name, created via innerHTML property');
38 testInIFrame('../resources/x-svg-element.html', function(doc) {
39 var xsvg = doc.getElementById('x-svg-element');
41 assert_not_equals(xsvg, null, 'Unresolved custom element should not be null');
43 assert_class_string(xsvg, 'SVGElement',
44 'Unresolved custom element must be a SVG element');
45 }, 'Test interface of unresolved element in loaded HTML document with embedded SVG elements');
46 </script>
47 </body>
48 </html>