[Bug 23623] Support [Clamp] for sequences

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23623

Nils Barth <nbarth+w3bugzilla@google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nbarth+w3bugzilla@google.co
                   |                            |m

--- Comment #6 from Nils Barth <nbarth+w3bugzilla@google.com> ---
Anne, it's tempting to attach extended attributes to types, but the grammar
(and semantics) are significantly easier if we attach to operation arguments
(and members) instead. Syntactically:
[ExtAttr] sequence<long> foo
...instead of:
sequence<[ExtAttr] long> foo

This is b/c extended attributes appear at 3 levels:
* definitions (interfaces etc.),
* members (attributes, operations, etc.),
* arguments (to operations).

Extended attributes basically don't attach to types; if they did, we'd need to
handle nesting, so these would have different meanings:
[ExtAttr] sequence<long> foo
sequence<[ExtAttr] long> foo
...and there would be ambiguity of whether an ExtAttr applies to a type or an
argument (or an attribute etc.); this:
[ExtAttr] sequence<long> foo
parses 2 ways:
([ExtAttr] sequence<long>) foo
[ExtAttr] (sequence<long> foo)
...which is pretty ugly.

http://dev.w3.org/2006/webapi/WebIDL/#idl-extended-attributes

Note that in the Candidate Recommendation, extended attributes are applicable
to typedefs:
typedef [Clamp] octet Value;
http://www.w3.org/TR/WebIDL/#dfn-typedef
...so:
sequence<Value>
in principle expands to:
sequence<[Clamp] octet> 
...but this makes quite a mess (as above), and is not present in the Editor's
Draft:
http://dev.w3.org/2006/webapi/WebIDL/#dfn-typedef

Hope this helps!

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 25 October 2013 01:40:39 UTC