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 only fishy bit is the animation stuff. In particular, there are two places
where we just mint the revert behavior:
* When serializing web-animations keyframes (the custom properties stuff in
declaration_block.rs). That codepath is already not sound and I wanted to
get rid of it in bug 1501530, but what do I know.
* When getting an animation value from a property declaration. At that point
we no longer have the CSS rules that apply to the element to compute the
right revert value handy. It'd also use the wrong style anyway, I think,
given the way StyleBuilder::for_animation works.
We _could_ probably get them out of somewhere, but it seems like a whole lot
of code reinventing the wheel which is probably not useful, and that Blink
and WebKit just cannot implement either since they don't have a rule tree,
so it just doesn't seem worth the churn.
The custom properties code looks a bit different in order to minimize hash
lookups in the common case. FWIW, `revert` for custom properties doesn't seem
very useful either, but oh well.
Differential Revision: https://phabricator.services.mozilla.com/D21877
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
The function was returning a Promise but was also
taking a callback for old-style test.
This patch turns the function into an async one,
remove the callback param and refactor tests that
relied on it.
Differential Revision: https://phabricator.services.mozilla.com/D19963