Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: Source/devtools/front_end/DOMStorageItemsView.js

Issue 23480006: DevTools: DOMStorage action history must be reset once page/script modifies the DOM storage (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/DOMStorageItemsView.js
diff --git a/Source/devtools/front_end/DOMStorageItemsView.js b/Source/devtools/front_end/DOMStorageItemsView.js
index 908ba8bcb2004ff8d7a3841612b7e213dca985d9..f4a9d621979f3b0e813fe31f765c85d5dbd32ba4 100644
--- a/Source/devtools/front_end/DOMStorageItemsView.js
+++ b/Source/devtools/front_end/DOMStorageItemsView.js
@@ -119,9 +119,13 @@ WebInspector.DOMStorageItemsView.prototype = {
if (childNode.data.key === storageData.key) {
rootNode.removeChild(childNode);
this.deleteButton.visible = (children.length > 1);
- return;
+ break;
}
}
+ if (this._setItem) {
+ this._setItem();
+ delete this._setItem;
+ }
},
/**
@@ -246,9 +250,11 @@ WebInspector.DOMStorageItemsView.prototype = {
{
var domStorage = this.domStorage;
if ("key" === columnIdentifier) {
- if (typeof oldText === "string")
+ if (typeof oldText === "string") {
domStorage.removeItem(oldText);
- domStorage.setItem(newText, editingNode.data.value || '');
+ this._setItem = domStorage.setItem.bind(domStorage, newText, editingNode.data.value || '');
+ } else
+ domStorage.setItem(newText, editingNode.data.value || '');
this._removeDupes(editingNode);
} else
domStorage.setItem(editingNode.data.key || '', newText);
« Source/devtools/front_end/DOMStorage.js ('K') | « Source/devtools/front_end/DOMStorage.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698