This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25994 - invalid extended attribute list syntax
Summary: invalid extended attribute list syntax
Status: CLOSED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: File API (show other bugs)
Version: unspecified
Hardware: All All
: P2 critical
Target Milestone: ---
Assignee: Arun
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-05 17:08 UTC by Glenn Adams
Modified: 2014-06-19 03:08 UTC (History)
2 users (show)

See Also:


Attachments

Description Glenn Adams 2014-06-05 17:08:46 UTC
The extended attribute list syntax used in the File API does not adhere to current WebIDL specification syntax. In particular, production 64 of the syntax [1] must consist of a comma separated list of ExtendedAttribute items.

[1] http://heycam.github.io/webidl/#proddef-ExtendedAttributeList

In order to fix this, please make the following changes:

(1) on definition of Blob interface, change

[Exposed=Window,Worker][Constructor,
Constructor(sequence<(ArrayBuffer or ArrayBufferView or Blob or DOMString)> blobParts, optional BlobPropertyBag options)]

to 

[Constructor,
Constructor(sequence<(ArrayBuffer or ArrayBufferView or Blob or DOMString)> blobParts, optional BlobPropertyBag options),
Exposed=Window,Worker]

(2) on definition of File interface, change

[Exposed=Window,Worker][Constructor(sequence<(Blob or DOMString or ArrayBufferView or ArrayBuffer)> fileBits, [EnsureUTF16] DOMString fileName, optional FilePropertyBag options)]

to

[Constructor(sequence<(Blob or DOMString or ArrayBufferView or ArrayBuffer)> fileBits, [EnsureUTF16] DOMString fileName, optional FilePropertyBag options),
Exposed=Window,Worker]

(3) on definition of FileReader interface, change

[Exposed=Window,Worker][Constructor]

to

[Constructor, Exposed=Window,Worker]

(4) on definition of FileReaderSync interface, change

[Exposed=Worker][Constructor]

to

[Constructor, Exposed=Worker]

Note that I have also reordered the Exposed extended attribute above to improve readability (given that it can contain a ',' as well).
Comment 1 Boris Zbarsky 2014-06-05 17:19:30 UTC
Note that the syntax of Exposed will likely change, since the current one can't be parsed unambiguously.
Comment 2 Arun 2014-06-13 20:35:55 UTC
(In reply to Boris Zbarsky from comment #1)
> Note that the syntax of Exposed will likely change, since the current one
> can't be parsed unambiguously.


bzbarsky, will it change in a way that's very different than the suggested correct syntax in the bug report by Glenn Adams? I admit I read WebIDL wrong, and created two sets of square brackets, one for extended attribute annotations and one for constructor. Should I leave this be till WebIDL decides on the correct syntax?
Comment 3 Boris Zbarsky 2014-06-13 23:22:39 UTC
> will it change in a way that's very different than the suggested correct syntax
> in the bug report by Glenn Adams

Unclear.  For now you should use what Glenn suggested, in any case.
Comment 5 Glenn Adams 2014-06-19 03:08:37 UTC
Thanks.