[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
bweinstein at apple.com
bweinstein at apple.com
Wed Apr 7 23:46:58 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 50fd8696147cd8815518efb63862716e294e0c57
Author: bweinstein at apple.com <bweinstein at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 18 18:12:07 2009 +0000
Fixes <http://webkit.org/b/31606>.
Web Inspector: Enter/Return key should enter edit mode for Editable Fields.
Reviewed by Pavel Feldman.
This implements Enter starting editing mode in an editable DataGrid. If the
DataGrid is editable and the user hits return, startEditing the first child
of the selected node. Also refactored some editing functions to take an
event target instead of the event itself, because the functions only needed
the target. Lastly, added had return in editing mode stop propogation, because
when enter was hit to confirm text, it would propagate back to the datagrid
and try to start editing again.
* inspector/front-end/DataGrid.js:
(WebInspector.DataGrid.prototype._ondblclick):
(WebInspector.DataGrid.prototype._startEditing):
(WebInspector.DataGrid.prototype.handleKeyEvent):
(WebInspector.DataGrid.prototype.dataGridNodeFromEvent):
(WebInspector.DataGrid.prototype._mouseDownInDataTable):
(WebInspector.DataGrid.prototype._clickInDataTable):
* inspector/front-end/inspector.js:
(WebInspector.startEditing.element.handleKeyEvent):
(WebInspector.startEditing):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e200919..5c99e87 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2009-11-17 Brian Weinstein <bweinstein at apple.com>
+
+ Reviewed by Pavel Feldman.
+
+ Fixes <http://webkit.org/b/31606>.
+ Web Inspector: Enter/Return key should enter edit mode for Editable Fields.
+
+ This implements Enter starting editing mode in an editable DataGrid. If the
+ DataGrid is editable and the user hits return, startEditing the first child
+ of the selected node. Also refactored some editing functions to take an
+ event target instead of the event itself, because the functions only needed
+ the target. Lastly, added had return in editing mode stop propogation, because
+ when enter was hit to confirm text, it would propagate back to the datagrid
+ and try to start editing again.
+
+ * inspector/front-end/DataGrid.js:
+ (WebInspector.DataGrid.prototype._ondblclick):
+ (WebInspector.DataGrid.prototype._startEditing):
+ (WebInspector.DataGrid.prototype.handleKeyEvent):
+ (WebInspector.DataGrid.prototype.dataGridNodeFromEvent):
+ (WebInspector.DataGrid.prototype._mouseDownInDataTable):
+ (WebInspector.DataGrid.prototype._clickInDataTable):
+ * inspector/front-end/inspector.js:
+ (WebInspector.startEditing.element.handleKeyEvent):
+ (WebInspector.startEditing):
+
2009-11-18 Ben Murdoch <benm at google.com>
Reviewed by Darin Adler.
diff --git a/WebCore/inspector/front-end/DataGrid.js b/WebCore/inspector/front-end/DataGrid.js
index 919d001..73ee482 100644
--- a/WebCore/inspector/front-end/DataGrid.js
+++ b/WebCore/inspector/front-end/DataGrid.js
@@ -142,7 +142,7 @@ WebInspector.DataGrid.prototype = {
if (this._editing || this._editingNode)
return;
- this._startEditing(event);
+ this._startEditing(event.target);
},
_startEditingColumnOfDataGridNode: function(node, column)
@@ -156,13 +156,13 @@ WebInspector.DataGrid.prototype = {
window.getSelection().setBaseAndExtent(element, 0, element, 1);
},
- _startEditing: function(event)
+ _startEditing: function(target)
{
- var element = event.target.enclosingNodeOrSelfWithNodeName("td");
+ var element = target.enclosingNodeOrSelfWithNodeName("td");
if (!element)
return;
- this._editingNode = this.dataGridNodeFromEvent(event);
+ this._editingNode = this.dataGridNodeFromNode(target);
if (!this._editingNode) {
if (!this.creationNode)
return;
@@ -520,6 +520,13 @@ WebInspector.DataGrid.prototype = {
handled = true;
this._deleteCallback(this.selectedNode);
}
+ } else if (isEnterKey(event)) {
+ if (this._editCallback) {
+ handled = true;
+ // The first child of the selected element is the <td class="0-column">,
+ // and that's what we want to edit.
+ this._startEditing(this.selectedNode._element.children[0]);
+ }
}
if (nextSelectedNode) {
@@ -550,9 +557,9 @@ WebInspector.DataGrid.prototype = {
// This is the root, do nothing.
},
- dataGridNodeFromEvent: function(event)
+ dataGridNodeFromNode: function(target)
{
- var rowElement = event.target.enclosingNodeOrSelfWithNodeName("tr");
+ var rowElement = target.enclosingNodeOrSelfWithNodeName("tr");
return rowElement._dataGridNode;
},
@@ -597,7 +604,7 @@ WebInspector.DataGrid.prototype = {
_mouseDownInDataTable: function(event)
{
- var gridNode = this.dataGridNodeFromEvent(event);
+ var gridNode = this.dataGridNodeFromNode(event.target);
if (!gridNode || !gridNode.selectable)
return;
@@ -615,7 +622,7 @@ WebInspector.DataGrid.prototype = {
_clickInDataTable: function(event)
{
- var gridNode = this.dataGridNodeFromEvent(event);
+ var gridNode = this.dataGridNodeFromNode(event.target);
if (!gridNode || !gridNode.hasChildren)
return;
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 02da8b5..a4ddcce 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -1680,6 +1680,8 @@ WebInspector.startEditing = function(element, committedCallback, cancelledCallba
if (isEnterKey(event)) {
editingCommitted.call(element);
event.preventDefault();
+ event.stopPropagation();
+ event.handled = true;
} else if (event.keyCode === 27) { // Escape key
editingCancelled.call(element);
event.preventDefault();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list