customElements

customElements

[19] window.customElements (CustomElementRegistry) は、カスタム要素定義を保持しているオブジェクトです。

仕様書

状態

[7] CustomElementRegistry オブジェクトは、 次の状態を持ちます。

カスタム要素定義集合
カスタム要素定義を探す手順で参照します。 初期状態ではです >>3
定義時約束写像
妥当なカスタム要素名から約束への写像です >>3whenDefined で使われます。 初期状態ではです。
要素定義が走っている

メンバー

[6] CustomElementRegistry インターフェイスは、 次のメンバーを持ちます。

[20] CustomElementRegistryメンバー

文脈

[8] CustomElementsRegistry インターフェイスは、 文書環境晒されます。

[9] CustomElementsRegistry オブジェクトは、 Window オブジェクトに関連付けられており、 customElements IDL属性から参照できます。

Window インターフェイス customElements 属性

[4] Window は、 CustomElementsRegistry を持ちます >>3。作成時に設定され >>3、以後変化しません。

[5] Window インターフェイスcustomElements IDL属性取得器は、 文脈オブジェクトCustomElementsRegistry を返さなければなりません >>3

CustomElementsRegistry インターフェイス get メソッド

[10] CustomElementsRegistry インターフェイスget メソッドは、 次のようにしなければなりません >>3

  1. [11] 名前を、第1引数を必須の DOMString として解釈した結果に設定します。
  2. [12] 文脈オブジェクト名前名前の項目を含むなら、
    1. [13] 文脈オブジェクト名前名前の項目の構築器を返します。
  3. [14] それ以外なら、
    1. [15] 未定義を返します。

[16] カスタム要素構築器に関わる各種処理の制限より、このメソッドが返すのは、 JavaScript関数undefined のいずれかとなります。

歴史

[1] Add custom elements to HTML · whatwg/html@6e7eaa4 ( 版) <https://github.com/whatwg/html/commit/6e7eaa4bd2912965fd83766f99f984f249531f3a>

[2] Add customElements.get() to retrieve a custom element constructor · whatwg/html@1d596a5 ( 版) <https://github.com/whatwg/html/commit/1d596a555d3c2f067ae643e447eaa88137b595ac>

[17] Handle reentrant custom element definition (domenic著, ) <https://github.com/whatwg/html/commit/270b5f3e48411063c431fdf98dbe41766ddc20b1>

[18] Rename "CustomElementsRegistry" to "CustomElementRegistry" (domenic著, ) <https://github.com/whatwg/html/commit/9e38ff4c7921c63b07fb6e8f4e3cb88d84bd39c2>

[21] Editorial: make the type of custom element constructors stricter (yuki3著, ) <https://github.com/whatwg/html/commit/f8bd887aff17a5ffaf8c50c76b937815c92fc5e4>