Steps to reproduce:
- In VE standalone, edit a<!----><dl></dl>
- Open the debugger, then click to put the selection beside the 'a'.
- Press Ctrl+A
Expected behaviour: Whole document is selected
Actual behaviour: Exception is thrown because the DOM selection leaks one text character beyond the ve-ce-surface div (into the ve-ui-debugBar-selectionLabel).
This is because the empty comment creates a { type: 'commentMeta' } node, whose outer length in the DM getNodeAndOffset doesn't count properly (because it has no corresponding DOM node).
This has regressed since the metadata patch: https://gerrit.wikimedia.org/r/#/c/385492/ - before that, meta items did not have an outer length.