Page MenuHomePhabricator

VisualEditor: Changing format of a list item right above a nested list item breaks
Closed, ResolvedPublic

Description

Screenshot

Steps to reproduce:

1.Open a page with
2,Add a bullet list or numbered list
3.Add an empty bullet item
4.Add indentation to it
5.Select the previous item
6.Change the paragraph style of the previous item

Observed Result:
An error appears in the console
Uncaught Error: Unbalanced set of replace operations found

Now press enter to add another item :
Uncaught Error: Unbalanced input passed to document

Press undo:
Uncaught Error: Offset could not be translated to a DOM element and offset

See the screenshot attached

Test Environment: https://test2.wikipedia.org/
Browser: Chrome Version 26.0.1410.65 & FF 25
OS: MAC OS X 10. 8. 5
Page:https://test2.wikipedia.org/wiki/27thmarChrome?veaction=edit


Version: unspecified
Severity: major

Attached:

Screen_Shot_2014-03-27_at_3.54.00_PM.png (768×1 px, 154 KB)

Details

Reference
bz63209

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:53 AM
bzimport set Reference to bz63209.

It suffices to do a format change on any list item that has a nested list item directly beneath it. In other words, if you have the list

  • Foo
  • Bar
    • Baz

then changing "Bar" to a heading will break. It doesn't matter if "Baz" is empty, it just has to be at a deeper list level than "Bar".

I've figured out why this bug happens and I know how to fix it. I have to go now but I'll write a patch when I get back (~1.5 hours)

Change 123892 had a related patch set uploaded by Catrope:
Adjust range manually in isolateAndUnwrap()

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

Change 124493 had a related patch set uploaded by Catrope:
Exclude insertions in ve.dm.SurfaceFragment#isolateAndUnwrap

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

Change 123892 abandoned by Catrope:
Adjust range manually in isolateAndUnwrap()

Reason:
Superseded by https://gerrit.wikimedia.org/r/#/c/124493/

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

Change 124493 merged by jenkins-bot:
Exclude insertions in ve.dm.SurfaceFragment#isolateAndUnwrap

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