Title: [125284] trunk
Revision
125284
Author
[email protected]
Date
2012-08-10 08:42:23 -0700 (Fri, 10 Aug 2012)

Log Message

Web Inspector: render arrays as dir in case they were logged into console prior to the front-end opening.
https://bugs.webkit.org/show_bug.cgi?id=93713

Reviewed by Vsevolod Vlasov.

Source/WebCore:

Dumping potentially outdated arrays using the "dir" representation.

* inspector/front-end/ConsoleMessage.js:
(WebInspector.ConsoleMessageImpl):
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsArray):
(WebInspector.ConsoleMessageImpl.prototype.clone):
* inspector/front-end/ConsoleModel.js:
(WebInspector.ConsoleModel.prototype.enableAgent.callback):
(WebInspector.ConsoleModel.prototype.enablingConsole):
(WebInspector.ConsoleMessage.create):
(WebInspector.ConsoleDispatcher.prototype.messageAdded):
* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleMessage.create):

LayoutTests:

* inspector/console/console-dirxml-expected.txt:
* inspector/console/console-external-array-expected.txt:
* inspector/console/console-format-collections-expected.txt:
* inspector/console/console-format-expected.txt:
* inspector/console/console-format.html:
* inspector/console/console-tests-expected.txt:
* platform/chromium/inspector/console/console-format-collections-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (125283 => 125284)


--- trunk/LayoutTests/ChangeLog	2012-08-10 15:36:47 UTC (rev 125283)
+++ trunk/LayoutTests/ChangeLog	2012-08-10 15:42:23 UTC (rev 125284)
@@ -1,3 +1,18 @@
+2012-08-10  Pavel Feldman  <[email protected]>
+
+        Web Inspector: render arrays as dir in case they were logged into console prior to the front-end opening.
+        https://bugs.webkit.org/show_bug.cgi?id=93713
+
+        Reviewed by Vsevolod Vlasov.
+
+        * inspector/console/console-dirxml-expected.txt:
+        * inspector/console/console-external-array-expected.txt:
+        * inspector/console/console-format-collections-expected.txt:
+        * inspector/console/console-format-expected.txt:
+        * inspector/console/console-format.html:
+        * inspector/console/console-tests-expected.txt:
+        * platform/chromium/inspector/console/console-format-collections-expected.txt:
+
 2012-08-10  Jon Lee  <[email protected]>
 
         Change Notification.permissionLevel() to Notification.permission

Modified: trunk/LayoutTests/inspector/console/console-dirxml-expected.txt (125283 => 125284)


--- trunk/LayoutTests/inspector/console/console-dirxml-expected.txt	2012-08-10 15:36:47 UTC (rev 125283)
+++ trunk/LayoutTests/inspector/console/console-dirxml-expected.txt	2012-08-10 15:42:23 UTC (rev 125284)
@@ -7,5 +7,5 @@
 #document console-dirxml.html:12
 #document-fragment console-dirxml.html:13
 <p></p> console-dirxml.html:14
-[<p></p>] console-dirxml.html:15
+Array[1] console-dirxml.html:15
 

Modified: trunk/LayoutTests/inspector/console/console-external-array-expected.txt (125283 => 125284)


--- trunk/LayoutTests/inspector/console/console-external-array-expected.txt	2012-08-10 15:36:47 UTC (rev 125283)
+++ trunk/LayoutTests/inspector/console/console-external-array-expected.txt	2012-08-10 15:42:23 UTC (rev 125284)
@@ -16,14 +16,14 @@
 CONSOLE MESSAGE: line 25: [object Float64Array]
 Tests that console logging detects external arrays as arrays.
 
-[0, 0, 0, 0, 0, 0, 0, 0, 0, 0] console-external-array.html:9
-[0, 0, 0, 0, 0, 0, 0, 0, 0, 0] console-external-array.html:10
-[0, 0, 0, 0, 0, 0, 0, 0, 0, 0] console-external-array.html:11
-[0, 0, 0, 0, 0, 0, 0, 0, 0, 0] console-external-array.html:12
-[0, 0, 0, 0, 0, 0, 0, 0, 0, 0] console-external-array.html:13
-[0, 0, 0, 0, 0, 0, 0, 0, 0, 0] console-external-array.html:14
-[0, 0, 0, 0, 0, 0, 0, 0, 0, 0] console-external-array.html:15
-[0, 0, 0, 0, 0, 0, 0, 0, 0, 0] console-external-array.html:16
+Int8Array[10] console-external-array.html:9
+Int16Array[10] console-external-array.html:10
+Int32Array[10] console-external-array.html:11
+Uint8Array[10] console-external-array.html:12
+Uint16Array[10] console-external-array.html:13
+Uint32Array[10] console-external-array.html:14
+Float32Array[10] console-external-array.html:15
+Float64Array[10] console-external-array.html:16
 Int8Array[10] console-external-array.html:18
 Int16Array[10] console-external-array.html:19
 Int32Array[10] console-external-array.html:20

Modified: trunk/LayoutTests/inspector/console/console-format-collections-expected.txt (125283 => 125284)


--- trunk/LayoutTests/inspector/console/console-format-collections-expected.txt	2012-08-10 15:36:47 UTC (rev 125283)
+++ trunk/LayoutTests/inspector/console/console-format-collections-expected.txt	2012-08-10 15:42:23 UTC (rev 125284)
@@ -18,17 +18,15 @@
 CONSOLE MESSAGE: line 51: [object Arguments]
 Tests that console nicely formats HTML Collections and NodeLists.
 
-[<select id="sel" name="sel">…</select>] console-format-collections.html:15
-[<script src="" <script src="" <script>…</script>] console-format-collections.html:19
-[<option value="1">one</option>, <option value="2">two</option>] console-format-collections.html:23
-[<html>…</html>, <head>…</head>, <script src="" <script src="" <script>…</script>, <body _onload_="onload()">…</body>, <p>
-Tests that console nicely formats HTML Collections and NodeLists.
-</p>, <div style="display:none">…</div>, <form id="f">…</form>, <select id="sel" name="sel">…</select>, <option value="1">one</option>, <option value="2">two</option>, <input type="radio" name="x" value="x1">, <input type="radio" name="x" value="x2">] console-format-collections.html:27
-[<select id="sel" name="sel">…</select>, <input type="radio" name="x" value="x1">, <input type="radio" name="x" value="x2">] console-format-collections.html:31
-[<input type="radio" name="x" value="x1">, <input type="radio" name="x" value="x2">] console-format-collections.html:35
-[1, Array[2]] console-format-collections.html:41
+NodeList[1] console-format-collections.html:15
+HTMLCollection[3] console-format-collections.html:19
+HTMLOptionsCollection[2] console-format-collections.html:23
+HTMLAllCollection[14] console-format-collections.html:27
+HTMLCollection[3] console-format-collections.html:31
+NodeList[2] console-format-collections.html:35
+Array[2] console-format-collections.html:41
 NonArrayWithLength console-format-collections.html:44
-[1, "2"] console-format-collections.html:51
+Arguments[2] console-format-collections.html:51
 [<select>] console-format-collections.html:15
  console-format-collections.html:19
 [<option>, <option>, selectedIndex: 0] console-format-collections.html:23

Modified: trunk/LayoutTests/inspector/console/console-format-expected.txt (125283 => 125284)


--- trunk/LayoutTests/inspector/console/console-format-expected.txt	2012-08-10 15:36:47 UTC (rev 125283)
+++ trunk/LayoutTests/inspector/console/console-format-expected.txt	2012-08-10 15:42:23 UTC (rev 125284)
@@ -46,13 +46,15 @@
 CONSOLE MESSAGE: line 55: Infinity
 CONSOLE MESSAGE: line 54: -Infinity
 CONSOLE MESSAGE: line 55: -Infinity
+CONSOLE MESSAGE: line 54: test,test2,,,test4,,,,,
+CONSOLE MESSAGE: line 55: test,test2,,,test4,,,,,
 Tests that console logging dumps proper messages.
 
 Message format number 1, 2 and 3.5 console-format.html:12
 Message format for string console-format.html:13
 Object Object console-format.html:14
-["test", "test2", undefined × 2, "test4", undefined × 5] console-format.html:20
-["test", "test2", undefined × 2, "test4", undefined × 5] console-format.html:21
+Array[10] console-format.html:20
+Array[10] console-format.html:21
 Array[10] console-format.html:22
 /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i console-format.html:54
 [/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\…?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i] console-format.html:55
@@ -136,4 +138,8 @@
 [-Infinity] console-format.html:55
 globals[18]
 -Infinity
+["test", "test2", 4: "test4", foo: Object] console-format.html:54
+[Array[10]] console-format.html:55
+globals[19]
+["test", "test2", undefined × 2, "test4", undefined × 5]
 

Modified: trunk/LayoutTests/inspector/console/console-format.html (125283 => 125284)


--- trunk/LayoutTests/inspector/console/console-format.html	2012-08-10 15:36:47 UTC (rev 125283)
+++ trunk/LayoutTests/inspector/console/console-format.html	2012-08-10 15:42:23 UTC (rev 125284)
@@ -43,7 +43,7 @@
     globals = [
         regex1, regex2, str, str2, error, node, func, multilinefunc, num, linkify,
         null, undefined, valuelessAttribute, valuedAttribute, existingAttribute, throwingLengthGetter,
-        NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY
+        NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, array
     ];
 
     runTest();

Modified: trunk/LayoutTests/inspector/console/console-tests-expected.txt (125283 => 125284)


--- trunk/LayoutTests/inspector/console/console-tests-expected.txt	2012-08-10 15:36:47 UTC (rev 125283)
+++ trunk/LayoutTests/inspector/console/console-tests-expected.txt	2012-08-10 15:42:23 UTC (rev 125284)
@@ -41,6 +41,6 @@
 #document console-tests.html:27 console-message console-log-level
 function () { } console-tests.html:28 console-message console-log-level
 function f() { } console-tests.html:29 console-message console-log-level
-[1, 2, 3] console-tests.html:30 console-message console-log-level
+Array[3] console-tests.html:30 console-message console-log-level
 /regexp.*/ console-tests.html:31 console-message console-log-level
 

Modified: trunk/LayoutTests/platform/chromium/inspector/console/console-format-collections-expected.txt (125283 => 125284)


--- trunk/LayoutTests/platform/chromium/inspector/console/console-format-collections-expected.txt	2012-08-10 15:36:47 UTC (rev 125283)
+++ trunk/LayoutTests/platform/chromium/inspector/console/console-format-collections-expected.txt	2012-08-10 15:42:23 UTC (rev 125284)
@@ -18,17 +18,15 @@
 CONSOLE MESSAGE: line 51: [object Arguments]
 Tests that console nicely formats HTML Collections and NodeLists.
 
-[<select id="sel" name="sel">…</select>] console-format-collections.html:15
-[<script src="" <script src="" <script>…</script>] console-format-collections.html:19
-[<option value="1">one</option>, <option value="2">two</option>] console-format-collections.html:23
-[<html>…</html>, <head>…</head>, <script src="" <script src="" <script>…</script>, <body _onload_="onload()">…</body>, <p>
-Tests that console nicely formats HTML Collections and NodeLists.
-</p>, <div style="display:none">…</div>, <form id="f">…</form>, <select id="sel" name="sel">…</select>, <option value="1">one</option>, <option value="2">two</option>, <input type="radio" name="x" value="x1">, <input type="radio" name="x" value="x2">] console-format-collections.html:27
-[<select id="sel" name="sel">…</select>, <input type="radio" name="x" value="x1">, <input type="radio" name="x" value="x2">] console-format-collections.html:31
-[<input type="radio" name="x" value="x1">, <input type="radio" name="x" value="x2">] console-format-collections.html:35
-[1, Array[2]] console-format-collections.html:41
+NodeList[1] console-format-collections.html:15
+HTMLCollection[3] console-format-collections.html:19
+HTMLOptionsCollection[2] console-format-collections.html:23
+HTMLAllCollection[14] console-format-collections.html:27
+HTMLCollection[3] console-format-collections.html:31
+NodeList[2] console-format-collections.html:35
+Array[2] console-format-collections.html:41
 NonArrayWithLength console-format-collections.html:44
-[1, "2"] console-format-collections.html:51
+Arguments[2] console-format-collections.html:51
 [<select>] console-format-collections.html:15
 [<script>, <script>, <script>] console-format-collections.html:19
 [<option>, <option>, selectedIndex: 0] console-format-collections.html:23

Modified: trunk/Source/WebCore/ChangeLog (125283 => 125284)


--- trunk/Source/WebCore/ChangeLog	2012-08-10 15:36:47 UTC (rev 125283)
+++ trunk/Source/WebCore/ChangeLog	2012-08-10 15:42:23 UTC (rev 125284)
@@ -1,3 +1,24 @@
+2012-08-10  Pavel Feldman  <[email protected]>
+
+        Web Inspector: render arrays as dir in case they were logged into console prior to the front-end opening.
+        https://bugs.webkit.org/show_bug.cgi?id=93713
+
+        Reviewed by Vsevolod Vlasov.
+
+        Dumping potentially outdated arrays using the "dir" representation.
+
+        * inspector/front-end/ConsoleMessage.js:
+        (WebInspector.ConsoleMessageImpl):
+        (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsArray):
+        (WebInspector.ConsoleMessageImpl.prototype.clone):
+        * inspector/front-end/ConsoleModel.js:
+        (WebInspector.ConsoleModel.prototype.enableAgent.callback):
+        (WebInspector.ConsoleModel.prototype.enablingConsole):
+        (WebInspector.ConsoleMessage.create):
+        (WebInspector.ConsoleDispatcher.prototype.messageAdded):
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleMessage.create):
+
 2012-08-10  Dana Jansens  <[email protected]>
 
         [chromium] Fix the colors in the debugging HUD

Modified: trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js (125283 => 125284)


--- trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js	2012-08-10 15:36:47 UTC (rev 125283)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js	2012-08-10 15:42:23 UTC (rev 125284)
@@ -43,8 +43,9 @@
  * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
  * @param {ConsoleAgent.StackTrace=} stackTrace
  * @param {WebInspector.NetworkRequest=} request
+ * @param {boolean=} isOutdated
  */
-WebInspector.ConsoleMessageImpl = function(source, level, message, linkifier, type, url, line, repeatCount, parameters, stackTrace, request)
+WebInspector.ConsoleMessageImpl = function(source, level, message, linkifier, type, url, line, repeatCount, parameters, stackTrace, request, isOutdated)
 {
     WebInspector.ConsoleMessage.call(this, source, level, url, line, repeatCount);
 
@@ -54,6 +55,7 @@
     this._parameters = parameters;
     this._stackTrace = stackTrace;
     this._request = request;
+    this._isOutdated = isOutdated;
 
     this._customFormatters = {
         "object": this._formatParameterAsObject,
@@ -361,7 +363,7 @@
         }
 
         const maxFlatArrayLength = 100;
-        if (array.arrayLength() > maxFlatArrayLength)
+        if (this._isOutdated || array.arrayLength() > maxFlatArrayLength)
             this._formatParameterAsObject(array, elem, false);
         else
             array.getOwnProperties(this._printArray.bind(this, array, elem));
@@ -713,7 +715,7 @@
      */
     clone: function()
     {
-        return WebInspector.ConsoleMessage.create(this.source, this.level, this._messageText, this.type, this.url, this.line, this.repeatCount, this._parameters, this._stackTrace, this._request);
+        return WebInspector.ConsoleMessage.create(this.source, this.level, this._messageText, this.type, this.url, this.line, this.repeatCount, this._parameters, this._stackTrace, this._request, this._isOutdated);
     }
 }
 

Modified: trunk/Source/WebCore/inspector/front-end/ConsoleModel.js (125283 => 125284)


--- trunk/Source/WebCore/inspector/front-end/ConsoleModel.js	2012-08-10 15:36:47 UTC (rev 125283)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleModel.js	2012-08-10 15:42:23 UTC (rev 125284)
@@ -53,10 +53,23 @@
         if (WebInspector.settings.monitoringXHREnabled.get())
             ConsoleAgent.setMonitoringXHREnabled(true);
 
-        ConsoleAgent.enable();
+        this._enablingConsole = true;
+        function callback()
+        {
+            delete this._enablingConsole;
+        }
+        ConsoleAgent.enable(callback.bind(this));
     },
 
     /**
+     * @return {boolean}
+     */
+    enablingConsole: function()
+    {
+        return !!this._enablingConsole;
+    },
+
+    /**
      * @param {WebInspector.ConsoleMessage} msg
      */
     addMessage: function(msg)
@@ -190,10 +203,10 @@
  * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
  * @param {ConsoleAgent.StackTrace=} stackTrace
  * @param {WebInspector.NetworkRequest=} request
- *
+ * @param {boolean=} isOutdated
  * @return {WebInspector.ConsoleMessage}
  */
-WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, repeatCount, parameters, stackTrace, request)
+WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, repeatCount, parameters, stackTrace, request, isOutdated)
 {
 }
 
@@ -254,7 +267,8 @@
             payload.repeatCount,
             payload.parameters,
             payload.stackTrace,
-            payload.networkRequestId ? WebInspector.networkRequestById(payload.networkRequestId) : undefined);
+            payload.networkRequestId ? WebInspector.networkRequestById(payload.networkRequestId) : undefined,
+            this._console._enablingConsole);
         this._console.addMessage(consoleMessage);
     },
 

Modified: trunk/Source/WebCore/inspector/front-end/ConsoleView.js (125283 => 125284)


--- trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2012-08-10 15:36:47 UTC (rev 125283)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2012-08-10 15:42:23 UTC (rev 125284)
@@ -954,7 +954,7 @@
  */
 WebInspector.consoleView = null;
 
-WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, repeatCount, parameters, stackTrace, request)
+WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, repeatCount, parameters, stackTrace, request, isOutdated)
 {
-    return new WebInspector.ConsoleMessageImpl(source, level, message, WebInspector.consoleView._linkifier, type, url, line, repeatCount, parameters, stackTrace, request);
+    return new WebInspector.ConsoleMessageImpl(source, level, message, WebInspector.consoleView._linkifier, type, url, line, repeatCount, parameters, stackTrace, request, isOutdated);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to