Drop IDL extended attributes from data-type values #2790
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fix for #2705, where the problem is that Bikeshed dies on argumentdef tables when a spec defines an IDL interface attribute or a dictionary member that comes with extended attributes, something like
To produce the ", of type foo" content that appears next to the term in the table, Bikeshed relies on the
data-type
attribute set in the IDL block. The value of that attribute comes from atype
field returned by widlparser. The code in Bikeshed expected that value to be a real IDL type (a simple type or a union) but that construct in widlparser is a "type with extended attributes": https://github.com/plinss/widlparser/blob/6c91beb68806fd6c206c57cecd15e455b0b6c1c1/widlparser/productions.py#L1294As a result, the type Bikeshed sees is
[EnforceRange] short
in the above example, which cannot be directly associated with a type in Web IDL.This update gets back to actual IDL types in the
data-type
attribute, which effectively solves the problem of the ", of type foo" content generation. A new idl008 test was added to check extended attributes.One side effect of that update is that
data-type
attribute values no longer contain trailing spaces. That seems a good thing (spaces where already stripped for attributes, but not for dictionary members), but required re-generating a bunch of reference tests.Note: If the inclusion of extended attributes in the
data-type
attribute was actually intended, then the fix would rather need to be done inattributeInfo.py
.