diff --git a/source b/source index 4a6e9844f2a..8151f3d6dff 100644 --- a/source +++ b/source @@ -3147,7 +3147,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
SyntaxError
" DOMException
if not given a valid
custom element name.
+
+ customElements
. upgrade
(root)Element definition is a process of adding a custom element definition @@ -66462,6 +66471,36 @@ fetch(articleURL) }); +
When invoked, the upgrade(root)
method must run
+ these steps:
Let candidates be a list of all of root's + inclusive descendants, in tree order, + that are element nodes.
For each candidate of candidates, + try to upgrade candidate.
The upgrade()
method allows upgrading
+ of elements at will. Normally elements are automatically upgraded when they become
+ connected, but this method can be used if you need to upgrade before you're ready to
+ connect the element.
const el = document.createElement("spider-man"); + +class SpiderMan extends HTMLElement {} +customElements.define("spider-man", SpiderMan); + +console.assert(!(el instanceof SpiderMan)); // not yet upgraded + +customElements.upgrade(el); +console.assert(el instanceof SpiderMan); // upgraded!+
To upgrade an element, given as