Re: ::part Additions

On 2.7.2013 17:28, Tab Atkins Jr. wrote:
> On Tue, Jul 2, 2013 at 6:32 AM, Bronislav Klučka
> <Bronislav.Klucka@bauglir.com> wrote:
>> Hi,
>>
>> since new paradigm conserning Custom Pseudo Elements have been introduced
>> http://lists.w3.org/Archives/Public/public-webapps/2013AprJun/0985.html
>> (part 5)
>>
>> I'd like to suggest few additions/changes:
>>
>> 1/ ability to style nested shadow dom elements
> We discussed this in a previous meeting (surfacing nested component
> parts, either automatically or via a switch) but I don't recall what
> the conclusion was.  Dimitri?
As Dimitri mentioned, there is a bug
https://www.w3.org/Bugs/Public/show_bug.cgi?id=22462
I'm mentioning it in my document, I'm fine with this solution, the 
question there is with default value.
>> 2/ change of part attribute from DOMString to DOMTokenList
> This sounds all right.  part='' is already class-like, since multiple
> elements can have the same part='' value.  The example at your page is
> pretty compelling about this ability's usage.  I guess ::part() would
> also expand to taking a list of idents.

Why would it? We have established convention for AND operator
.class1.class2
would became
::part(node-checked)::part(node-selected)

and for OR operator
.class1, .class2
would became
::part(node-checked), ::part(node-selected)

:matches(.class1, .class2)
would became
:matches(::part(node-checked), ::part(node-selected))

>
>> 3/ ability to create complex selectors using ::part
> Interesting!  I guess it would just surface a synthesized tree based
> on only the elements that contain part=''?  That is, two elements
> would have a parent-child relationship (and thus be selectable with
> the > combinator) if they were the closest elements with part='', even
> if there were other elements between them?  Like:
>
> <div part='parent'>
>    <div>
>      <div part='child'></div>
>    </div>
> </div>
>
> ~TJ
Interesting point, maybe little bit counter intuitive for some people, 
but since it's shadow and we are essentially
targeting the only visible parts within the DOM it makes sense

Brona

Received on Tuesday, 2 July 2013 15:53:19 UTC