2011-03-05 Pavel Podivilov <podivilov@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: move breakpoint column adjustment to debugger model.
        https://bugs.webkit.org/show_bug.cgi?id=55821

        Test: inspector/debugger/debug-inlined-scripts.html

        * inspector/front-end/DebuggerModel.js:
        (WebInspector.DebuggerModel.prototype.setBreakpoint.didSetBreakpoint):
        (WebInspector.DebuggerModel.prototype.setBreakpoint):
        * inspector/front-end/SourceFrameContent.js:
        (WebInspector.SourceFrameContent.prototype.sourceFrameLineNumberToActualLocation):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e0c8fe13
2011-03-05 Pavel Podivilov <podivilov@chromium.org>
Reviewed by Pavel Feldman.
Web Inspector: move breakpoint column adjustment to debugger model.
https://bugs.webkit.org/show_bug.cgi?id=55821
Test: inspector/debugger/debug-inlined-scripts.html
* inspector/front-end/DebuggerModel.js:
(WebInspector.DebuggerModel.prototype.setBreakpoint.didSetBreakpoint):
(WebInspector.DebuggerModel.prototype.setBreakpoint):
* inspector/front-end/SourceFrameContent.js:
(WebInspector.SourceFrameContent.prototype.sourceFrameLineNumberToActualLocation):
2011-01-21 John Knottenbelt <jknotten@chromium.org>
Reviewed by Dmitry Titov.
......
......@@ -78,6 +78,15 @@ WebInspector.DebuggerModel.prototype = {
setBreakpoint: function(url, lineNumber, columnNumber, condition, enabled)
{
// Adjust column if needed.
var minColumnNumber = 0;
for (var id in this._scripts) {
var script = this._scripts[id];
if (url === script.sourceURL && lineNumber === script.lineOffset)
minColumnNumber = minColumnNumber ? Math.min(minColumnNumber, script.columnOffset) : script.columnOffset;
}
columnNumber = Math.max(columnNumber, minColumnNumber);
function didSetBreakpoint(breakpointsPushedToBackend, breakpointId, locations)
{
if (!breakpointId)
......
......@@ -48,18 +48,7 @@ WebInspector.SourceFrameContent.prototype = {
sourceFrameLineNumberToActualLocation: function(lineNumber)
{
// Script content may start right after <script> tag without new line (e.g. "<script>function f()...").
// In that case, column number should be equal to script column offset.
var columnNumber = 0;
for (var i = 0; i < this._scriptRanges.length; ++i) {
var scriptRange = this._scriptRanges[i];
if (scriptRange.start.lineNumber < lineNumber)
continue;
if (scriptRange.start.lineNumber === lineNumber)
columnNumber = scriptRange.start.columnNumber;
break;
}
var location = this._mapping.sourceLocationToActualLocation(lineNumber, columnNumber);
var location = this._mapping.sourceLocationToActualLocation(lineNumber, 0);
location.sourceID = this._sourceIDForSourceFrameLineNumber(lineNumber);
return location;
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment