Page MenuHomePhabricator

Clicking on a slug while the selection is inside a table causes an exception
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. In VE standalone, edit <table><tr><td>hello</td><td>world</td></tr></table>
  2. Click on the word "hello" to put the selection inside the table
  3. Click on the "Insert paragraph" slug just above the table

Expected behaviour: The paragraph is inserted
Actual behaviour: The paragraph is inserted, but an exception is thrown

This happens because paragraph insertion modifies the document, but the tableNode.editingFragment.selection doesn't get correspondingly updated.

However, the impact is mitigated because we've fixed T185546, so the danger of the exception causing model corruption is pretty low.

Event Timeline

The table selection update is incorrect, because we're calling tx.translateRange with excludeInsertion=false, but there should always be excludeInsertion=true for a table.

Change 568042 had a related patch set uploaded (by Divec; owner: Divec):
[VisualEditor/VisualEditor@master] Always use excludeInsertion when translating table selections

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

Change 568042 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Always use excludeInsertion when translating table selections

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

Change 569296 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (62458b89d)

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

Change 569296 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (62458b89d)

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

JTannerWMF added subscribers: marcella, JTannerWMF.

Hi @marcella this is ready for close out

marcella awarded a token.