Web Inspector: Basic blocks highlighting should use line/column locations instead...
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2018 22:27:30 +0000 (22:27 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2018 22:27:30 +0000 (22:27 +0000)
commit5706b6106a0f0b09e9c93dba4a2cfb1c8e363e39
tree46efa3b521cbf83a5c134ba87e14872adebaecb1
parentad395774dd339e2253c188a6f4f753de27095d72
Web Inspector: Basic blocks highlighting should use line/column locations instead of offsets
https://bugs.webkit.org/show_bug.cgi?id=187613
<rdar://problem/42131808>

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/BasicBlockAnnotator.js:
Basic blocks sent from the backend include offsets into the original
file, rather than line/column locations. In order to translate to positions
within CodeMirror, we need to calculate the original line and column
for each block.

(WI.BasicBlockAnnotator.prototype.insertAnnotations):
(WI.BasicBlockAnnotator.prototype._calculateBasicBlockPositions.offsetToPosition):
(WI.BasicBlockAnnotator.prototype._calculateBasicBlockPositions):
(WI.BasicBlockAnnotator.prototype._annotateBasicBlockExecutionRanges.):
(WI.BasicBlockAnnotator.prototype._annotateBasicBlockExecutionRanges):
(WI.BasicBlockAnnotator.prototype._highlightTextForBasicBlock):

* UserInterface/Models/SourceCodePosition.js:
(WI.SourceCodePosition.prototype.offsetColumn):

* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.getTextInRange):
(WI.TextEditor.prototype.addStyleToTextRange):
Better encapsulation for CodeMirror positions.

* UserInterface/Workers/Formatter/FormatterUtilities.js:
(get if):
Update String.prototype.lineEndings to support additional line separators.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233820 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/BasicBlockAnnotator.js
Source/WebInspectorUI/UserInterface/Models/SourceCodePosition.js
Source/WebInspectorUI/UserInterface/Views/TextEditor.js
Source/WebInspectorUI/UserInterface/Workers/Formatter/FormatterUtilities.js