mediawiki-extensions-CodeMi.../resources
MusikAnimal 0506a10eab ve.ui.CodeMirrorAction.v6: use infinity viewport to avoid misalignment
The 2017 editor has an infinite viewport, meaning the entire document is
printed on page load. CodeMirror 6 meanwhile only processes text in the
visible viewport. This presents a situation where if large chunks of
text are inserted outside the visible range (such as the "Changes
recovered" feature of VE), it can cause misalignment of the VE surface
and visible CodeMirror layer, as CodeMirror has not accounted for the
off-screen lines of text.

CodeMirror 5 had a `viewportMargin: infinity` option that prevented this
issue, but at the cost of performance. CodeMirror 6 removed this option,
but the same effect can be achieved by tricking CodeMirror into thinking
we're printing the document, in which case it will process all lines.
This seriously hurts performance, and is a nasty hack, but until the
2017 editor is reworked to have a viewport, there may be no other means
to prevent the misalignment.

The discovery of this issue and the fix are courtesy of Fandom engineers

Bug: T357482
Change-Id: If11ce48459e8faf55015108e8c2eabdc16e0d917
(cherry picked from commit 2ad096a580)
2024-08-21 16:49:14 +00:00
..
legacy Use dispatchEvent instead of jQuery triggerHandler for focus/blur events 2024-08-05 13:45:06 -04:00
lib Isolate build step to CM6 library and restructure files to work with RL 2024-07-31 22:45:48 -04:00
ve-cm ve.ui.CodeMirrorAction.v6: use infinity viewport to avoid misalignment 2024-08-21 16:49:14 +00:00
.eslintrc.json CodeMirror 6 for VE 2017 wikitext editor 2024-08-01 03:15:21 -04:00
codemirror.bundle.js Isolate build step to CM6 library and restructure files to work with RL 2024-07-31 22:45:48 -04:00
codemirror.js Merge "CodeMirror: add Ctrl+Shift+z as redo shortcut on Windows" 2024-08-14 23:10:58 +00:00
codemirror.less Isolate build step to CM6 library and restructure files to work with RL 2024-07-31 22:45:48 -04:00
codemirror.mediawiki.bidiIsolation.js Isolate build step to CM6 library and restructure files to work with RL 2024-07-31 22:45:48 -04:00
codemirror.mediawiki.colorblind.less Isolate build step to CM6 library and restructure files to work with RL 2024-07-31 22:45:48 -04:00
codemirror.mediawiki.config.js Isolate build step to CM6 library and restructure files to work with RL 2024-07-31 22:45:48 -04:00
codemirror.mediawiki.init.js Isolate build step to CM6 library and restructure files to work with RL 2024-07-31 22:45:48 -04:00
codemirror.mediawiki.js Merge "CodeMirrorModeMediaWiki: various small fixes" 2024-08-15 03:10:01 +00:00
codemirror.mediawiki.less build: Upgrade stylelint-config-wikimedia to 0.17.2 2024-08-10 08:03:19 +03:00
codemirror.mediawiki.templateFolding.js Isolate build step to CM6 library and restructure files to work with RL 2024-07-31 22:45:48 -04:00
codemirror.textSelection.js Isolate build step to CM6 library and restructure files to work with RL 2024-07-31 22:45:48 -04:00
codemirror.wikieditor.js CodeMirror 6 for VE 2017 wikitext editor 2024-08-01 03:15:21 -04:00
codemirror.wikieditor.mediawiki.init.js Isolate build step to CM6 library and restructure files to work with RL 2024-07-31 22:45:48 -04:00