[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
joepeck at webkit.org
joepeck at webkit.org
Thu Apr 8 00:08:43 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 02237f7508bc456dd797e280182c49e9a6a587ce
Author: joepeck at webkit.org <joepeck at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Dec 1 20:08:18 2009 +0000
2009-12-01 Joseph Pecoraro <joepeck at webkit.org>
Reviewed by Timothy Hatcher.
Web Inspector: Escape key in the Search Field should be more User Friendly
https://bugs.webkit.org/show_bug.cgi?id=32005
* inspector/front-end/inspector.js:
(WebInspector.loaded): add mousedown listener on the search field
(WebInspector.searchFieldManualFocus): user clicked to focus on the search field
(WebInspector.searchKeyDown): handle escape
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index be6ac77..d252747 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2009-12-01 Joseph Pecoraro <joepeck at webkit.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: Escape key in the Search Field should be more User Friendly
+ https://bugs.webkit.org/show_bug.cgi?id=32005
+
+ * inspector/front-end/inspector.js:
+ (WebInspector.loaded): add mousedown listener on the search field
+ (WebInspector.searchFieldManualFocus): user clicked to focus on the search field
+ (WebInspector.searchKeyDown): handle escape
+
2009-12-01 Dave Hyatt <hyatt at apple.com>
Reviewed by David Kilzer.
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index ce234f8..7d5adaf 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -503,6 +503,7 @@ WebInspector.loaded = function()
var searchField = document.getElementById("search");
searchField.addEventListener("search", this.performSearch.bind(this), false); // when the search is emptied
+ searchField.addEventListener("mousedown", this.searchFieldManualFocus.bind(this), false); // when the search field is manually selected
toolbarElement.addEventListener("mousedown", this.toolbarDragStart, true);
document.getElementById("close-button-left").addEventListener("click", this.close, true);
@@ -1529,8 +1530,28 @@ WebInspector.addMainEventListeners = function(doc)
doc.addEventListener("click", this.documentClick.bind(this), true);
}
+WebInspector.searchFieldManualFocus = function(event)
+{
+ this.currentFocusElement = event.target;
+ this._previousFocusElement = event.target;
+}
+
WebInspector.searchKeyDown = function(event)
{
+ // Escape Key will clear the field and clear the search results
+ if (event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Esc) {
+ event.preventDefault();
+ event.handled = true;
+ event.target.value = "";
+
+ this.performSearch(event);
+ this.currentFocusElement = this.previousFocusElement;
+ if (this.currentFocusElement === event.target)
+ this.currentFocusElement.select();
+
+ return false;
+ }
+
if (!isEnterKey(event))
return false;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list