Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (183946 => 183947)
--- trunk/Source/WebInspectorUI/ChangeLog 2015-05-07 21:15:21 UTC (rev 183946)
+++ trunk/Source/WebInspectorUI/ChangeLog 2015-05-07 21:16:59 UTC (rev 183947)
@@ -1,5 +1,25 @@
2015-05-07 Joseph Pecoraro <[email protected]>
+ Web Inspector: Expanding Object with only __proto__ looks poor should have a label
+ https://bugs.webkit.org/show_bug.cgi?id=144755
+
+ Reviewed by Timothy Hatcher.
+
+ Better handle cases where expanding an object has only a __proto__
+ and no other properties.
+
+ * UserInterface/Views/ObjectTreePropertyTreeElement.js:
+ (WebInspector.ObjectTreePropertyTreeElement.mode.prototype.this.children.length):
+ (WebInspector.ObjectTreePropertyTreeElement):
+ * UserInterface/Views/ObjectTreeView.css:
+ (.object-tree-outline li .empty-message):
+ * UserInterface/Views/ObjectTreeView.js:
+ (WebInspector.ObjectTreeView.createEmptyMessageElement):
+ (WebInspector.ObjectTreeView.comparePropertyDescriptors):
+ (WebInspector.ObjectTreeView.prototype._updateProperties):
+
+2015-05-07 Joseph Pecoraro <[email protected]>
+
Web Inspector: Fix querySelector in ResourceContentView.js, caught by assertion
https://bugs.webkit.org/show_bug.cgi?id=144756
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js (183946 => 183947)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js 2015-05-07 21:15:21 UTC (rev 183946)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js 2015-05-07 21:16:59 UTC (rev 183947)
@@ -363,6 +363,7 @@
prototypeName = this._sanitizedPrototypeString(resolvedValue);
}
+ var hadProto = false;
for (var propertyDescriptor of properties) {
// FIXME: If this is a pure API ObjectTree, we should show the native getters.
// For now, just skip native binding getters in API mode, since we likely
@@ -377,11 +378,14 @@
this.appendChild(new WebInspector.ObjectTreePropertyTreeElement(propertyDescriptor, propertyPath, mode, prototypeName));
} else
this.appendChild(new WebInspector.ObjectTreePropertyTreeElement(propertyDescriptor, propertyPath, mode, prototypeName));
+
+ if (propertyDescriptor.name === "__proto__")
+ hadProto = true;
}
- if (!this.children.length) {
+ if (!this.children.length || (hadProto && this.children.length === 1)) {
var emptyMessageElement = WebInspector.ObjectTreeView.createEmptyMessageElement(WebInspector.UIString("No Properties."));
- this.appendChild(new WebInspector.TreeElement(emptyMessageElement, null, false));
+ this.insertChild(new WebInspector.TreeElement(emptyMessageElement, null, false), 0);
}
}
};
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css (183946 => 183947)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css 2015-05-07 21:15:21 UTC (rev 183946)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css 2015-05-07 21:16:59 UTC (rev 183947)
@@ -117,7 +117,7 @@
.object-tree-outline li .empty-message {
color: rgb(60%, 60%, 60%);
- margin-left: 7px;
+ margin-left: 15px;
font-family: -webkit-system-font, sans-serif;
font-size: 12px;
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js (183946 => 183947)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js 2015-05-07 21:15:21 UTC (rev 183946)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js 2015-05-07 21:16:59 UTC (rev 183947)
@@ -94,7 +94,7 @@
emptyMessageElement.className = "empty-message";
emptyMessageElement.textContent = message;
return emptyMessageElement;
- };
+ }
static comparePropertyDescriptors(propertyA, propertyB)
{
@@ -153,7 +153,7 @@
b = b.substring(chunkb.length);
}
return diff;
- };
+ }
// Public
@@ -289,6 +289,7 @@
var isArray = this._object.isArray();
var isPropertyMode = this._mode === WebInspector.ObjectTreeView.Mode.Properties;
+ var hadProto = false;
for (var propertyDescriptor of properties) {
if (isArray && isPropertyMode) {
if (propertyDescriptor.isIndexProperty())
@@ -297,11 +298,14 @@
this._outline.appendChild(new WebInspector.ObjectTreePropertyTreeElement(propertyDescriptor, propertyPath, this._mode));
} else
this._outline.appendChild(new WebInspector.ObjectTreePropertyTreeElement(propertyDescriptor, propertyPath, this._mode));
+
+ if (propertyDescriptor.name === "__proto__")
+ hadProto = true;
}
- if (!this._outline.children.length) {
+ if (!this._outline.children.length || (hadProto && this._outline.children.length === 1)) {
var emptyMessageElement = WebInspector.ObjectTreeView.createEmptyMessageElement(WebInspector.UIString("No Properties."));
- this._outline.appendChild(new WebInspector.TreeElement(emptyMessageElement, null, false));
+ this._outline.insertChild(new WebInspector.TreeElement(emptyMessageElement, null, false), 0);
}
}