Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js

Issue 662793002: [DevTools] Replace usages of document with custom functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 WebInspector.CodeMirrorTextEditor._whitespaceStyleInjected = true; 688 WebInspector.CodeMirrorTextEditor._whitespaceStyleInjected = true;
689 const classBase = ".show-whitespaces .CodeMirror .cm-whitespace-"; 689 const classBase = ".show-whitespaces .CodeMirror .cm-whitespace-";
690 const spaceChar = "·"; 690 const spaceChar = "·";
691 var spaceChars = ""; 691 var spaceChars = "";
692 var rules = ""; 692 var rules = "";
693 for (var i = 1; i <= WebInspector.CodeMirrorTextEditor.MaximumNumberOfWh itespacesPerSingleSpan; ++i) { 693 for (var i = 1; i <= WebInspector.CodeMirrorTextEditor.MaximumNumberOfWh itespacesPerSingleSpan; ++i) {
694 spaceChars += spaceChar; 694 spaceChars += spaceChar;
695 var rule = classBase + i + "::before { content: '" + spaceChars + "' ;}\n"; 695 var rule = classBase + i + "::before { content: '" + spaceChars + "' ;}\n";
696 rules += rule; 696 rules += rule;
697 } 697 }
698 var style = document.createElement("style"); 698 var style = createElement("style");
699 style.textContent = rules; 699 style.textContent = rules;
700 document.head.appendChild(style); 700 document.head.appendChild(style);
701 }, 701 },
702 702
703 _handleKeyDown: function(e) 703 _handleKeyDown: function(e)
704 { 704 {
705 if (this._autocompleteController.keyDown(e)) 705 if (this._autocompleteController.keyDown(e))
706 e.consume(true); 706 e.consume(true);
707 }, 707 },
708 708
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 function tokenOverride(superToken, stream, state) 2434 function tokenOverride(superToken, stream, state)
2435 { 2435 {
2436 var token = superToken(stream, state); 2436 var token = superToken(stream, state);
2437 return token ? tokenPrefix + token.split(/ +/).join(" " + tokenPrefix) : token; 2437 return token ? tokenPrefix + token.split(/ +/).join(" " + tokenPrefix) : token;
2438 } 2438 }
2439 } 2439 }
2440 2440
2441 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("css", "css-") ; 2441 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("css", "css-") ;
2442 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("javascript", "js-"); 2442 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("javascript", "js-");
2443 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("xml", "xml-") ; 2443 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("xml", "xml-") ;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/settings/SettingsScreen.js ('k') | Source/devtools/front_end/source_frame/CodeMirrorUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698