[WebIDL] add text to discourage `InterfaceOwnedBySomeoneElse implements InterfaceIJustWrote;` and suggest `ConcreteObjectThatImplementsThatInterface implements InterfaceIJustWrote;` instead.

I recently saw a snippet of Web IDL code that goes like this:

X implements Y;
interface Y: Z
 {...};
Z implements P;

The problem is this:
  ConcreteObject A;
  A implements IFoo;
  A implements IBar;
  A implements IBaz;
  ConcreteObject B;
  B implements IFoo;


If someone decides that they have a `B` and want to make B's IFoo
interface do more, they might say:
IFoo implements IMyFooMore;

expecting it to make B more powerful -- but at the same time, it
causes random effects on A.

Note that we had this experience while working on Mozilla.

The rule which we tried to enforce is this:

Only the owner of IFoo is allowed to extend IFoo until IFoo is frozen,
at which point, IFoo MAY but probably SHOULD NOT be extended by
others.

Roughly that translates into:

  You, owner of ConcreteObject X are free to use 'X implements IWhatever;', but
  You are NOT free to use 'IStandardsBodyThing implements IWhatever;'.

And I'd like to see text to this effect added to the specification.

Received on Monday, 29 August 2011 17:08:59 UTC