Modified: trunk/Source/WebCore/ChangeLog (111382 => 111383)
--- trunk/Source/WebCore/ChangeLog 2012-03-20 11:57:34 UTC (rev 111382)
+++ trunk/Source/WebCore/ChangeLog 2012-03-20 12:01:26 UTC (rev 111383)
@@ -1,3 +1,20 @@
+2012-03-20 Yury Semikhatsky <[email protected]>
+
+ Web Inspector: provide class name filter for "comparison" view in heap profiler
+ https://bugs.webkit.org/show_bug.cgi?id=81641
+
+ Class name filtering now works for both Summary and Comparison views.
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/front-end/DetailedHeapshotView.js:
+ (WebInspector.DetailedHeapshotView.prototype._createToolbarWithClassNameFilter):
+ (WebInspector.DetailedHeapshotView.prototype._changeNameFilter):
+ * inspector/front-end/heapProfiler.css:
+ (.detailed-heapshot-view .class-view-grid):
+ (.detailed-heapshot-view .class-view-toolbar):
+ (.detailed-heapshot-view .class-view-toolbar input.class-name-filter):
+
2012-03-20 Nikolas Zimmermann <[email protected]>
Make animVal support type-safe
Modified: trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js (111382 => 111383)
--- trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js 2012-03-20 11:57:34 UTC (rev 111382)
+++ trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js 2012-03-20 12:01:26 UTC (rev 111383)
@@ -299,15 +299,6 @@
loader(profileIndex, firstSnapshotLoaded.bind(this));
},
- _nameFilterChanged: function(filterString)
- {
- var filter = filterString.toLowerCase();
- for (var i = 0, l = this.children.length; i < l; ++i) {
- var node = this.children[i];
- if (node.depth === 0)
- node.revealed = node._name.toLowerCase().indexOf(filter) !== -1;
- }
- }
};
WebInspector.HeapSnapshotConstructorsDataGrid.prototype.__proto__ = WebInspector.HeapSnapshotSortableDataGrid.prototype;
@@ -455,25 +446,20 @@
this.constructorsView = new WebInspector.View();
this.constructorsView.element.addStyleClass("view");
+ this.constructorsView.element.appendChild(this._createToolbarWithClassNameFilter());
- this.constructorsViewToolbar = document.createElement("div");
- this.constructorsViewToolbar.addStyleClass("constructors-view-toolbar");
- this.constructorsViewFilter = document.createElement("input");
- this.constructorsViewFilter.addStyleClass("constructors-view-filter");
- this.constructorsViewFilter.setAttribute("placeholder", WebInspector.UIString("Class filter"));
- this.constructorsViewFilter.addEventListener("keyup", this._changeNameFilter.bind(this), false);
- this.constructorsViewToolbar.appendChild(this.constructorsViewFilter);
- this.constructorsView.element.appendChild(this.constructorsViewToolbar);
-
this.constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGrid();
- this.constructorsDataGrid.element.addStyleClass("constructors-view-grid");
+ this.constructorsDataGrid.element.addStyleClass("class-view-grid");
this.constructorsDataGrid.element.addEventListener("mousedown", this._mouseDownInContentsGrid.bind(this), true);
this.constructorsDataGrid.show(this.constructorsView.element);
this.constructorsDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
this.diffView = new WebInspector.View();
this.diffView.element.addStyleClass("view");
+ this.diffView.element.appendChild(this._createToolbarWithClassNameFilter());
+
this.diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid();
+ this.diffDataGrid.element.addStyleClass("class-view-grid");
this.diffDataGrid.show(this.diffView.element);
this.diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
@@ -802,11 +788,29 @@
this.performSearch(this.currentQuery, this._searchFinishedCallback);
},
- _changeNameFilter: function()
+ _createToolbarWithClassNameFilter: function()
{
- this.dataGrid._nameFilterChanged(this.constructorsViewFilter.value);
+ var toolbar = document.createElement("div");
+ toolbar.addStyleClass("class-view-toolbar");
+ var classNameFilter = document.createElement("input");
+ classNameFilter.addStyleClass("class-name-filter");
+ classNameFilter.setAttribute("placeholder", WebInspector.UIString("Class filter"));
+ classNameFilter.addEventListener("keyup", this._changeNameFilter.bind(this, classNameFilter), false);
+ toolbar.appendChild(classNameFilter);
+ return toolbar;
},
+ _changeNameFilter: function(classNameInputElement)
+ {
+ var filter = classNameInputElement.value.toLowerCase();
+ var children = this.dataGrid.children;
+ for (var i = 0, l = children.length; i < l; ++i) {
+ var node = children[i];
+ if (node.depth === 0)
+ node.revealed = node._name.toLowerCase().indexOf(filter) !== -1;
+ }
+ },
+
_profiles: function()
{
return WebInspector.panels.profiles.getProfiles(WebInspector.DetailedHeapshotProfileType.TypeId);
Modified: trunk/Source/WebCore/inspector/front-end/heapProfiler.css (111382 => 111383)
--- trunk/Source/WebCore/inspector/front-end/heapProfiler.css 2012-03-20 11:57:34 UTC (rev 111382)
+++ trunk/Source/WebCore/inspector/front-end/heapProfiler.css 2012-03-20 12:01:26 UTC (rev 111383)
@@ -187,11 +187,11 @@
right: 0;
}
-.detailed-heapshot-view .constructors-view-grid {
+.detailed-heapshot-view .class-view-grid {
top: 22px;
}
-.detailed-heapshot-view .constructors-view-toolbar {
+.detailed-heapshot-view .class-view-toolbar {
height: 22px;
background-color: #DDD;
display: block;
@@ -201,7 +201,7 @@
top: 0;
}
-.detailed-heapshot-view .constructors-view-toolbar input.constructors-view-filter {
+.detailed-heapshot-view .class-view-toolbar input.class-name-filter {
width: 200px;
height: 18px;
font-size: 11px;