Title: [184602] trunk
Revision
184602
Author
[email protected]
Date
2015-05-19 17:35:52 -0700 (Tue, 19 May 2015)

Log Message

Web Inspector: Improve Preview for NodeList / array like collections
https://bugs.webkit.org/show_bug.cgi?id=145177

Patch by Joseph Pecoraro <[email protected]> on 2015-05-19
Reviewed by Timothy Hatcher.

Source/_javascript_Core:

* inspector/InjectedScriptSource.js:
(InjectedScript.RemoteObject.prototype._appendPropertyPreviews):
For "array" like object previews skip over non-index properties.
We are not marking the object as lossless by choice, but we
may return to this decision later.

Source/WebInspectorUI:

* UserInterface/Views/ObjectPreviewView.js:
(WebInspector.ObjectPreviewView.prototype._appendPreview):
Show the class name for a non-basic-Array, but still hide
it for a basic Array.

LayoutTests:

* inspector/model/remote-object-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (184601 => 184602)


--- trunk/LayoutTests/ChangeLog	2015-05-19 23:59:27 UTC (rev 184601)
+++ trunk/LayoutTests/ChangeLog	2015-05-20 00:35:52 UTC (rev 184602)
@@ -1,3 +1,12 @@
+2015-05-19  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Improve Preview for NodeList / array like collections
+        https://bugs.webkit.org/show_bug.cgi?id=145177
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/model/remote-object-expected.txt:
+
 2015-05-19  Chris Dumez  <[email protected]>
 
         [Mac] Font lookups are flakey due to caching

Modified: trunk/LayoutTests/inspector/model/remote-object-expected.txt (184601 => 184602)


--- trunk/LayoutTests/inspector/model/remote-object-expected.txt	2015-05-19 23:59:27 UTC (rev 184601)
+++ trunk/LayoutTests/inspector/model/remote-object-expected.txt	2015-05-20 00:35:52 UTC (rev 184602)
@@ -1578,7 +1578,7 @@
     "_type": "object",
     "_subtype": "array",
     "_description": "Int32Array",
-    "_lossless": false,
+    "_lossless": true,
     "_overflow": false,
     "_size": 4,
     "_properties": [
@@ -1601,21 +1601,6 @@
         "_name": "3",
         "_type": "number",
         "_value": "0"
-      },
-      {
-        "_name": "byteOffset",
-        "_type": "number",
-        "_value": "0"
-      },
-      {
-        "_name": "byteLength",
-        "_type": "number",
-        "_value": "16"
-      },
-      {
-        "_name": "buffer",
-        "_type": "object",
-        "_value": "ArrayBuffer"
       }
     ],
     "_entries": null
@@ -1634,7 +1619,7 @@
     "_type": "object",
     "_subtype": "array",
     "_description": "Int32Array",
-    "_lossless": false,
+    "_lossless": true,
     "_overflow": false,
     "_size": 4,
     "_properties": [
@@ -1657,21 +1642,6 @@
         "_name": "3",
         "_type": "number",
         "_value": "3"
-      },
-      {
-        "_name": "byteOffset",
-        "_type": "number",
-        "_value": "0"
-      },
-      {
-        "_name": "byteLength",
-        "_type": "number",
-        "_value": "16"
-      },
-      {
-        "_name": "buffer",
-        "_type": "object",
-        "_value": "ArrayBuffer"
       }
     ],
     "_entries": null
@@ -2297,16 +2267,6 @@
         "_type": "object",
         "_subtype": "node",
         "_value": "script"
-      },
-      {
-        "_name": "item",
-        "_type": "function",
-        "_value": ""
-      },
-      {
-        "_name": "namedItem",
-        "_type": "function",
-        "_value": ""
       }
     ],
     "_entries": null
@@ -2346,16 +2306,6 @@
         "_type": "object",
         "_subtype": "node",
         "_value": "p.my-test"
-      },
-      {
-        "_name": "constructor",
-        "_type": "object",
-        "_value": "NodeListConstructor"
-      },
-      {
-        "_name": "item",
-        "_type": "function",
-        "_value": ""
       }
     ],
     "_entries": null
@@ -2395,16 +2345,6 @@
         "_type": "object",
         "_subtype": "node",
         "_value": "p.my-test"
-      },
-      {
-        "_name": "constructor",
-        "_type": "object",
-        "_value": "NodeListConstructor"
-      },
-      {
-        "_name": "item",
-        "_type": "function",
-        "_value": ""
       }
     ],
     "_entries": null

Modified: trunk/Source/_javascript_Core/ChangeLog (184601 => 184602)


--- trunk/Source/_javascript_Core/ChangeLog	2015-05-19 23:59:27 UTC (rev 184601)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-05-20 00:35:52 UTC (rev 184602)
@@ -1,3 +1,16 @@
+2015-05-19  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Improve Preview for NodeList / array like collections
+        https://bugs.webkit.org/show_bug.cgi?id=145177
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/InjectedScriptSource.js:
+        (InjectedScript.RemoteObject.prototype._appendPropertyPreviews):
+        For "array" like object previews skip over non-index properties.
+        We are not marking the object as lossless by choice, but we
+        may return to this decision later.
+
 2015-05-19  Michael Saboff  <[email protected]>
 
         REGRESSION(183787): JIT is enabled for all builds

Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js (184601 => 184602)


--- trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js	2015-05-19 23:59:27 UTC (rev 184601)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js	2015-05-20 00:35:52 UTC (rev 184602)
@@ -1053,12 +1053,12 @@
             if (name === "__proto__")
                 continue;
 
-            // Do not show "length" on array like objects in preview.
-            if (this.subtype === "array" && name === "length")
+            // For arrays, only allow indexes.
+            if (this.subtype === "array" && !isUInt32(name))
                 continue;
 
             // Do not show non-enumerable non-own properties. Special case to allow array indexes that may be on the prototype.
-            if (!descriptor.enumerable && !descriptor.isOwn && !(this.subtype === "array" && isUInt32(name)))
+            if (!descriptor.enumerable && !descriptor.isOwn && this.subtype !== "array")
                 continue;
 
             // If we have a filter, only show properties in the filter.

Modified: trunk/Source/WebInspectorUI/ChangeLog (184601 => 184602)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-05-19 23:59:27 UTC (rev 184601)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-05-20 00:35:52 UTC (rev 184602)
@@ -1,3 +1,15 @@
+2015-05-19  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Improve Preview for NodeList / array like collections
+        https://bugs.webkit.org/show_bug.cgi?id=145177
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/ObjectPreviewView.js:
+        (WebInspector.ObjectPreviewView.prototype._appendPreview):
+        Show the class name for a non-basic-Array, but still hide
+        it for a basic Array.
+
 2015-05-19  Nikita Vasilyev  <[email protected]>
 
         Web Inspector: Convert stackTrace from raw payload data to an array of CallFrames

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js (184601 => 184602)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js	2015-05-19 23:59:27 UTC (rev 184601)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js	2015-05-20 00:35:52 UTC (rev 184602)
@@ -125,8 +125,8 @@
             if (preview.subtype === "regexp" || preview.subtype === "null") {
                 // Display null / regexps as simple formatted values.
                 displayObjectAsValue = true;
-            }  else if (preview.subtype !== "array" && preview.description !== "Object") {
-                // Class names for other non-array / non-basic-Object types.
+            } 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.
                 var nameElement = element.appendChild(document.createElement("span"));
                 nameElement.className = "object-preview-name";
                 nameElement.textContent = preview.description + " ";
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to