Title: [125165] trunk
Revision
125165
Author
[email protected]
Date
2012-08-09 05:08:49 -0700 (Thu, 09 Aug 2012)

Log Message

Web Inspector: improve large array logging experience
https://bugs.webkit.org/show_bug.cgi?id=93499

Reviewed by Vsevolod Vlasov.

Source/WebCore:

Group elements in chunks of 100, not smaller.

* inspector/front-end/ObjectPropertiesSection.js:
(WebInspector.FunctionScopeMainTreeElement):
(WebInspector.FunctionScopeMainTreeElement.prototype.onpopulate):
(WebInspector.ArrayGroupingTreeElement._populateRanges):

LayoutTests:

* inspector/console/console-big-array-expected.txt:
* inspector/console/console-big-array.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (125164 => 125165)


--- trunk/LayoutTests/ChangeLog	2012-08-09 11:34:52 UTC (rev 125164)
+++ trunk/LayoutTests/ChangeLog	2012-08-09 12:08:49 UTC (rev 125165)
@@ -1,3 +1,13 @@
+2012-08-09  Pavel Feldman  <[email protected]>
+
+        Web Inspector: improve large array logging experience
+        https://bugs.webkit.org/show_bug.cgi?id=93499
+
+        Reviewed by Vsevolod Vlasov.
+
+        * inspector/console/console-big-array-expected.txt:
+        * inspector/console/console-big-array.html:
+
 2012-08-09  MORITA Hajime  <[email protected]>
 
         DOMCharacterDataModified should not be fired inside shadows

Modified: trunk/LayoutTests/inspector/console/console-big-array-expected.txt (125164 => 125165)


--- trunk/LayoutTests/inspector/console/console-big-array-expected.txt	2012-08-09 11:34:52 UTC (rev 125164)
+++ trunk/LayoutTests/inspector/console/console-big-array-expected.txt	2012-08-09 12:08:49 UTC (rev 125165)
@@ -1,40 +1,55 @@
-CONSOLE MESSAGE: line 13: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100
+CONSOLE MESSAGE: line 13: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100
 CONSOLE MESSAGE: line 19: 0,1,2,3,4,5,6,7,8,9,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100
 Tests that console logging dumps large arrays properly.
 
 
 
 Array[101]
-    [0 … 4]
+    [0 … 19]
     0: 0
     1: 1
     2: 2
     3: 3
     4: 4
-    [5 … 9]
     5: 5
     6: 6
     7: 7
     8: 8
     9: 9
-    [10 … 14]
     10: 10
     11: 11
     12: 12
     13: 13
     14: 14
-    [15 … 19]
     15: 15
     16: 16
     17: 17
     18: 18
     19: 19
-    [20 … 24]
+    [20 … 39]
     20: 20
     21: 21
     22: 22
     23: 23
     24: 24
+    25: 25
+    26: 26
+    27: 27
+    28: 28
+    29: 29
+    30: 30
+    31: 31
+    32: 32
+    33: 33
+    34: 34
+    35: 35
+    36: 36
+    37: 37
+    38: 38
+    39: 39
+    [40 … 100]
+    40: 40
+    41: 41
     100: 100
     length: 101
     __proto__: Array[0] console-big-array.html:13

Modified: trunk/LayoutTests/inspector/console/console-big-array.html (125164 => 125165)


--- trunk/LayoutTests/inspector/console/console-big-array.html	2012-08-09 11:34:52 UTC (rev 125164)
+++ trunk/LayoutTests/inspector/console/console-big-array.html	2012-08-09 12:08:49 UTC (rev 125165)
@@ -7,7 +7,7 @@
 function onload()
 {
     var a = [];
-    for (var i = 0; i < 25; ++i)
+    for (var i = 0; i < 42; ++i)
         a[i] = i;
     a[100] = 100;
     console.dir(a);
@@ -23,6 +23,8 @@
 
 function test()
 {
+    WebInspector.ArrayGroupingTreeElement._bucketThreshold = 20;
+
     var messages = WebInspector.console.messages;
     var sections = [];
     for (var i = 0; i < messages.length; ++i) {
@@ -42,7 +44,7 @@
     var populated = false;
     function populateCalled()
     {
-        populated = this._toIndex === 24;
+        populated = this._toIndex == 100;
     }
 
     InspectorTest.runAfterPendingDispatches(expandRecursively);

Modified: trunk/Source/WebCore/ChangeLog (125164 => 125165)


--- trunk/Source/WebCore/ChangeLog	2012-08-09 11:34:52 UTC (rev 125164)
+++ trunk/Source/WebCore/ChangeLog	2012-08-09 12:08:49 UTC (rev 125165)
@@ -1,3 +1,17 @@
+2012-08-09  Pavel Feldman  <[email protected]>
+
+        Web Inspector: improve large array logging experience
+        https://bugs.webkit.org/show_bug.cgi?id=93499
+
+        Reviewed by Vsevolod Vlasov.
+
+        Group elements in chunks of 100, not smaller. 
+
+        * inspector/front-end/ObjectPropertiesSection.js:
+        (WebInspector.FunctionScopeMainTreeElement):
+        (WebInspector.FunctionScopeMainTreeElement.prototype.onpopulate):
+        (WebInspector.ArrayGroupingTreeElement._populateRanges):
+
 2012-08-09  MORITA Hajime  <[email protected]>
 
         DOMCharacterDataModified should not be fired inside shadows

Modified: trunk/Source/WebCore/inspector/front-end/ObjectPropertiesSection.js (125164 => 125165)


--- trunk/Source/WebCore/inspector/front-end/ObjectPropertiesSection.js	2012-08-09 11:34:52 UTC (rev 125164)
+++ trunk/Source/WebCore/inspector/front-end/ObjectPropertiesSection.js	2012-08-09 12:08:49 UTC (rev 125165)
@@ -551,7 +551,6 @@
 
         }
         DebuggerAgent.getFunctionDetails(this._remoteObject.objectId, didGetDetails.bind(this));
-
     }
 };
 
@@ -600,7 +599,7 @@
     this._populated = false;
 }
 
-WebInspector.ArrayGroupingTreeElement._bucketThreshold = 20;
+WebInspector.ArrayGroupingTreeElement._bucketThreshold = 100;
 
 /**
  * @param {TreeElement|TreeOutline} treeElement
@@ -639,14 +638,11 @@
                 ++count;
         }
 
-        var bucketSize;
-        if (count < bucketThreshold)
+        var bucketSize = count;
+        if (count <= bucketThreshold)
             bucketSize = count;
-        else {
-            bucketSize = Math.ceil(count / bucketThreshold);
-            if (bucketSize < bucketThreshold)
-                bucketSize = Math.floor(Math.sqrt(count));
-        }
+        else
+            bucketSize = Math.pow(bucketThreshold, Math.floor(Math.log(count) / Math.log(bucketThreshold)));
 
         var ranges = [];
         count = 0;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to