Adds the file name and line number for call frames next to
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jun 2008 22:33:18 +0000 (22:33 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jun 2008 22:33:18 +0000 (22:33 +0000)
        the function name in the Call Stack pane.

        https://bugs.webkit.org/show_bug.cgi?id=19586

        Reviewed by Adam Roben.

        * English.lproj/localizedStrings.js: Updated strings.
        * page/inspector/CallStackSidebarPane.js:
        (WebInspector.CallStackSidebarPane.prototype.update): Create a subtitle
        based on the URL and line number.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@34635 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/English.lproj/localizedStrings.js
WebCore/page/inspector/CallStackSidebarPane.js
WebCore/page/inspector/ScriptsPanel.js

index 4a8c10e..10448b5 100644 (file)
@@ -1,5 +1,19 @@
 2008-06-17  Timothy Hatcher  <timothy@apple.com>
 
+        Adds the file name and line number for call frames next to
+        the function name in the Call Stack pane.
+
+        https://bugs.webkit.org/show_bug.cgi?id=19586
+
+        Reviewed by Adam Roben.
+
+        * English.lproj/localizedStrings.js: Updated strings.
+        * page/inspector/CallStackSidebarPane.js:
+        (WebInspector.CallStackSidebarPane.prototype.update): Create a subtitle
+        based on the URL and line number.
+
+2008-06-17  Timothy Hatcher  <timothy@apple.com>
+
         Use accurate call frame title's based on the call frame type.
 
         https://bugs.webkit.org/show_bug.cgi?id=19585
index 4191461..c24a390 100644 (file)
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
index 07c8d52..eb72104 100644 (file)
@@ -29,7 +29,7 @@ WebInspector.CallStackSidebarPane = function()
 }
 
 WebInspector.CallStackSidebarPane.prototype = {
-    update: function(callFrame)
+    update: function(callFrame, sourceIDMap)
     {
         this.bodyElement.removeChildren();
 
@@ -45,6 +45,9 @@ WebInspector.CallStackSidebarPane.prototype = {
         }
 
         var title;
+        var subtitle;
+        var scriptOrResource;
+
         do {
             switch (callFrame.type) {
             case "function":
@@ -55,7 +58,17 @@ WebInspector.CallStackSidebarPane.prototype = {
                 break;
             }
 
-            var placard = new WebInspector.Placard(title);
+            scriptOrResource = sourceIDMap[callFrame.sourceIdentifier];
+            subtitle = WebInspector.displayNameForURL(scriptOrResource.sourceURL || scriptOrResource.url);
+
+            if (callFrame.line > 0) {
+                if (subtitle)
+                    subtitle += ":" + callFrame.line;
+                else
+                    subtitle = WebInspector.UIString("line %d", callFrame.line);
+            }
+
+            var placard = new WebInspector.Placard(title, subtitle);
             placard.callFrame = callFrame;
 
             placard.element.addEventListener("click", this._placardSelected.bind(this), false);
index 8b12ad2..39f906b 100644 (file)
@@ -303,7 +303,7 @@ WebInspector.ScriptsPanel.prototype = {
 
         var callStackPane = this.sidebarPanes.callstack;
         var currentFrame = InspectorController.currentCallFrame();
-        callStackPane.update(currentFrame);
+        callStackPane.update(currentFrame, this._sourceIDMap);
         callStackPane.selectedCallFrame = currentFrame;
 
         WebInspector.currentPanel = this;