WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
63222
Add a helper function to FileList to retrieve a list of filenames.
https://bugs.webkit.org/show_bug.cgi?id=63222
Summary
Add a helper function to FileList to retrieve a list of filenames.
Dimitri Glazkov (Google)
Reported
2011-06-22 19:30:54 PDT
Add a helper function to FileList to retrieve a list of filenames.
Attachments
Patch
(4.20 KB, patch)
2011-06-22 19:32 PDT
,
Dimitri Glazkov (Google)
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Dimitri Glazkov (Google)
Comment 1
2011-06-22 19:32:17 PDT
Created
attachment 98297
[details]
Patch
Kent Tamura
Comment 2
2011-06-22 19:37:09 PDT
Comment on
attachment 98297
[details]
Patch ok
WebKit Review Bot
Comment 3
2011-06-22 20:08:11 PDT
Comment on
attachment 98297
[details]
Patch Clearing flags on attachment: 98297 Committed
r89523
: <
http://trac.webkit.org/changeset/89523
>
WebKit Review Bot
Comment 4
2011-06-22 20:08:15 PDT
All reviewed patches have been landed. Closing bug.
Alexey Proskuryakov
Comment 5
2011-06-23 00:58:57 PDT
+Vector<String> FileList::filenames() const +{ + Vector<String> filenames; + for (unsigned i = 0; i < m_files.size(); ++i) + filenames.append(m_files[i]->path()); This function returns paths, so why is it called "filenames()"?
Dimitri Glazkov (Google)
Comment 6
2011-06-23 06:55:10 PDT
(In reply to
comment #5
)
> +Vector<String> FileList::filenames() const > +{ > + Vector<String> filenames; > + for (unsigned i = 0; i < m_files.size(); ++i) > + filenames.append(m_files[i]->path()); > > This function returns paths, so why is it called "filenames()"?
Oh, that's interesting. It seems there's a schism in how FileList is used in HTMLInputElement vs. File API. The File instances are populated from FileChoooser (
http://codesearch.google.com/codesearch#OAMlx_jo-ck/src/third_party/WebKit/Source/WebCore/rendering/RenderFileUploadControl.cpp&l=91
), where they are definitely filenames. Then they are briefly called paths (
http://codesearch.google.com/codesearch#OAMlx_jo-ck/src/third_party/WebKit/Source/WebCore/html/FileInputType.cpp&l=191
), while remaining to be filenames. It seems that either File objects are not semantically well-formed, or I am totally misunderstanding the meaning of word "path".
Alexey Proskuryakov
Comment 7
2011-06-23 10:00:26 PDT
And there's also fakepath (see
bug 29000
). Would be nice to clean this up.
Dimitri Glazkov (Google)
Comment 8
2011-06-23 10:50:38 PDT
(In reply to
comment #7
)
> And there's also fakepath (see
bug 29000
). > > Would be nice to clean this up.
One thing we could do is just get rid of FileList altogether for managing input[type=file]. I don't think there's an actual need for that. WDYT?
Alexey Proskuryakov
Comment 9
2011-06-23 10:55:47 PDT
> WDYT?
I don't have anything wise to say :-)
Dimitri Glazkov (Google)
Comment 10
2011-06-24 20:55:29 PDT
(In reply to
comment #9
)
> > WDYT? > > I don't have anything wise to say :-)
I looked at it and turns out there are good reasons for input->files() to be a FileList*. I'll just rename filenames to paths in FileList.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug