Page MenuHomePhabricator

ve.ce.FocusableNode throws an error on selecting an about group containing a top-level whitespace text node
Closed, ResolvedPublic8 Estimated Story Points

Description

  1. In VE standalone, load <p><span about="x" rel="ve:Alien">Foo</span> <a about="x" rel="ve:Alien" href="foo">Bar</a></p>
  2. Cursor right
  3. Observe the error in ve.ce.FocusableNode where node.classList.contains is accessed on a text node

The error happens with any text node (it needn't be whitespace) or comment node. If we want to ban top-level text nodes/comment nodes from about groups altogether (including whitespace) we should modify getAboutGroup in ve.dm.Converter to reflect that. Else we should handle these things correctly.

Event Timeline

Per discussion this should be treated as two separate groups. About grouping is only supposed to work on sibling elements, so top level text nodes must be wrapped.

Change 287199 had a related patch set uploaded (by Esanders):
Split about groups on text nodes

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

Jdforrester-WMF triaged this task as High priority.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
Jdforrester-WMF set the point value for this task to 8.

Change 287199 merged by jenkins-bot:
Split about groups on text nodes

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