From 5524318fe73a1123da10491a6a545b50af88ea60 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 07:07:09 -0400 Subject: Bug 1416999 - Remove document.registerElement Tag #1375 --- dom/tests/mochitest/webcomponents/mochitest.ini | 5 +- .../test_custom_element_callback_innerhtml.html | 26 ++++---- ..._custom_element_register_invalid_callbacks.html | 69 ---------------------- .../test_document_register_parser.html | 47 --------------- .../test_document_shared_registry.html | 46 --------------- .../test_template_custom_elements.html | 32 ---------- .../test_unresolved_pseudo_class.html | 26 ++++---- 7 files changed, 28 insertions(+), 223 deletions(-) delete mode 100644 dom/tests/mochitest/webcomponents/test_custom_element_register_invalid_callbacks.html delete mode 100644 dom/tests/mochitest/webcomponents/test_document_register_parser.html delete mode 100644 dom/tests/mochitest/webcomponents/test_document_shared_registry.html delete mode 100644 dom/tests/mochitest/webcomponents/test_template_custom_elements.html (limited to 'dom/tests/mochitest') diff --git a/dom/tests/mochitest/webcomponents/mochitest.ini b/dom/tests/mochitest/webcomponents/mochitest.ini index 756e6f2ae..2cfd747c4 100644 --- a/dom/tests/mochitest/webcomponents/mochitest.ini +++ b/dom/tests/mochitest/webcomponents/mochitest.ini @@ -17,12 +17,14 @@ support-files = htmlconstructor_builtin_tests.js [test_custom_element_in_shadow.html] skip-if = true || stylo # disabled - See bug 1390396 and 1293844 -[test_custom_element_register_invalid_callbacks.html] [test_custom_element_throw_on_dynamic_markup_insertion.html] [test_custom_element_get.html] [test_custom_element_when_defined.html] [test_custom_element_uncatchable_exception.html] skip-if = !debug # TestFunctions only applied in debug builds +[test_custom_element_define.html] +[test_custom_element_define_parser.html] +[test_custom_element_template.html] [test_nested_content_element.html] [test_dest_insertion_points.html] [test_fallback_dest_insertion_points.html] @@ -41,7 +43,6 @@ skip-if = true # disabled - See bug 1390396 [test_event_stopping.html] [test_template.html] [test_template_xhtml.html] -[test_template_custom_elements.html] [test_shadowroot.html] [test_shadowroot_inert_element.html] [test_shadowroot_style.html] diff --git a/dom/tests/mochitest/webcomponents/test_custom_element_callback_innerhtml.html b/dom/tests/mochitest/webcomponents/test_custom_element_callback_innerhtml.html index bb5008538..22d957117 100644 --- a/dom/tests/mochitest/webcomponents/test_custom_element_callback_innerhtml.html +++ b/dom/tests/mochitest/webcomponents/test_custom_element_callback_innerhtml.html @@ -18,23 +18,19 @@ SimpleTest.waitForExplicitFinish(); var connectedCallbackCount = 0; -var p = Object.create(HTMLElement.prototype); - -p.createdCallback = function() { - ok(true, "createdCallback called."); -}; - -p.connectedCallback = function() { - ok(true, "connectedCallback should be called when the parser creates an element in the document."); - connectedCallbackCount++; - // connectedCallback should be called twice, once for the element created for innerHTML and - // once for the element created in this document. - if (connectedCallbackCount == 2) { - SimpleTest.finish(); +class Foo extends HTMLElement { + connectedCallback() { + ok(true, "connectedCallback should be called when the parser creates an element in the document."); + connectedCallbackCount++; + // connectedCallback should be called twice, once for the element created for innerHTML and + // once for the element created in this document. + if (connectedCallbackCount == 2) { + SimpleTest.finish(); + } } -} +}; -document.registerElement("x-foo", { prototype: p }); +customElements.define("x-foo", Foo); var container = document.getElementById("container"); container.innerHTML = ''; diff --git a/dom/tests/mochitest/webcomponents/test_custom_element_register_invalid_callbacks.html b/dom/tests/mochitest/webcomponents/test_custom_element_register_invalid_callbacks.html deleted file mode 100644 index 572579ba8..000000000 --- a/dom/tests/mochitest/webcomponents/test_custom_element_register_invalid_callbacks.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - Test registering invalid lifecycle callbacks for custom elements. - - - - -Bug 1275835 - - - - diff --git a/dom/tests/mochitest/webcomponents/test_document_register_parser.html b/dom/tests/mochitest/webcomponents/test_document_register_parser.html deleted file mode 100644 index a4fb63139..000000000 --- a/dom/tests/mochitest/webcomponents/test_document_register_parser.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Test for document.registerElement for elements created by the parser - - - - - -Bug 783129 - - - -
- - - - diff --git a/dom/tests/mochitest/webcomponents/test_document_shared_registry.html b/dom/tests/mochitest/webcomponents/test_document_shared_registry.html deleted file mode 100644 index db72e1e6c..000000000 --- a/dom/tests/mochitest/webcomponents/test_document_shared_registry.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Test shared registry for associated HTML documents. - - - - -
-Bug 783129 - - - diff --git a/dom/tests/mochitest/webcomponents/test_template_custom_elements.html b/dom/tests/mochitest/webcomponents/test_template_custom_elements.html deleted file mode 100644 index f7f4340cf..000000000 --- a/dom/tests/mochitest/webcomponents/test_template_custom_elements.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Test for custom elements in template - - - - - -Bug 1091425 - - - - diff --git a/dom/tests/mochitest/webcomponents/test_unresolved_pseudo_class.html b/dom/tests/mochitest/webcomponents/test_unresolved_pseudo_class.html index 3e1fae8ee..a1ff3b3c6 100644 --- a/dom/tests/mochitest/webcomponents/test_unresolved_pseudo_class.html +++ b/dom/tests/mochitest/webcomponents/test_unresolved_pseudo_class.html @@ -42,7 +42,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1111633