[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

yurys at chromium.org yurys at chromium.org
Wed Dec 22 16:37:47 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 804a1781aff0f3173a95b73ada0a37b566420d7c
Author: yurys at chromium.org <yurys at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 29 16:04:23 2010 +0000

    2010-11-29  Yury Semikhatsky  <yurys at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: display name of an object constructor as the object's type
            https://bugs.webkit.org/show_bug.cgi?id=50063
    
            Name of the function that has created given object is used as the object's
            type when it's displayed in the inspector front-end(in case of V8). Before
            this change, it was always a value of the object's constructor.name property
            which is confusing in some cases(see the test).
    
            Removed check for jsEngine from the InjectedScript.js, all VM-specific code
            is now encapsulated on the bindings layer.
    
            Test: inspector/console-object-constructor-name.html
    
            * bindings/js/JSInjectedScriptHostCustom.cpp:
            (WebCore::InjectedScriptHost::createInjectedScript):
            (WebCore::JSInjectedScriptHost::constructorName):
            * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
            (WebCore::InjectedScriptHost::createInjectedScript):
            (WebCore::V8InjectedScriptHost::constructorNameCallback):
            * inspector/InjectedScriptHost.idl:
            * inspector/front-end/InjectedScript.js:
            (injectedScriptConstructor.):
    
    2010-11-29  Yury Semikhatsky  <yurys at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: display name of an object constructor as the object's type
            https://bugs.webkit.org/show_bug.cgi?id=50063
    
            * inspector/console-object-constructor-name-expected.txt: Added.
            * inspector/console-object-constructor-name.html: Added.
            * inspector/extensions-events-expected.txt:
            * platform/chromium/inspector/console-object-constructor-name-expected.txt: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72800 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ad97530..365fb33 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-29  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: display name of an object constructor as the object's type
+        https://bugs.webkit.org/show_bug.cgi?id=50063
+
+        * inspector/console-object-constructor-name-expected.txt: Added.
+        * inspector/console-object-constructor-name.html: Added.
+        * inspector/extensions-events-expected.txt:
+        * platform/chromium/inspector/console-object-constructor-name-expected.txt: Added.
+
 2010-11-29  Philippe Normand  <pnormand at igalia.com>
 
         Unreviewed, skipping crashing test.
diff --git a/LayoutTests/inspector/console-object-constructor-name-expected.txt b/LayoutTests/inspector/console-object-constructor-name-expected.txt
new file mode 100644
index 0000000..727d0cb
--- /dev/null
+++ b/LayoutTests/inspector/console-object-constructor-name-expected.txt
@@ -0,0 +1,9 @@
+CONSOLE MESSAGE: line 11: [object Object]
+CONSOLE MESSAGE: line 12: [object Object]
+CONSOLE MESSAGE: line 13: [object Object]
+Tests that the name of the function invoked as object constructor will be displayed as its type in the front-end. Bug 50063.
+
+console-object-constructor-name.html:11Parent
+console-object-constructor-name.html:12Parent
+console-object-constructor-name.html:13Object
+
diff --git a/LayoutTests/inspector/console-object-constructor-name.html b/LayoutTests/inspector/console-object-constructor-name.html
new file mode 100644
index 0000000..6a065e0
--- /dev/null
+++ b/LayoutTests/inspector/console-object-constructor-name.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/console-tests2.js"></script>
+<script>
+
+function Parent() { }
+function Child() { }
+Child.prototype = new Parent();
+var outer = { inner: function() { } };
+console.log(new Parent());
+console.log(new Child());
+console.log(new outer.inner());
+
+function test()
+{
+    InspectorTest.expandConsoleMessages();
+    InspectorTest.dumpConsoleMessages();
+    InspectorTest.completeTest();
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that the name of the function invoked as object constructor will be displayed as its type in the front-end.
+<a href="https://bugs.webkit.org/show_bug.cgi?id=50063">Bug 50063.</a>
+</p>
+
+</body>
+</html>
diff --git a/LayoutTests/inspector/extensions-events-expected.txt b/LayoutTests/inspector/extensions-events-expected.txt
index 29be03a..7e4b560 100644
--- a/LayoutTests/inspector/extensions-events-expected.txt
+++ b/LayoutTests/inspector/extensions-events-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 669: [object HTMLParagraphElement]
+CONSOLE MESSAGE: line 658: [object HTMLParagraphElement]
 Tests WebInspector extension API
 
 Started extension.
diff --git a/LayoutTests/platform/chromium/inspector/console-object-constructor-name-expected.txt b/LayoutTests/platform/chromium/inspector/console-object-constructor-name-expected.txt
new file mode 100755
index 0000000..f97b6ff
--- /dev/null
+++ b/LayoutTests/platform/chromium/inspector/console-object-constructor-name-expected.txt
@@ -0,0 +1,8 @@
+CONSOLE MESSAGE: line 11: [object Object]
+CONSOLE MESSAGE: line 12: [object Object]
+CONSOLE MESSAGE: line 13: [object Object]
+Tests that the name of the function invoked as object constructor will be displayed as its type in the front-end. Bug 50063.
+
+console-object-constructor-name.html:11Parent
+console-object-constructor-name.html:12Child
+console-object-constructor-name.html:13outer.inner
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3eaf376..67bf376 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,30 @@
+2010-11-29  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: display name of an object constructor as the object's type
+        https://bugs.webkit.org/show_bug.cgi?id=50063
+
+        Name of the function that has created given object is used as the object's
+        type when it's displayed in the inspector front-end(in case of V8). Before
+        this change, it was always a value of the object's constructor.name property
+        which is confusing in some cases(see the test).
+
+        Removed check for jsEngine from the InjectedScript.js, all VM-specific code
+        is now encapsulated on the bindings layer.
+
+        Test: inspector/console-object-constructor-name.html
+
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        (WebCore::JSInjectedScriptHost::constructorName):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        (WebCore::V8InjectedScriptHost::constructorNameCallback):
+        * inspector/InjectedScriptHost.idl:
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor.):
+
 2010-11-29  Jeremy Moskovich  <jeremy at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
index 9cf4604..de72dea 100644
--- a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -95,7 +95,6 @@ ScriptObject InjectedScriptHost::createInjectedScript(const String& source, Scri
     args.append(toJS(scriptState, globalObject, this));
     args.append(globalThisValue);
     args.append(jsNumber(id));
-    args.append(jsString(scriptState, String("JSC")));
     JSValue result = JSC::call(scriptState, functionValue, callType, callData, globalThisValue, args);
     if (result.isObject())
         return ScriptObject(scriptState, result.getObject());
@@ -137,6 +136,15 @@ JSValue JSInjectedScriptHost::nodeForId(ExecState* exec)
     return toJS(exec, node);
 }
 
+JSValue JSInjectedScriptHost::internalConstructorName(ExecState* exec)
+{
+    if (exec->argumentCount() < 1)
+        return jsUndefined();
+
+    UString result = exec->argument(0).toThisObject(exec)->className();
+    return jsString(exec, result);
+}
+
 JSValue JSInjectedScriptHost::pushNodePathToFrontend(ExecState* exec)
 {
     if (exec->argumentCount() < 3)
diff --git a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
index b3007a4..81ad955 100644
--- a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -114,9 +114,8 @@ ScriptObject InjectedScriptHost::createInjectedScript(const String& scriptSource
       scriptHostWrapper,
       windowGlobal,
       v8::Number::New(id),
-      v8::String::New("v8")
     };
-    v8::Local<v8::Value> injectedScriptValue = v8::Function::Cast(*v)->Call(windowGlobal, 4, args);
+    v8::Local<v8::Value> injectedScriptValue = v8::Function::Cast(*v)->Call(windowGlobal, 3, args);
     v8::Local<v8::Object> injectedScript(v8::Object::Cast(*injectedScriptValue));
     return ScriptObject(inspectedScriptState, injectedScript);
 }
@@ -155,6 +154,18 @@ v8::Handle<v8::Value> V8InjectedScriptHost::nodeForIdCallback(const v8::Argument
     return toV8(node);
 }
 
+v8::Handle<v8::Value> V8InjectedScriptHost::internalConstructorNameCallback(const v8::Arguments& args)
+{
+    INC_STATS("InjectedScriptHost.internalConstructorName()");
+    if (args.Length() < 1)
+        return v8::Undefined();
+
+    if (!args[0]->IsObject())
+        return v8::Undefined();
+
+    return args[0]->ToObject()->GetConstructorName();
+}
+
 v8::Handle<v8::Value> V8InjectedScriptHost::pushNodePathToFrontendCallback(const v8::Arguments& args)
 {
     INC_STATS("InjectedScriptHost.pushNodePathToFrontend()");
diff --git a/WebCore/inspector/InjectedScriptHost.idl b/WebCore/inspector/InjectedScriptHost.idl
index 9b2ed6c..5fb57b4 100644
--- a/WebCore/inspector/InjectedScriptHost.idl
+++ b/WebCore/inspector/InjectedScriptHost.idl
@@ -38,6 +38,7 @@ module core {
         [Custom] DOMObject nodeForId(in long nodeId);
         [Custom] int pushNodePathToFrontend(in DOMObject node, in boolean withChildren, in boolean selectInUI);
         long inspectedNode(in unsigned long num);
+        [Custom] DOMObject internalConstructorName(in DOMObject object);
 
 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
         [Custom] DOMObject currentCallFrame();
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index fff6680..106668f 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -26,7 +26,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-var injectedScriptConstructor = (function (InjectedScriptHost, inspectedWindow, injectedScriptId, jsEngine) {
+var injectedScriptConstructor = (function (InjectedScriptHost, inspectedWindow, injectedScriptId) {
 
 var InjectedScript = function()
 {
@@ -427,9 +427,17 @@ InjectedScript.prototype = {
         switch (type) {
         case "object":
         case "node":
-            return this._className(obj);
+            var result = InjectedScriptHost.internalConstructorName(obj);
+            if (result === "Object") {
+                // In Chromium DOM wrapper prototypes will have Object as their constructor name,
+                // get the real DOM wrapper name from the constructor property.
+                var constructorName = obj.constructor && obj.constructor.name;
+                if (constructorName)
+                    return constructorName;
+            }
+            return result;
         case "array":
-            var className = this._className(obj);
+            var className = InjectedScriptHost.internalConstructorName(obj);
             if (typeof obj.length === "number")
                 className += "[" + obj.length + "]";
             return className;
@@ -455,25 +463,6 @@ InjectedScript.prototype = {
         return "" + obj;
     },
 
-    _className: function(obj)
-    {
-        // We can't use the same code for fetching class names of the dom bindings prototype chain.
-        // Both of the methods below result in "Object" names on the foreign engine bindings.
-        // I gave up and am using a check below to distinguish between the egine bingings.
-
-        if (jsEngine == "JSC") {
-            var str = inspectedWindow.Object ? inspectedWindow.Object.prototype.toString.call(obj) : this._toString(obj);
-            return str.replace(/^\[object (.*)\]$/i, "$1");
-        } else {
-            // V8
-            if (isFinite(obj.length) && typeof obj.callee === "function") {
-                // Arguments.constructor === Object in V8
-                return "Arguments";
-            }
-            return obj.constructor && obj.constructor.name || "Object";
-        }
-    },
-
     _logEvent: function(event)
     {
         console.log(event.type, event);
diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS
index 0dbf733..32c01f0 100644
--- a/WebKit/chromium/DEPS
+++ b/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
 
 vars = {
   'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
-  'chromium_rev': '67404'
+  'chromium_rev': '67532'
 }
 
 deps = {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list