[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Wed Apr 7 23:20:23 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit bb77bafc1eeabae4af80eb17d41f7735e1867c0d
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 3 19:38:01 2009 +0000

    2009-11-03  Keishi Hattori  <casey.hattori at gmail.com>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: hover over JS "things" in source and see their values
            https://bugs.webkit.org/show_bug.cgi?id=30913
    
            * inspector/front-end/SourceFrame.js:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50472 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2419770..557a673 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,12 @@
+2009-11-03  Keishi Hattori  <casey.hattori at gmail.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: hover over JS "things" in source and see their values
+        https://bugs.webkit.org/show_bug.cgi?id=30913
+
+        * inspector/front-end/SourceFrame.js:
+
 2009-11-03  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index a01e1a5..00155fe 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -2053,7 +2053,9 @@ WebInspector.JavaScriptSourceSyntaxHighlighter = function(table, sourceFrame) {
         this.cursor += token.length;
         if (keywords.indexOf(token) === -1) {
             this.appendNonToken();
-            this.lineFragment.appendChild(this.createSpan(token, "webkit-javascript-ident"));
+            var identElement = this.createSpan(token, "webkit-javascript-ident");
+            identElement.addEventListener("mouseover", showDatatip, false);
+            this.lineFragment.appendChild(identElement);
             this.lexState = this.LexState.DivisionAllowed;
         } else {
             this.appendNonToken();
@@ -2062,6 +2064,37 @@ WebInspector.JavaScriptSourceSyntaxHighlighter = function(table, sourceFrame) {
         }
     }
     
+    function showDatatip(event) {
+        if (!WebInspector.panels.scripts || !WebInspector.panels.scripts.paused)
+            return;
+
+        var node = event.target;
+        var parts = [node.textContent];
+        while (node.previousSibling && node.previousSibling.textContent === ".") {
+            node = node.previousSibling.previousSibling;
+            if (!node || !node.hasStyleClass("webkit-javascript-ident"))
+                break;
+            parts.unshift(node.textContent);
+        }
+
+        var expression = parts.join(".");
+
+        WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, "console", callback);
+        function callback(result, exception)
+        {
+            if (exception)
+                return;
+            event.target.setAttribute("title", result.description);
+            event.target.addEventListener("mouseout", onmouseout, false);
+            
+            function onmouseout(event)
+            {
+                event.target.removeAttribute("title");
+                event.target.removeEventListener("mouseout", onmouseout, false);
+            }
+        }
+    }
+    
     function divPunctuatorAction(token)
     {
         this.cursor += token.length;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list