Skip to content

Extended attributes parser is too permissive #222

@saschanaz

Description

@saschanaz

Currently we allows anything including numbers and strings for extended attribute rhs:

// Conformance with ExtendedAttributeList grammar in http://www.w3.org/TR/WebIDL/#idl-extended-attributes
// Section 3.11
[IntAttr=0, FloatAttr=3.14, StringAttr="abc"]
interface IdInterface {};

... but the spec says:

The ExtendedAttribute grammar symbol matches nearly any sequence of tokens, however the extended attributes defined in this document only accept a more restricted syntax. Any extended attribute encountered in an IDL fragment is matched against the following five grammar symbols to determine which form (or forms) it is in:

Grammar symbol Form Example
ExtendedAttributeNoArgs takes no arguments [Replaceable]
ExtendedAttributeArgList takes an argument list [Constructor(double x, double y)]
ExtendedAttributeNamedArgList takes a named argument list [NamedConstructor=Image(DOMString >src)]
ExtendedAttributeIdent takes an identifier [PutForwards=name]
ExtendedAttributeIdentList takes an identifier list [Exposed=(Window,Worker)]

rhs should only allow 1) a named argument list 2) an identifier or 3) an identifier list.

Related to https://github.com/w3c/respec/issues/1760

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions