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

Overloading methods in a separate partial definition is invalid #209

Closed
tidoust opened this issue Mar 20, 2024 · 3 comments · Fixed by #210
Closed

Overloading methods in a separate partial definition is invalid #209

tidoust opened this issue Mar 20, 2024 · 3 comments · Fixed by #210

Comments

@tidoust
Copy link
Contributor

tidoust commented Mar 20, 2024

The Sanitizer API overloads methods already defined in HTML, such as Document.parseHTMLUnsafe() (HTML, Sanitizer API).

That is forbidden by Web IDL: it imposes that "Operations must not be overloaded across interface, partial interface, interface mixin, and partial interface mixin definitions." (see Overloading).

I suspect that you're doing that on purpose, know what you're doing, and that the final goal is to upstream these definitions to HTML. I also don't see any immediate workaround (apart from relaxing the constraint in Web IDL, perhaps?)

In the meantime, I note that this creates a practical problem: the updated IDL defined in the Sanitizer API cannot reach Web Platform Tests (interfaces/sanitizer-api.idl) because one of the guarantees that we enforce in Webref on the way to Web Platform Tests is that the Web IDL as a whole, merging the IDL defined across specs, is valid.

@annevk
Copy link
Collaborator

annevk commented Mar 20, 2024

Can we annotate them in some way that they're not indexed? It shouldn't really matter until it's standardized.

@otherdaniel
Copy link
Collaborator

Would this work? #210

That looks a bit dorky, since it just renames the methods in questions by adding a __TO_BE_MERGED suffix. But it should make the tools happy again.

@tidoust
Copy link
Contributor Author

tidoust commented Mar 20, 2024

Can we annotate them in some way that they're not indexed?

Yes, adding class=extract would work to exclude the IDL from indexing.

The renames obviously work as well.

We can also make do with the problem from a tooling perspective. We would create a patch on our side to exclude the IDL and make the tools happy again. That's less ideal for us, of course ;) Anyway, I was more reporting the problem so what you are aware of it and not surprised that propagation to WPT appears broken.

otherdaniel added a commit that referenced this issue Mar 21, 2024
This closes #209, by adding "__TO_BE_MERGED" to any methods already defined in HTML. The intent is that the reader can still identify which method we mean, but the tools won't get confused.
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

Successfully merging a pull request may close this issue.

3 participants