W3C home > Mailing lists > Public > www-style@w3.org > November 2013

Re: [selectors] :sorted pseudoclass for sorted tables

From: Peter Linss <peter.linss@hp.com>
Date: Mon, 25 Nov 2013 20:06:40 -0800
Cc: www-style list <www-style@w3.org>
Message-Id: <1D6FC9A4-FE2E-4AC0-B419-8A76575A428D@hp.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

On Nov 25, 2013, at 1:05 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> Now that HTML defines a way to sort tables, Hixie would like a
> pseudoclass letting authors target based on this:
> <https://www.w3.org/Bugs/Public/show_bug.cgi?id=20522>
> 
> His proposal is for a :sorted pseudo-class, which also comes in a
> functional version, :sorted( [ ascending | descending ] ).  He's
> looking at defining it to match <th> elements that head a sorted
> column.
> 
> Thoughts?  Any objections to me adding this to Selectors 4?

Sounds reasonable. If we’re going to add it though, I suggest we also add the capability to select on the ordinality of the sort, something like:
:sorted( [ ascending | descending ] || <number> )

It’s also unfortunate that the selector uses ‘ascending’ and ‘descending’ where HTML uses ‘’ and ‘reversed’ for the sort order. It would be easier for authors to remember if they were in sync.

Peter
Received on Tuesday, 26 November 2013 04:07:05 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:37 UTC