mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
031b96dd2a
Before, replacement operations that both inserted and removed data at the same time would be treated as removals followed by insertions, so we'd reap the metadata from the affected range and move it to the start of the range. For a pure replacement, this doesn't make any sense. Instead, preserve the first min(insertLength, removeLength) elements in the metadata array, then perform a pure insertion splice or a pure removal splice for the length adjustment. Any metadata reaped in a removal splice is restored at the offset where we started removing, after the preserved portion. These changes make the behavior of metadata reaping saner in general (the previous behavior had the potential to move metadata around if it was near a paragraph opening or closing and you converted the paragraph to a heading), and makes the behavior match up with translateOffset(), which is desirable for MetaList synchronization. Change-Id: If9a1c6a7cf43ead7e3e1e8f6e081b139ca65fa53 |
||
---|---|---|
.. | ||
annotations | ||
metaitems | ||
nodes | ||
ve.dm.Annotation.js | ||
ve.dm.AnnotationFactory.js | ||
ve.dm.BranchNode.js | ||
ve.dm.Converter.js | ||
ve.dm.Document.js | ||
ve.dm.DocumentSlice.js | ||
ve.dm.DocumentSynchronizer.js | ||
ve.dm.js | ||
ve.dm.LeafNode.js | ||
ve.dm.MetaItem.js | ||
ve.dm.MetaItemFactory.js | ||
ve.dm.ModelRegistry.js | ||
ve.dm.Node.js | ||
ve.dm.NodeFactory.js | ||
ve.dm.Surface.js | ||
ve.dm.SurfaceFragment.js | ||
ve.dm.Transaction.js | ||
ve.dm.TransactionProcessor.js |