-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Validate proper use of extended attributes #570
Comments
I hacked something into webref's consistency tests to show the use for top-level definitions, which won't cover attributes and members. Here's the list of things that appear:
That confirms that there's some invalid use of at least |
I've sent WICG/portals#265 and w3c/css-houdini-drafts#1023 to fix the issues I spotted. |
This should make implementing #570 easier since every IDL type object will have the same type string.
This should make implementing #570 easier since every IDL type object will have the same type string.
On top of validating the proper use of extended attributes, could there be an option to validate additional grammar constraints for extended attributes? The Web IDL spec leaves the grammar of extended attributes fairly open: "The ExtendedAttribute grammar symbol matches nearly any sequence of tokens". The Web IDL parser rightfully accepts anything there. However, the Web IDL spec also defines a more restricted syntax for the specific extended attributes that are practically used in web specs. I don't think that the parser should validate that syntax by default, but in practice we would typically want to validate these constraints on all web specs that define some IDL. A recent example is the (invalid) definition of [Exposed=]
interface SandboxWindowProxy : WindowProxy {}; The |
Oh, AFAIK the parser already only supports a subset of what's allowed. I'll take a look. |
I took a look, but the parser already fails with that code.
So I'm not sure how this could happen, as the parser return nothing but an exception 🤔. Try it yourself on https://w3c.github.io/webidl2.js/checker/. |
Arrrrrgh, actually no, I fixed it last year in #635 and forgot to publish it. 🤦♀️ Anyway, 24.2.1. |
Web IDL has a lot of requirements about which extended attributes may be used where. For example:
There's bound to be some violations of these rules in the wild, so it would be good to validate them.
(Required
[Exposed]
extended attributes are already validated.)The text was updated successfully, but these errors were encountered: