Skip to content

Commit

Permalink
Add customElements.get() to retrieve a custom element constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic authored and annevk committed Apr 13, 2016
1 parent 41215dd commit 1804c62
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -67168,6 +67168,7 @@ console.log(plasticButton2.getAttribute("is")); // will output "plastic-button"<

<pre class="idl">interface <dfn>CustomElementsRegistry</dfn> {
void <span data-x="dom-CustomElementsRegistry-define">define</span>(DOMString name, Function constructor, optional ElementRegistrationOptions options);
any <span data-x="dom-CustomElementsRegistry-get">get</span>(DOMString name);
};

dictionary <dfn>ElementRegistrationOptions</dfn> {
Expand Down Expand Up @@ -67198,6 +67199,14 @@ dictionary <dfn>ElementRegistrationOptions</dfn> {
a <span>customized built-in element</span> for the <span>element type</span> identified by the supplied
<var>baseLocalName</var>. A <code>NotSupportedError</code> will be thrown upon trying to extend a
<span>custom element</span> or an unknown element.</dd>

<dt><var>window</var> . <code data-x="dom-window-customElements">customElements</code> . <code
data-x="dom-CustomElementsRegistry-get">get</code>(<var>name</var>)</dt>

<dd>Retrieves the <span>custom element constructor</span> defined for the given <span
data-x="concept-custom-element-definition-name">name</span>. Returns undefined if there is no
<span>custom element definition</span> with the given <span
data-x="concept-custom-element-definition-name">name</span>.</dd>
</dl>

<p><dfn>Element definition</dfn> is a process of adding a <span>custom element definition</span>
Expand Down Expand Up @@ -67296,6 +67305,18 @@ dictionary <dfn>ElementRegistrationOptions</dfn> {
<li><p>Add <var>definition</var> to this <code>CustomElementsRegistry</code>.</p></li>
</ol>

<p>When invoked, the <dfn><code
data-x="dom-CustomElementsRegistry-get">get(<var>name</var>)</code></dfn> method must run these
steps:</p>

<ol>
<li><p>If this <code>CustomElementsRegistry</code> contains an entry with <span
data-x="concept-custom-element-definition-name">name</span> <var>name</var>, then return that
entry's <span data-x="concept-custom-element-definition-constructor">constructor</span>.</p></li>

<li><p>Otherwise, return undefined.</p></li>
</ol>

<h4><dfn data-x="custom-element-upgrades">Upgrades</dfn></h4>

<p>To <dfn data-x="concept-upgrade-an-element" data-export="">upgrade an element</dfn>, given as
Expand Down

0 comments on commit 1804c62

Please sign in to comment.