Renames "WebKit/source" to "blink/renderer" references in DevTools. Skipping presubmit for protocol.json and CodeMirror (usually requires words "roll CodeMirror" in description when making changes in cm/ or cm_modes/). NOPRESUBMIT=true Bug: none Change-Id: Iadb44142a5ae1058dae656b93e904c7636f1fa32 Reviewed-on: https://chromium-review.googlesource.com/1003033 Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Commit-Queue: Erik Luo <luoe@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#549220} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: aff59449a34f98ed04cd94547f0ceaaf25d38f71
Rolling CodeMirror
What's this about?
CodeMirror is a third-party library, which supports editing experience in Chrome DevTools. DevTools does not fork CodeMirror, thus all CodeMirror patches should go upstream to http://codemirror.net. Every once in a while, the CodeMirror dependency (which is located in Source/devtools/front_end/cm/ folder) should be updated to a newer version.
Updating CodeMirror
This requires the following steps to be done:
- File
headlesscodemirror.jsis arunmode-standalone.jsfile from CodeMirror distribution, but wrapped in(function(window) { ... }(this))construction. This is needed to support in web workers. - File
markselection.jsis amark-selection.jsfrom CodeMirror distribution. The "dash" is removed due to the restriction on the chromium grd generator. - File codemirror.css contains both the default theme of CodeMirror and structural css required for it to work. Discard everything in the file up to the word
/* STOP */. - All other files in front_end/cm/ folder should be substituted with their newer versions from the upstream.
Testing
DevTools wrap CodeMirror via CodeMirrorTextEditor.js and cmdevtools.css files.
Although there are a couple of automated tests (LayoutTests/inspector/editor/) to verify overall sanity of the setup, a manual testing is mandatory before
landing a roll. Here is a rough testing scenario outline:
- Create a new snippet and type in a small function with a few nested for-loops. (The author suggests a bubble-sort). Make sure that:
- Words
function,for,varare highlighted - "Smart braces" behavior works
- "Enter" after opening curly brace adds correct indent
- Autocompletion works
- Multiple cursors functionality works as intended - Ctrl+D/Ctrl+U shortcuts
- Set a breakpoint inside a function, select some text and summon a context menu over it.
- Words
- Make sure there are items such as "Add to Watch", "Evaluate in Console" and "Copy/Paste"
Make sure minified jquery opens nicely in the editor (minified jquery could be found as a resource on http://jquery.com)
- Verify
jquery.min.jsis formatted via "Pretty print" action
- Verify
- Go to the Elements panel, select a node and verify the "Edit it as HTML" command works.
Committing
The only changes allowed to front_end/cm/ folder are CodeMirror rolls. There's a presubmit check that enforces this, so make sure you include the phrase "roll CodeMirror" into your patch description.
Example
Example CodeMirror roll patchset: https://codereview.chromium.org/273763003