implement stable sorting in cookie manager, etc.



15 years ago
3 years ago


(Reporter: chaw, Unassigned)


Firefox Tracking Flags

(Not tracked)




15 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040624 Debian/1.7-2
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040624 Debian/1.7-2

In short, the sorting method used for sorting cookies (and probably other items
in other tools and windows) is not stable.  Technically, it is probably not a
bug, since the sorting interface doesn't promise stable sorts.  However, not
having a stable sort makes it quite hard to deal with large lists.  Bug 57898,
reported for MailNews, has a fairly long discussion of essentially this
behavior, so I'll point  to it for more details.

Reproducible: Always
Steps to Reproduce:
1. Visit a number of cookie-full pages, with cookie warnings enabled; permit
some sites to set cookies and bar others, so that the cookie manager has several
such directives stored.
2. Bring up the cookie manager, say, using the Tools menu; click on the Sites tab.
3. Sort on Site by clicking on the header; sort on Status; repeat as needed.

Actual Results:  
Sorting is not stable: Items are reordered when not required, destroying their
natural or earlier-sorted order.

Expected Results:  
A stable sorting algorithm would maintain the order of previous sorts and would
be the easiest solution.

There are obvious similarities with Bug number 57898, reported for MailNews.

In general, it would be really nice to have stable-sort behavior in all
interfaces that support sorting (e.g., bookmarks, cookies, history, mail
folders, ...).


15 years ago
Component: Browser-General → X-remote
OS: Linux → All
Hardware: PC → All

Comment 1

15 years ago
This is sorted via JavaScript Array.sort (called in SortTree at

Previous cookie sort problems are in Component Networking:Cookies (such as bug

Making JavaScript Array.sort stable is bug 224128, so this bug depends on that bug.

(BTW mailnews header sorting turns out to be implemented with C++, called in
MsgSortThreadPane at
Depends on: 224128
Comment hidden (obsolete)

Comment 3

14 years ago
(In reply to comment #2)

This bug still exists.  To reproduce, try bring up the window that displays
cookies and then sort the different columns as indicated in the original report.

Comment 4

4 years ago
confirming that cookie manager sorting is unstable.

Stable sorting is available (bug 224128) but is not being used.
Component: X-remote → Untriaged
Ever confirmed: true
Summary: Sorting is not stable, making it difficult to manage large lists of cookies, etc. → implement stable sorting in cookie manager, etc.


3 years ago
Component: Untriaged → JavaScript Engine
This isn't a JS bug, it's a bug in the SeaMonkey cookie manager (which doesn't share code with Firefox'). If the Firefox cookie viewer has a similar issue, a different bug should be filed for that in Firefox::Preferences.
Component: JavaScript Engine → Preferences
Product: Core → SeaMonkey
Assignee: general → nobody
Component: Preferences → Passwords & Permissions
You need to log in before you can comment on or make changes to this bug.