Closed Bug 377359 Opened 18 years ago Closed 17 years ago

Group cookies by domain when sorting

Categories

(Camino Graveyard :: Preferences, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino1.6

People

(Reporter: stuart.morgan+bugzilla, Assigned: stuart.morgan+bugzilla)

Details

(Keywords: fixed1.8.1.12)

Attachments

(1 file)

Right now we sort cookies alphabetically, which means that .foo.com and www.foo.com are at opposite ends of the list. We should sort by reverse domain (as Safari does), or perhaps just by everything after the first '.'.
We could use the effectiveTLD service :p
Attached patch reverse dns sort (deleted) — Splinter Review
Sorts cookies and cookie exceptions by reverse dns, for better grouping.
Attachment #295128 - Flags: superreview?
Attachment #295128 - Flags: superreview? → superreview?(mark)
Comment on attachment 295128 [details] [diff] [review] reverse dns sort I've only got comments on variable names. >Index: PreferencePanes/Privacy/PrivacyPane.mm >+- (NSComparisonResult)reverseHostnameCompare:(NSString *)aString { otherString is a little more descriptive? >+ NSArray* leftHandComponents = [self componentsSeparatedByString:@"."]; >+ NSArray* rightHandComponents = [aString componentsSeparatedByString:@"."]; What's special about leftness and rightness? >+ int i = [leftHandComponents count] - 1; >+ int j = [rightHandComponents count] - 1; i and j don't say anything about what string they're attached to, whether they're named "left" and "right" or "self" and "other" or whatever else. Oh, boy, I hope this rots bug 354975 again!
Attachment #295128 - Flags: superreview?(mark) → superreview+
(In reply to comment #3) > Oh, boy, I hope this rots bug 354975 again! Sam will be crushed.
(In reply to comment #3) > What's special about leftness and rightness? Just that it helps me remember which sort result constant to return ;) I'll fix the names. > Oh, boy, I hope this rots bug 354975 again! Zing! (But I'm big enough to admit I deserved that.)
I just checked in bug 354975 (beat ya to it!), feel free to check this in with the additional one-liner change to get the new keychain exclusions sheet to use reverseHostnameCompare:.
Landed on trunk and MOZILLA_1_8_BRANCH with comments 3 and 6 addressed.
Status: NEW → RESOLVED
Closed: 17 years ago
Keywords: fixed1.8.1.12
Resolution: --- → FIXED
Target Milestone: --- → Camino1.6
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: