Title: [140968] trunk/Source/WebCore
Revision
140968
Author
[email protected]
Date
2013-01-28 08:14:26 -0800 (Mon, 28 Jan 2013)

Log Message

Web Inspector: Inherit SidebarPane from View.
https://bugs.webkit.org/show_bug.cgi?id=108075

Patch by Vladislav Kaznacheev <[email protected]> on 2013-01-28
Reviewed by Pavel Feldman.

Inherited WebInspector.SidebarPane from WebInspector.View to streamlines the code and
simplify further enhancements to sidebar panes. Got rid of obsolete onattach calls.

No new tests.

* inspector/front-end/AuditResultView.js:
(WebInspector.AuditResultView):
* inspector/front-end/ElementsPanel.js:
(WebInspector.ElementsPanel):
(WebInspector.ElementsPanel.prototype.wasShown):
(WebInspector.ElementsPanel.prototype.willHide):
* inspector/front-end/ExtensionServer.js:
(WebInspector.ExtensionServer.prototype._onCreateSidebarPane):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel):
(WebInspector.ScriptsPanel.prototype.wasShown):
* inspector/front-end/SidebarPane.js:
(WebInspector.SidebarPane):
* inspector/front-end/WatchExpressionsSidebarPane.js:
(WebInspector.WatchExpressionsSidebarPane.prototype._refreshExpressionsIfNeeded):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (140967 => 140968)


--- trunk/Source/WebCore/ChangeLog	2013-01-28 15:34:59 UTC (rev 140967)
+++ trunk/Source/WebCore/ChangeLog	2013-01-28 16:14:26 UTC (rev 140968)
@@ -1,3 +1,31 @@
+2013-01-28  Vladislav Kaznacheev  <[email protected]>
+
+        Web Inspector: Inherit SidebarPane from View.
+        https://bugs.webkit.org/show_bug.cgi?id=108075
+
+        Reviewed by Pavel Feldman.
+
+        Inherited WebInspector.SidebarPane from WebInspector.View to streamlines the code and
+        simplify further enhancements to sidebar panes. Got rid of obsolete onattach calls.
+
+        No new tests.
+
+        * inspector/front-end/AuditResultView.js:
+        (WebInspector.AuditResultView):
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel):
+        (WebInspector.ElementsPanel.prototype.wasShown):
+        (WebInspector.ElementsPanel.prototype.willHide):
+        * inspector/front-end/ExtensionServer.js:
+        (WebInspector.ExtensionServer.prototype._onCreateSidebarPane):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        (WebInspector.ScriptsPanel.prototype.wasShown):
+        * inspector/front-end/SidebarPane.js:
+        (WebInspector.SidebarPane):
+        * inspector/front-end/WatchExpressionsSidebarPane.js:
+        (WebInspector.WatchExpressionsSidebarPane.prototype._refreshExpressionsIfNeeded):
+
 2013-01-28  Martin Robinson  <[email protected]>
 
         [Freetype] Synthetic bold not applied to fallback fonts properly

Modified: trunk/Source/WebCore/inspector/front-end/AuditResultView.js (140967 => 140968)


--- trunk/Source/WebCore/inspector/front-end/AuditResultView.js	2013-01-28 15:34:59 UTC (rev 140967)
+++ trunk/Source/WebCore/inspector/front-end/AuditResultView.js	2013-01-28 16:14:26 UTC (rev 140968)
@@ -43,7 +43,7 @@
     }
     categoryResults.sort(categorySorter);
     for (var i = 0; i < categoryResults.length; ++i)
-        this.element.appendChild(new WebInspector.AuditCategoryResultPane(categoryResults[i]).element);
+        new WebInspector.AuditCategoryResultPane(categoryResults[i]).show(this.element);
 }
 
 WebInspector.AuditResultView.prototype = {

Modified: trunk/Source/WebCore/inspector/front-end/ElementsPanel.js (140967 => 140968)


--- trunk/Source/WebCore/inspector/front-end/ElementsPanel.js	2013-01-28 15:34:59 UTC (rev 140967)
+++ trunk/Source/WebCore/inspector/front-end/ElementsPanel.js	2013-01-28 16:14:26 UTC (rev 140968)
@@ -98,11 +98,8 @@
     this.sidebarPanes.styles.addEventListener("style property toggled", this._stylesPaneEdited, this);
     this.sidebarPanes.metrics.addEventListener("metrics edited", this._metricsPaneEdited, this);
 
-    for (var pane in this.sidebarPanes) {
-        this.sidebarElement.appendChild(this.sidebarPanes[pane].element);
-        if (this.sidebarPanes[pane].onattach)
-            this.sidebarPanes[pane].onattach();
-    }
+    for (var pane in this.sidebarPanes)
+        this.sidebarPanes[pane].show(this.sidebarElement);
 
     this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._getPopoverAnchor.bind(this), this._showPopover.bind(this));
     this._popoverHelper.setTimeout(0);
@@ -148,7 +145,7 @@
         if (!this.treeOutline.rootDOMNode)
             WebInspector.domAgent.requestDocument();
 
-        this.sidebarElement.insertBefore(this.sidebarPanes.domBreakpoints.element, this.sidebarPanes.eventListeners.element);
+        this.sidebarPanes.domBreakpoints.show(this.sidebarElement, this.sidebarPanes.eventListeners.element);
     },
 
     willHide: function()
@@ -160,11 +157,6 @@
         // Detach heavy component on hide
         this.contentElement.removeChild(this.treeOutline.element);
 
-        for (var pane in this.sidebarPanes) {
-            if (this.sidebarPanes[pane].willHide)
-                this.sidebarPanes[pane].willHide();
-        }
-
         WebInspector.Panel.prototype.willHide.call(this);
     },
 

Modified: trunk/Source/WebCore/inspector/front-end/ExtensionServer.js (140967 => 140968)


--- trunk/Source/WebCore/inspector/front-end/ExtensionServer.js	2013-01-28 15:34:59 UTC (rev 140967)
+++ trunk/Source/WebCore/inspector/front-end/ExtensionServer.js	2013-01-28 16:14:26 UTC (rev 140968)
@@ -237,7 +237,7 @@
         var sidebar = new WebInspector.ExtensionSidebarPane(message.title, message.id);
         this._clientObjects[id] = sidebar;
         panel.sidebarPanes[id] = sidebar;
-        panel.sidebarElement.appendChild(sidebar.element);
+        sidebar.show(panel.sidebarElement);
 
         return this._status.OK();
     },

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (140967 => 140968)


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2013-01-28 15:34:59 UTC (rev 140967)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2013-01-28 16:14:26 UTC (rev 140968)
@@ -129,7 +129,7 @@
     for (var pane in this.sidebarPanes) {
         if (this.sidebarPanes[pane] === this.sidebarPanes.domBreakpoints)
             continue;
-        this._debugSidebarContentsElement.appendChild(this.sidebarPanes[pane].element);
+        this.sidebarPanes[pane].show(this._debugSidebarContentsElement);
     }
 
     this.sidebarPanes.callstack.expanded = true;
@@ -215,8 +215,7 @@
     wasShown: function()
     {
         WebInspector.Panel.prototype.wasShown.call(this);
-        this._debugSidebarContentsElement.insertBefore(this.sidebarPanes.domBreakpoints.element, this.sidebarPanes.xhrBreakpoints.element);
-        this.sidebarPanes.watchExpressions.show();
+        this.sidebarPanes.domBreakpoints.show(this._debugSidebarContentsElement, this.sidebarPanes.xhrBreakpoints.element);
 
         this._navigatorController.wasShown();
     },

Modified: trunk/Source/WebCore/inspector/front-end/SidebarPane.js (140967 => 140968)


--- trunk/Source/WebCore/inspector/front-end/SidebarPane.js	2013-01-28 15:34:59 UTC (rev 140967)
+++ trunk/Source/WebCore/inspector/front-end/SidebarPane.js	2013-01-28 16:14:26 UTC (rev 140968)
@@ -28,11 +28,11 @@
 
 /**
  * @constructor
- * @extends {WebInspector.Object}
+ * @extends {WebInspector.View}
  */
 WebInspector.SidebarPane = function(title)
 {
-    this.element = document.createElement("div");
+    WebInspector.View.call(this);
     this.element.className = "pane";
 
     this.titleElement = document.createElement("div");
@@ -134,5 +134,5 @@
             this.toggleExpanded();
     },
 
-    __proto__: WebInspector.Object.prototype
+    __proto__: WebInspector.View.prototype
 }

Modified: trunk/Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js (140967 => 140968)


--- trunk/Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js	2013-01-28 15:34:59 UTC (rev 140967)
+++ trunk/Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js	2013-01-28 16:14:26 UTC (rev 140968)
@@ -38,18 +38,14 @@
 }
 
 WebInspector.WatchExpressionsSidebarPane.prototype = {
-    show: function()
+    wasShown: function()
     {
-        this._visible = true;
-
         // Expand and update watches first time they are shown.
-        if (this._wasShown) {
+        if (this.section) {
             this._refreshExpressionsIfNeeded();
             return;
         }
 
-        this._wasShown = true;
-
         this.section = new WebInspector.WatchExpressionsSection();
         this.bodyElement.appendChild(this.section.element);
 
@@ -70,11 +66,6 @@
             this.expanded = true;
     },
 
-    hide: function()
-    {
-        this._visible = false;
-    },
-
     reset: function()
     {
         this.refreshExpressions();
@@ -94,7 +85,7 @@
 
     _refreshExpressionsIfNeeded: function()
     {
-        if (this._requiresUpdate && this._visible) {
+        if (this._requiresUpdate && this.isShowing()) {
             this.section.update();
             delete this._requiresUpdate;
         } else
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to