Title: [86745] trunk/Source/WebCore
- Revision
- 86745
- Author
- [email protected]
- Date
- 2011-05-18 02:45:17 -0700 (Wed, 18 May 2011)
Log Message
2011-05-18 Pavel Feldman <[email protected]>
Reviewed by Yury Semikhatsky.
Web Inspector: do not reveal line -1 when navigating to anchor without line specified.
https://bugs.webkit.org/show_bug.cgi?id=60971
* inspector/front-end/ResourcesPanel.js:
(WebInspector.ResourcesPanel.prototype.showAnchorLocation):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype.showAnchorLocation.):
(WebInspector.ScriptsPanel.prototype.showAnchorLocation):
* inspector/front-end/inspector.js:
(WebInspector._showAnchorLocation):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (86744 => 86745)
--- trunk/Source/WebCore/ChangeLog 2011-05-18 09:33:42 UTC (rev 86744)
+++ trunk/Source/WebCore/ChangeLog 2011-05-18 09:45:17 UTC (rev 86745)
@@ -1,3 +1,18 @@
+2011-05-18 Pavel Feldman <[email protected]>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: do not reveal line -1 when navigating to anchor without line specified.
+ https://bugs.webkit.org/show_bug.cgi?id=60971
+
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype.showAnchorLocation):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.showAnchorLocation.):
+ (WebInspector.ScriptsPanel.prototype.showAnchorLocation):
+ * inspector/front-end/inspector.js:
+ (WebInspector._showAnchorLocation):
+
2011-05-18 Kent Tamura <[email protected]>
Reviewed by Hajime Morita.
Modified: trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js (86744 => 86745)
--- trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js 2011-05-18 09:33:42 UTC (rev 86744)
+++ trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js 2011-05-18 09:45:17 UTC (rev 86745)
@@ -350,7 +350,8 @@
}
return;
}
- this.showResource(resource, anchor.getAttribute("line_number") - 1);
+ var lineNumber = parseInt(anchor.getAttribute("line_number"));
+ this.showResource(resource, lineNumber !== NaN ? lineNumber - 1 : undefined);
},
showResource: function(resource, line)
Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (86744 => 86745)
--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js 2011-05-18 09:33:42 UTC (rev 86744)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js 2011-05-18 09:45:17 UTC (rev 86745)
@@ -516,13 +516,18 @@
showAnchorLocation: function(anchor)
{
- function didRequestSourceMapping(mapping)
- {
- var lineNumber = mapping.scriptLocationToSourceLine({lineNumber:anchor.getAttribute("line_number") - 1, columnNumber:0});
- this._showSourceLine(sourceFile.id, lineNumber);
+ 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 sourceFile = this._presentationModel.sourceFileForScriptURL(anchor.href);
- sourceFile.requestSourceMapping(didRequestSourceMapping.bind(this));
+ this._showSourceFrameAndAddToHistory(sourceFile.id);
},
_showSourceLine: function(sourceFileId, lineNumber)
Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (86744 => 86745)
--- trunk/Source/WebCore/inspector/front-end/inspector.js 2011-05-18 09:33:42 UTC (rev 86744)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js 2011-05-18 09:45:17 UTC (rev 86745)
@@ -1170,7 +1170,7 @@
WebInspector._showAnchorLocation = function(anchor)
{
- var preferedPanel = this.panels[anchor.getAttribute("preferred_panel") || "resources"];
+ var preferedPanel = this.panels[anchor.getAttribute("preferred_panel") || "scripts"];
if (WebInspector._showAnchorLocationInPanel(anchor, preferedPanel))
return true;
if (preferedPanel !== this.panels.resources && WebInspector._showAnchorLocationInPanel(anchor, this.panels.resources))
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes