Page MenuHomePhabricator

VisualEditor: "Uncaught Error:Invalid start offset:-1" shows up while deleting the bullets of a bulleted list
Closed, ResolvedPublic

Description

Steps to reproduce:

There are several issues in this bug.I tried to document all of them chronologically in one issue for convenience.

1.click on the Edit button
2.click on the bullet list icon.
3.Click on tab to add indentation to the list for several times.
4.Now press Enter/Return
5.It deletes the bullets, where as pressing delete does not do that.
6.After deleting all the bullets by pressing return it goes to the next line
7.Again add bulleted list with indentation on the first line
8.Now this time if you press Enter it goes to the next line but does not add next bullet.
9.Now go to the end of the first line and press enter, this time the next bullet gets added.
10.Now try adding indentation to the second item , it does not work
11.Delete the bullet and repeat the action again,this time it will add indentation.
12.Now if you save the page , you will see there is no bullets in the read mode
13.If you try to delete all the content by selecting with mouse pad, it gives the error:
"Uncaught Error:Invalid start offset:-1"

Test Environment: production
Browser: Chrome Version 26.0.1410.65 & FF 25
OS: MAC OS X 10. 8. 5
Example Page where in the read mode there is no bullets but in the edit mode they appear:

http://en.wikipedia.beta.wmflabs.org/wiki/New_bullet


Version: unspecified
Severity: normal

Details

Reference
bz58003

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:18 AM
bzimport set Reference to bz58003.

Another way to reproduce the error "Uncaught Error:Invalid start offset:-1"

1.Open the editor
2.Add a text
3.Go the next line add a bullet list with a text
4.Add indentation to that item
5.Press enter go to the next line then add indentation to the second empty bullet item
6.Press enter to go to the next line
7.It actually takes the cursor to the end of first bulleted item
8.Press delete until all the bullets comes in the same line.
9.The cursor then moves to the end of the first line of step 2
10.Delete that text
11.Now place your cursor at the end of series bullets press delete to delete it

A. you will get the error:Uncaught TypeError: Cannot call method 'getOffset' of null

B. If you again press delete , you will get "Uncaught Error:Invalid start offset:-1"

C. if you press undo then redo, you will get "Uncaught Error: Unbalanced input passed to document"

D. if you attempt to save the page, you will get "Uncaught TypeError: Cannot set property 'lastOuterPost' of null"

Steps 1-7 are as expected. I don't understand step 8, as after 7 there is only one double-indented bullet item.

Created attachment 14088
video capture of the bug

Attached:

I've reproduced the steps in the video but I don't get an exception. Can you try again with the latest code.

Yes , I can still reproduce it.Attaching the screenshot.
Are you getting the error:Uncaught TypeError: Cannot call method 'getOffset' of null ?

Created attachment 14234
Reproduced on 6th Jan

Attached:

Screen_Shot_2014-01-06_at_9.39.46_AM.png (658×997 px, 127 KB)

I can't reproduce this problem as written (Chrome here too), but there is some funkiness related to being able to split some mutli-depth bullet list items oddly.

Giving steps to reproduce again:

1.Open a completely new page with VE
2.Add a text
3.Click on Bullet list icon from the toolbar
4.Add indentation to that line
5.Go to the next line (Adds a second bullet)
6.Add indentation to this second bullet line too
7.Go back to the first bullet point and delete the text
8.Go back to end of the second empty bullet point
9.Press Delete(this will bring all the bullet points in one line)

After this step you will get the error:Uncaught TypeError: Cannot call method 'getOffset' of null

If you press Delete again it will show error Uncaught Error: Invalid start offset: -1

Looks like this was done as part of the "handle enter" re-write.