Title: [199322] trunk/Source/WebInspectorUI
Revision
199322
Author
[email protected]
Date
2016-04-11 16:47:13 -0700 (Mon, 11 Apr 2016)

Log Message

Web Inspector: Unstyled nodes in ObjectTree previews look poor
https://bugs.webkit.org/show_bug.cgi?id=156475
<rdar://problem/25667351>

Patch by Joseph Pecoraro <[email protected]> on 2016-04-11
Reviewed by Timothy Hatcher.

* UserInterface/Views/ObjectPreviewView.js:
(WebInspector.ObjectPreviewView.prototype._appendPreview):
Treat nodes as simple values.

(WebInspector.ObjectPreviewView.prototype._initTitleElement):
(WebInspector.ObjectPreviewView.prototype._appendValuePreview):
Format nodes nicely, and treat them as lossy since they have properties.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (199321 => 199322)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-04-11 23:46:07 UTC (rev 199321)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-04-11 23:47:13 UTC (rev 199322)
@@ -1,5 +1,21 @@
 2016-04-11  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: Unstyled nodes in ObjectTree previews look poor
+        https://bugs.webkit.org/show_bug.cgi?id=156475
+        <rdar://problem/25667351>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/ObjectPreviewView.js:
+        (WebInspector.ObjectPreviewView.prototype._appendPreview):
+        Treat nodes as simple values.
+
+        (WebInspector.ObjectPreviewView.prototype._initTitleElement):
+        (WebInspector.ObjectPreviewView.prototype._appendValuePreview):
+        Format nodes nicely, and treat them as lossy since they have properties.
+
+2016-04-11  Joseph Pecoraro  <[email protected]>
+
         Web Inspector: HeapSnapshot instance property path popover should include a descriptive header
         https://bugs.webkit.org/show_bug.cgi?id=156431
         <rdar://problem/25633594>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js (199321 => 199322)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js	2016-04-11 23:46:07 UTC (rev 199321)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js	2016-04-11 23:47:13 UTC (rev 199322)
@@ -109,6 +109,8 @@
         // Display null / regexps as simple formatted values even in title.
         if (this._preview.subtype === "regexp" || this._preview.subtype === "null")
             this._titleElement.appendChild(WebInspector.FormattedValue.createElementForObjectPreview(this._preview));
+        else if (this._preview.subtype === "node")
+            this._titleElement.appendChild(WebInspector.FormattedValue.createElementForNodePreview(this._preview));
         else
             this._titleElement.textContent = this._preview.description || "";
     }
@@ -122,8 +124,8 @@
     {
         var displayObjectAsValue = false;
         if (preview.type === "object") {
-            if (preview.subtype === "regexp" || preview.subtype === "null") {
-                // Display null / regexps as simple formatted values.
+            if (preview.subtype === "regexp" || preview.subtype === "null" || preview.subtype === "node") {
+                // Display null / regexps / nodes as simple formatted values.
                 displayObjectAsValue = true;
             } else if ((preview.subtype === "array" && preview.description !== "Array") || (preview.subtype !== "array" && preview.description !== "Object")) {
                 // Class names for other non-basic-Array / non-basic-Object types.
@@ -255,6 +257,11 @@
 
     _appendValuePreview(element, preview)
     {
+        if (preview.subtype === "node") {
+            element.appendChild(WebInspector.FormattedValue.createElementForNodePreview(preview));
+            return false;
+        }
+
         element.appendChild(WebInspector.FormattedValue.createElementForObjectPreview(preview));
         return true;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to