Last modified: 2014-08-20 17:55:34 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"
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
Change 155260 had a related patch set uploaded by Esanders: Fix check for left/right annotations https://gerrit.wikimedia.org/r/155260
Change 155260 merged by jenkins-bot: Fix check for left/right annotations https://gerrit.wikimedia.org/r/155260