Last modified: 2014-08-20 17:55:34 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T70588, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68588 - VisualEditor: Putting cursor after reference list throws "offset was inside a handlesOwnChildren node" error
VisualEditor: Putting cursor after reference list throws "offset was inside a...
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
Data Model (Other open bugs)
unspecified
All All
: High normal
: VE-deploy-2014-08-21
Assigned To: Ed Sanders
http://en.wikipedia.beta.wmflabs.org/...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-25 20:58 UTC by James Forrester
Modified: 2014-08-20 17:55 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description James Forrester 2014-07-25 20:58:54 UTC
Steps:

1. Open http://en.wikipedia.beta.wmflabs.org/wiki/7thfeb?veaction=edit
2. Scroll to bottom
3. Place cursor in slug between gallery and references list
4. Cursor right twice

Expected outcome: Cursor ends up in slug at end of the page after the references list

Actual outcome: Error thrown: "offset was inside a handlesOwnChildren node"
Comment 1 Roan Kattouw 2014-07-28 19:21:36 UTC
This doesn't seem to be related to focusable nodes or the end of the document. All you need to do is put the cursor in a block slug after a references list.

Suppose the references list is at (23,25). What happens is this:
* setSelection (25,25) is called
* It tries to compute insertion annotations by pulling from the left
* It does so by calling getNearestContentOffset( 24, -1 )
* Two stack levels deeper, getRelativeOffset() notices that 24 is inside of a handlesOwnChildren node and throws an exception

Questions:
* Why is reference list a handlesOwnChildren node? Is it because <ref> can be nested inside of <references>?
* Why do we do offset-1 here? There is a Math.max() to guard against ending up at -1, but this bug uncovers another reason why subtracting one from an offset is dangerous and should ideally never be done
Comment 2 Gerrit Notification Bot 2014-08-20 13:56:00 UTC
Change 155260 had a related patch set uploaded by Esanders:
Fix check for left/right annotations

https://gerrit.wikimedia.org/r/155260
Comment 3 Gerrit Notification Bot 2014-08-20 17:55:34 UTC
Change 155260 merged by jenkins-bot:
Fix check for left/right annotations

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links