Title: [233861] trunk/Source/WebInspectorUI
Revision
233861
Author
[email protected]
Date
2018-07-16 13:06:52 -0700 (Mon, 16 Jul 2018)

Log Message

Web Inspector: Fix execution highlighting after r233820
https://bugs.webkit.org/show_bug.cgi?id=187703
<rdar://problem/42246167>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.currentPositionToOriginalPosition):
(WI.TextEditor.prototype._updateExecutionRangeHighlight):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (233860 => 233861)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-07-16 19:49:11 UTC (rev 233860)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-07-16 20:06:52 UTC (rev 233861)
@@ -1,3 +1,17 @@
+2018-07-16  Matt Baker  <[email protected]>
+
+        Web Inspector: Fix execution highlighting after r233820
+        https://bugs.webkit.org/show_bug.cgi?id=187703
+        <rdar://problem/42246167>
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/SourceCodeTextEditor.js:
+        (WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
+        * UserInterface/Views/TextEditor.js:
+        (WI.TextEditor.prototype.currentPositionToOriginalPosition):
+        (WI.TextEditor.prototype._updateExecutionRangeHighlight):
+
 2018-07-16  Aaron Chu  <[email protected]>
 
         AX: Audit Tab should have an Audit Manager

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js (233860 => 233861)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js	2018-07-16 19:49:11 UTC (rev 233860)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js	2018-07-16 20:06:52 UTC (rev 233861)
@@ -1413,8 +1413,7 @@
 
     textEditorExecutionHighlightRange(currentPosition, callback)
     {
-        let {line, ch} = this.currentPositionToOriginalPosition(currentPosition);
-        let position = new WI.SourceCodePosition(line, ch);
+        let position = this.currentPositionToOriginalPosition(currentPosition);
 
         let script = this._getAssociatedScript(position);
         if (!script) {
@@ -1491,7 +1490,7 @@
                 return aLength - bLength;
             });
 
-            let characterAtPosition = this.getTextInRange(currentPosition, {line: currentPosition.line, ch: currentPosition.ch + 1});
+            let characterAtPosition = this.getTextInRange(currentPosition, currentPosition.offsetColumn(1));
             let characterAtPositionIsDotOrBracket = characterAtPosition === "." || characterAtPosition === "[";
 
             for (let i = 0; i < nodes.length; ++i) {

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js (233860 => 233861)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js	2018-07-16 19:49:11 UTC (rev 233860)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js	2018-07-16 20:06:52 UTC (rev 233861)
@@ -784,8 +784,8 @@
         if (!this._formatterSourceMap)
             return position;
 
-        let location = this._formatterSourceMap.formattedToOriginal(position.line, position.ch);
-        return {line: location.lineNumber, ch: location.columnNumber};
+        let location = this._formatterSourceMap.formattedToOriginal(position.lineNumber, position.columnNumber);
+        return new WI.SourceCodePosition(location.lineNumber, location.columnNumber);
     }
 
     currentPositionToCurrentOffset(position)
@@ -1323,7 +1323,7 @@
         if (isNaN(this._executionLineNumber))
             return;
 
-        let currentPosition = {line: this._executionLineNumber, ch: this._executionColumnNumber};
+        let currentPosition = new WI.SourceCodePosition(this._executionLineNumber, this._executionColumnNumber);
 
         this._delegate.textEditorExecutionHighlightRange(currentPosition, (range) => {
             let start, end;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to