Title: [201222] trunk/Source/WebInspectorUI
Revision
201222
Author
[email protected]
Date
2016-05-20 12:36:01 -0700 (Fri, 20 May 2016)

Log Message

Web Inspector: Split Console is auto opening all the time when using Inspect Element context menu
https://bugs.webkit.org/show_bug.cgi?id=157910
<rdar://problem/26374066>

Reviewed by Timothy Hatcher.

Currently, "synthetic" property is only used to decide whether adding a console message should
open the console or not. Replace it with "shouldRevealConsole".

* UserInterface/Controllers/DOMTreeManager.js:
(WebInspector.DOMTreeManager.prototype.inspectNodeObject.nodeAvailable):
(WebInspector.DOMTreeManager.prototype.inspectNodeObject):
* UserInterface/Controllers/_javascript_LogViewController.js:
(WebInspector._javascript_LogViewController.prototype.appendImmediateExecutionWithResult.saveResultCallback):
(WebInspector._javascript_LogViewController.prototype.appendImmediateExecutionWithResult):
(WebInspector._javascript_LogViewController.prototype.consolePromptTextCommitted.printResult):
(WebInspector._javascript_LogViewController.prototype.consolePromptTextCommitted):
(WebInspector._javascript_LogViewController.prototype._appendConsoleMessageView):
* UserInterface/Models/ConsoleCommandResultMessage.js:
(WebInspector.ConsoleCommandResultMessage):
(WebInspector.ConsoleCommandResultMessage.prototype.get shouldRevealConsole):
(WebInspector.ConsoleCommandResultMessage.prototype.get synthetic): Deleted.
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.node.shortestGCRootPath.):
(WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (201221 => 201222)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-05-20 19:13:03 UTC (rev 201221)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-05-20 19:36:01 UTC (rev 201222)
@@ -1,3 +1,31 @@
+2016-05-20  Nikita Vasilyev  <[email protected]>
+
+        Web Inspector: Split Console is auto opening all the time when using Inspect Element context menu
+        https://bugs.webkit.org/show_bug.cgi?id=157910
+        <rdar://problem/26374066>
+
+        Reviewed by Timothy Hatcher.
+
+        Currently, "synthetic" property is only used to decide whether adding a console message should
+        open the console or not. Replace it with "shouldRevealConsole".
+
+        * UserInterface/Controllers/DOMTreeManager.js:
+        (WebInspector.DOMTreeManager.prototype.inspectNodeObject.nodeAvailable):
+        (WebInspector.DOMTreeManager.prototype.inspectNodeObject):
+        * UserInterface/Controllers/_javascript_LogViewController.js:
+        (WebInspector._javascript_LogViewController.prototype.appendImmediateExecutionWithResult.saveResultCallback):
+        (WebInspector._javascript_LogViewController.prototype.appendImmediateExecutionWithResult):
+        (WebInspector._javascript_LogViewController.prototype.consolePromptTextCommitted.printResult):
+        (WebInspector._javascript_LogViewController.prototype.consolePromptTextCommitted):
+        (WebInspector._javascript_LogViewController.prototype._appendConsoleMessageView):
+        * UserInterface/Models/ConsoleCommandResultMessage.js:
+        (WebInspector.ConsoleCommandResultMessage):
+        (WebInspector.ConsoleCommandResultMessage.prototype.get shouldRevealConsole):
+        (WebInspector.ConsoleCommandResultMessage.prototype.get synthetic): Deleted.
+        * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
+        (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.node.shortestGCRootPath.):
+        (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
+
 2016-05-19  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Can't resume Debugger after breaking on exception in Promise

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js (201221 => 201222)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js	2016-05-20 19:13:03 UTC (rev 201221)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js	2016-05-20 19:36:01 UTC (rev 201222)
@@ -336,8 +336,8 @@
                 if (!remoteObject)
                     return;
                 let specialLogStyles = true;
-                let synthetic = true;
-                WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(WebInspector.UIString("Selected Element"), remoteObject, specialLogStyles, synthetic);
+                let shouldRevealConsole = false;
+                WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(WebInspector.UIString("Selected Element"), remoteObject, specialLogStyles, shouldRevealConsole);
             });
         }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/_javascript_LogViewController.js (201221 => 201222)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/_javascript_LogViewController.js	2016-05-20 19:13:03 UTC (rev 201221)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/_javascript_LogViewController.js	2016-05-20 19:36:01 UTC (rev 201222)
@@ -118,7 +118,7 @@
         consoleSession.element.scrollIntoView();
     }
 
-    appendImmediateExecutionWithResult(text, result, addSpecialUserLogClass, synthetic)
+    appendImmediateExecutionWithResult(text, result, addSpecialUserLogClass, shouldRevealConsole)
     {
         console.assert(result instanceof WebInspector.RemoteObject);
 
@@ -127,7 +127,7 @@
 
         function saveResultCallback(savedResultIndex)
         {
-            let commandResultMessage = new WebInspector.ConsoleCommandResultMessage(result, false, savedResultIndex, synthetic);
+            let commandResultMessage = new WebInspector.ConsoleCommandResultMessage(result, false, savedResultIndex, shouldRevealConsole);
             let commandResultMessageView = new WebInspector.ConsoleMessageView(commandResultMessage);
             this._appendConsoleMessageView(commandResultMessageView, true);
         }
@@ -225,8 +225,8 @@
             if (!result || this._cleared)
                 return;
 
-            let synthetic = false;
-            let commandResultMessage = new WebInspector.ConsoleCommandResultMessage(result, wasThrown, savedResultIndex, synthetic);
+            let shouldRevealConsole = true;
+            let commandResultMessage = new WebInspector.ConsoleCommandResultMessage(result, wasThrown, savedResultIndex, shouldRevealConsole);
             let commandResultMessageView = new WebInspector.ConsoleMessageView(commandResultMessage);
             this._appendConsoleMessageView(commandResultMessageView, true);
         }
@@ -269,9 +269,7 @@
         if (WebInspector.consoleContentView.visible)
             this.renderPendingMessagesSoon();
 
-        // We only auto show the console if the message is a non-synthetic result.
-        // This is when the user evaluated something directly in the prompt.
-        if (!WebInspector.isShowingConsoleTab() && messageView.message && (messageView.message.type === WebInspector.ConsoleMessage.MessageType.Result || messageView.message.synthetic))
+        if (!WebInspector.isShowingConsoleTab() && messageView.message && messageView.message.shouldRevealConsole)
             WebInspector.showSplitConsole();
     }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleCommandResultMessage.js (201221 => 201222)


--- trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleCommandResultMessage.js	2016-05-20 19:13:03 UTC (rev 201221)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleCommandResultMessage.js	2016-05-20 19:36:01 UTC (rev 201222)
@@ -29,7 +29,7 @@
 
 WebInspector.ConsoleCommandResultMessage = class ConsoleCommandResult extends WebInspector.ConsoleMessage
 {
-    constructor(result, wasThrown, savedResultIndex, synthetic)
+    constructor(result, wasThrown, savedResultIndex, shouldRevealConsole = true)
     {
         let source = WebInspector.ConsoleMessage.MessageSource.JS;
         let level = (wasThrown ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
@@ -38,7 +38,7 @@
         super(source, level, "", type, undefined, undefined, undefined, 0, [result], undefined, undefined);
 
         this._savedResultIndex = savedResultIndex;
-        this._synthetic = synthetic || false;
+        this._shouldRevealConsole = shouldRevealConsole;
 
         if (this._savedResultIndex && this._savedResultIndex > WebInspector.ConsoleCommandResultMessage.maximumSavedResultIndex)
             WebInspector.ConsoleCommandResultMessage.maximumSavedResultIndex = this._savedResultIndex;
@@ -58,9 +58,9 @@
         return this._savedResultIndex;
     }
 
-    get synthetic()
+    get shouldRevealConsole()
     {
-        return this._synthetic;
+        return this._shouldRevealConsole;
     }
 };
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js (201221 => 201222)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js	2016-05-20 19:13:03 UTC (rev 201221)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js	2016-05-20 19:36:01 UTC (rev 201222)
@@ -53,7 +53,7 @@
     static logHeapSnapshotNode(node)
     {
         let heapObjectIdentifier = node.id;
-        let synthetic = true;
+        let shouldRevealConsole = true;
         let text = WebInspector.UIString("Heap Snapshot Object (@%d)").format(heapObjectIdentifier);
 
         node.shortestGCRootPath((gcRootPath) => {
@@ -73,21 +73,19 @@
                         heapSnapshotRootPath = heapSnapshotRootPath.appendEdge(component);
                 }
 
-                if (!heapSnapshotRootPath.isFullPathImpossible()) {
-                    synthetic = false;
+                if (!heapSnapshotRootPath.isFullPathImpossible())
                     text = heapSnapshotRootPath.fullPath;
-                }
             }
 
             if (node.className === "string") {
                 HeapAgent.getPreview(heapObjectIdentifier, function(error, string, functionDetails, objectPreviewPayload) {
                     let remoteObject = error ? WebInspector.RemoteObject.fromPrimitiveValue(undefined) : WebInspector.RemoteObject.fromPrimitiveValue(string);
-                    WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, remoteObject, synthetic);
+                    WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, remoteObject, shouldRevealConsole);
                 });
             } else {
                 HeapAgent.getRemoteObject(heapObjectIdentifier, WebInspector.RuntimeManager.ConsoleObjectGroup, function(error, remoteObjectPayload) {
                     let remoteObject = error ? WebInspector.RemoteObject.fromPrimitiveValue(undefined) : WebInspector.RemoteObject.fromPayload(remoteObjectPayload);
-                    WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, remoteObject, synthetic);
+                    WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, remoteObject, shouldRevealConsole);
                 });
             }
         });
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to