Title: [89777] trunk/Source/WebCore
Revision
89777
Author
[email protected]
Date
2011-06-26 18:47:50 -0700 (Sun, 26 Jun 2011)

Log Message

2011-06-26  Dimitri Glazkov  <[email protected]>

        Reviewed by Adam Barth.

        FileList::filenames should be FileList::paths, because it's more accurate.
        https://bugs.webkit.org/show_bug.cgi?id=63414

        Refactoring, no change in behavior.

        * fileapi/FileList.cpp:
        (WebCore::FileList::paths): Renamed from filenames.
        * fileapi/FileList.h:
        * html/FileInputType.cpp:
        (WebCore::FileInputType::handleDOMActivateEvent): Changed to use filenames, also fixed a reach-unto-thyself whoopsie.
        (WebCore::FileInputType::requestIcon): Ditto.
        (WebCore::FileInputType::filesChosen): Ditto.
        * rendering/RenderFileUploadControl.cpp:
        (WebCore::RenderFileUploadControl::fileTextValue): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (89776 => 89777)


--- trunk/Source/WebCore/ChangeLog	2011-06-27 00:31:19 UTC (rev 89776)
+++ trunk/Source/WebCore/ChangeLog	2011-06-27 01:47:50 UTC (rev 89777)
@@ -1,3 +1,22 @@
+2011-06-26  Dimitri Glazkov  <[email protected]>
+
+        Reviewed by Adam Barth.
+
+        FileList::filenames should be FileList::paths, because it's more accurate.
+        https://bugs.webkit.org/show_bug.cgi?id=63414
+
+        Refactoring, no change in behavior.
+
+        * fileapi/FileList.cpp:
+        (WebCore::FileList::paths): Renamed from filenames.
+        * fileapi/FileList.h:
+        * html/FileInputType.cpp:
+        (WebCore::FileInputType::handleDOMActivateEvent): Changed to use filenames, also fixed a reach-unto-thyself whoopsie.
+        (WebCore::FileInputType::requestIcon): Ditto.
+        (WebCore::FileInputType::filesChosen): Ditto.
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::RenderFileUploadControl::fileTextValue): Ditto.
+
 2011-06-26  Young Han Lee  <[email protected]>
 
         Reviewed by Dirk Schulze.

Modified: trunk/Source/WebCore/fileapi/FileList.cpp (89776 => 89777)


--- trunk/Source/WebCore/fileapi/FileList.cpp	2011-06-27 00:31:19 UTC (rev 89776)
+++ trunk/Source/WebCore/fileapi/FileList.cpp	2011-06-27 01:47:50 UTC (rev 89777)
@@ -41,13 +41,13 @@
     return m_files[index].get();
 }
 
-Vector<String> FileList::filenames() const
+Vector<String> FileList::paths() const
 {
-    Vector<String> filenames;
+    Vector<String> paths;
     for (unsigned i = 0; i < m_files.size(); ++i)
-        filenames.append(m_files[i]->path());
+        paths.append(m_files[i]->path());
 
-    return filenames;
+    return paths;
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/fileapi/FileList.h (89776 => 89777)


--- trunk/Source/WebCore/fileapi/FileList.h	2011-06-27 00:31:19 UTC (rev 89776)
+++ trunk/Source/WebCore/fileapi/FileList.h	2011-06-27 01:47:50 UTC (rev 89777)
@@ -47,7 +47,7 @@
         bool isEmpty() const { return m_files.isEmpty(); }
         void clear() { m_files.clear(); }
         void append(PassRefPtr<File> file) { m_files.append(file); }
-        Vector<String> filenames() const;
+        Vector<String> paths() const;
 
     private:
         FileList();

Modified: trunk/Source/WebCore/html/FileInputType.cpp (89776 => 89777)


--- trunk/Source/WebCore/html/FileInputType.cpp	2011-06-27 00:31:19 UTC (rev 89776)
+++ trunk/Source/WebCore/html/FileInputType.cpp	2011-06-27 01:47:50 UTC (rev 89777)
@@ -147,8 +147,7 @@
         settings.allowsMultipleFiles = input->fastHasAttribute(multipleAttr);
 #endif
         settings.acceptTypes = input->accept();
-        ASSERT(input->files());
-        settings.selectedFiles = input->files()->filenames();
+        settings.selectedFiles = m_fileList->paths();
         chrome->runOpenPanel(input->document()->frame(), newFileChooser(settings));
     }
     event->setDefaultHandled();
@@ -252,25 +251,25 @@
     element()->ensureShadowRoot()->appendChild(UploadButtonElement::create(element()->document()), ec);
 }
 
-void FileInputType::requestIcon(const Vector<String>& filenames)
+void FileInputType::requestIcon(const Vector<String>& paths)
 {
-    if (!filenames.size())
+    if (!paths.size())
         return;
 
     if (Chrome* chrome = this->chrome())
-        chrome->loadIconForFiles(filenames, newFileIconLoader());
+        chrome->loadIconForFiles(paths, newFileIconLoader());
 }
 
-void FileInputType::filesChosen(const Vector<String>& filenames)
+void FileInputType::filesChosen(const Vector<String>& paths)
 {
     HTMLInputElement* input = element();
-    setFileList(filenames);
+    setFileList(paths);
 
     input->setFormControlValueMatchesRenderer(true);
     input->notifyFormStateChanged();
     input->setNeedsValidityCheck();
 
-    requestIcon(filenames);
+    requestIcon(paths);
 
     if (input->renderer())
         input->renderer()->repaint();

Modified: trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp (89776 => 89777)


--- trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp	2011-06-27 00:31:19 UTC (rev 89776)
+++ trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp	2011-06-27 01:47:50 UTC (rev 89777)
@@ -210,7 +210,7 @@
 {
     HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
     ASSERT(input->files());
-    return theme()->fileListNameForWidth(input->files()->filenames(), style()->font(), maxFilenameWidth());
+    return theme()->fileListNameForWidth(input->files()->paths(), style()->font(), maxFilenameWidth());
 }
     
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to