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

Interfaces with named getters inheriting from interfaces with named getters #833

Open
domenic opened this issue Jan 18, 2020 · 1 comment

Comments

@domenic
Copy link
Member

domenic commented Jan 18, 2020

The Web IDL spec says

If an object implements more than one interface that defines a given special operation, then it is undefined which (if any) special operation is invoked for that operation.

However we have on the platform

[Exposed=Window]
interface HTMLFormControlsCollection : HTMLCollection {
  // inherits length and item()
  getter (RadioNodeList or Element)? namedItem(DOMString name); // shadows inherited namedItem()
};

[Exposed=Window, LegacyUnenumerableNamedProperties]
interface HTMLCollection {
  readonly attribute unsigned long length;
  getter Element? item(unsigned long index);
  getter Element? namedItem(DOMString name);
};

Thus instances of HTMLFormControlsCollection implement two interface that both defined named getters, and we're in some kind of undefined situation.

We should presumably instead update the Web IDL spec to use the most-derived operation.

The normative text in e.g. LegacyPlatformObjectGetOwnProperty is pretty unclear right now, talking a lot about running steps but not specifying what interface to run them for.

@bzbarsky
Copy link
Collaborator

We should presumably instead update the Web IDL spec to use the most-derived operation.

I agree. That's what browsers implement in practice, I expect. Certainly it's what Gecko implements.

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

No branches or pull requests

2 participants