Title: [106538] trunk
Revision
106538
Author
[email protected]
Date
2012-02-02 00:09:07 -0800 (Thu, 02 Feb 2012)

Log Message

hidden attribute on <input type=file /> suppresses the file selection dialog
https://bugs.webkit.org/show_bug.cgi?id=58208

Patch by Rakesh KN <[email protected]> on 2012-02-02
Reviewed by Ryosuke Niwa.

.:

* ManualTests/input-file-hidden-open-dialog-on-click.html: Added.
Adding manual test as the file dialog opens only in User gesture.

Source/WebCore:

We want to allow opening file dialog on hidden element when click() is called
on the element. The behaviour is similar to Firefox and IE.

Added manual test as the file dialog opens only on user gesture.

* html/FileInputType.cpp:
(WebCore::FileInputType::handleDOMActivateEvent):
Removed renderer check as input can be hidden.

Modified Paths

Added Paths

Diff

Modified: trunk/ChangeLog (106537 => 106538)


--- trunk/ChangeLog	2012-02-02 08:04:02 UTC (rev 106537)
+++ trunk/ChangeLog	2012-02-02 08:09:07 UTC (rev 106538)
@@ -1,3 +1,13 @@
+2012-02-02  Rakesh KN  <[email protected]>
+
+        hidden attribute on <input type=file /> suppresses the file selection dialog
+        https://bugs.webkit.org/show_bug.cgi?id=58208
+
+        Reviewed by Ryosuke Niwa.
+
+        * ManualTests/input-file-hidden-open-dialog-on-click.html: Added.
+        Adding manual test as the file dialog opens only in User gesture.
+
 2012-02-01  Philippe Normand  <[email protected]>
 
         [GStreamer] FFTFrame implementation

Added: trunk/ManualTests/input-file-hidden-open-dialog-on-click.html (0 => 106538)


--- trunk/ManualTests/input-file-hidden-open-dialog-on-click.html	                        (rev 0)
+++ trunk/ManualTests/input-file-hidden-open-dialog-on-click.html	2012-02-02 08:09:07 UTC (rev 106538)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset='utf-8' />
+    <title>Test that file dialog opens when click() is called </title>
+</head>
+<body>
+Test manually that when you click on "Click me" button, an file open dialog appears.
+<input id=fileinput type="file" hidden />
+<button _onclick_="document.getElementById('fileinput').click();">Click me</button>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (106537 => 106538)


--- trunk/Source/WebCore/ChangeLog	2012-02-02 08:04:02 UTC (rev 106537)
+++ trunk/Source/WebCore/ChangeLog	2012-02-02 08:09:07 UTC (rev 106538)
@@ -1,3 +1,19 @@
+2012-02-02  Rakesh KN  <[email protected]>
+
+        hidden attribute on <input type=file /> suppresses the file selection dialog
+        https://bugs.webkit.org/show_bug.cgi?id=58208
+
+        Reviewed by Ryosuke Niwa.
+
+        We want to allow opening file dialog on hidden element when click() is called
+        on the element. The behaviour is similar to Firefox and IE.
+
+        Added manual test as the file dialog opens only on user gesture.
+
+        * html/FileInputType.cpp:
+        (WebCore::FileInputType::handleDOMActivateEvent):
+        Removed renderer check as input can be hidden.
+
 2012-02-01  Philippe Normand  <[email protected]>
 
         [GStreamer] FFTFrame implementation

Modified: trunk/Source/WebCore/html/FileInputType.cpp (106537 => 106538)


--- trunk/Source/WebCore/html/FileInputType.cpp	2012-02-02 08:04:02 UTC (rev 106537)
+++ trunk/Source/WebCore/html/FileInputType.cpp	2012-02-02 08:09:07 UTC (rev 106538)
@@ -139,7 +139,7 @@
 
 void FileInputType::handleDOMActivateEvent(Event* event)
 {
-    if (element()->disabled() || !element()->renderer())
+    if (element()->disabled())
         return;
 
     if (!ScriptController::processingUserGesture())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to