Re: [selectors] :sorted pseudoclass for HTML

On Thu, 27 Dec 2012, fantasai wrote:
> On 12/27/2012 06:01 AM, Tab Atkins Jr. wrote:
> > Hixie recently added the ability to declaratively sort tables to HTML. To
> > support these on the CSS side, it would be
> > convenient to define a :sorted pseudoclass, along with :sorted(ascending)
> > and :sorted(descending), which apply to table cells
> > in sorted columns. The relevant bug is at <
> > https://www.w3.org/Bugs/Public/show_bug.cgi?id=20522>. We can just defer to
> > the
> > host language to define what elements are sorted at any given time.
> > 
> > Anyone have any objections to us adding these to Selectors 4?
> 
> Yes. Why are we not just indexing off the [sorted] attribute itself?

That was my initial approach, but unfortunately there's no way to select 
an element whose sorted="" attribute does not contain a space-separated 
keyword that is an integer other than 1, which is what I'd like to match 
here. (We don't technically need the argument, since you _can_ match on 
the attribute having a "reversed" keyword, but it seems cleaner to do it 
all with a pseudo once you're doing any of it with a pseudo.)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 28 December 2012 08:40:45 UTC