Re: [css4-selectors] Focused descendant pseudo class

26.01.2012, 20:03, "Brice PARENT" <brice@websailors.fr>:
> Le 26/01/2012 16:33, Marat Tanalin | tanalin.com a écrit :
>
>>  26.01.2012, 03:06, "fantasai" <fantasai.lists@inkedblade.net>:
>>>  On 01/25/2012 02:34 PM, Brian Kardell wrote:
>>>>   ! Or $   ?
>>>>
>>>>   :-)
>>>  Something. Or other. :) The problem with $ was that it's often
>>>  used for variables, so people didn't like that for that reason,
>>>  which is fair. I don't have a particular preference of ASCII
>>>  character.
>>>
>>>  ~fantasai
>>  Currently we probably have too many syntaxes that have similar meaning:
>>
>>  1. ':scope' in Selectors 4 (dev.w3.org/csswg/selectors4/ );
>>  2. '!'  in Selectors 4 (dev.w3.org/csswg/selectors4/ );
>>  3. '&' in CSS Hierarchies Module (dev.w3.org/csswg/css3-hierarchies/ ).
>>
>>  Instead, we could use one ':this' pseudo-element. I've initially proposed this pseudo-element in a thread related to potential '@with' at-rule:
>>
>>  http://lists.w3.org/Archives/Public/www-style/2012Jan/0371.html
>>
>>  (':scope' may be considered as possible alternative for ':this', though use of ':scope' is questionable for me since it can be confusing when used in conjunction with HTML5 scoped stylesheets.)
>
> Wouldn't this disallow the use of :this described in the linked page
> about @rule?
> In the examples with the @rule page, it seems like :this is to be
> replaced by the content of @with, but the selector continues like it
> always does, pointing to the last element.
> Here, the :this would tell that even if the selector is continuing, this
> is the element we want to be affected by the css rules.

':this' pseudoclass is intended to point to current scoping level.

So, ':this' inside ':matches()' points to element which ':matches()' is attached to (if I correctly understand ':matches()' meaning):

    .foo:matches(:this .bar) {...}

while ':this' outside of ':matches()' points to its own parent scope (for example, to @with-rule selector).

To be able to access arbitrary level of scoping, we probably just additionally need functional form of ':this', so that in following example:

    @with(.example) {
        .foo:matches(:this(2) > :this .bar) {...}
    }

':this(2)' would point to '.example', while ':this' points to ':matches()' subject.

At that, ':this', ':this()', ':this(0)', ':this(1)' would be equivalents of each other.

As for current draft for subject selector, I personally don't quite like that paradigm at all, and I would instead prefer more flexible and intuitive '<' and '<<' combinators that I've proposed earlier in current thread:

http://lists.w3.org/Archives/Public/www-style/2012Jan/1143.html

Received on Friday, 27 January 2012 17:02:24 UTC