Page MenuHomePhabricator

Enforce suggestedParentNodeTypes in fixupInsertion
Closed, ResolvedPublic8 Estimated Story Points

Description

Currently suggestedParentNodeTypes is only checked during isolateAndUnwrap, which means if you try to convert a paragraph to a heading inside a list it will unwrap (the primary use case), however we should protect against other actions that would lead to headings being inserted into lists, such as copy & paste, or naive API calls (such as SurfaceFragment#insert).

parentNodeTypes is enforced during document#fixupInsertion, which is run on every transactionBuilder and is much more robust.

Event Timeline

Jdforrester-WMF moved this task from To Triage to TR1: Releases on the VisualEditor board.
Jdforrester-WMF set the point value for this task to 8.

Change 361890 had a related patch set uploaded (by Jforrester; owner: DLynch):
[mediawiki/extensions/VisualEditor@master] dm.SurfaceFragment tests: exercise fixupInsertion for mwHeadings

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

Change 361888 had a related patch set uploaded (by Jforrester; owner: DLynch):
[VisualEditor/VisualEditor@master] dm.Document fixupInsertion: check suggestedParents as well

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

Change 361888 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] dm.Document fixupInsertion: check suggestedParents as well

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

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

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

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

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

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

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