[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
tkent at chromium.org
tkent at chromium.org
Tue Jan 5 23:47:28 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit dc85a8dda4fd9a15ab43890df50dd994ac2f47ae
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 11 18:13:55 2009 +0000
2009-12-11 Kent Tamura <tkent at chromium.org>
Reviewed by Darin Fisher.
Add acceptTypes() method to FileChooser.
https://bugs.webkit.org/show_bug.cgi?id=32429
This method returns an 'accept' attribute value of the
corresponding INPUT element. A ChromeClient::runOpenPanel()
implementation can refer it through a FileChooser instance to
support type-restricted file selecting.
This makes no user-visible changes for now.
* platform/FileChooser.h:
(WebCore::FileChooser::acceptTypes):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::acceptTypes):
* rendering/RenderFileUploadControl.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4d3f33d..06538fb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2009-12-11 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add acceptTypes() method to FileChooser.
+ https://bugs.webkit.org/show_bug.cgi?id=32429
+
+ This method returns an 'accept' attribute value of the
+ corresponding INPUT element. A ChromeClient::runOpenPanel()
+ implementation can refer it through a FileChooser instance to
+ support type-restricted file selecting.
+
+ This makes no user-visible changes for now.
+
+ * platform/FileChooser.h:
+ (WebCore::FileChooser::acceptTypes):
+ * rendering/RenderFileUploadControl.cpp:
+ (WebCore::RenderFileUploadControl::acceptTypes):
+ * rendering/RenderFileUploadControl.h:
+
2009-12-11 Victor Wang <victorw at chromium.org>
Reviewed by Darin Fisher.
diff --git a/WebCore/platform/FileChooser.h b/WebCore/platform/FileChooser.h
index 1d4e970..0764a6a 100644
--- a/WebCore/platform/FileChooser.h
+++ b/WebCore/platform/FileChooser.h
@@ -42,6 +42,7 @@ class FileChooserClient {
public:
virtual void valueChanged() = 0;
virtual bool allowsMultipleFiles() = 0;
+ virtual String acceptTypes() = 0;
virtual ~FileChooserClient();
};
@@ -64,6 +65,8 @@ public:
void chooseFiles(const Vector<String>& paths);
bool allowsMultipleFiles() const { return m_client ? m_client->allowsMultipleFiles() : false; }
+ // Acceptable MIME types. It's an 'accept' attribute value of the corresponding INPUT element.
+ String acceptTypes() const { return m_client ? m_client->acceptTypes() : String(); }
private:
FileChooser(FileChooserClient*, const Vector<String>& initialFilenames);
diff --git a/WebCore/rendering/RenderFileUploadControl.cpp b/WebCore/rendering/RenderFileUploadControl.cpp
index 37ee8fb..b4d35f4 100644
--- a/WebCore/rendering/RenderFileUploadControl.cpp
+++ b/WebCore/rendering/RenderFileUploadControl.cpp
@@ -108,6 +108,11 @@ bool RenderFileUploadControl::allowsMultipleFiles()
return !input->getAttribute(multipleAttr).isNull();
}
+String RenderFileUploadControl::acceptTypes()
+{
+ return static_cast<HTMLInputElement*>(node())->accept();
+}
+
void RenderFileUploadControl::click()
{
Frame* frame = node()->document()->frame();
diff --git a/WebCore/rendering/RenderFileUploadControl.h b/WebCore/rendering/RenderFileUploadControl.h
index 72ba308..dcdce4d 100644
--- a/WebCore/rendering/RenderFileUploadControl.h
+++ b/WebCore/rendering/RenderFileUploadControl.h
@@ -49,6 +49,7 @@ public:
String fileTextValue() const;
bool allowsMultipleFiles();
+ String acceptTypes();
private:
virtual const char* renderName() const { return "RenderFileUploadControl"; }
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list