Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/custom-elements/registering-custom-elements/unresolved-elements-interface-html-unknown-element.html

Issue 1962003002: Import web-platform-tests@41d6911b288a9624c249a406b9bf51607a2dd04d (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skip submit-entity-body.html Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Unresolved element interface must be HTMLUnknownElement, if the namespace is neither HTML Namespace nor SVG Namespace</title>
5 <meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru ">
6 <meta name="assert" content="When an unresolved element is created, it's element interface must be HTMLUnknownElement, if the namespace is neither HTML Namespac e nor SVG Namespace">
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 </head>
12 <body>
13 <div id="log"></div>
14 <script>
15 var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
16
17 test(function() {
18 var doc = newHTMLDocument();
19 doc.body.innerHTML =
20 '<math xmlns="' + MATHML_NAMESPACE + '">' +
21 '<x-a id="x-a"></x-a>' +
22 '</math>';
23 var xa = doc.querySelector('#x-a');
24
25 assert_not_equals(xa, null, 'Unregistered custom element should not be null' );
26
27 // According https://code.google.com/p/chromium/issues/detail?id=336377
28 // expected class string is Element
29 assert_class_string(xa, 'Element', 'Unresolved custom element must be an Ele ment');
30 }, 'Test interface of unresolved element with MathML namespace, created via inne rHTML property');
31
32
33 test(function() {
34 var doc = newHTMLDocument();
35 var xa = doc.createElementNS(MATHML_NAMESPACE, 'x-b');
36
37 assert_class_string(xa, 'Element',
38 'Unresolved custom element must be a HTMLUnknownElement');
39 }, 'Test interface of unresolved element with MathML namespace, ' +
40 'created by Document.createElementNS');
41
42
43 testInIFrame('../resources/x-mathml-element.html', function(doc) {
44 var customElement = doc.getElementById('x-math-element');
45
46 assert_not_equals(customElement, null, 'Unregistered custom element should n ot be null');
47
48 assert_class_string(customElement, 'Element',
49 'Unresolved custom element must be a Element');
50 }, 'Test interface of unresolved element in loaded HTML document with embedded M athML elements');
51 </script>
52 </body>
53 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698