Page MenuHomePhabricator

In production, sometimes page scrolling stops working and in the console getting "Error: offset was inside a handlesOwnChildren node" in Firefox
Closed, ResolvedPublic8 Estimated Story Points

Description

I am getting this issue is happening intermittently ,
When I place my cursor into a slug,I see an error in the console:
Uncaught Error: offset was inside a handlesOwnChildren node

Then I am getting stuck at that part of page , not being able to scroll up or down , or Close /Save the page.

I dont have any exact steps to reproduce right now.Will update the bug when I find it.


Version: unspecified
Severity: normal

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:31 AM
bzimport set Reference to bz68537.

(In reply to Rummana Yasmeen from comment #0)

I am getting this issue is happening intermittently ,
When I place my cursor into a slug,I see an error in the console:
Uncaught Error: offset was inside a handlesOwnChildren node

Does this happen only for slugs right after a reference list node? Cause that's bug 68588.

Then I am getting stuck at that part of page , not being able to scroll up
or down , or Close /Save the page.

Whooaaaaa, that's scary.

I managed to reproduce it consistently by following these steps:

1.Open this page:https://en.wikipedia.org/wiki/User:RYasmeen_%28WMF%29/sandbox?veaction=edit
2.Click on any of the references list
3.Now place your cursor at the bottom edge of the highlight of references list, you will see cursor appearing in the last line
4.Now try adding a media file there

It gets stuck and throws error:
Uncaught Error: offset was inside a handlesOwnChildren node

See the video capture attached

This happens because of a bug in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1132768 . Firefox wrongly allows the cursor to be dropped inside of a contenteditable=false node, but only if the selection was in a different contentEditable area before; if the selection was in the same contentEditable area, then Firefox does behave correctly. Rummana's actions trigger this bug because clicking on the reference list's highlight focuses the pasteTarget, and then clicking at the edge moves the focus back into the surface. You can achieve the same effect by placing the cursor in a table cell (by double-clicking on the cell), then clicking at the edge of a cE=false node. However, if the cursor came from within the same container (e.g. it was on the line below the references list), you won't trigger this bug, because Firefox behaves correctly in that case (well, mostly correctly, apart from https://bugzilla.mozilla.org/show_bug.cgi?id=1097242 ).

Applying -moz-user-select: none; to focusable nodes appears to fix this. I propose we use that as a workaround, unless someone knows of a reason why that's a bad idea, or someone can convince me that we should use -moz-user-select: all; instead.

Incidentally, this is like the only case ever where getting Uncaught Error: offset was inside a handlesOwnChildren node actually makes sense. The cursor ends up inside the references list, and trying to insert an image there will fail, as it should, because reference lists are handlesOwnChildren nodes and you can't insert stuff into them.

Jdforrester-WMF renamed this task from VisualEditor: In production, sometimes page scrolling is not working and in the console Getting Error: offset was inside a handlesOwnChildren node to In production, sometimes page scrolling is not working and in the console Getting Error: offset was inside a handlesOwnChildren node in Firefox.Feb 14 2015, 1:19 AM

Change 192031 had a related patch set uploaded (by Catrope):
Work around Firefox bug allowing cursor in cE=false

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

Patch-For-Review

Jdforrester-WMF renamed this task from In production, sometimes page scrolling is not working and in the console Getting Error: offset was inside a handlesOwnChildren node in Firefox to In production, sometimes page scrolling stops working and in the console getting "Error: offset was inside a handlesOwnChildren node" in Firefox.Feb 23 2015, 5:02 PM
Jdforrester-WMF closed this task as Resolved.
Jdforrester-WMF reassigned this task from Esanders to Catrope.
Jdforrester-WMF moved this task from Accepted to Done on the VisualEditor 2014/15 Q3 blockers board.

Change 192031 merged by jenkins-bot:
Work around Firefox bug allowing cursor in cE=false

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