Optimizations for the code introduced in Ic403e0a:
* Skip this entirely when something is selected (as discussed
in Ic403e0a).
* Use a combination of existing methods. I benchmarked these
again. This approach is "significantly" slower compared to
the custom code from before. However, "significantly" here
means something like 1 nanosecond vs. 4 nanoseconds. Both
is effectively nothing.
* Use the same approach in another place. This one is triggered
every time a change is made, e.g. a character typed. I
benchmarked this as well. The new code is about 500x faster
(yes, seriously).
Bug: T269094
Change-Id: I00fe595a89be7a257e27ed28d38568c81483338b
The fallback technique makes the whole edit surface semi-transparent,
so reset native selections to full opacity.
Change-Id: If6cd585b1a09c549781fe82a3bdf18d64ac597b5
I had to make some CSS selectors more specific, because the
library changed
.CodeMirror pre
to
.CodeMirror pre.CodeMirror-line,
.CodeMirror pre.CodeMirror-line-like
This is only relevant for entire lines (implemented as <pre>
elements). Most of the custom CSS is for characters, not lines.
In my tests in the Wikitext editor as well as VisualEditor I
could not spot any difference between the old and new version.
Bug: T258999
Change-Id: I6f0f030f972838727f3ef220feb105264f122798
Move this stuff to Timeless itself since we can just reuse the width cutoff
and padding variables directly there and don't need to worry about them
randomly changing.
Corresponding change: Ic64b9786cb7186dba3eb2042a3238149c3bb44c6
Bug: T230756
Change-Id: Ia7168341bcadbc60e307b58b67afc1975a2424f9
VisualEditor's default padding for the source editing surface was
changed in Icdc6f1e2a7544ebbd828f85ff370113a0e06983a (June 2018).
Since then the alignment of editing surface and CodeMirror syntax
highlighting surface was broken in skins that don't override the
default padding (basically every skin except Vector and MonoBook).
Unfortunately Vector and MonoBook happen to be the only skins we
officially support and actually test, so the issue went unnoticed.
Bug: T205154
Bug: T205658
Change-Id: Ic85a6c20b266f6b93ab8ec9c2d35acff679f31bc
This patch makes Codemirror on VE independent of the beta feature,
making it always load.
This is a first step to graduating CodeMirror out of beta.
Bug: T191923
Change-Id: Ide794e8f986d3f0455ff282819c71d9144dd75db
Keep all our font rule settings in one place to make it
easier to keep them in sync. Also add a rule for 'hyphens' in
case the browser default has changed.
Bug: T192019
Change-Id: I2c27e5075a9bc6aaed9fe048d163f57976708357
We can't guarantee the preserve glyph width, e.g.
on Firefox with Chinese characters.
Bug: T184467
Change-Id: I6fc92fcd034bda3d9a94749935aae03c8373f7c5
Deferring the insertions can lead to sync issues, so use
a different technique to selective refresh the CodeMirror
view when the height changes.
This reverts commit 8e3d96f75f.
Bug: T188473
Bug: T185184
Change-Id: I502501cc0325db64f29a67716306733859d102a9
Due to using bold as a highlight style, the VE overlay technique
will only work with monospaced fonts.
Change-Id: I33e3e07cf0f3d8e25dd35623286eedf28ba20ae1