- From: Benjamin Poulain <bpoulain@apple.com>
- Date: Tue, 07 Oct 2014 11:50:20 -0700
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- Cc: "L. David Baron" <dbaron@dbaron.org>, Ted O'Connor <eoconnor@apple.com>, www-style list <www-style@w3.org>
- Message-id: <D8DF8ABC-1BE4-4119-9566-DD18664AAC87@apple.com>
On Oct 7, 2014, at 10:36 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote: > On Mon, Oct 6, 2014 at 6:41 PM, Benjamin Poulain <bpoulain@apple.com> wrote: >> Thanks for the feedback! >> >> On Oct 6, 2014, at 1:50 PM, L. David Baron <dbaron@dbaron.org> wrote: >>> On Monday 2014-10-06 12:27 -0700, Benjamin Poulain wrote: >>>> Hi, >>>> >>>> I have added :nth-child(An+B of selector) to Webkit (for now as an experimental feature behind a flag but enabled by default in WebKit Nightly). >>>> >>>> I have the following feedback: >>>> >>>> 1) Because of the definition (An+B-1 matching the selectorList), it is almost always necessary to repeat the selectors outside and inside :nth-child(). Most cases look something like: >>>> li[foo].bar:nth-child(2n+1 of li[foo].bar) >>>> >>>> I personally like the power given by that definition but it is counter intuitive to write selectors with it. In my opinion, it would be beneficial to have one example covering this aspect in the specification. >>> >>> I wonder if that's really what we want, though. I tend to think >>> it's not. (Just because the :nth-child() definitions were written a >>> certain way before we added the "of" feature doesn't mean that we >>> want to keep the formal definition the same way once it starts >>> mattering which of two choices [1] we take for how to write the >>> formal definition.) >>> >>> At the very least, I don't think the group discussed this when >>> agreeing to add the feature, and I think we should. >> >> I am very much divided on this. >> >> On one hand, the current definition allows for some cool stuff. >> >> For example, you can easily get any image appearing directly after the first paragraph and only the first paragraph: >> img:nth-child(2 of p) >> or with no paragraph above: >> img:nth-child(1 of p) > > Being able to select a range *until* something else is something that > I think is useful, but should be addressed directly, rather than > smuggled in via a confusing and unintended syntax. The same argument > applies to descendant selectors, for example - it's reasonable to want > to select all "img" descendants of a comment block, but not ones > nested inside of *further* comments. Ok, awesome, looks like everyone agrees. I’ll update the implementation this week. Can you please update the definition? I’ll create a WebKIt specific extensions for the use cases that are no longer covered. Benjamin
Received on Tuesday, 7 October 2014 18:52:45 UTC