attachShadow

attachShadow

仕様書

処理

[4] Element インターフェイスattachShadow メソッドは、 次のようにしなければなりません >>3
  1. [5] 状態を、第1引数を辞書 ShadowRootInit として解釈した結果に設定します。
  2. [6] 文脈オブジェクトが、影ホストとなれる要素のいずれかでなければ、
    1. [7] NotSupportedError 例外投げ、ここで停止します。
  3. [8] 文脈オブジェクト影ホストなら、
    1. [9] InvalidStateError 例外投げ、ここで停止します。
  4. [10] を、影根に設定します。
    節点文書
    文脈オブジェクト節点文書
    ホスト
    文脈オブジェクト
    モード
    状態mode
  5. [11] 文脈オブジェクト影根を、に設定します。
  6. [12] を返します。

[15] 辞書 ShadowRootInit >>14 は、 次のメンバーを持ちます。

[13] 影ホストとなれる要素は、次のものです >>3

歴史

[1] Shadow: define .attachShadow() and .shadowRoot · whatwg/dom@1699495 ( 版) https://github.com/whatwg/dom/commit/169949553da85cfee6b03df361ed3e8142ddc54e

[2] Shadow: define attachShadow() for custom elements · whatwg/dom@b8d2854 ( 版) https://github.com/whatwg/dom/commit/b8d2854152aaabc412063c67bcb4177d8a2607a1

[16] Use "NotSupportedError" when trying to attachShadow() twice (domenic著, ) https://github.com/whatwg/dom/commit/bcdab96b3e72cebb168d02e2a566e845abbe0df4

[17] Add "disable shadow" flag check to Element.attachShadow() by tkent-google · Pull Request #760 · whatwg/dom () https://github.com/whatwg/dom/pull/760

[18] Use "NotSupportedError" when trying to attachShadow() twice by domenic · Pull Request #761 · whatwg/dom () https://github.com/whatwg/dom/pull/761

[19] Add "disable shadow" flag check to element.attachShadow() (tkent-google著, ) https://github.com/whatwg/dom/commit/daa525d4078a7991aa0d7698a3591a5e61f53dd3

[20] Custom elements: Add element.attachInternals() and ElementInternals interface by tkent-google · Pull Request #4324 · whatwg/html () https://github.com/whatwg/html/pull/4324

[21] Add "disable shadow" flag check to Element.attachShadow() by tkent-google · Pull Request #760 · whatwg/dom () https://github.com/whatwg/dom/pull/760

[22] Editorial: attachShadow() takes a required dictionary (annevk著, ) https://github.com/whatwg/dom/commit/a257369620a17b6af578591219a72b5c1d8f96a5

[23] Editorial: attachShadow() takes a required dictionary by annevk · Pull Request #775 · whatwg/dom () https://github.com/whatwg/dom/pull/775