REGRESSION(r99369): File input button doesn't highlight when pressed
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2012 20:15:53 +0000 (20:15 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2012 20:15:53 +0000 (20:15 +0000)
commit2d61b11f374415f51a3fe9998e25af5227332bdc
tree17dd25461d6f2e2d8e74876ebf260ca39e3948a5
parent0bd80317f3a497071835383fda1aa60b9da56a14
REGRESSION(r99369): File input button doesn't highlight when pressed
https://bugs.webkit.org/show_bug.cgi?id=79385

Reviewed by Kent Tamura.

Source/WebCore:

Fixes an issue where the file input button doesn't highlight on mouse press.

Currently we always override the active state of the button with whether
a dragged file is being hovered over the file input control (i.e. can the control
receive a dropped file; HTMLInputElement::canReceiveDroppedFiles()).
Instead, we should only override the active state of the button when the state
changes for whether we can receive dropped files (e.g. during a drag) so that
we honor the active state of the button when it is pressed.

Test: fast/forms/file/file-input-pressed-state.html

* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::RenderFileUploadControl):
(WebCore::RenderFileUploadControl::updateFromElement):
* rendering/RenderFileUploadControl.h:
(RenderFileUploadControl):

LayoutTests:

Add test to ensure that the file input button visually changes when pressed.

* fast/forms/file/file-input-pressed-state-expected.txt: Added.
* fast/forms/file/file-input-pressed-state.html: Added.
* platform/mac/fast/forms/file/file-input-pressed-state-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@110598 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/file/file-input-pressed-state-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/file/file-input-pressed-state.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/file/file-input-pressed-state-expected.png [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFileUploadControl.cpp
Source/WebCore/rendering/RenderFileUploadControl.h