Title: [194116] trunk/Source/WebInspectorUI
Revision
194116
Author
[email protected]
Date
2015-12-15 14:33:55 -0800 (Tue, 15 Dec 2015)

Log Message

Web Inspector: Convert Sidebar classes to use View
https://bugs.webkit.org/show_bug.cgi?id=152274

Reviewed by Brian Burg.

Updated Sidebar and SidebarPanel to inherit from View. Mostly mechanical changes.
Once the DetailsSection class family inherits from View (https://webkit.org/b/152269),
directly modifying a sidebar's 'contentView' element will rarely be necessary.

* UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js:
(WebInspector.ApplicationCacheDetailsSidebarPanel):

* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
(WebInspector.CSSStyleDetailsSidebarPanel):
(WebInspector.CSSStyleDetailsSidebarPanel.prototype.refresh):
(WebInspector.CSSStyleDetailsSidebarPanel.prototype._switchPanels):
Add/remove panels as subviews of the sidebar.
(WebInspector.CSSStyleDetailsSidebarPanel.prototype._filterDidChange):

* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WebInspector.DOMNodeDetailsSidebarPanel):

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._debuggerDidPause):

* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._buildLayerInfoSection):
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel):
(WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
(WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):

* UserInterface/Views/ProbeDetailsSidebarPanel.js:
(WebInspector.ProbeDetailsSidebarPanel.prototype.set inspectedProbeSets):

* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel):
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshURL):
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshImageSizeSection):
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRequestDataSection):

* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype.refresh.):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype.refresh):

* UserInterface/Views/SidebarPanel.js:
Inherit from View.
(WebInspector.SidebarPanel):
Replace the content element (the portion of the view excluding navigation
bars, filter bars, etc.) with a View object. A sidebar's content can be a mixture
of unwrapped DOM elements and View objects. For now, the content view's element
will be mutated directly, but once the DetailsSection class family inherits from
the View class the handling of details sections will be simplified.
(WebInspector.SidebarPanel.prototype.get contentView):
(WebInspector.SidebarPanel.prototype.shown):
(WebInspector.SidebarPanel.prototype.hidden):
(WebInspector.SidebarPanel.prototype.get contentElement): Deleted.
Replaced by WebInspector.SidebarPanel.prototype.get contentView.

* UserInterface/Views/StyleDetailsPanel.js:
Inherit from View.
(WebInspector.StyleDetailsPanel):
(WebInspector.StyleDetailsPanel.prototype.get element): Deleted.
Defer to View.element getter.

* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype._updateTimelineOverviewHeight):

* UserInterface/Views/VisualStyleDetailsPanel.js:
(WebInspector.VisualStyleDetailsPanel):
(WebInspector.VisualStyleDetailsPanel.prototype._updateSections):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (194115 => 194116)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-12-15 22:33:55 UTC (rev 194116)
@@ -1,3 +1,81 @@
+2015-12-15  Matt Baker  <[email protected]>
+
+        Web Inspector: Convert Sidebar classes to use View
+        https://bugs.webkit.org/show_bug.cgi?id=152274
+
+        Reviewed by Brian Burg.
+
+        Updated Sidebar and SidebarPanel to inherit from View. Mostly mechanical changes.
+        Once the DetailsSection class family inherits from View (https://webkit.org/b/152269),
+        directly modifying a sidebar's 'contentView' element will rarely be necessary.
+
+        * UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js:
+        (WebInspector.ApplicationCacheDetailsSidebarPanel):
+
+        * UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
+        (WebInspector.CSSStyleDetailsSidebarPanel):
+        (WebInspector.CSSStyleDetailsSidebarPanel.prototype.refresh):
+        (WebInspector.CSSStyleDetailsSidebarPanel.prototype._switchPanels):
+        Add/remove panels as subviews of the sidebar.
+        (WebInspector.CSSStyleDetailsSidebarPanel.prototype._filterDidChange):
+
+        * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
+        (WebInspector.DOMNodeDetailsSidebarPanel):
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel):
+        (WebInspector.DebuggerSidebarPanel.prototype._debuggerDidPause):
+
+        * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
+        (WebInspector.LayerTreeDetailsSidebarPanel.prototype._buildLayerInfoSection):
+        (WebInspector.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):
+
+        * UserInterface/Views/NavigationSidebarPanel.js:
+        (WebInspector.NavigationSidebarPanel):
+        (WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
+        (WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):
+
+        * UserInterface/Views/ProbeDetailsSidebarPanel.js:
+        (WebInspector.ProbeDetailsSidebarPanel.prototype.set inspectedProbeSets):
+
+        * UserInterface/Views/ResourceDetailsSidebarPanel.js:
+        (WebInspector.ResourceDetailsSidebarPanel):
+        (WebInspector.ResourceDetailsSidebarPanel.prototype._refreshURL):
+        (WebInspector.ResourceDetailsSidebarPanel.prototype._refreshImageSizeSection):
+        (WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRequestDataSection):
+
+        * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
+        (WebInspector.ScopeChainDetailsSidebarPanel):
+        (WebInspector.ScopeChainDetailsSidebarPanel.prototype.refresh.):
+        (WebInspector.ScopeChainDetailsSidebarPanel.prototype.refresh):
+
+        * UserInterface/Views/SidebarPanel.js:
+        Inherit from View.
+        (WebInspector.SidebarPanel):
+        Replace the content element (the portion of the view excluding navigation
+        bars, filter bars, etc.) with a View object. A sidebar's content can be a mixture
+        of unwrapped DOM elements and View objects. For now, the content view's element
+        will be mutated directly, but once the DetailsSection class family inherits from
+        the View class the handling of details sections will be simplified.
+        (WebInspector.SidebarPanel.prototype.get contentView):
+        (WebInspector.SidebarPanel.prototype.shown):
+        (WebInspector.SidebarPanel.prototype.hidden):
+        (WebInspector.SidebarPanel.prototype.get contentElement): Deleted.
+        Replaced by WebInspector.SidebarPanel.prototype.get contentView.
+
+        * UserInterface/Views/StyleDetailsPanel.js:
+        Inherit from View.
+        (WebInspector.StyleDetailsPanel):
+        (WebInspector.StyleDetailsPanel.prototype.get element): Deleted.
+        Defer to View.element getter.
+
+        * UserInterface/Views/TimelineSidebarPanel.js:
+        (WebInspector.TimelineSidebarPanel.prototype._updateTimelineOverviewHeight):
+
+        * UserInterface/Views/VisualStyleDetailsPanel.js:
+        (WebInspector.VisualStyleDetailsPanel):
+        (WebInspector.VisualStyleDetailsPanel.prototype._updateSections):
+
 2015-12-14  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Stack traces in console incorrectly show "(anonymous function)" for global code

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -47,8 +47,8 @@
 
         this._statusSection = new WebInspector.DetailsSection("application-cache-status", WebInspector.UIString("Status"), [this._statusGroup]);
 
-        this.contentElement.appendChild(this._locationSection.element);
-        this.contentElement.appendChild(this._statusSection.element);
+        this.contentView.element.appendChild(this._locationSection.element);
+        this.contentView.element.appendChild(this._statusSection.element);
 
         WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.NetworkStateUpdated, this._networkStateUpdated, this);
         WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestStatusChanged, this._frameManifestStatusChanged, this);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -63,7 +63,7 @@
                 groupElement.appendChild(labelElement);
             }, this);
 
-            this.contentElement.appendChild(this._forcedPseudoClassContainer);
+            this.contentView.element.appendChild(this._forcedPseudoClassContainer);
         }
 
         this._computedStyleDetailsPanel = new WebInspector.ComputedStyleDetailsPanel(this);
@@ -120,7 +120,7 @@
         if (!domNode)
             return;
 
-        this.contentElement.scrollTop = this._initialScrollOffset;
+        this.contentView.element.scrollTop = this._initialScrollOffset;
 
         for (var panel of this._panels) {
             panel.element._savedScrollTop = undefined;
@@ -227,30 +227,30 @@
 
         if (this._selectedPanel) {
             this._selectedPanel.hidden();
-            this._selectedPanel.element._savedScrollTop = this.contentElement.scrollTop;
-            this._selectedPanel.element.remove();
+            this._selectedPanel.element._savedScrollTop = this.contentView.element.scrollTop;
+            this.contentView.removeSubview(this._selectedPanel);
         }
 
         this._selectedPanel = selectedPanel;
+        if (!this._selectedPanel)
+            return;
 
-        if (this._selectedPanel) {
-            this.contentElement.appendChild(this._selectedPanel.element);
+        this.contentView.addSubview(this._selectedPanel);
 
-            if (typeof this._selectedPanel.element._savedScrollTop === "number")
-                this.contentElement.scrollTop = this._selectedPanel.element._savedScrollTop;
-            else
-                this.contentElement.scrollTop = this._initialScrollOffset;
+        if (typeof this._selectedPanel.element._savedScrollTop === "number")
+            this.contentView.element.scrollTop = this._selectedPanel.element._savedScrollTop;
+        else
+            this.contentView.element.scrollTop = this._initialScrollOffset;
 
-            var hasFilter = typeof this._selectedPanel.filterDidChange === "function";
-            this.contentElement.classList.toggle("has-filter-bar", hasFilter);
-            if (this._filterBar)
-                this.contentElement.classList.toggle(WebInspector.CSSStyleDetailsSidebarPanel.FilterInProgressClassName, hasFilter && this._filterBar.hasActiveFilters());
+        let hasFilter = typeof this._selectedPanel.filterDidChange === "function";
+        this.contentView.element.classList.toggle("has-filter-bar", hasFilter);
+        if (this._filterBar)
+            this.contentView.element.classList.toggle(WebInspector.CSSStyleDetailsSidebarPanel.FilterInProgressClassName, hasFilter && this._filterBar.hasActiveFilters());
 
-            this.contentElement.classList.toggle("supports-new-rule", typeof this._selectedPanel.newRuleButtonClicked === "function");
-            this._selectedPanel.shown();
+        this.contentView.element.classList.toggle("supports-new-rule", typeof this._selectedPanel.newRuleButtonClicked === "function");
+        this._selectedPanel.shown();
 
-            this._lastSelectedSectionSetting.value = selectedPanel.navigationInfo.identifier;
-        }
+        this._lastSelectedSectionSetting.value = selectedPanel.navigationInfo.identifier;
     }
 
     _forcedPseudoClassCheckboxChanged(pseudoClass, event)
@@ -286,7 +286,7 @@
 
     _filterDidChange()
     {
-        this.contentElement.classList.toggle(WebInspector.CSSStyleDetailsSidebarPanel.FilterInProgressClassName, this._filterBar.hasActiveFilters());
+        this.contentView.element.classList.toggle(WebInspector.CSSStyleDetailsSidebarPanel.FilterInProgressClassName, this._filterBar.hasActiveFilters());
 
         this._selectedPanel.filterDidChange(this._filterBar);
     }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -55,10 +55,10 @@
         this._eventListenersSectionGroup = new WebInspector.DetailsSectionGroup;
         var eventListenersSection = new WebInspector.DetailsSection("dom-node-event-listeners", WebInspector.UIString("Event Listeners"), [this._eventListenersSectionGroup]);
 
-        this.contentElement.appendChild(identitySection.element);
-        this.contentElement.appendChild(attributesSection.element);
-        this.contentElement.appendChild(propertiesSection.element);
-        this.contentElement.appendChild(eventListenersSection.element);
+        this.contentView.element.appendChild(identitySection.element);
+        this.contentView.element.appendChild(attributesSection.element);
+        this.contentView.element.appendChild(propertiesSection.element);
+        this.contentView.element.appendChild(eventListenersSection.element);
 
         if (this._accessibilitySupported()) {
             this._accessibilityEmptyRow = new WebInspector.DetailsSectionRow(WebInspector.UIString("No Accessibility Information"));
@@ -89,9 +89,9 @@
             this._accessibilityGroup = new WebInspector.DetailsSectionGroup([this._accessibilityEmptyRow]);
             var accessibilitySection = new WebInspector.DetailsSection("dom-node-accessibility", WebInspector.UIString("Accessibility"), [this._accessibilityGroup]);
 
-            this.contentElement.appendChild(accessibilitySection.element);
+            this.contentView.element.appendChild(accessibilitySection.element);
         }
-        }
+    }
 
     // Public
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -129,7 +129,7 @@
 
         var breakpointsGroup = new WebInspector.DetailsSectionGroup([breakpointsRow]);
         var breakpointsSection = new WebInspector.DetailsSection("scripts", WebInspector.UIString("Scripts"), [breakpointsGroup]);
-        this.contentElement.appendChild(breakpointsSection.element);
+        this.contentView.element.appendChild(breakpointsSection.element);
 
         this._callStackContentTreeOutline = this.createContentTreeOutline(true, true);
         this._callStackContentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange, this._treeSelectionDidChange, this);
@@ -248,9 +248,9 @@
 
     _debuggerDidPause(event)
     {
-        this.contentElement.insertBefore(this._callStackSection.element, this.contentElement.firstChild);
+        this.contentView.element.insertBefore(this._callStackSection.element, this.contentView.element.firstChild);
         if (this._updatePauseReason())
-            this.contentElement.insertBefore(this._pauseReasonSection.element, this.contentElement.firstChild);
+            this.contentView.element.insertBefore(this._pauseReasonSection.element, this.contentView.element.firstChild);
 
         this._debuggerPauseResumeButtonItem.enabled = true;
         this._debuggerPauseResumeButtonItem.toggled = true;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDetailsSidebarPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDetailsSidebarPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDetailsSidebarPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -117,7 +117,7 @@
 
         this._layerInfoSection = new WebInspector.DetailsSection("layer-info", WebInspector.UIString("Layer Info"), [this._noLayerInformationGroup]);
 
-        this.contentElement.appendChild(this._layerInfoSection.element);
+        this.contentView.element.appendChild(this._layerInfoSection.element);
     }
 
     _buildDataGridSection()
@@ -154,8 +154,7 @@
         var group = new WebInspector.DetailsSectionGroup([this._childLayersRow]);
         var section = new WebInspector.DetailsSection("layer-children", WebInspector.UIString("Child Layers"), [group], null, true);
 
-        var element = this.contentElement.appendChild(section.element);
-        element.classList.add(section.identifier);
+        this.contentView.element.appendChild(section.element);
     }
 
     _buildBottomBar()

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -33,7 +33,7 @@
 
         this._visibleContentTreeOutlines = new Set;
 
-        this.contentElement.addEventListener("scroll", this._updateContentOverflowShadowVisibility.bind(this));
+        this.contentView.element.addEventListener("scroll", this._updateContentOverflowShadowVisibility.bind(this));
 
         this._contentTreeOutline = this.createContentTreeOutline(true);
 
@@ -162,7 +162,7 @@
         contentTreeOutline.hidden = !dontHideByDefault;
         contentTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName);
 
-        this.contentElement.appendChild(contentTreeOutline.element);
+        this.contentView.element.appendChild(contentTreeOutline.element);
 
         if (!suppressFiltering) {
             contentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.ElementAdded, this._treeElementAddedOrChanged, this);
@@ -479,8 +479,8 @@
     {
         this._updateContentOverflowShadowVisibilityIdentifier = undefined;
 
-        var scrollHeight = this.contentElement.scrollHeight;
-        var offsetHeight = this.contentElement.offsetHeight;
+        let scrollHeight = this.contentView.element.scrollHeight;
+        let offsetHeight = this.contentView.element.offsetHeight;
 
         if (scrollHeight < offsetHeight) {
             if (this._topOverflowShadowElement)
@@ -489,11 +489,11 @@
             return;
         }
 
-        var edgeThreshold = 1;
-        var scrollTop = this.contentElement.scrollTop;
+        let edgeThreshold = 1;
+        let scrollTop = this.contentView.element.scrollTop;
 
-        var topCoverage = Math.min(scrollTop, edgeThreshold);
-        var bottomCoverage = Math.max(0, (offsetHeight + scrollTop) - (scrollHeight - edgeThreshold));
+        let topCoverage = Math.min(scrollTop, edgeThreshold);
+        let bottomCoverage = Math.max(0, (offsetHeight + scrollTop) - (scrollHeight - edgeThreshold));
 
         if (this._topOverflowShadowElement)
             this._topOverflowShadowElement.style.opacity = (topCoverage / edgeThreshold).toFixed(1);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -50,16 +50,16 @@
 
     set inspectedProbeSets(newProbeSets)
     {
-        for (var probeSet of this._inspectedProbeSets) {
-            var removedSection = this._probeSetSections.get(probeSet);
-            this.contentElement.removeChild(removedSection.element);
+        for (let probeSet of this._inspectedProbeSets) {
+            let removedSection = this._probeSetSections.get(probeSet);
+            removedSection.element.remove();
         }
 
         this._inspectedProbeSets = newProbeSets;
 
-        for (var probeSet of newProbeSets) {
-            var shownSection = this._probeSetSections.get(probeSet);
-            this.contentElement.appendChild(shownSection.element);
+        for (let probeSet of newProbeSets) {
+            let shownSection = this._probeSetSections.get(probeSet);
+            this.contentView.element.appendChild(shownSection.element);
         }
     }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -102,11 +102,11 @@
         this._imageSizeSection = new WebInspector.DetailsSection("resource-type", WebInspector.UIString("Image Size"));
         this._imageSizeSection.groups = [new WebInspector.DetailsSectionGroup([this._imageWidthRow, this._imageHeightRow])];
 
-        this.contentElement.appendChild(this._typeSection.element);
-        this.contentElement.appendChild(this._locationSection.element);
-        this.contentElement.appendChild(this._requestAndResponseSection.element);
-        this.contentElement.appendChild(this._requestHeadersSection.element);
-        this.contentElement.appendChild(this._responseHeadersSection.element);
+        this.contentView.element.appendChild(this._typeSection.element);
+        this.contentView.element.appendChild(this._locationSection.element);
+        this.contentView.element.appendChild(this._requestAndResponseSection.element);
+        this.contentView.element.appendChild(this._requestHeadersSection.element);
+        this.contentView.element.appendChild(this._responseHeadersSection.element);
     }
 
     // Public
@@ -225,7 +225,7 @@
 
         if (urlComponents.queryString) {
             // Ensure the "Query Parameters" section is displayed, right after the "Request & Response" section.
-            this.contentElement.insertBefore(this._queryParametersSection.element, this._requestAndResponseSection.element.nextSibling);
+            this.contentView.element.insertBefore(this._queryParametersSection.element, this._requestAndResponseSection.element.nextSibling);
 
             this._queryParametersRow.dataGrid = this._createNameValueDataGrid(parseQueryString(urlComponents.queryString, true));
         } else {
@@ -382,12 +382,12 @@
         if (resource.type !== WebInspector.Resource.Type.Image || resource.failed) {
             var imageSectionElement = this._imageSizeSection.element;
             if (imageSectionElement.parentNode)
-                this.contentElement.removeChild(imageSectionElement);
+                this.contentView.element.removeChild(imageSectionElement);
             return;
         }
 
         // Ensure the section is displayed, right before the "Location" section.
-        this.contentElement.insertBefore(this._imageSizeSection.element, this._locationSection.element);
+        this.contentView.element.insertBefore(this._imageSizeSection.element, this._locationSection.element);
 
         // Get the metrics for this resource and fill in the metrics rows with that information.
         resource.getImageSize(function(size) {
@@ -416,7 +416,7 @@
         }
 
         // Ensure the section is displayed, right before the "Request Headers" section.
-        this.contentElement.insertBefore(this._requestDataSection.element, this._requestHeadersSection.element);
+        this.contentView.element.insertBefore(this._requestDataSection.element, this._requestHeadersSection.element);
 
         var requestDataContentType = resource.requestDataContentType || "";
         if (requestDataContentType && requestDataContentType.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)) {

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -54,7 +54,7 @@
 
         this._watchExpressionsSectionGroup = new WebInspector.DetailsSectionGroup;
         this._watchExpressionsSection = new WebInspector.DetailsSection("watch-expressions", WebInspector.UIString("Watch Expressions"), [this._watchExpressionsSectionGroup], this._watchExpressionOptionsElement);
-        this.contentElement.appendChild(this._watchExpressionsSection.element);
+        this.contentView.element.appendChild(this._watchExpressionsSection.element);
 
         this._updateWatchExpressionsNavigationBar();
 
@@ -125,8 +125,8 @@
                     emptyRow.showEmptyMessage();
                 }
 
-                this.contentElement.removeChildren();
-                this.contentElement.appendChild(this._watchExpressionsSection.element);
+                this.contentView.element.removeChildren();
+                this.contentView.element.appendChild(this._watchExpressionsSection.element);
 
                 // Bail if the call frame changed while we were waiting for the async response.
                 if (this._callFrame !== callFrame)
@@ -136,7 +136,7 @@
                     return;
 
                 for (let callFrameSection of callFrameSections)
-                    this.contentElement.appendChild(callFrameSection.element);
+                    this.contentView.element.appendChild(callFrameSection.element);
             }
 
             // We need a timeout in place in case there are long running, pending backend dispatches. This can happen

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -40,9 +40,9 @@
         this.element.setAttribute("role", role || "group");
         this.element.setAttribute("aria-label", label || displayName);
 
-        this._contentElement = document.createElement("div");
-        this._contentElement.className = "content";
-        this.element.appendChild(this._contentElement);
+        this._contentView = new WebInspector.View;
+        this._contentView.element.classList.add("content");
+        this.addSubview(this._contentView);
     }
 
     // Public
@@ -52,9 +52,9 @@
         return this._identifier;
     }
 
-    get contentElement()
+    get contentView()
     {
-        return this._contentElement;
+        return this._contentView;
     }
 
     get visible()
@@ -128,14 +128,14 @@
 
     shown()
     {
-        this._contentElement.scrollTop = this._savedScrollPosition;
+        this._contentView.element.scrollTop = this._savedScrollPosition;
 
         // Implemented by subclasses.
     }
 
     hidden()
     {
-        this._savedScrollPosition = this._contentElement.scrollTop;
+        this._savedScrollPosition = this._contentView.element.scrollTop;
 
         // Implemented by subclasses.
     }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.StyleDetailsPanel = class StyleDetailsPanel extends WebInspector.Object
+WebInspector.StyleDetailsPanel = class StyleDetailsPanel extends WebInspector.View
 {
     constructor(delegate, className, identifier, label)
     {
@@ -31,11 +31,8 @@
 
         this._delegate = delegate || null;
 
-        this._element = document.createElement("div");
-        this._element.className = className;
-
         // Add this offset-sections class name so the sticky headers don't overlap the navigation bar.
-        this.element.classList.add("offset-sections");
+        this.element.classList.add(className, "offset-sections");
 
         this._navigationInfo = {identifier, label};
 
@@ -45,11 +42,6 @@
 
     // Public
 
-    get element()
-    {
-        return this._element;
-    }
-
     get navigationInfo()
     {
         return this._navigationInfo;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -873,7 +873,7 @@
         }
 
         this._timelineEventsTitleBarContainer.style.top = (overviewHeight + eventTitleBarOffset) + "px";
-        this.contentElement.style.top = (overviewHeight + contentElementOffset) + "px";
+        this.contentView.element.style.top = (overviewHeight + contentElementOffset) + "px";
     }
 
     _recordGlyphMousedOver(event)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js (194115 => 194116)


--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js	2015-12-15 22:10:20 UTC (rev 194115)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js	2015-12-15 22:33:55 UTC (rev 194116)
@@ -60,7 +60,7 @@
         this._selectorSection = new WebInspector.VisualStyleSelectorSection(this);
         this._selectorSection.addEventListener(WebInspector.VisualStyleSelectorSection.Event.SelectorChanged, this._updateSections, this);
         this._selectorSection.addEventListener(WebInspector.VisualStyleSelectorSection.Event.StyleTextChanged, this._prepareForChange, this);
-        this._element.appendChild(this._selectorSection.element);
+        this.element.appendChild(this._selectorSection.element);
 
         // Layout Section
         this._generateSection("display", WebInspector.UIString("Display"));
@@ -73,7 +73,7 @@
         this._generateSection("alignment", WebInspector.UIString("Alignment"));
 
         this._sections.layout = new WebInspector.DetailsSection("layout", WebInspector.UIString("Layout"), [this._groups.display.section, this._groups.position.section, this._groups.float.section, this._groups.dimensions.section, this._groups.margin.section, this._groups.padding.section, this._groups.flexbox.section, this._groups.alignment.section]);
-        this._element.appendChild(this._sections.layout.element);
+        this.element.appendChild(this._sections.layout.element);
 
         // Text Section
         this._generateSection("text-style", WebInspector.UIString("Style"));
@@ -82,7 +82,7 @@
         this._generateSection("text-shadow", WebInspector.UIString("Shadow"));
 
         this._sections.text = new WebInspector.DetailsSection("text", WebInspector.UIString("Text"), [this._groups.textStyle.section, this._groups.font.section, this._groups.textSpacing.section, this._groups.textShadow.section]);
-        this._element.appendChild(this._sections.text.element);
+        this.element.appendChild(this._sections.text.element);
 
         // Background Section
         this._generateSection("background-style", WebInspector.UIString("Style"));
@@ -91,13 +91,13 @@
         this._generateSection("box-shadow", WebInspector.UIString("Shadow"));
 
         this._sections.background = "" WebInspector.DetailsSection("background", WebInspector.UIString("Background"), [this._groups.backgroundStyle.section, this._groups.border.section, this._groups.outline.section, this._groups.boxShadow.section]);
-        this._element.appendChild(this._sections.background.element);
+        this.element.appendChild(this._sections.background.element);
 
         // Animation Section
         this._generateSection("transition", WebInspector.UIString("Transition"));
 
         this._sections.animation = new WebInspector.DetailsSection("animation", WebInspector.UIString("Animation"), [this._groups.transition.section]);
-        this._element.appendChild(this._sections.animation.element);
+        this.element.appendChild(this._sections.animation.element);
     }
 
     // Public
@@ -155,7 +155,7 @@
             return;
 
         let disabled = this._currentStyle[WebInspector.VisualStyleDetailsPanel.StyleDisabledSymbol];
-        this._element.classList.toggle("disabled", !!disabled);
+        this.element.classList.toggle("disabled", !!disabled);
         if (disabled)
             return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to