Closed Bug 753672 Opened 9 years ago Closed 9 years ago
Dragging and dropping a bookmark in Chevron makes wrong order
Build Identifier: http://hg.mozilla.org/releases/mozilla-beta/rev/168f3814b32e 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. Reproducible: Always Steps to Reproduce: 1. Add bookmarks and shrink window width so that chevron popup contains as follows aaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccccc 2. Drag and drop ccccccccccccccccccccccc to between aaaaaaaaaaaaaaaaaaaaaaa and bbbbbbbbbbbbbbbbbbbbbbb Actual Results: bbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccccc aaaaaaaaaaaaaaaaaaaaaaa Expand window width, you can see correct order. aaaaaaaaaaaaaaaaaaaaaaa ccccccccccccccccccccccc bbbbbbbbbbbbbbbbbbbbbbb Expected Results: aaaaaaaaaaaaaaaaaaaaaaa ccccccccccccccccccccccc bbbbbbbbbbbbbbbbbbbbbbb
This problem also exists in Aurora14.0a2 and Nigtly15.0a1.
The problem is this code: http://mxr.mozilla.org/mozilla-central/source/browser/components/places/content/browserPlacesViews.js#1245 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.
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.
sorry, attached the queue patch instead of the 8 lines of context ones.
Attachment #622957 - Flags: review? → review?(mano)
Attachment #622957 - Flags: review?(mano) → review+
OS: Windows 7 → All
Hardware: x86 → All
Target Milestone: --- → Firefox 15
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"
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.