OLD | NEW |
(Empty) | |
| 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'); |
| 21 |
| 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.cr
eateElementNS()'); |
| 24 |
| 25 |
| 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'); |
| 33 |
| 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'); |
| 36 |
| 37 |
| 38 testInIFrame('../resources/x-svg-element.html', function(doc) { |
| 39 var xsvg = doc.getElementById('x-svg-element'); |
| 40 |
| 41 assert_not_equals(xsvg, null, 'Unresolved custom element should not be null'
); |
| 42 |
| 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 S
VG elements'); |
| 46 </script> |
| 47 </body> |
| 48 </html> |
OLD | NEW |