We were clearing the completion text all the time to prevent
a visual glitch while typing (See Bug 1491776). But since we
are now waiting for 75ms before calling the autocomplete
function (which triggers the autocompletion text update), we
have a flash of the completion text, which isn't ideal.
In this patch, we check if the typed letters match the begining
of the completion text, and if they do, we don't clear the
completion text.
In the same time, we set the completion text in absolute position
so it doesn't jump when the new letter is added in the CodeMirror
document.
Finally, we change how the Editor pipe events from CodeMirror to
include parameters, so we can use them in JsTerm.
Differential Revision: https://phabricator.services.mozilla.com/D36163
This copies what's done in Chrome DevTools to make codeMirror more accessible.
A new input mode is added which overrides the default `textarea` one.
This makes the "Edit as HTML" feature usable for people relying on screen readers.
This may be used in the future in the console, where we could remove the legacy
console input and serve the CodeMirror instance for everyone.
Differential Revision: https://phabricator.services.mozilla.com/D24930
We use to include all the keyMap files in the
codeMirror bundle, but these files can be
pretty large, and are useless if the user did
not select a custom key mapping in the settings
panel.
This patch changes this to only load those files
when they are needed, either when a new editor
is created, or when the user changes the key mapping
preference. The files are only loaded once.
Differential Revision: https://phabricator.services.mozilla.com/D22977
The file and its dependencies are pretty large and can take
a while to load. Since some consumers might not need those function,
loading them lazily looks like a good move.
Differential Revision: https://phabricator.services.mozilla.com/D20147
If the cssProperties config wasn't provided, the Editor
was loading getClientCssProperties, which loads properties-db
which is quite large.
Since the Style Editor is providing a cssProperties config,
this was done for all the other consumers, none of them
actually having any use of it.
We remove this default behaviour which allows us to speed
up panel/source opening quite significantly.
Differential Revision: https://phabricator.services.mozilla.com/D20305
The file and its dependencies are pretty large and can take
a while to load. Since some consumers might not need those function,
loading them lazily looks like a good move.
Differential Revision: https://phabricator.services.mozilla.com/D20147
This config is not set by any Editor consumer, so
it's safe to remove it. Furthermore, this allow us
to clean things up a bit and remove a test.
Differential Revision: https://phabricator.services.mozilla.com/D20302