Title: [88344] trunk/Source/WebCore
Revision
88344
Author
[email protected]
Date
2011-06-08 06:48:05 -0700 (Wed, 08 Jun 2011)

Log Message

2011-05-18  Pavel Podivilov  <[email protected]>

        Reviewed by Yury Semikhatsky.

        Web Inspector: hide script location to ui location conversion details from ScriptsPanel.
        https://bugs.webkit.org/show_bug.cgi?id=61035

        * inspector/front-end/DebuggerPresentationModel.js:
        (WebInspector.DebuggerPresentationModel.prototype.sourceFileForScriptURL):
        (WebInspector.DebuggerPresentationModel.prototype.scriptLocationToUILocation.didRequestSourceMapping):
        (WebInspector.DebuggerPresentationModel.prototype.scriptLocationToUILocation):
        * inspector/front-end/ScriptsPanel.js:
        (WebInspector.ScriptsPanel.prototype.showAnchorLocation.didGetUILocation):
        (WebInspector.ScriptsPanel.prototype.showAnchorLocation):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88343 => 88344)


--- trunk/Source/WebCore/ChangeLog	2011-06-08 13:24:52 UTC (rev 88343)
+++ trunk/Source/WebCore/ChangeLog	2011-06-08 13:48:05 UTC (rev 88344)
@@ -1,3 +1,18 @@
+2011-05-18  Pavel Podivilov  <[email protected]>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: hide script location to ui location conversion details from ScriptsPanel.
+        https://bugs.webkit.org/show_bug.cgi?id=61035
+
+        * inspector/front-end/DebuggerPresentationModel.js:
+        (WebInspector.DebuggerPresentationModel.prototype.sourceFileForScriptURL):
+        (WebInspector.DebuggerPresentationModel.prototype.scriptLocationToUILocation.didRequestSourceMapping):
+        (WebInspector.DebuggerPresentationModel.prototype.scriptLocationToUILocation):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.showAnchorLocation.didGetUILocation):
+        (WebInspector.ScriptsPanel.prototype.showAnchorLocation):
+
 2011-06-08  Tommy Widenflycht  <[email protected]>
 
         Reviewed by Tony Gentilcore.

Modified: trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js (88343 => 88344)


--- trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js	2011-06-08 13:24:52 UTC (rev 88343)
+++ trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js	2011-06-08 13:48:05 UTC (rev 88344)
@@ -80,9 +80,22 @@
 
     sourceFileForScriptURL: function(scriptURL)
     {
-        return this._sourceFiles[scriptURL];
+        return this._sourceFiles[this._createSourceFileId(scriptURL)];
     },
 
+    scriptLocationToUILocation: function(sourceURL, sourceId, lineNumber, columnNumber, callback)
+    {
+        var sourceFile = this._sourceFileForScript(sourceURL, sourceId);
+        var scriptLocation = { lineNumber: lineNumber, columnNumber: columnNumber };
+
+        function didRequestSourceMapping(mapping)
+        {
+            var lineNumber = mapping.scriptLocationToSourceLine(scriptLocation);
+            callback(sourceFile.id, lineNumber);
+        }
+        sourceFile.requestSourceMapping(didRequestSourceMapping);
+    },
+
     requestSourceFileContent: function(sourceFileId, callback)
     {
         this._sourceFiles[sourceFileId].requestContent(callback);

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (88343 => 88344)


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2011-06-08 13:24:52 UTC (rev 88343)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2011-06-08 13:48:05 UTC (rev 88344)
@@ -511,18 +511,18 @@
 
     showAnchorLocation: function(anchor)
     {
-        var sourceFile = this._presentationModel.sourceFileForScriptURL(anchor.href);
         var anchorLineNumber = parseInt(anchor.getAttribute("line_number"));
-        if (anchorLineNumber !== NaN) {
-            function didRequestSourceMapping(mapping)
-            {
-                var lineNumber = mapping.scriptLocationToSourceLine({ lineNumber: anchorLineNumber - 1, columnNumber: 0 });
-                this._showSourceLine(sourceFile.id, lineNumber);
-            }
-            sourceFile.requestSourceMapping(didRequestSourceMapping.bind(this));
-            return;
+        var hasAnchorLineNumber = anchorLineNumber !== NaN;
+        var lineNumber = hasAnchorLineNumber ? anchorLineNumber - 1 : 0;
+
+        function didGetUILocation(sourceFileId, lineNumber)
+        {
+            if (hasAnchorLineNumber)
+                this._showSourceLine(sourceFileId, lineNumber);
+            else
+                this._showSourceFrameAndAddToHistory(sourceFileId);
         }
-        this._showSourceFrameAndAddToHistory(sourceFile.id);
+        this._presentationModel.scriptLocationToUILocation(anchor.href, null, lineNumber, 0, didGetUILocation.bind(this));
     },
 
     _showSourceLine: function(sourceFileId, lineNumber)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to