Steps to reproduce:
- In VE standalone, edit <h1>I <i>lovve</i> <a href="x">sciience</a>.</h1>
- Correct lovve->love.
- Correct sciience->science.
Firefox behaviour:
- In the DM, 'love' is unannotated. In the DOM, it is '<i>love</i>' - a bare <i> node without class='ve-ce-textStyleAnnotation ve-ce-italicAnnotation.
- In the DM, 'science' is unannotated. In the DOM, the text changes but remains inside the original link node structure.
This is because Firefox:
- removes the old text (including the <i class=...> node in the first case);
- fires an input event;
- inserts the new text (including the bare <i> node in the first case);
- fires another input event
In the first case this removes the annotation node, whereas in the second case it does not (presumably thanks to the link nails preserving the cartouche). But in both cases, it removes the annotation entirely from the DM linearization, which then screws up the annotation-guessing heuristics on insertion.
Chrome behaviour:
- In both the DM and the DOM, the annotations remain exactly as before the corrections.
This is because Chrome:
- replaces the old text (text node only) with the new text;
- fires an input event
The synchronization errors will not happen if we actually apply browser richtext (see https://gerrit.wikimedia.org/r/247800 ), but this is another way of getting bare elements without VE classes into the DOM (see also T116269 ).