[Bug 26302] New: Please add a FileList constructor

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

            Bug ID: 26302
           Summary: Please add a FileList constructor
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: File API
          Assignee: arun@mozilla.com
          Reporter: costan@gmail.com
        QA Contact: public-webapps-bugzilla@w3.org
                CC: public-webapps@w3.org

Please consider adding a FileList constructor. I think it should take a
sequence<File> argument, for consistency with the File constructor.

Motivation: when combined with the File constructor and with a read-write
"files" property on the HTMLInputElement (see Bug 17125), this is sufficient to
implement any changes to the list of files that an <input type="file"> would
upload. For example, Bug 17125 can be implemented by creating a new FileList
that contains all the Files in the old list, except for the one that should be
removed.

Security implications: there shouldn't be any, as it already is possible to
create a FileList in a round-about way, by adding File instances to a
DataTransfer [1] via items.add(File) and reading the files attribute. This is
already used in the wild [2]. Also, this proposal leaves FileList immutable,
which might simplify some correctness / security analysis.

Alternatives: Bug 24586 proposes removing FileList altogether, but it relies on
Bug 23682, which requires significant changes and thinking. The approach
suggested here can be implemented now. If the JS array succeeds, the FileList
constructor can be deprecated at the same time as the items() method.

Thank you!


[1]
http://www.whatwg.org/specs/web-apps/current-work/multipage/user-interaction.html#datatransfer
[2] http://crbug.com/360308

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Thursday, 10 July 2014 00:31:04 UTC