mediawiki-extensions-Visual.../modules/ve/dm
Catrope 031b96dd2a Make metadata reaping handle replacement operations more sanely
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
2013-03-14 23:35:50 -07:00
..
annotations Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
metaitems Change MetaNodes to MetaItems 2013-03-14 23:35:50 -07:00
nodes Change MetaNodes to MetaItems 2013-03-14 23:35:50 -07:00
ve.dm.Annotation.js Change MetaNodes to MetaItems 2013-03-14 23:35:50 -07:00
ve.dm.AnnotationFactory.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.dm.BranchNode.js Use static.name once for ce and dm nodes 2013-03-07 17:19:39 -08:00
ve.dm.Converter.js Change MetaNodes to MetaItems 2013-03-14 23:35:50 -07:00
ve.dm.Document.js Make metadata reaping handle replacement operations more sanely 2013-03-14 23:35:50 -07:00
ve.dm.DocumentSlice.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.dm.DocumentSynchronizer.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.dm.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.dm.LeafNode.js Use static.name once for ce and dm nodes 2013-03-07 17:19:39 -08:00
ve.dm.MetaItem.js Change MetaNodes to MetaItems 2013-03-14 23:35:50 -07:00
ve.dm.MetaItemFactory.js Change MetaNodes to MetaItems 2013-03-14 23:35:50 -07:00
ve.dm.ModelRegistry.js Change MetaNodes to MetaItems 2013-03-14 23:35:50 -07:00
ve.dm.Node.js Change MetaNodes to MetaItems 2013-03-14 23:35:50 -07:00
ve.dm.NodeFactory.js Change MetaNodes to MetaItems 2013-03-14 23:35:50 -07:00
ve.dm.Surface.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.dm.SurfaceFragment.js Refactor convert to use isolateAndUnwrap 2013-03-13 01:07:52 +00:00
ve.dm.Transaction.js Merge "Implement SurfaceFragment.rewrapAllNodes" 2013-02-26 00:22:01 +00:00
ve.dm.TransactionProcessor.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00