Web Inspector: Cleanup unused/invalid parameters for TreeElements
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Jul 2017 17:27:43 +0000 (17:27 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Jul 2017 17:27:43 +0000 (17:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173987

Reviewed by Brian Burg.

* UserInterface/Views/TreeElement.js:
* UserInterface/Views/GeneralTreeElement.js:

* UserInterface/Views/ApplicationCacheFrameTreeElement.js:
* UserInterface/Views/BreakpointTreeElement.js:
* UserInterface/Views/CSSStyleSheetTreeElement.js:
* UserInterface/Views/CallFrameTreeElement.js:
* UserInterface/Views/ContentFlowTreeElement.js:
* UserInterface/Views/DOMNodeTreeElement.js:
* UserInterface/Views/DatabaseTableTreeElement.js:
* UserInterface/Views/DatabaseTreeElement.js:
* UserInterface/Views/FolderTreeElement.js:
* UserInterface/Views/FolderizedTreeElement.js:
* UserInterface/Views/FrameTreeElement.js:
* UserInterface/Views/IndexedDatabaseObjectStoreIndexTreeElement.js:
* UserInterface/Views/IndexedDatabaseObjectStoreTreeElement.js:
* UserInterface/Views/IndexedDatabaseTreeElement.js:
* UserInterface/Views/IssueTreeElement.js:
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
* UserInterface/Views/ProfileNodeTreeElement.js:
* UserInterface/Views/ResourceTreeElement.js:
* UserInterface/Views/ScriptTreeElement.js:
* UserInterface/Views/SearchResultTreeElement.js:
* UserInterface/Views/SourceCodeTreeElement.js:
* UserInterface/Views/SourceMapResourceTreeElement.js:
* UserInterface/Views/StorageTreeElement.js:
* UserInterface/Views/TimelineRecordTreeElement.js:
* UserInterface/Views/TypeTreeElement.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220004 268f45cc-cd09-0410-ab3c-d52691b4dbfc

28 files changed:
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameTreeElement.js
Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js
Source/WebInspectorUI/UserInterface/Views/CSSStyleSheetTreeElement.js
Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.js
Source/WebInspectorUI/UserInterface/Views/ContentFlowTreeElement.js
Source/WebInspectorUI/UserInterface/Views/DOMNodeTreeElement.js
Source/WebInspectorUI/UserInterface/Views/DatabaseTableTreeElement.js
Source/WebInspectorUI/UserInterface/Views/DatabaseTreeElement.js
Source/WebInspectorUI/UserInterface/Views/FolderTreeElement.js
Source/WebInspectorUI/UserInterface/Views/FolderizedTreeElement.js
Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js
Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js
Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreIndexTreeElement.js
Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreTreeElement.js
Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseTreeElement.js
Source/WebInspectorUI/UserInterface/Views/IssueTreeElement.js
Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js
Source/WebInspectorUI/UserInterface/Views/ProfileNodeTreeElement.js
Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js
Source/WebInspectorUI/UserInterface/Views/ScriptTreeElement.js
Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js
Source/WebInspectorUI/UserInterface/Views/SourceCodeTreeElement.js
Source/WebInspectorUI/UserInterface/Views/SourceMapResourceTreeElement.js
Source/WebInspectorUI/UserInterface/Views/StorageTreeElement.js
Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js
Source/WebInspectorUI/UserInterface/Views/TreeElement.js
Source/WebInspectorUI/UserInterface/Views/TypeTreeElement.js

index db01cdf..f17424d 100644 (file)
@@ -1,3 +1,39 @@
+2017-07-28  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: Cleanup unused/invalid parameters for TreeElements
+        https://bugs.webkit.org/show_bug.cgi?id=173987
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Views/TreeElement.js:
+        * UserInterface/Views/GeneralTreeElement.js:
+
+        * UserInterface/Views/ApplicationCacheFrameTreeElement.js:
+        * UserInterface/Views/BreakpointTreeElement.js:
+        * UserInterface/Views/CSSStyleSheetTreeElement.js:
+        * UserInterface/Views/CallFrameTreeElement.js:
+        * UserInterface/Views/ContentFlowTreeElement.js:
+        * UserInterface/Views/DOMNodeTreeElement.js:
+        * UserInterface/Views/DatabaseTableTreeElement.js:
+        * UserInterface/Views/DatabaseTreeElement.js:
+        * UserInterface/Views/FolderTreeElement.js:
+        * UserInterface/Views/FolderizedTreeElement.js:
+        * UserInterface/Views/FrameTreeElement.js:
+        * UserInterface/Views/IndexedDatabaseObjectStoreIndexTreeElement.js:
+        * UserInterface/Views/IndexedDatabaseObjectStoreTreeElement.js:
+        * UserInterface/Views/IndexedDatabaseTreeElement.js:
+        * UserInterface/Views/IssueTreeElement.js:
+        * UserInterface/Views/ObjectTreeBaseTreeElement.js:
+        * UserInterface/Views/ProfileNodeTreeElement.js:
+        * UserInterface/Views/ResourceTreeElement.js:
+        * UserInterface/Views/ScriptTreeElement.js:
+        * UserInterface/Views/SearchResultTreeElement.js:
+        * UserInterface/Views/SourceCodeTreeElement.js:
+        * UserInterface/Views/SourceMapResourceTreeElement.js:
+        * UserInterface/Views/StorageTreeElement.js:
+        * UserInterface/Views/TimelineRecordTreeElement.js:
+        * UserInterface/Views/TypeTreeElement.js:
+
 2017-07-26  Devin Rousso  <drousso@apple.com>
 
         Uncaught Exception: undefined is not an object (evaluating 'this._memoryRow.value = Number.bytesToString(this._canvas.memoryCost)')
index 9b346cb..732ce54 100644 (file)
@@ -29,7 +29,9 @@ WebInspector.ApplicationCacheFrameTreeElement = class ApplicationCacheFrameTreeE
     {
         console.assert(representedObject instanceof WebInspector.ApplicationCacheFrame);
 
-        super("application-cache-frame", "", "", representedObject, false);
+        const title = null;
+        const subtitle = null;
+        super("application-cache-frame", title, subtitle, representedObject);
 
         this.updateTitles();
     }
index 0c88112..c24f402 100644 (file)
@@ -32,7 +32,8 @@ WebInspector.BreakpointTreeElement = class BreakpointTreeElement extends WebInsp
         if (!className)
             className = WebInspector.BreakpointTreeElement.GenericLineIconStyleClassName;
 
-        super(["breakpoint", className], title, null, breakpoint, false);
+        const subtitle = null;
+        super(["breakpoint", className], title, subtitle, breakpoint);
 
         this._breakpoint = breakpoint;
         this._probeSet = null;
index 9f66636..78ebae1 100644 (file)
@@ -30,10 +30,6 @@ WebInspector.CSSStyleSheetTreeElement = class CSSStyleSheetTreeElement extends W
         console.assert(styleSheet instanceof WebInspector.CSSStyleSheet);
         console.assert(styleSheet.isInspectorStyleSheet());
 
-        const classNames = ["stylesheet", "stylesheet-icon"];
-        const title = WebInspector.UIString("Inspector Style Sheet");
-        const subtitle = null;
-        const hasChildren = false;
-        super(styleSheet, classNames, title, subtitle, styleSheet, hasChildren);
+        super(styleSheet, ["stylesheet", "stylesheet-icon"], WebInspector.UIString("Inspector Style Sheet"));
     }
 };
index 50ed877..e6ab8f8 100644 (file)
@@ -31,8 +31,8 @@ WebInspector.CallFrameTreeElement = class CallFrameTreeElement extends WebInspec
 
         let className = WebInspector.CallFrameView.iconClassNameForCallFrame(callFrame);
         let title = callFrame.functionName || WebInspector.UIString("(anonymous function)");
-
-        super(["call-frame", className], title, null, callFrame, false);
+        const subtitle = null;
+        super(["call-frame", className], title, subtitle, callFrame);
 
         this._callFrame = callFrame;
         this._isActiveCallFrame = false;
index 4fe2cc5..2fc8f3d 100644 (file)
@@ -34,6 +34,7 @@ WebInspector.ContentFlowTreeElement = class ContentFlowTreeElement extends WebIn
     {
         console.assert(representedObject instanceof WebInspector.ContentFlow);
 
-        super("content-flow-icon", representedObject.name, null, representedObject, false);
+        const subtitle = null;
+        super("content-flow-icon", representedObject.name, subtitle, representedObject);
     }
 };
index 7d5d2de..b9df122 100644 (file)
@@ -29,7 +29,8 @@ WebInspector.DOMNodeTreeElement = class DOMNodeTreeElement extends WebInspector.
     {
         console.assert(domNode instanceof WebInspector.DOMNode);
 
-        super("dom-node", domNode.displayName, null, domNode, true);
+        const subtitle = null;
+        super("dom-node", domNode.displayName, subtitle, domNode, {hasChildren: true});
 
         this.status = WebInspector.linkifyNodeReferenceElement(domNode, WebInspector.createGoToArrowButton());
     }
index 1b976bd..7937090 100644 (file)
@@ -29,6 +29,7 @@ WebInspector.DatabaseTableTreeElement = class DatabaseTableTreeElement extends W
     {
         console.assert(representedObject instanceof WebInspector.DatabaseTableObject);
 
-        super("database-table-icon", representedObject.name, null, representedObject, false);
+        const subtitle = null;
+        super("database-table-icon", representedObject.name, subtitle, representedObject);
     }
 };
index 8de7095..87678fe 100644 (file)
@@ -29,7 +29,8 @@ WebInspector.DatabaseTreeElement = class DatabaseTreeElement extends WebInspecto
     {
         console.assert(representedObject instanceof WebInspector.DatabaseObject);
 
-        super("database-icon", representedObject.name, null, representedObject, true);
+        const subtitle = null;
+        super("database-icon", representedObject.name, subtitle, representedObject, {hasChildren: true});
 
         this.hasChildren = false;
 
index 7eb10fd..ec6678d 100644 (file)
@@ -31,8 +31,7 @@ WebInspector.FolderTreeElement = class FolderTreeElement extends WebInspector.Ge
 
         const classNames = [WebInspector.FolderTreeElement.FolderIconStyleClassName];
         const subtitle = null;
-        const hasChildren = true;
-        super(classNames, title, subtitle, representedObject, hasChildren);
+        super(classNames, title, subtitle, representedObject, {hasChildren: true});
     }
 };
 
index be6e49b..fae52fb 100644 (file)
@@ -25,9 +25,9 @@
 
 WebInspector.FolderizedTreeElement = class FolderizedTreeElement extends WebInspector.GeneralTreeElement
 {
-    constructor(classNames, title, subtitle, representedObject, hasChildren)
+    constructor(classNames, title, subtitle, representedObject)
     {
-        super(classNames, title, subtitle, representedObject, hasChildren);
+        super(classNames, title, subtitle, representedObject);
 
         this.shouldRefreshChildren = true;
 
index 12885e4..737fe82 100644 (file)
 
 WebInspector.FrameTreeElement = class FrameTreeElement extends WebInspector.ResourceTreeElement
 {
-    constructor(frame, representedObject)
+    constructor(frame)
     {
         console.assert(frame instanceof WebInspector.Frame);
 
-        super(frame.mainResource, representedObject || frame);
+        super(frame.mainResource, frame);
 
         this._frame = frame;
 
index ee81a3f..40980c3 100644 (file)
@@ -25,9 +25,9 @@
 
 WebInspector.GeneralTreeElement = class GeneralTreeElement extends WebInspector.TreeElement
 {
-    constructor(classNames, title, subtitle, representedObject, hasChildren)
+    constructor(classNames, title, subtitle, representedObject, options)
     {
-        super("", representedObject, hasChildren);
+        super("", representedObject, options);
 
         this.classNames = classNames;
 
index 4e8bb68..4651394 100644 (file)
@@ -29,7 +29,8 @@ WebInspector.IndexedDatabaseObjectStoreIndexTreeElement = class IndexedDatabaseO
     {
         console.assert(objectStoreIndex instanceof WebInspector.IndexedDatabaseObjectStoreIndex);
 
-        super("database-table-icon", objectStoreIndex.name, null, objectStoreIndex, false);
+        const subtitle = null;
+        super("database-table-icon", objectStoreIndex.name, subtitle, objectStoreIndex);
 
         this._objectStoreIndex = objectStoreIndex;
     }
index 1eca008..e76b1be 100644 (file)
@@ -29,7 +29,8 @@ WebInspector.IndexedDatabaseObjectStoreTreeElement = class IndexedDatabaseObject
     {
         console.assert(objectStore instanceof WebInspector.IndexedDatabaseObjectStore);
 
-        super("database-table-icon", objectStore.name, null, objectStore, !!objectStore.indexes.length);
+        const subtitle = null;
+        super("database-table-icon", objectStore.name, subtitle, objectStore, {hasChildren: !!objectStore.indexes.length});
 
         this._objectStore = objectStore;
     }
index 7ab54d6..fff29be 100644 (file)
@@ -29,7 +29,8 @@ WebInspector.IndexedDatabaseTreeElement = class IndexedDatabaseTreeElement exten
     {
         console.assert(indexedDatabase instanceof WebInspector.IndexedDatabase);
 
-        super("database-icon", indexedDatabase.name, null, indexedDatabase, !!indexedDatabase.objectStores.length);
+        const subtitle = null;
+        super("database-icon", indexedDatabase.name, subtitle, indexedDatabase, {hasChildren: !!indexedDatabase.objectStores.length});
 
         this._indexedDatabase = indexedDatabase;
     }
index b8d91f3..4be581c 100644 (file)
@@ -37,7 +37,9 @@ WebInspector.IssueTreeElement = class IssueTreeElement extends WebInspector.Gene
             break;
         }
 
-        super([WebInspector.IssueTreeElement.StyleClassName, levelStyleClassName], null, null, issueMessage, false);
+        const title = null;
+        const subtitle = null;
+        super([WebInspector.IssueTreeElement.StyleClassName, levelStyleClassName], title, subtitle, issueMessage);
 
         this._issueMessage = issueMessage;
         this._updateTitles();
index d0370c8..7967965 100644 (file)
@@ -31,7 +31,10 @@ WebInspector.ObjectTreeBaseTreeElement = class ObjectTreeBaseTreeElement extends
         console.assert(propertyPath instanceof WebInspector.PropertyPath);
         console.assert(!property || property instanceof WebInspector.PropertyDescriptor);
 
-        super(null, null, null, representedObject, false);
+        const classNames = null;
+        const title = null;
+        const subtitle = null;
+        super(classNames, title, subtitle, representedObject);
 
         this._property = property;
         this._propertyPath = propertyPath;
index 8d16d4c..36f67d5 100644 (file)
@@ -72,9 +72,7 @@ WebInspector.ProfileNodeTreeElement = class ProfileNodeTreeElement extends WebIn
         if (profileNode.functionName && profileNode.functionName.startsWith("on") && profileNode.functionName.length >= 5)
             className = WebInspector.CallFrameView.EventListenerIconStyleClassName;
 
-        var hasChildren = !!profileNode.childNodes.length;
-
-        super([className], title, subtitle, profileNode, hasChildren);
+        super([className], title, subtitle, profileNode, {hasChildren: !!profileNode.childNodes.length});
 
         this._profileNode = profileNode;
         this._delegate = delegate || null;
index 50d4108..40e0f04 100644 (file)
@@ -29,7 +29,9 @@ WebInspector.ResourceTreeElement = class ResourceTreeElement extends WebInspecto
     {
         console.assert(resource instanceof WebInspector.Resource);
 
-        super(resource, ["resource", WebInspector.ResourceTreeElement.ResourceIconStyleClassName, resource.type], "", "", representedObject || resource, false);
+        const title = null;
+        const subtitle = null;
+        super(resource, ["resource", WebInspector.ResourceTreeElement.ResourceIconStyleClassName, resource.type], title, subtitle, representedObject || resource);
 
         this._updateResource(resource);
     }
index 6fceb44..ac467cc 100644 (file)
@@ -29,14 +29,16 @@ WebInspector.ScriptTreeElement = class ScriptTreeElement extends WebInspector.So
     {
         console.assert(script instanceof WebInspector.Script);
 
-        super(script, "script", null, null, script, false);
+        const title = null;
+        const subtitle = null;
+        super(script, "script", title, subtitle);
 
         this.mainTitle = script.displayName;
 
         if (script.url && !script.dynamicallyAddedScriptElement) {
             // Show the host as the subtitle if it is different from the main title.
-            var subtitle = WebInspector.displayNameForHost(script.urlComponents.host);
-            this.subtitle = this.mainTitle !== subtitle ? subtitle : null;
+            let host = WebInspector.displayNameForHost(script.urlComponents.host);
+            this.subtitle = this.mainTitle !== host ? host : null;
 
             this.tooltip = script.url;
 
index 67cd473..d42134d 100644 (file)
@@ -30,8 +30,8 @@ WebInspector.SearchResultTreeElement = class SearchResultTreeElement extends Web
         console.assert(representedObject instanceof WebInspector.DOMSearchMatchObject || representedObject instanceof WebInspector.SourceCodeSearchMatchObject);
 
         var title = WebInspector.SearchResultTreeElement.truncateAndHighlightTitle(representedObject.title, representedObject.searchTerm, representedObject.sourceCodeTextRange);
-
-        super(representedObject.className, title, null, representedObject, false);
+        const subtitle = null;
+        super(representedObject.className, title, subtitle, representedObject);
     }
 
     // Static
index d02bcf8..8774925 100644 (file)
 
 WebInspector.SourceCodeTreeElement = class SourceCodeTreeElement extends WebInspector.FolderizedTreeElement
 {
-    constructor(sourceCode, classNames, title, subtitle, representedObject, hasChildren)
+    constructor(sourceCode, classNames, title, subtitle, representedObject)
     {
         console.assert(sourceCode instanceof WebInspector.SourceCode);
 
-        super(classNames, title, subtitle, representedObject || sourceCode, hasChildren);
+        super(classNames, title, subtitle, representedObject || sourceCode);
 
         this._updateSourceCode(sourceCode);
     }
index 08722a2..9005818 100644 (file)
@@ -25,7 +25,7 @@
 
 WebInspector.SourceMapResourceTreeElement = class SourceMapResourceTreeElement extends WebInspector.ResourceTreeElement
 {
-    constructor(sourceMapResource, representedObject)
+    constructor(sourceMapResource)
     {
         console.assert(sourceMapResource instanceof WebInspector.SourceMapResource);
 
index 934c79c..f02aea9 100644 (file)
@@ -27,7 +27,8 @@ WebInspector.StorageTreeElement = class StorageTreeElement extends WebInspector.
 {
     constructor(classNames, title, representedObject)
     {
-        super(classNames, title, null, representedObject, false);
+        const subtitle = null;
+        super(classNames, title, subtitle, representedObject);
 
         this.flattened = false;
     }
index b97825e..92ac0fd 100644 (file)
@@ -55,7 +55,7 @@ WebInspector.TimelineRecordTreeElement = class TimelineRecordTreeElement extends
         let iconStyleClass = WebInspector.TimelineTabContentView.iconClassNameForRecord(timelineRecord);
         let title = WebInspector.TimelineTabContentView.displayNameForRecord(timelineRecord);
 
-        super([iconStyleClass], title, subtitle, representedObject || timelineRecord, false);
+        super([iconStyleClass], title, subtitle, representedObject || timelineRecord);
 
         this._record = timelineRecord;
         this._sourceCodeLocation = sourceCodeLocation;
index f35a41a..75276a7 100644 (file)
 
 WebInspector.TreeElement = class TreeElement extends WebInspector.Object
 {
-    constructor(title, representedObject, hasChildren)
+    constructor(title, representedObject, options = {})
     {
         super();
 
         this._title = title;
-        this.representedObject = (representedObject || {});
+        this.representedObject = representedObject || {};
 
         if (this.representedObject.__treeElementIdentifier)
             this.identifier = this.representedObject.__treeElementIdentifier;
@@ -46,7 +46,7 @@ WebInspector.TreeElement = class TreeElement extends WebInspector.Object
         this._selectable = true;
         this.expanded = false;
         this.selected = false;
-        this.hasChildren = hasChildren;
+        this.hasChildren = options.hasChildren;
         this.children = [];
         this.treeOutline = null;
         this.parent = null;
index 082382b..02a7674 100644 (file)
@@ -27,7 +27,10 @@ WebInspector.TypeTreeElement = class TypeTreeElement extends WebInspector.Genera
 {
     constructor(name, structureDescription, isPrototype)
     {
-        super(null, null, null, structureDescription || null, false);
+        const classNames = null;
+        const title = null;
+        const subtitle = null;
+        super(classNames, title, subtitle, structureDescription || null);
 
         console.assert(!structureDescription || structureDescription instanceof WebInspector.StructureDescription);