| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 | 751 |
| 752 /** | 752 /** |
| 753 * @param {number} x | 753 * @param {number} x |
| 754 * @param {number} y | 754 * @param {number} y |
| 755 * @return {?WebInspector.TextRange} | 755 * @return {?WebInspector.TextRange} |
| 756 * // FIXME: remove this suppression. | 756 * // FIXME: remove this suppression. |
| 757 * @suppressGlobalPropertiesCheck | 757 * @suppressGlobalPropertiesCheck |
| 758 */ | 758 */ |
| 759 coordinatesToCursorPosition: function(x, y) | 759 coordinatesToCursorPosition: function(x, y) |
| 760 { | 760 { |
| 761 var element = this.element.ownerDocument.deepElementFromPoint(x, y); | 761 var element = this.element.ownerDocument.elementFromPoint(x, y); |
| 762 if (!element || !element.isSelfOrDescendant(this._codeMirror.getWrapperE
lement())) | 762 if (!element || !element.isSelfOrDescendant(this._codeMirror.getWrapperE
lement())) |
| 763 return null; | 763 return null; |
| 764 var gutterBox = this._codeMirror.getGutterElement().boxInWindow(); | 764 var gutterBox = this._codeMirror.getGutterElement().boxInWindow(); |
| 765 if (x >= gutterBox.x && x <= gutterBox.x + gutterBox.width && | 765 if (x >= gutterBox.x && x <= gutterBox.x + gutterBox.width && |
| 766 y >= gutterBox.y && y <= gutterBox.y + gutterBox.height) | 766 y >= gutterBox.y && y <= gutterBox.y + gutterBox.height) |
| 767 return null; | 767 return null; |
| 768 var coords = this._codeMirror.coordsChar({left: x, top: y}); | 768 var coords = this._codeMirror.coordsChar({left: x, top: y}); |
| 769 return WebInspector.CodeMirrorUtils.toRange(coords, coords); | 769 return WebInspector.CodeMirrorUtils.toRange(coords, coords); |
| 770 }, | 770 }, |
| 771 | 771 |
| (...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2442 function tokenOverride(superToken, stream, state) | 2442 function tokenOverride(superToken, stream, state) |
| 2443 { | 2443 { |
| 2444 var token = superToken(stream, state); | 2444 var token = superToken(stream, state); |
| 2445 return token ? tokenPrefix + token.split(/ +/).join(" " + tokenPrefix) :
token; | 2445 return token ? tokenPrefix + token.split(/ +/).join(" " + tokenPrefix) :
token; |
| 2446 } | 2446 } |
| 2447 } | 2447 } |
| 2448 | 2448 |
| 2449 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("css", "css-")
; | 2449 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("css", "css-")
; |
| 2450 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("javascript",
"js-"); | 2450 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("javascript",
"js-"); |
| 2451 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("xml", "xml-")
; | 2451 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("xml", "xml-")
; |
| OLD | NEW |