Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is ConstrainablePattern using [NoInterfaceObject]? #501

Closed
tobie opened this issue Dec 18, 2017 · 2 comments
Closed

Why is ConstrainablePattern using [NoInterfaceObject]? #501

tobie opened this issue Dec 18, 2017 · 2 comments

Comments

@tobie
Copy link
Member

tobie commented Dec 18, 2017

ConstrainablePattern uses the [NoInterfaceObject] extended attribute, yet it's not a mixin, nor does it seem to need to do so for legacy compat reasons, which is now the only legit reason to use this extended attribute.

I suggest replacing the ConstrainablePattern interface's [NoInterfaceObject] extended attribute with the [Exposed] extended attribute, specifying the globals on which it should be exposed.

@alvestrand
Copy link
Contributor

This was done because (at least at the time we did this) the ConstrainablePattern can't be inherited from, due to the way WebIDL does inheritance.
Instead, each instance of the Constrainable pattern has to define the operations anew, without using inheritance to express the commonality.
Thus, [Nointerface] is used as a heads-up more than anything else: "You can syntax-check this IDL, but embedding it in a browser is useless, since it won't do anything".

To quote from section 11.1 of the spec:

"Although this specification formally defines ConstrainablePattern as a WebIDL interface, it is actually a template or pattern for other interfaces and cannot be inherited directly since the return values of the methods need to be extended, something WebIDL cannot do."

@tobie
Copy link
Member Author

tobie commented Dec 19, 2017

Oh, I see. If that's not a concern for implementors (i.e. if they're not pulling this in by accident despite it not being in use anywhere), I guess that's fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants