[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

pfeldman at chromium.org pfeldman at chromium.org
Thu Oct 29 20:47:25 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit bb499a98743c0dbab2d0d7034efb1bb3dcb1c3af
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 19 02:09:14 2009 +0000

    2009-10-18  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: Properties on Arrays and NodeLists are not logged correctly.
    
            https://bugs.webkit.org/show_bug.cgi?id=30485
    
    WebCore:
            * inspector/front-end/ConsoleView.js:
            (WebInspector.ConsoleView.prototype._formatarray):
            (WebInspector.ConsoleView.prototype._printArray):
    
    LayoutTests:
            * inspector/console-format-expected.txt:
            * inspector/console-format.html:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49762 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 42fa7d2..30f372e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -2,6 +2,18 @@
 
         Reviewed by Timothy Hatcher.
 
+        Web Inspector: Properties on Arrays and NodeLists are
+        not logged correctly.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30485
+
+        * inspector/console-format-expected.txt:
+        * inspector/console-format.html:
+
+2009-10-18  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
         Web Inspector: make console tests more granular.
 
         https://bugs.webkit.org/show_bug.cgi?id=30496
diff --git a/LayoutTests/inspector/console-dir.html b/LayoutTests/inspector/console-dir.html
index d8abf6d..6618ad4 100755
--- a/LayoutTests/inspector/console-dir.html
+++ b/LayoutTests/inspector/console-dir.html
@@ -31,7 +31,7 @@ function dumpMessages()
 {
     var result = [];
     var messages = WebInspector.console.messages;
-    for (var i = 0; i &lt; messages.length; ++i)
+    for (var i = 0; i < messages.length; ++i)
         result.push(messages[i].toMessageElement().textContent.replace(/\u200b/g, ""));
     return result;
 }
diff --git a/LayoutTests/inspector/console-dirxml.html b/LayoutTests/inspector/console-dirxml.html
index 271a504..ebd6c4c 100755
--- a/LayoutTests/inspector/console-dirxml.html
+++ b/LayoutTests/inspector/console-dirxml.html
@@ -29,7 +29,7 @@ function dumpMessages()
 {
     var result = [];
     var messages = WebInspector.console.messages;
-    for (var i = 0; i &lt; messages.length; ++i)
+    for (var i = 0; i < messages.length; ++i)
         result.push(messages[i].toMessageElement().textContent.replace(/\u200b/g, ""));
     return result;
 }
diff --git a/LayoutTests/inspector/console-format-expected.txt b/LayoutTests/inspector/console-format-expected.txt
index b5da540..06361db 100644
--- a/LayoutTests/inspector/console-format-expected.txt
+++ b/LayoutTests/inspector/console-format-expected.txt
@@ -1,9 +1,11 @@
 CONSOLE MESSAGE: line 8: Message format number %i, %d and %f
 CONSOLE MESSAGE: line 9: Message %s for %s
 CONSOLE MESSAGE: line 10: Object %o
+CONSOLE MESSAGE: line 15: test,test2,,,test4
 Tests that console logging dumps proper messages.
 
 console-format.html:8Message format number 1, 2 and 3.5
 console-format.html:9Message format for string
 console-format.html:10Object Object
+console-format.html:15["test", "test2", undefined, undefined, "test4"]
 
diff --git a/LayoutTests/inspector/console-format.html b/LayoutTests/inspector/console-format.html
index b83cf6a..69e534f 100755
--- a/LayoutTests/inspector/console-format.html
+++ b/LayoutTests/inspector/console-format.html
@@ -9,13 +9,18 @@ function doit()
     console.log('Message %s for %s', 'format', 'string');
     console.log('Object %o', {'foo' : 'bar' });
 
+    var array = ["test", "test2"];
+    array.foo = "bar";
+    array[4] = "test4";
+    console.log(array);
+
     function callback(result)
     {
         for (var i = 0; i < result.length; ++i)
             output(result[i]);
         notifyDone();
     }
-    evaluateInWebInspector("dumpMessages()", callback);
+    evaluateInWebInspector("dumpMessages", callback);
 }
 
 </script>
@@ -27,13 +32,18 @@ Tests that console logging dumps proper messages.
 </p>
 
 <div id="frontend-script" style="display:none">
-function dumpMessages()
+function dumpMessages(testController)
 {
-    var result = [];
-    var messages = WebInspector.console.messages;
-    for (var i = 0; i &lt; messages.length; ++i)
-        result.push(messages[i].toMessageElement().textContent.replace(/\u200b/g, ""));
-    return result;
+    // Array formatting is deferred due to the async InjectedScriptAccess.getProperties call.
+    // Queue message log dump in order to see proper result.
+    testController.waitUntilDone();
+    setTimeout(function() {
+        var result = [];
+        var messages = WebInspector.console.messages;
+        for (var i = 0; i < messages.length; ++i)
+            result.push(messages[i].toMessageElement().textContent);
+        testController.notifyDone(result);
+    }, 0);
 }
 </div>
 
diff --git a/LayoutTests/inspector/console-tests.html b/LayoutTests/inspector/console-tests.html
index d0e7a98..7fc1494 100755
--- a/LayoutTests/inspector/console-tests.html
+++ b/LayoutTests/inspector/console-tests.html
@@ -41,7 +41,7 @@ function dumpMessages()
 {
     var result = [];
     var messages = WebInspector.console.messages;
-    for (var i = 0; i &lt; messages.length; ++i) {
+    for (var i = 0; i < messages.length; ++i) {
         var element = messages[i].toMessageElement();
         result.push({ text: element.textContent.replace(/\u200b/g, ""), clazz: element.getAttribute("class")});
     }
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 65edf36..2d0d76b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,17 @@
 2009-10-18  Pavel Feldman  <pfeldman at chromium.org>
 
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Properties on Arrays and NodeLists are not logged correctly.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30485
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype._formatarray):
+        (WebInspector.ConsoleView.prototype._printArray):
+
+2009-10-18  Pavel Feldman  <pfeldman at chromium.org>
+
         Not reviewed: touching WebCore so that it
         initiated inspector frontend deployment on Windows.
 
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index 1dd3a71..f6c2d46 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -224,7 +224,6 @@ void InspectorDOMAgent::unbind(Node* node, NodeToIdMap* nodesMap)
     int id = nodesMap->get(node);
     if (!id)
         return;
-
     m_idToNode.remove(id);
     nodesMap->remove(node);
     bool childrenRequested = m_childrenRequested.contains(id);
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 8068ad4..780e8a9 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -504,21 +504,31 @@ WebInspector.ConsoleView.prototype = {
 
     _formatarray: function(arr, elem)
     {
-        var self = this;
-        function printResult(properties)
-        {
-            if (!properties)
-                return;
-            elem.appendChild(document.createTextNode("["));
-            for (var i = 0; i < properties.length; ++i) {
-                var property = properties[i].value;
-                elem.appendChild(self._format(property));
-                if (i < properties.length - 1)
-                    elem.appendChild(document.createTextNode(", "));
-            }
-            elem.appendChild(document.createTextNode("]"));
+        InjectedScriptAccess.getProperties(arr, false, this._printArray.bind(this, elem));
+    },
+
+    _printArray: function(elem, properties)
+    {
+        if (!properties)
+            return;
+        var elements = [];
+        for (var i = 0; i < properties.length; ++i) {
+            var name = properties[i].name;
+            if (name == parseInt(name))
+                elements[name] = this._format(properties[i].value);
+        }
+
+        elem.appendChild(document.createTextNode("["));
+        for (var i = 0; i < elements.length; ++i) {
+            var element = elements[i];
+            if (element)
+                elem.appendChild(element);
+            else
+                elem.appendChild(document.createTextNode("undefined"))
+            if (i < elements.length - 1)
+                elem.appendChild(document.createTextNode(", "));
         }
-        InjectedScriptAccess.getProperties(arr, false, printResult);
+        elem.appendChild(document.createTextNode("]"));
     },
 
     _formatnode: function(object, elem)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list