Page MenuHomePhabricator

VisualEditor: Un-listing when the caret is at the end of the document throws an error
Closed, ResolvedPublic

Description


Version: unspecified
Severity: normal

Details

Reference
bz40339

Event Timeline

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

Details:

Uncaught TypeError: Cannot read property 'annotations' of undefined ve.dm.Document.js:529

ve.dm.Document.getAnnotationsFromOffset ve.dm.Document.js:529
ve.dm.Surface.change ve.dm.Surface.js:123
ve.ui.ListButtonTool.unlist ve.ui.ListButtonTool.js:161
ve.ui.ListButtonTool.onClick ve.ui.ListButtonTool.js:177
VeUiButtonTool.tool.$.on.mouseup ve.ui.ButtonTool.js:40
jQuery.event.dispatch load.php:3060
elemData.handle.eventHandle

The correct stack error for this is:
Uncaught TypeError: Cannot read property 'html/data-parsoid' of undefined ve.js:357
ve.compareObjects ve.js:357
ve.dm.Transaction.newFromContentBranchConversion ve.dm.Transaction.js:284
ve.ui.ListButtonTool.list ve.ui.ListButtonTool.js:66
ve.ui.ListButtonTool.onClick ve.ui.ListButtonTool.js:175
VeUiButtonTool.tool.$.on.mouseup ve.ui.ButtonTool.js:40
jQuery.event.dispatch load.php:3060
jQuery.event.add.elemData.handle.eventHandle

Fixed in https://gerrit.wikimedia.org/r/25974

Confirmed still an issue.

Pushing to next milestone as they did not make it to master by yesterday.

Reassigning to Trevor because Rob is out

Confirmed still a problem in master as of 2012-11-27; now is a properly-thrown error from ve.dm.Document.prototype.getNodeFromOffset:

Uncaught Error: ve.dm.Document.getNodeFromOffset(): offset 26 is out of bounds ve.dm.Document.js:546
ve.dm.Document.getNodeFromOffset ve.dm.Document.js:546
ve.dm.Surface.change ve.dm.Surface.js:212
ve.ce.Surface.onSelectionChange ve.ce.Surface.js:260
[...]

Fixed in gerrit 36597.