Page MenuHomePhabricator

DM/DOM sync errors can arise from spellchecking in Firefox
Closed, ResolvedPublic8 Estimated Story Points

Description

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 ).

Event Timeline

dchan claimed this task.
dchan raised the priority of this task from to Medium.
dchan updated the task description. (Show Details)
dchan added a subscriber: Esanders.
Jdforrester-WMF edited a custom field.
Jdforrester-WMF moved this task from To Triage to TR3: Language support on the VisualEditor board.
Jdforrester-WMF edited a custom field.

Change 247800 had a related patch set uploaded (by Divec):
Diff richtext to build model changes

https://gerrit.wikimedia.org/r/247800

Change 247800 merged by jenkins-bot:
Diff richtext to build model changes

https://gerrit.wikimedia.org/r/247800