[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
pfeldman at chromium.org
pfeldman at chromium.org
Wed Dec 22 16:28:12 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 6ec0d8d5f27f6eedec5d109817a2818542987199
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 24 10:28:27 2010 +0000
2010-11-24 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: add "Locally modified" group into the resource panel.
https://bugs.webkit.org/show_bug.cgi?id=50005
* English.lproj/localizedStrings.js:
* inspector/front-end/ResourcesPanel.js:
(WebInspector.ResourcesPanel):
(WebInspector.ResourcesPanel.prototype.reset):
(WebInspector.ResourcesPanel.prototype.addLocallyModifiedRevision):
(WebInspector.ResourcesPanel.prototype._innerShowView):
(WebInspector.BaseStorageTreeElement.prototype.set titleText):
(WebInspector.LocallyModifiedResourceTreeElement):
(WebInspector.LocallyModifiedResourceTreeElement.prototype.onselect):
(WebInspector.LocallyModifiedResourceTreeElement.prototype.gcRevisions):
(WebInspector.LocallyModifiedRevisionTreeElement):
(WebInspector.LocallyModifiedRevisionTreeElement.prototype.onattach):
(WebInspector.LocallyModifiedRevisionTreeElement.prototype.onselect):
(WebInspector.LocallyModifiedRevisionTreeElement.prototype._ondragstart):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72654 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7162c12..5333eef 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,28 @@
Reviewed by Yury Semikhatsky.
+ Web Inspector: add "Locally modified" group into the resource panel.
+ https://bugs.webkit.org/show_bug.cgi?id=50005
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel):
+ (WebInspector.ResourcesPanel.prototype.reset):
+ (WebInspector.ResourcesPanel.prototype.addLocallyModifiedRevision):
+ (WebInspector.ResourcesPanel.prototype._innerShowView):
+ (WebInspector.BaseStorageTreeElement.prototype.set titleText):
+ (WebInspector.LocallyModifiedResourceTreeElement):
+ (WebInspector.LocallyModifiedResourceTreeElement.prototype.onselect):
+ (WebInspector.LocallyModifiedResourceTreeElement.prototype.gcRevisions):
+ (WebInspector.LocallyModifiedRevisionTreeElement):
+ (WebInspector.LocallyModifiedRevisionTreeElement.prototype.onattach):
+ (WebInspector.LocallyModifiedRevisionTreeElement.prototype.onselect):
+ (WebInspector.LocallyModifiedRevisionTreeElement.prototype._ondragstart):
+
+2010-11-24 Pavel Feldman <pfeldman at chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
Web Inspector: pass style id to front-end as Object, not string.
https://bugs.webkit.org/show_bug.cgi?id=49971
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index 4eb11b9..a6255ec 100644
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index 5285dae..200267d 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -56,12 +56,16 @@ WebInspector.ResourcesPanel = function(database)
this.applicationCacheListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Application Cache"), "ApplicationCache", "application-cache-storage-tree-item");
this.sidebarTree.appendChild(this.applicationCacheListTreeElement);
+ this.locallyModifiedListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Locally Modified"), "LocallyModified", "frame-storage-tree-item");
+ this.sidebarTree.appendChild(this.locallyModifiedListTreeElement);
+ this.locallyModifiedListTreeElement.hidden = true;
+
if (Preferences.fileSystemEnabled) {
this.fileSystemListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("File System"), "FileSystem", "file-system-storage-tree-item");
this.sidebarTree.appendChild(this.fileSystemListTreeElement);
this.fileSystemListTreeElement.expand();
}
-
+
this.storageViews = document.createElement("div");
this.storageViews.id = "storage-views";
this.element.appendChild(this.storageViews);
@@ -74,6 +78,7 @@ WebInspector.ResourcesPanel = function(database)
this._cookieViews = {};
this._origins = {};
this._domains = {};
+ this._locallyModifiedResources = {};
this.sidebarElement.addEventListener("mousemove", this._onmousemove.bind(this), false);
this.sidebarElement.addEventListener("mouseout", this._onmouseout.bind(this), false);
@@ -147,7 +152,7 @@ WebInspector.ResourcesPanel.prototype = {
this._domStorage = [];
this._cookieViews = {};
-
+ this._locallyModifiedResources = {};
this._fileSystemView = null;
this._applicationCacheView = null;
@@ -158,6 +163,7 @@ WebInspector.ResourcesPanel.prototype = {
this.sessionStorageListTreeElement.removeChildren();
this.cookieListTreeElement.removeChildren();
this.applicationCacheListTreeElement.removeChildren();
+ this.locallyModifiedListTreeElement.removeChildren();
if (Preferences.fileSystemEnabled)
this.fileSystemListTreeElement.removeChildren();
this.storageViews.removeChildren();
@@ -308,6 +314,20 @@ WebInspector.ResourcesPanel.prototype = {
this.sessionStorageListTreeElement.appendChild(domStorageTreeElement);
},
+ addLocallyModifiedRevision: function(url, resourceType, content)
+ {
+ this.locallyModifiedListTreeElement.hidden = false;
+
+ var newRevision = new WebInspector.LocallyModifiedRevisionTreeElement(this, url, resourceType, content);
+ var lastRevision = this._locallyModifiedResources[url];
+ this._locallyModifiedResources[url] = newRevision;
+
+ if (lastRevision)
+ lastRevision.becomeLogEntry(newRevision);
+ else
+ this.locallyModifiedListTreeElement.appendChild(newRevision);
+ },
+
selectDatabase: function(databaseId)
{
var database;
@@ -457,7 +477,7 @@ WebInspector.ResourcesPanel.prototype = {
_innerShowView: function(view)
{
if (this.visibleView)
- this.visibleView.hide();
+ this.visibleView.detach();
view.show(this.storageViews);
this.visibleView = view;
@@ -813,7 +833,8 @@ WebInspector.BaseStorageTreeElement.prototype = {
set titleText(titleText)
{
this._titleText = titleText;
- this.titleElement.textContent = this._titleText;
+ if (this.titleElement)
+ this.titleElement.textContent = this._titleText;
},
isEventWithinDisclosureTriangle: function()
@@ -1181,6 +1202,66 @@ WebInspector.ApplicationCacheTreeElement.prototype = {
}
WebInspector.ApplicationCacheTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
+WebInspector.LocallyModifiedRevisionTreeElement = function(storagePanel, url, resourceType, content)
+{
+ var resource = new WebInspector.Resource(null, url);
+ resource.type = resourceType;
+ resource.content = content;
+
+ var timestamp = new Date();
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, resource.displayName, "resource-sidebar-tree-item resources-category-" + resource.category.name);
+ this.tooltip = resource.url;
+ this.timestamp = timestamp;
+ this._resource = resource;
+}
+
+WebInspector.LocallyModifiedRevisionTreeElement.prototype = {
+ becomeLogEntry: function(newRevision)
+ {
+ var oldChildren = this.children.slice();
+ var oldExpanded = this.expanded;
+ var oldIndex = this.parent.children.indexOf(this);
+
+ this.removeChildren();
+ this.titleText = this.timestamp.toLocaleTimeString();
+ this.toLocaleString();
+ this.hasChildren = false;
+
+ this.parent.insertChild(newRevision, oldIndex);
+ this.parent.removeChild(this);
+
+ const oneMinute = 1000 * 60;
+ if (newRevision.timestamp - this.timestamp > oneMinute)
+ newRevision.appendChild(this);
+
+ for (var i = 0; i < oldChildren.length; ++i)
+ newRevision.appendChild(oldChildren[i]);
+ if (oldExpanded)
+ newRevision.expand();
+ },
+
+ onattach: function()
+ {
+ WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);
+ this.listItemElement.draggable = true;
+ this.listItemElement.addEventListener("dragstart", this._ondragstart.bind(this), false);
+ },
+
+ onselect: function()
+ {
+ WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+ this._storagePanel._showResourceView(this._resource);
+ },
+
+ _ondragstart: function(event)
+ {
+ event.dataTransfer.setData("text/plain", this._resource.content);
+ event.dataTransfer.effectAllowed = "copy";
+ return true;
+ }
+}
+WebInspector.LocallyModifiedRevisionTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
+
WebInspector.FileSystemTreeElement = function(storagePanel, origin)
{
WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, origin, "file-system-storage-tree-item");
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list