Page MenuHomePhabricator

Uncaught Error: “Offset could not be translated to a DOM element and offset: 2” when selecting a heading format with language inspector open.
Closed, ResolvedPublic8 Estimated Story Points

Description

Environment- beta, test2

1>Open the language inspector on an empty page.
2>While the inspector is open, select any heading format.
JS error Uncaught Error: “Offset could not be translated to a DOM element and offset: 2”.Screenshot attached.

Event Timeline

Swainr raised the priority of this task from to Medium.
Swainr updated the task description. (Show Details)
Swainr changed Security from none to None.
Swainr subscribed.

s1.png (574×1 px, 64 KB)

Browsers-Chrome 39,FF 33.1.1

I can't reproduce this. Seems similar to T74950 though

Actually I got this, but I had to start with a blank document. Will change the task description.

Jdforrester-WMF renamed this task from [Regression pre-wmf12]- Uncaught Error: “Offset could not be translated to a DOM element and offset: 2” when selecting a heading format with language inspector open. to [Regression wmf12] Uncaught Error: “Offset could not be translated to a DOM element and offset: 2” when selecting a heading format with language inspector open..Jan 10 2015, 1:19 AM

Comes down to the inspector closing, and trying to restore the selection by doing context.getSurface().getView().focus(); ...and discovering that it has a bad idea what the selection should be. (Specifically, it thinks the selection is at index 2, when the max allowable would be 1.)

Change 250646 had a related patch set uploaded (by DLynch):
Forcibly trigger a selection when using a Tool, to close inspectors

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

@DLynch and I decided this should wait for the basic scheduler singleton (T117620 ), which should be implementable fairly quickly, rather than further increasing the setTimeout complexity of the codebase.

Change 250904 had a related patch set uploaded (by DLynch):
Add ve.Scheduler, use it to avoid conflict in ve.ui.Tool

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

Change 250646 merged by jenkins-bot:
Close inspectors before executing a ve.ui.Tool command

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

Jdforrester-WMF renamed this task from [Regression wmf12] Uncaught Error: “Offset could not be translated to a DOM element and offset: 2” when selecting a heading format with language inspector open. to Uncaught Error: “Offset could not be translated to a DOM element and offset: 2” when selecting a heading format with language inspector open..Nov 10 2015, 12:46 AM
Jdforrester-WMF closed this task as Resolved.
Jdforrester-WMF assigned this task to DLynch.
Jdforrester-WMF removed a project: Patch-For-Review.
Jdforrester-WMF edited a custom field.