Title: [86743] trunk/Source/WebCore
Revision
86743
Author
mnaga...@chromium.org
Date
2011-05-18 02:31:32 -0700 (Wed, 18 May 2011)

Log Message

2011-05-17  Mikhail Naganov  <mnaga...@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: [Chromium] Make retaining paths list of the Detailed
        heap snapshots view resizable.
        https://bugs.webkit.org/show_bug.cgi?id=60960

        * inspector/front-end/DetailedHeapshotView.js:
        (WebInspector.DetailedHeapshotView.prototype.resize):
        (WebInspector.DetailedHeapshotView.prototype._startRetainersHeaderDragging):
        (WebInspector.DetailedHeapshotView.prototype._retainersHeaderDragging):
        (WebInspector.DetailedHeapshotView.prototype._endRetainersHeaderDragging):
        (WebInspector.DetailedHeapshotView.prototype._updateRetainmentViewHeight):
        * inspector/front-end/heapProfiler.css:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (86742 => 86743)


--- trunk/Source/WebCore/ChangeLog	2011-05-18 09:10:49 UTC (rev 86742)
+++ trunk/Source/WebCore/ChangeLog	2011-05-18 09:31:32 UTC (rev 86743)
@@ -1,3 +1,19 @@
+2011-05-17  Mikhail Naganov  <mnaga...@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: [Chromium] Make retaining paths list of the Detailed
+        heap snapshots view resizable.
+        https://bugs.webkit.org/show_bug.cgi?id=60960
+
+        * inspector/front-end/DetailedHeapshotView.js:
+        (WebInspector.DetailedHeapshotView.prototype.resize):
+        (WebInspector.DetailedHeapshotView.prototype._startRetainersHeaderDragging):
+        (WebInspector.DetailedHeapshotView.prototype._retainersHeaderDragging):
+        (WebInspector.DetailedHeapshotView.prototype._endRetainersHeaderDragging):
+        (WebInspector.DetailedHeapshotView.prototype._updateRetainmentViewHeight):
+        * inspector/front-end/heapProfiler.css:
+
 2011-05-16  Jeremy Noble  <jer.no...@apple.com>
 
         Reviewed by Darin Adler.

Modified: trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js (86742 => 86743)


--- trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js	2011-05-18 09:10:49 UTC (rev 86742)
+++ trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js	2011-05-18 09:31:32 UTC (rev 86743)
@@ -494,37 +494,41 @@
     this.showShallowSizeAsPercent = false;
     this.showRetainedSizeAsPercent = false;
 
+    this.viewsContainer = document.createElement("div");
+    this.viewsContainer.addStyleClass("views-container");
+    this.element.appendChild(this.viewsContainer);
+
     this.containmentView = new WebInspector.View();
     this.containmentView.element.addStyleClass("view");
     this.containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid();
     this.containmentDataGrid.element.addEventListener("click", this._mouseClickInContainmentGrid.bind(this), true);
     this.containmentView.element.appendChild(this.containmentDataGrid.element);
-    this.element.appendChild(this.containmentView.element);
+    this.viewsContainer.appendChild(this.containmentView.element);
 
     this.constructorsView = new WebInspector.View();
     this.constructorsView.element.addStyleClass("view");
     this.constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGrid();
     this.constructorsDataGrid.element.addEventListener("click", this._mouseClickInContainmentGrid.bind(this), true);
     this.constructorsView.element.appendChild(this.constructorsDataGrid.element);
-    this.element.appendChild(this.constructorsView.element);
+    this.viewsContainer.appendChild(this.constructorsView.element);
 
     this.diffView = new WebInspector.View();
     this.diffView.element.addStyleClass("view");
     this.diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid();
     this.diffDataGrid.element.addEventListener("click", this._mouseClickInContainmentGrid.bind(this), true);
     this.diffView.element.appendChild(this.diffDataGrid.element);
-    this.element.appendChild(this.diffView.element);
+    this.viewsContainer.appendChild(this.diffView.element);
 
     this.dominatorView = new WebInspector.View();
     this.dominatorView.element.addStyleClass("view");
     this.dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid();
     this.dominatorDataGrid.element.addEventListener("click", this._mouseClickInContainmentGrid.bind(this), true);
     this.dominatorView.element.appendChild(this.dominatorDataGrid.element);
-    this.element.appendChild(this.dominatorView.element);
+    this.viewsContainer.appendChild(this.dominatorView.element);
 
-    var retainmentView = new WebInspector.View();
-    retainmentView.element.addStyleClass("view");
-    retainmentView.element.addStyleClass("retaining-paths-view");
+    this.retainmentViewHeader = document.createElement("div");
+    this.retainmentViewHeader.addStyleClass("retainers-view-header");
+    this.retainmentViewHeader.addEventListener("mousedown", this._startRetainersHeaderDragging.bind(this), true);
     var retainingPathsTitleDiv = document.createElement("div");
     retainingPathsTitleDiv.className = "title";
     var retainingPathsTitle = document.createElement("span");
@@ -540,12 +544,17 @@
     this.retainingPathsRoot.appendChild(toWindowObjectsTraceOption);
     retainingPathsTitleDiv.appendChild(retainingPathsTitle);
     retainingPathsTitleDiv.appendChild(this.retainingPathsRoot);
-    retainmentView.element.appendChild(retainingPathsTitleDiv);
+    this.retainmentViewHeader.appendChild(retainingPathsTitleDiv);
+    this.element.appendChild(this.retainmentViewHeader);
+
+    this.retainmentView = new WebInspector.View();
+    this.retainmentView.element.addStyleClass("view");
+    this.retainmentView.element.addStyleClass("retaining-paths-view");
     this.retainmentDataGrid = new WebInspector.HeapSnapshotRetainingPathsList();
     this.retainmentDataGrid.element.addEventListener("click", this._mouseClickInRetainmentGrid.bind(this), true);
-    retainmentView.element.appendChild(this.retainmentDataGrid.element);
-    retainmentView.visible = true;
-    this.element.appendChild(retainmentView.element);
+    this.retainmentView.element.appendChild(this.retainmentDataGrid.element);
+    this.retainmentView.visible = true;
+    this.element.appendChild(this.retainmentView.element);
     this.retainmentDataGrid.reset();
 
     this.dataGrid = this.constructorsDataGrid;
@@ -670,6 +679,9 @@
     {
         if (this.dataGrid)
             this.dataGrid.updateWidths();
+
+        var height = this.retainmentView.element.clientHeight;
+        this._updateRetainmentViewHeight(height);
     },
 
     refreshShowAsPercents: function()
@@ -1082,6 +1094,41 @@
             this.helpPopover.show(this.helpButton.element);
     },
 
+    _startRetainersHeaderDragging: function(event)
+    {
+        if (!this.visible || event.target === this.retainingPathsRoot)
+            return;
+
+        WebInspector.elementDragStart(this.retainmentViewHeader, this._retainersHeaderDragging.bind(this), this._endRetainersHeaderDragging.bind(this), event, "row-resize");
+        this._previousDragPosition = event.pageY;
+        event.stopPropagation();
+    },
+
+    _retainersHeaderDragging: function(event)
+    {
+        var height = this.retainmentView.element.clientHeight;
+        height += this._previousDragPosition - event.pageY;
+        this._previousDragPosition = event.pageY;
+        this._updateRetainmentViewHeight(height);
+        event.preventDefault();
+        event.stopPropagation();
+    },
+
+    _endRetainersHeaderDragging: function(event)
+    {
+        WebInspector.elementDragEnd(event);
+        delete this._previousDragPosition;
+        event.stopPropagation();
+    },
+
+    _updateRetainmentViewHeight: function(height)
+    {
+        height = Number.constrain(height, Preferences.minConsoleHeight, this.element.clientHeight - Preferences.minConsoleHeight);
+        this.viewsContainer.style.bottom = (height + this.retainmentViewHeader.clientHeight) + "px";
+        this.retainmentView.element.style.height = height + "px";
+        this.retainmentViewHeader.style.bottom = height + "px";        
+    },
+
     _updateBaseOptions: function()
     {
         var list = this._profiles();

Modified: trunk/Source/WebCore/inspector/front-end/heapProfiler.css (86742 => 86743)


--- trunk/Source/WebCore/inspector/front-end/heapProfiler.css	2011-05-18 09:10:49 UTC (rev 86742)
+++ trunk/Source/WebCore/inspector/front-end/heapProfiler.css	2011-05-18 09:31:32 UTC (rev 86743)
@@ -143,27 +143,22 @@
     left: 0;
     right: 0;
     bottom: 0;
-    -webkit-box-orient: vertical;
 }
 
 .detailed-heapshot-view.visible {
-    display: -webkit-box;
+    display: block;
 }
 
 .detailed-heapshot-view .view {
     display: none;
-    -webkit-box-flex: 3;
-    -webkit-box-orient: vertical;
 }
 
 .detailed-heapshot-view .view.visible {
-    display: -webkit-box;
+    display: block;
 }
 
 .detailed-heapshot-view .data-grid {
     border: none;
-    position: relative;
-    -webkit-box-flex: 1;
 }
 
 .detailed-heapshot-view .data-grid td.count-column {
@@ -224,22 +219,56 @@
     background-color: #d6dde5;
 }
 
+.detailed-heapshot-view .data-grid {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+}
+
+.detailed-heapshot-view .views-container { 
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 173px;
+}
+
+.detailed-heapshot-view .views-container .view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+}
+
 .detailed-heapshot-view .retaining-paths-view {
-    -webkit-box-flex: 1;
+    height: 150px;
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    right: 0;
 }
 
-.detailed-heapshot-view .retaining-paths-view .title {
-    background-color: rgb(235, 235, 235);
-    background-image: url(Images/statusbarBackground.png);
-    background-repeat: repeat-x;
+.detailed-heapshot-view .retainers-view-header {
+    background-image: url(Images/statusbarResizerVertical.png), url(Images/statusbarBackground.png);
+    background-repeat: no-repeat, repeat-x;
+    background-position: right center, center;
+    cursor: row-resize;
     height: 23px;
     font: -webkit-small-control;
     font-weight: bold;
     color: rgb(48, 48, 48);
     text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;
+    display: block;
+    position: absolute;
+    left: 0;
+    right: 0;
+    bottom: 150px;
 }
 
-.detailed-heapshot-view .retaining-paths-view .title > span {
+.detailed-heapshot-view .retainers-view-header .title > span {
     display: inline-block;
     padding-top: 3px;
     vertical-align: middle;
@@ -247,10 +276,6 @@
     margin-right: 8px;
 }
 
-.detailed-heapshot-view .retaining-paths-to-windows {
-    
-}
-
 .heapshot-help-status-bar-item .glyph {
     -webkit-mask-position: -160px 0;
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to