Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0 ID:20120501201020
Dragging and dropping a bookmark in Chevron makes wrong order.
Bug 731563 and bug 734646 triggered this problem.
Steps to Reproduce:
1. Add bookmarks and shrink window width so that chevron popup contains as follows
2. Drag and drop ccccccccccccccccccccccc to between aaaaaaaaaaaaaaaaaaaaaaa and bbbbbbbbbbbbbbbbbbbbbbb
Expand window width, you can see correct order.
aaaaaaaaaaaaaaaaaaaaaaa ccccccccccccccccccccccc bbbbbbbbbbbbbbbbbbbbbbb
This problem also exists in Aurora14.0a2 and Nigtly15.0a1.
Created attachment 622651 [details]
json backup if necessary
The problem is this code:
that is using wrong indices (with the _startMarker those should be increased by 1), making a patch that uses the right indices is trivial.
Though, the fact is that I don't see why we need that code at all, the chevron view should update quite fine by itself, indeed commenting it out everything works like a charm. I wonder if it's just something inherited from a past where the chevron was not a view. Taking a deeper look at old blame, but I think I'll just remove that code...
Funny, I added that code in bug 418671, like 4 years ago. The reason is updateChevron was synchronous at that time, the toolbar gets the nodeMoved before the chevron, and calls updateChevron, then the menu gets nodeMoved and does the actual nodes exchange, at this point in the old code updateChevron had made its work already, so the visible/hidden nodes status was out of sync.
Now instead, updateChevron is fired on a 100ms timer, this means by the time it runs the menu already got nodeMoved, so the proper nodes are made visible/hidden.
I don't really think we plan to go back to the synchronous behavior, so I'll remove the code and stick a nice comment about what we should do and why we don't need to.
Created attachment 622956 [details] [diff] [review]
I think this is actually even better than the old approach, the menu view has better knowledge of itself than someone else.
I also think making a test here would be tricky, not impossible but the time to make it proper is not worth it.
Created attachment 622957 [details] [diff] [review]
sorry, attached the queue patch instead of the 8 lines of context ones.
I'm not going to ask approval here, even if this would be a safe fix, there is not need to rush it since there is dataloss, just some broken ordering (and it's easy to fix the order in the library or sidebar)
"since there is NO dataloss"