Web Inspector: Make debugger stepping highlights work in inline <script>s
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Sep 2016 19:24:32 +0000 (19:24 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Sep 2016 19:24:32 +0000 (19:24 +0000)
commit5656cea8287c908a8210b8add07b6e291b23e4b9
treeda31e92de5be12b8605cd57e6b98f1a7bb72bdb5
parentbdb98ce09269927b6f285d9f17408637a2bb1e8b
Web Inspector: Make debugger stepping highlights work in inline <script>s
https://bugs.webkit.org/show_bug.cgi?id=162753
<rdar://problem/28551332>

Reviewed by Brian Burg.

* UserInterface/Models/TextRange.js:
(WebInspector.TextRange.prototype.contains):
Check if a given line/column falls within this range.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._getAssociatedScript):
If we are in a Document resource find the associated script at a given position.

(WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
When comparing offsets to SyntaxTree offsets, the SyntaxTree's offset of 0 is the
first character of the Script, which differs from the current SourceCode's offset.
Adjust the offset by the Script's startOffset.

* UserInterface/Views/TextEditor.js:
(WebInspector.TextEditor.prototype.currentPositionToOriginalPosition):
(WebInspector.TextEditor.prototype._updateExecutionRangeHighlight):
Pass both the original offset and original position to the delegate.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/FormatterSourceMap.js
Source/WebInspectorUI/UserInterface/Models/TextRange.js
Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
Source/WebInspectorUI/UserInterface/Views/TextEditor.js