This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20524 - We should come up with a more intelligent default sorting algorithm.
Summary: We should come up with a more intelligent default sorting algorithm.
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-27 01:12 UTC by contributor
Modified: 2013-03-02 01:30 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2012-12-27 01:12:03 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#table-sorting-model
Complete: http://www.whatwg.org/c#table-sorting-model

Comment:
We should come up with a more intelligent default sorting algorithm.

Posted from: 76.102.14.57
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.101 Safari/537.11
Comment 1 Ian 'Hixie' Hickson 2012-12-27 01:19:10 UTC
Specifically, one that handles all of the following:

  * IPv4 addresses
  * Version numbers (lists of integers)
  * Simple floating point numbers (-1.0, 0.1, 100, .100)
  * Simple floating point numbers with prefixes and suffixes
    ($3.00, $30.00, 30g, 0.35mm) - sorting on the number
  * Strings like "season 5 episode 14", sorting on the numbers
  * Strings without numbers, of course

This probably means walking the strings one character at a time, and when we get to what looks like a number, figuring out if it's in the form digits, -digits, digets.digits, -digits.digits, or digits.digits.digits, and sorting accordingly.
Comment 2 Ian 'Hixie' Hickson 2012-12-27 22:31:28 UTC
Stuart says he has also been asked about exponent floats (as in, 1.2e3).
Comment 3 contributor 2013-03-02 01:30:23 UTC
Checked in as WHATWG revision r7727.
Check-in comment: Sort algorithm, first draft.
http://html5.org/tools/web-apps-tracker?from=7726&to=7727