Title: [181722] trunk/Source
Revision
181722
Author
[email protected]
Date
2015-03-18 20:26:55 -0700 (Wed, 18 Mar 2015)

Log Message

Web Inspector: Debugger Popovers and Probes should use FormattedValue/ObjectTreeView instead of Custom/ObjectPropertiesSection
https://bugs.webkit.org/show_bug.cgi?id=142830

Reviewed by Timothy Hatcher.

Source/_javascript_Core:

* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::breakpointActionProbe):
Give Probe Samples object previews.

Source/WebInspectorUI:

* UserInterface/Views/ProbeSetDataGrid.css:
(.details-section.probe-set .data-grid .object-tree > :matches(.title, .object-preview)::before):
Another line-height fix for object tree disclosure triangles.

* UserInterface/Views/ProbeSetDataGridNode.js:
(WebInspector.ProbeSetDataGridNode.prototype.createCellContent):
Create an ObjectTree / FormattedValue for the RemoteObject.

* UserInterface/Views/SourceCodeTextEditor.css:
(.popover .debugger-popover-content > .title):
(.popover .debugger-popover-content > .body):
(.popover .debugger-popover-content.function > .body):
Be more specific and don't accidentally style ".title" within the body.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForObject):
Show a properties only ObjectTree instead of an ObjectPropertiesSection.

(WebInspector.SourceCodeTextEditor.prototype._showPopoverForString): Deleted.
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForRegExp): Deleted.
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForNumber): Deleted.
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForBoolean): Deleted.
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForNull): Deleted.
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForUndefined): Deleted.
(WebInspector.SourceCodeTextEditor.prototype._showPopoverWithFormattedValue):
Reduce most of these to a single popover for formatted values.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (181721 => 181722)


--- trunk/Source/_javascript_Core/ChangeLog	2015-03-19 02:16:12 UTC (rev 181721)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-03-19 03:26:55 UTC (rev 181722)
@@ -1,3 +1,14 @@
+2015-03-18  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Debugger Popovers and Probes should use FormattedValue/ObjectTreeView instead of Custom/ObjectPropertiesSection
+        https://bugs.webkit.org/show_bug.cgi?id=142830
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/agents/InspectorDebuggerAgent.cpp:
+        (Inspector::InspectorDebuggerAgent::breakpointActionProbe):
+        Give Probe Samples object previews.
+
 2015-03-17  Ryuan Choi  <[email protected]>
 
         [EFL] Expose _javascript_ binding interface through ewk_extension

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp (181721 => 181722)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp	2015-03-19 02:16:12 UTC (rev 181721)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp	2015-03-19 03:26:55 UTC (rev 181722)
@@ -727,7 +727,7 @@
 void InspectorDebuggerAgent::breakpointActionProbe(JSC::ExecState* scriptState, const ScriptBreakpointAction& action, unsigned batchId, unsigned sampleId, const Deprecated::ScriptValue& sample)
 {
     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
-    RefPtr<Protocol::Runtime::RemoteObject> payload = injectedScript.wrapObject(sample, objectGroupForBreakpointAction(action));
+    RefPtr<Protocol::Runtime::RemoteObject> payload = injectedScript.wrapObject(sample, objectGroupForBreakpointAction(action), true);
     auto result = Protocol::Debugger::ProbeSample::create()
         .setProbeId(action.identifier)
         .setBatchId(batchId)

Modified: trunk/Source/WebInspectorUI/ChangeLog (181721 => 181722)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-03-19 02:16:12 UTC (rev 181721)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-03-19 03:26:55 UTC (rev 181722)
@@ -1,5 +1,39 @@
 2015-03-18  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: Debugger Popovers and Probes should use FormattedValue/ObjectTreeView instead of Custom/ObjectPropertiesSection
+        https://bugs.webkit.org/show_bug.cgi?id=142830
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/ProbeSetDataGrid.css:
+        (.details-section.probe-set .data-grid .object-tree > :matches(.title, .object-preview)::before):
+        Another line-height fix for object tree disclosure triangles.
+
+        * UserInterface/Views/ProbeSetDataGridNode.js:
+        (WebInspector.ProbeSetDataGridNode.prototype.createCellContent):
+        Create an ObjectTree / FormattedValue for the RemoteObject.
+
+        * UserInterface/Views/SourceCodeTextEditor.css:
+        (.popover .debugger-popover-content > .title):
+        (.popover .debugger-popover-content > .body):
+        (.popover .debugger-popover-content.function > .body):
+        Be more specific and don't accidentally style ".title" within the body.
+
+        * UserInterface/Views/SourceCodeTextEditor.js:
+        (WebInspector.SourceCodeTextEditor.prototype._showPopoverForObject):
+        Show a properties only ObjectTree instead of an ObjectPropertiesSection.
+
+        (WebInspector.SourceCodeTextEditor.prototype._showPopoverForString): Deleted.
+        (WebInspector.SourceCodeTextEditor.prototype._showPopoverForRegExp): Deleted.
+        (WebInspector.SourceCodeTextEditor.prototype._showPopoverForNumber): Deleted.
+        (WebInspector.SourceCodeTextEditor.prototype._showPopoverForBoolean): Deleted.
+        (WebInspector.SourceCodeTextEditor.prototype._showPopoverForNull): Deleted.
+        (WebInspector.SourceCodeTextEditor.prototype._showPopoverForUndefined): Deleted.
+        (WebInspector.SourceCodeTextEditor.prototype._showPopoverWithFormattedValue):
+        Reduce most of these to a single popover for formatted values.
+
+2015-03-18  Joseph Pecoraro  <[email protected]>
+
         Web Inspector: Scopes sidebar should use new ObjectTreeView and not ObjectPropertiesSection
         https://bugs.webkit.org/show_bug.cgi?id=142808
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.css (181721 => 181722)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.css	2015-03-19 02:16:12 UTC (rev 181721)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.css	2015-03-19 03:26:55 UTC (rev 181722)
@@ -85,3 +85,8 @@
 .details-section.probe-set .data-grid .section {
     left: -6px;
 }
+
+.details-section.probe-set .data-grid .object-tree > :matches(.title, .object-preview)::before {
+ /* The line-height inside a data-grid is 17px instead of 13px, this will center vertically on the top line. */
+    top: 2px;
+}

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGridNode.js (181721 => 181722)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGridNode.js	2015-03-19 02:16:12 UTC (rev 181721)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGridNode.js	2015-03-19 03:26:55 UTC (rev 181722)
@@ -85,22 +85,8 @@
             return sample;
         }
 
-        if (sample instanceof WebInspector.RemoteObject) {
-            switch (sample.type) {
-            case "function": // FIXME: is there a better way to visualize functions?
-            case "object":
-                return new WebInspector.ObjectPropertiesSection(sample, WebInspector.ProbeSet.SampleObjectTitle).element;
-            case "string":
-            case "number":
-            case "boolean":
-            case "undefined":
-            case "null":
-                return document.createTextNode(sample.value);
-            case "array":
-            // FIXME: reuse existing visualization of arrays here.
-            default: console.log("Don't know how to represent sample:", sample);
-            }
-        }
+        if (sample instanceof WebInspector.RemoteObject)
+            return WebInspector.FormattedValue.createObjectTreeOrFormattedValueForRemoteObject(sample, null);
 
         return sample;
     },

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css (181721 => 181722)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css	2015-03-19 02:16:12 UTC (rev 181721)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css	2015-03-19 03:26:55 UTC (rev 181722)
@@ -138,7 +138,7 @@
     min-height: 250px;
 }
 
-.popover .debugger-popover-content .title {
+.popover .debugger-popover-content > .title {
     font-weight: bold;
     padding-left: 10px;
 
@@ -147,14 +147,14 @@
     white-space: nowrap;
 }
 
-.popover .debugger-popover-content .body {
+.popover .debugger-popover-content > .body {
     border-top: 1px solid rgb(194, 194, 147);
     overflow: auto;
     margin-top: 5px;
     padding-top: 5px;
 }
 
-.popover .debugger-popover-content.function .body {
+.popover .debugger-popover-content.function > .body {
     padding-left: 10px;
     padding-right: 10px;
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js (181721 => 181722)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js	2015-03-19 02:16:12 UTC (rev 181721)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js	2015-03-19 03:26:55 UTC (rev 181722)
@@ -1391,22 +1391,17 @@
                 this._showPopoverForFunction(data);
                 break;
             case "object":
-                if (data.subtype === "regexp") 
-                    this._showPopoverForRegExp(data);
+                if (data.subtype === "null" || data.subtype === "regexp")
+                    this._showPopoverWithFormattedValue(data);
                 else
                     this._showPopoverForObject(data);
                 break;
             case "string":
-                this._showPopoverForString(data);
-                break;
             case "number":
-                this._showPopoverForNumber(data);
-                break;
             case "boolean":
-                this._showPopoverForBoolean(data);
-                break;
             case "undefined":
-                this._showPopoverForUndefined(data);
+            case "symbol":
+                this._showPopoverWithFormattedValue(data);
                 break;
             }
         }
@@ -1520,11 +1515,6 @@
 
     _showPopoverForObject: function(data)
     {
-        if (data.subtype === "null") {
-            this._showPopoverForNull(data);
-            return;
-        }
-
         var content = document.createElement("div");
         content.className = "object expandable";
 
@@ -1533,68 +1523,24 @@
         titleElement.textContent = data.description;
         content.appendChild(titleElement);
 
-        var section = new WebInspector.ObjectPropertiesSection(data);
-        section.expanded = true;
-        section.element.classList.add("body");
-        content.appendChild(section.element);
+        // FIXME: If this is a variable, it would be nice to put the variable name in the PropertyPath.
+        var objectTree = new WebInspector.ObjectTreeView(data, WebInspector.ObjectTreeView.Mode.Properties, null);
+        objectTree.showOnlyProperties();
+        objectTree.expand();
 
-        this._showPopover(content);
-    },
+        var bodyElement = content.appendChild(document.createElement("div"));
+        bodyElement.className = "body";
+        bodyElement.appendChild(objectTree.element);
 
-    _showPopoverForString: function(data)
-    {
-        var content = document.createElement("div");
-        content.className = "string formatted-string";
-        content.textContent = "\"" + data.description + "\"";
-
         this._showPopover(content);
     },
 
-    _showPopoverForRegExp: function(data)
+    _showPopoverWithFormattedValue: function(remoteObject)
     {
-        var content = document.createElement("div");
-        content.className = "regexp formatted-regexp";
-        content.textContent = data.description;
-
+        var content = WebInspector.FormattedValue.createElementForRemoteObject(remoteObject);
         this._showPopover(content);
     },
 
-    _showPopoverForNumber: function(data)
-    {
-        var content = document.createElement("span");
-        content.className = "number formatted-number";
-        content.textContent = data.description;
-
-        this._showPopover(content);
-    },
-
-    _showPopoverForBoolean: function(data)
-    {
-        var content = document.createElement("span");
-        content.className = "boolean formatted-boolean";
-        content.textContent = data.description;
-
-        this._showPopover(content);
-    },
-
-    _showPopoverForNull: function(data)
-    {
-        var content = document.createElement("span");
-        content.className = "boolean formatted-null";
-        content.textContent = data.description;
-
-        this._showPopover(content);
-    },
-
-    _showPopoverForUndefined: function(data)
-    {
-        var content = document.createElement("span");
-        content.className = "boolean formatted-undefined";
-        content.textContent = data.description;
-
-        this._showPopover(content);
-    },
-
     willDismissPopover: function(popover)
     {
         this.tokenTrackingController.removeHighlightedRange();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to