implements

implements 文 (Web IDL)

[11] implements (statement) は、 あるインターフェイス実装するオブジェクトが更に実装しなければならないインターフェイスを指定するものです >>10

仕様書

構文

[12] implements は、次のような定義です >>10

A implements B;

[13] これは、 A実装するオブジェクトB実装しなければならないことを表します >>10

制約

[16] 両辺が表すものはインターフェイスでなければなりません。 ただしコールバックインターフェイスであってはなりません。 >>10

[15] 両辺インターフェイスは異なるものでなければなりません。 一方が他方を継承していてはなりません。 >>10

[14] implements 推移的に適用されます >>10

[17] implements 有向グラフとしたとき、 循環してはなりません >>10

[18] 次のようなケースは禁止されていませんがいいのでしょうか。
interface B {};
interface C {};
interface D : C {};
B implements D;
C implements B;

[21] ただし左辺補助的インターフェイスであるような implements勧められていません (discouraged) >>10。 (推移的に適用されるような implements を書くべきではありません。)

[22] 実際にはそのような例はなさそうです。

[24] implements によって生じるメンバーの制約については、 派生的インターフェイス群を参照してください。

補助的インターフェイス

[19] あるオブジェクト実装するインターフェイスのうち、 implements 右辺に指定されているものや、 その継承インターフェイスのことを、 補助的インターフェイス (supplemental interface) といいます >>10

[20] すなわち、 interface: で表されるような本筋の継承関係ではなく、 implements によって追加で実装するよう指定されているインターフェイス群のことを補助的インターフェイスと呼んでいます。

[23] 派生的インターフェイス群と似ていますが、補助的インターフェイスの方がより多くのインターフェイスが該当します。 継承インターフェイスimplements補助的インターフェイスになりますが、 派生的インターフェイス群にはなりません。

歴史

implements

[2] 24417 – [Exposed] on an interface that is "implements"ed into another should mean something () https://www.w3.org/Bugs/Public/show_bug.cgi?id=24417

[3] Update WebIDL definition(s) to use new mixin syntax · Issue #532 · whatwg/dom () https://github.com/whatwg/dom/issues/532

[4] Use Web IDL's new-ish interface mixins concept (romandev著, ) https://github.com/whatwg/html/commit/c8867a179c21134021dc3435e98c1b9c4542d794

[5] interface: use Web IDL's new-ish interface mixins concept (#1176) (romandev著, ) https://github.com/w3c/webdriver/commit/d50bdf0c0d6cac5e54cdedc263df3cc2cba173f9

[6] Add support for interface mixins (tobie著, ) https://github.com/heycam/webidl/commit/45e8173d40ddff8dcf81697326e094bcf8b92920

[7] The spec's wording for where to place operations is broken and confusing · Issue #164 · heycam/webidl () https://github.com/heycam/webidl/issues/164

[8] 25495 – Behavior of no [Exposed] on interface members is weird () https://www.w3.org/Bugs/Public/show_bug.cgi?id=25495

[9] Designing mixins · Issue #363 · heycam/webidl () https://github.com/heycam/webidl/issues/363

[25] Define "implements" checks using internal slots (littledan著, ) https://github.com/heycam/webidl/commit/d534bbefd52182e09594bb7c4c229dd24b4251c0

[27] Add [[PlatformBrand]] internal slot to all platform objects · Issue #97 · heycam/webidl () https://github.com/heycam/webidl/issues/97

[28] Define "implements" checks using internal slots by Ms2ger · Pull Request #654 · heycam/webidl () https://github.com/heycam/webidl/pull/654