Page MenuHomePhabricator

Uncaught TypeError: Cannot read property 'ownerDocument' of undefined
Closed, ResolvedPublic

Description

The title isn't descriptive enough, but I wasn't able to depict what's happening succinctly. When content of table cell is deleted, error from the title of this ticket is logged in console and successive attempts to access the cell by double-clicking aresn't fruitful because we get the weird jump, and cell looks locked forever. Here is the screen recording showing the behavior.

ve-tables-jump.gif (929×1 px, 2 MB)

Here is the transcript of my actions from the gif:

  1. Double click to access the cell with value "20"
  2. Move cursor to enable deleting with backspace key (using Del key gives the same result)
  3. Press backspace twice to delete cell value of "20"
  4. Focus is lost from the cell I'm currently editing
  5. Try to focus/edit same cell again. Double click the cell
  6. Browser window scrolls uncontrollably
  7. Scroll back down to see the cell in question and try again
  8. Trying one more time gives same result

Event Timeline

This is the culprit (cc @matmarex):
https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/VisualEditor/+/432421/

We make only-child paragraphs display:inline for view-mode appearance consistency, but this causes them to be treated as annotations by CE, so when the paragraph is emptied, it is automatically removed from the DOM. The selection focus node is now unattached which triggers the exception.

Esanders raised the priority of this task from Medium to High.Jun 23 2018, 1:16 PM
Esanders added a project: Regression.

Change 441596 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Give up on realistic styling of mw-collapsible

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

Esanders moved this task from Incoming to Code review on the VisualEditor (Current work) board.

The above patch results in a worse rendering of the [collapsible] button in order, at the expense of the CE not crashing:

image.png (489×337 px, 20 KB)

Change 441596 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Give up on realistic styling of mw-collapsible

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

Vvjjkkii renamed this task from Uncaught TypeError: Cannot read property 'ownerDocument' of undefined to ofaaaaaaaa.Jul 1 2018, 1:02 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed Esanders as the assignee of this task.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
JJMC89 renamed this task from ofaaaaaaaa to Uncaught TypeError: Cannot read property 'ownerDocument' of undefined.Jul 1 2018, 4:47 AM
JJMC89 closed this task as Resolved.
JJMC89 assigned this task to Esanders.
JJMC89 updated the task description. (Show Details)