Page MenuHomePhabricator

VisualEditor: Deleting across inline alien errors
Closed, ResolvedPublic

Description

Author: orbit

Description:
Try creating "some text <inlinealien>blah</inlinealien> more text" and select across the inline alien and delete.

Uncaught TypeError: Cannot call method 'getDataFromNode' of undefined


Version: unspecified
Severity: normal

Details

Reference
bz42707

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 12:47 AM
bzimport set Reference to bz42707.

Argh. I figured out why this happens.

  • .splice() is called on the dm.ParagraphNode to remove the alien
  • which calls .adjustLength() on the dm.ParagraphNode
  • which emits an update event on the dm.ParagraphNode
  • which causes .renderContents() to be called on the ce.ParagraphNode
  • which attempts to rerender its ce.TextNode children
  • one of which is now associated with a detached dm.TextNode
  • which means it crashed when trying to get the data from the linear model

I'm not entirely sure what the solution should be. Perhaps ce.ContentBranchNode shouldn't rerender for an update on the node itself, only on its children?

Fix in gerrit 37056.