summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/file/file-input-pressed-state.html
diff options
context:
space:
mode:
authordbates@webkit.org <dbates@webkit.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2012-03-13 20:15:53 +0000
committerdbates@webkit.org <dbates@webkit.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2012-03-13 20:15:53 +0000
commit4f7f54e53c34b943c093cc2355fb020a3c61113a (patch)
treebef91cb2ea09ff17c8445f347f5b3df1e07f8b7c /third_party/WebKit/LayoutTests/fast/forms/file/file-input-pressed-state.html
parent05799bf3ce47a6ce70c3743de06c4397b3b2654f (diff)
downloadchromium_src-4f7f54e53c34b943c093cc2355fb020a3c61113a.zip
chromium_src-4f7f54e53c34b943c093cc2355fb020a3c61113a.tar.gz
chromium_src-4f7f54e53c34b943c093cc2355fb020a3c61113a.tar.bz2
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: svn://svn.chromium.org/blink/trunk@110598 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/forms/file/file-input-pressed-state.html')
-rw-r--r--third_party/WebKit/LayoutTests/fast/forms/file/file-input-pressed-state.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/forms/file/file-input-pressed-state.html b/third_party/WebKit/LayoutTests/fast/forms/file/file-input-pressed-state.html
new file mode 100644
index 0000000..25f69e7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/forms/file/file-input-pressed-state.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText(true); // Dump pixel test result.
+</script>
+</head>
+<body>
+<!-- The output of this test is only meaningful as a pixel test result because form controls have a platform-specific look-and-feel. -->
+<!-- You can run this test either in DRT as a pixel test or by hand. -->
+<div id="description">
+<p>This tests that pressing on the file input button visually changes its appearance. For instance, when pressed, the button will have an Aqua background color when using the Blue appearance (System Preferences > General) on OS X.</p>
+<p>To run this test manually, click and hold on the input file button (below). This test PASSED if the button visually highlights when pressed. Otherwise, it FAILED.</p>
+</div>
+<input type="file" id="file">
+<script>
+if (window.eventSender) {
+ // Remove the descriptive text so as minimize pixel differences due to discrepancies in font rendering.
+ document.body.removeChild(document.getElementById("description"));
+
+ var file = document.getElementById("file");
+ var x = file.offsetLeft + 10;
+ var y = file.offsetTop + 10;
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+}
+</script>
+</body>
+</html>