Page MenuHomePhabricator

VisualEditor: Two replacements within the same transaction and the same paragraph cause change markers to be off
Closed, InvalidPublic

Description

Test case:

+ 'removing then inserting a character': {
+ 'calls': [
+ ['pushRetain', 41],
+ ['pushReplace', ['i'], []],
+ ['pushReplace', [], ['j']]
+ ],
+ 'expected': function ( data ) {
+ data[41] = 'j';
+ ve.setProp( data[37], 'internal', 'changed', 'content', 2 );
+ }

}

This sets the second change marker on data[36]. This happens because the start offsets handled in TransactionProcessor.replace are translated using this.adjustment , but that glosses over the fact that not all adjustments captured in this.adjustment actually apply if the offset is before the cursor. Instead, we need some sort of offset translation. I tried using ve.dm.Transaction.translateOffset() but that doesn't seem to work out of the box very well.

I guess theoretically this might also be an issue with other uses of .start attributes in the replacement processor, but it hasn't led to issues so far.

Low prio because we currently don't generate transactions that trigger this case.


Version: unspecified
Severity: major

Details

Reference
bz42222

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 1:13 AM
bzimport set Reference to bz42222.

With bug 45061 all change marker code has been removed.