Title: [245535] trunk/Source/WebInspectorUI
- Revision
- 245535
- Author
- [email protected]
- Date
- 2019-05-20 13:45:22 -0700 (Mon, 20 May 2019)
Log Message
Web Inspector: Storage tab crashes easily when adding new local/session storage entries.
https://bugs.webkit.org/show_bug.cgi?id=198004
Reviewed by Ross Kirsling.
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype._startEditingNodeAtColumnIndex):
Force a layout in the case that a new `PlaceholderDataGridNode` was added to the end of the
`DataGrid` as part of the `editCallback`. Web Inspector won't crash without this, but it
won't properly select/focus the next row when tabbing from the last column to the next row.
(WI.DataGrid.prototype._editingCommitted):
Save the new value of the column before removing the editing styles, as that refreshes the
`DataGridNode`. If the new value isn't saved, the old value is used during the refresh.
(WI.DataGrid.prototype._keyDown):
Drive-by: use `get element` instead of using the member variable directly, as the underlying
value might not have been initialized yet.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (245534 => 245535)
--- trunk/Source/WebInspectorUI/ChangeLog 2019-05-20 20:32:35 UTC (rev 245534)
+++ trunk/Source/WebInspectorUI/ChangeLog 2019-05-20 20:45:22 UTC (rev 245535)
@@ -1,3 +1,24 @@
+2019-05-20 Devin Rousso <[email protected]>
+
+ Web Inspector: Storage tab crashes easily when adding new local/session storage entries.
+ https://bugs.webkit.org/show_bug.cgi?id=198004
+
+ Reviewed by Ross Kirsling.
+
+ * UserInterface/Views/DataGrid.js:
+ (WI.DataGrid.prototype._startEditingNodeAtColumnIndex):
+ Force a layout in the case that a new `PlaceholderDataGridNode` was added to the end of the
+ `DataGrid` as part of the `editCallback`. Web Inspector won't crash without this, but it
+ won't properly select/focus the next row when tabbing from the last column to the next row.
+
+ (WI.DataGrid.prototype._editingCommitted):
+ Save the new value of the column before removing the editing styles, as that refreshes the
+ `DataGridNode`. If the new value isn't saved, the old value is used during the refresh.
+
+ (WI.DataGrid.prototype._keyDown):
+ Drive-by: use `get element` instead of using the member variable directly, as the underlying
+ value might not have been initialized yet.
+
2019-05-19 Nikita Vasilyev <[email protected]>
Web Inspector: Decrease spacing before and after tooltip paragraphs
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js (245534 => 245535)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js 2019-05-20 20:32:35 UTC (rev 245534)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js 2019-05-20 20:45:22 UTC (rev 245535)
@@ -516,11 +516,13 @@
{
console.assert(node, "Invalid argument: must provide DataGridNode to edit.");
+ this.updateLayoutIfNeeded();
+
this._editing = true;
this._editingNode = node;
this._editingNode.select();
- var element = this._editingNode._element.children[columnIndex];
+ var element = this._editingNode.element.children[columnIndex];
WI.startEditing(element, this._startEditingConfig(element));
window.getSelection().setBaseAndExtent(element, 0, element, 1);
}
@@ -559,7 +561,9 @@
var columnIndex = this.orderedColumns.indexOf(columnIdentifier);
var textBeforeEditing = this._editingNode.data[columnIdentifier] || "";
+
var currentEditingNode = this._editingNode;
+ currentEditingNode.data[columnIdentifier] = newText.trim();
// Returns an object with the next node and column index to edit, and whether it
// is an appropriate time to re-sort the table rows. When editing, we want to
@@ -598,8 +602,6 @@
this._editingCancelled(element);
- // Update table's data model, and delegate to the callback to update other models.
- currentEditingNode.data[columnIdentifier] = newText.trim();
this._editCallback(currentEditingNode, columnIdentifier, textBeforeEditing, newText, moveDirection);
var textDidChange = textBeforeEditing.trim() !== newText.trim();
@@ -1399,7 +1401,7 @@
} else if (isEnterKey(event)) {
if (this._editCallback) {
handled = true;
- this._startEditing(this.selectedNode._element.children[0]);
+ this._startEditing(this.selectedNode.element.children[0]);
}
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes