Changeset 247639 in webkit
- Timestamp:
- Jul 19, 2019 12:39:12 AM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r247533 r247639 1 2019-07-19 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Issues toggling multiple breakpoints on one line 4 https://bugs.webkit.org/show_bug.cgi?id=199918 5 6 Reviewed by Joseph Pecoraro. 7 8 * UserInterface/Views/SourceCodeTextEditor.js: 9 (WI.SourceCodeTextEditor): 10 (WI.SourceCodeTextEditor.prototype.close): 11 (WI.SourceCodeTextEditor.prototype.textEditorGutterContextMenu): 12 (WI.SourceCodeTextEditor.prototype.textEditorUpdatedFormatting): 13 (WI.SourceCodeTextEditor.prototype._handleFormatterDidChange): Added. 14 Listen for `WI.SourceCode.Event.FormatterDidChange` events as there may be multiple content 15 views for the same `WI.SourceCode`. Previously, if there were, only the active one would 16 properly update it's "line -> column -> breakpoint" mapping, causing an error to be thrown 17 when the non-active content views tried to retrieve the breakpoint for the new line/column. 18 1 19 2019-07-17 Olivier Blin <olivier.blin@softathome.com> 2 20 -
trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
r246667 r247639 91 91 WI.consoleManager.addEventListener(WI.ConsoleManager.Event.IssueAdded, this._issueWasAdded, this); 92 92 93 this._sourceCode.addEventListener(WI.SourceCode.Event.FormatterDidChange, this._handleFormatterDidChange, this); 93 94 if (this._sourceCode instanceof WI.SourceMapResource || this._sourceCode.sourceMaps.length > 0) 94 95 WI.notifications.addEventListener(WI.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this); … … 177 178 } 178 179 179 WI.consoleManager.removeEventListener(WI.ConsoleManager.Event.IssueAdded, this._issueWasAdded, this); 180 181 if (this._sourceCode instanceof WI.SourceMapResource || this._sourceCode.sourceMaps.length > 0) 182 WI.notifications.removeEventListener(WI.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this); 183 else 184 this._sourceCode.removeEventListener(WI.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this); 180 WI.consoleManager.removeEventListener(null, null, this); 181 WI.notifications.removeEventListener(null, null, this); 182 this._sourceCode.removeEventListener(null, null, this); 185 183 } 186 184 … … 1263 1261 } 1264 1262 1265 // Multiple breakpoints.1266 let removeBreakpoints = () => {1267 for (let breakpoint of breakpoints) {1268 if (WI.debuggerManager.isBreakpointRemovable(breakpoint))1269 WI.debuggerManager.removeBreakpoint(breakpoint);1270 }1271 };1272 1273 1263 let shouldDisable = breakpoints.some((breakpoint) => !breakpoint.disabled); 1274 let toggleBreakpoints = (shouldDisable) => {1264 contextMenu.appendItem(shouldDisable ? WI.UIString("Disable Breakpoints") : WI.UIString("Enable Breakpoints"), () => { 1275 1265 for (let breakpoint of breakpoints) 1276 1266 breakpoint.disabled = shouldDisable; 1277 }; 1278 1279 if (shouldDisable) 1280 contextMenu.appendItem(WI.UIString("Disable Breakpoints"), toggleBreakpoints); 1281 else 1282 contextMenu.appendItem(WI.UIString("Enable Breakpoints"), toggleBreakpoints); 1283 contextMenu.appendItem(WI.UIString("Delete Breakpoints"), removeBreakpoints); 1267 }); 1268 1269 contextMenu.appendItem(WI.UIString("Delete Breakpoints"), () => { 1270 for (let breakpoint of breakpoints) 1271 WI.debuggerManager.removeBreakpoint(breakpoint); 1272 }); 1284 1273 } 1285 1274 … … 1388 1377 } 1389 1378 1390 // Some breakpoints / issues may have moved, some might not have. Just go through 1391 // and remove and reinsert all the breakpoints / issues. 1392 1393 var oldBreakpointMap = this._breakpointMap; 1394 this._breakpointMap = {}; 1395 1396 for (var lineNumber in oldBreakpointMap) { 1397 for (var columnNumber in oldBreakpointMap[lineNumber]) { 1398 var breakpoint = oldBreakpointMap[lineNumber][columnNumber]; 1399 var newLineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation); 1400 this._addBreakpointWithEditorLineInfo(breakpoint, newLineInfo); 1401 this.setBreakpointInfoForLineAndColumn(lineNumber, columnNumber, null); 1402 this.setBreakpointInfoForLineAndColumn(newLineInfo.lineNumber, newLineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint)); 1403 } 1404 } 1405 1406 this._reinsertAllIssues(); 1407 this._reinsertAllThreadIndicators(); 1379 this._handleFormatterDidChange(); 1408 1380 } 1409 1381 … … 1608 1580 } 1609 1581 1582 _handleFormatterDidChange(event) 1583 { 1584 if (this._ignoreAllBreakpointLocationUpdates) 1585 return; 1586 1587 // Some breakpoints / issues may have moved, some might not have. Just go through 1588 // and remove and reinsert all the breakpoints / issues. 1589 1590 var oldBreakpointMap = this._breakpointMap; 1591 this._breakpointMap = {}; 1592 1593 for (var lineNumber in oldBreakpointMap) { 1594 for (var columnNumber in oldBreakpointMap[lineNumber]) { 1595 var breakpoint = oldBreakpointMap[lineNumber][columnNumber]; 1596 var newLineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation); 1597 this._addBreakpointWithEditorLineInfo(breakpoint, newLineInfo); 1598 this.setBreakpointInfoForLineAndColumn(lineNumber, columnNumber, null); 1599 this.setBreakpointInfoForLineAndColumn(newLineInfo.lineNumber, newLineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint)); 1600 } 1601 } 1602 1603 this._reinsertAllIssues(); 1604 this._reinsertAllThreadIndicators(); 1605 } 1606 1610 1607 _sourceCodeSourceMapAdded(event) 1611 1608 {
Note: See TracChangeset
for help on using the changeset viewer.