Re: ::part Additions

On 2.7.2013 18:21, Bronislav Klučka wrote:
>
> On 2.7.2013 18:03, Tab Atkins Jr. wrote:
>> On Tue, Jul 2, 2013 at 8:52 AM, Bronislav Klučka
>> <Bronislav.Klucka@bauglir.com> wrote:
>>> 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:
>>>>> 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))
>> Oh, no no no.  ::part() is not a pseudo-class, it's a pseudo-element -
>> it points to a brand new element, rather than filtering the one you've
>> got.  The fact that part='' is acting like class='' notwithstanding,
>> using ::part() like would be an abuse of the syntax.  If we want to
>> support this, it has to be through something like "::part(node-checked
>> node-selected)".
>>
>> As an example of why violating the syntax model is a bad idea, this
>> directly conflicts with your desire to surface the ::part()s of nested
>> components - the thing that exposes them might be exposed as a
>> ::part() as well, so you need to be able to chain off of an existing
>> ::part(), like "x-video::part(controls)::part(play-button)" (assuming
>> the controls were actually implemented by another component nested
>> inside the <x-video> shadow tree).
>>
>> ~TJ
>>
> And back to
>
> x-video::part(controls)::part(play-button)
>
> example
>
> how it would be different from
>
> x-video ::part(controls) ::part(play-button)
>
> or this wouldn't be possible? the only possibilities being
> ::part(play-button)
> or
> ::part(controls)::part(play-button)
> or
> x-video::part(controls)::part(play-button)
>
> Brona
>
>
>
>
>

I do not want to spam this topic so just last thought on pseudo-elements 
and custom pseudo elements (parts), it's more generic issue (CSS 
selector syntax)
the no-space syntax can work when there is only one pseudo-element and 
usually the last one

p::first-letter - makes sense
thou as an "element:: it would be better to  for something like
p ::first-letter or p > ::first-letter not to target first letters in 
SPANs in P..
because its element within other element... not a filter
but when we start to nest and go more complex it becomes really strange

consider chessboard
------------------------------------------
with regular HTML+CSS one would go for something like

table td { background: silver; }
table tr:nth-of-child(2n + 1) td:nth-of-child(2n),
table tr:nth-of-child(2n) td:nth-of-child(2n + 1) { background: black; }
------------------------------------------
my way (wrong way)

chessboard ::part(cell) { background: silver; }
chessboard ::part(row):nth-of-child(2n + 1) ::part(cell):nth-of-child(2n),
chessboard ::part(row):nth-of-child(2n) ::part(cell):nth-of-child(2n + 
1) { background: black; }

nesting working as usual (no change there), replacing TR and TD with 
custom counterparts - intuitive, easy
------------------------------------------
correct way

chessboard::part(cell) { background: silver; }
chessboard::part(row):nth-of-child(2n + 1)::part(cell):nth-of-child(2n),
chessboard::part(row):nth-of-child(2n)::part(cell):nth-of-child(2n + 1) 
{ background: black; }

mixing of pseudo classes and pseudo elements into one strange selector 
one have to carefully read to separate parts, what is pseudo element, 
what is pseudo class.
------------------------------------------

the fact is, that no space creates filtering and space created nesting 
is throughout the CSS, regardless of selector (tag, class, id, 
attrribute), with this only exception. pseudo element is not actually 
filter on set of parents, but nested parts of all parents

p ::part(this1) + ::part(this2) makes sense and only one sense
p::part(this1) + p::part(this2) is confusing

as I wrote above, nesting several pseudo elements, allowing complex 
selectors makes this a lot more confusing.


  Brona

Received on Tuesday, 2 July 2013 17:44:45 UTC