Re: :nth-col() extension

On Tue, Jan 27, 2009 at 8:11 PM, L. David Baron <dbaron@dbaron.org> wrote:
>
> On Tuesday 2009-01-27 19:59 -0600, Tab Atkins Jr. wrote:
>> Assuming for a moment that the :col() pseudoclass were planned for
>> implementation, would :col(:hover) (and presumably :col(:active) and
>> :col(:focus)) pose any substantial problem?
>
> I see the use case for :hover, but I'm having trouble inferring from
> that what you'd want :active and :focus to do here.

Sorry about that.  My email was originally only about hover; I added
the :focus and :active bits without much thought, and so yeah, it
doesn't directly make much sense.  ^_^  The idea (in my mind) was
something akin to "tr:matches(td :focus) td" (which also depends on
currently undefined syntax) - that is, match any cells in a row
(/column) which contains a cell with a focused/active element.  That
wouldn't be implied at all by the simple ":col(:focus)" selector, so
ignore that.  Let's just talk about :hover.

> That said, I think it might be better to have a different selector,
> since I'm somewhat uncomfortable making :hover mean something
> different inside :col().  In other words, we add a :column-hover
> pseudoclass that matches any table-column one of whose cells is in
> :hover, and then :col(:column-hover) matches any of those cells.

I wouldn't have a problem with this, and I see what you mean by
":hover [meaning] something different inside :col()".  Since the
selector within :col() is meant to directly target <col> elements, and
a <col> element can't ever be hovered in the proper sense, I accept
that this would be a little weird.

>> PS: While I'm here, it feels a little better for a :col or :nth-col to
>> instead be ::col or ::nth-col, that is, for it to be a pseudoelement
>> rather than a pseudoclass.  This might seem weird (<col> is a real
>
> No, it's definitely a pseudo-class, since it's something that
> applies to an existing element (a cell).

Indeed, in the normal conception of things.  My little aside would
have required the ::col() pseudoelement to be part of a normal
selector and have children and such, so that you would write
"::col(#col1) td" to target the <td>s associated with <col id="col1">.
 As I wrote, though, it would mean breaking the existing pseudoelement
syntax, which isn't worth it.  It was just a meandering aside, not
meant to be taken as a serious part of the proposal.  ^_^

~TJ

Received on Wednesday, 28 January 2009 02:44:52 UTC