[Bug 26552] New: [Shadow]: consider supporting :first-child, nth-child() in content select

https://www.w3.org/Bugs/Public/show_bug.cgi?id=26552

            Bug ID: 26552
           Summary: [Shadow]: consider supporting :first-child,
                    nth-child() in content select
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Component Model
          Assignee: dglazkov@chromium.org
          Reporter: tomalecpub@gmail.com
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-webapps@w3.org

"3.6 Satisfying Matching Criteria"

Consider following case. Custom Element that extends ordered list(, and creates
a pyramid of news)
my-article-list shadow root:

<div class="lead">
    <h1>Breaking news:</h1>
    <content select=":first-child"></content>
</div>
<div class="asides">
    <content select=":nth-child(2)"></content>
    <content select=":nth-child(3)"></content>
</div>
<div>
    <content></content>
</div>

And input should look like:

<my-article-list>
    <article>Most important article</article>
    <article>Important article</article>
    <article>Important article</article>
    <article>article</article>
    ...
</my-article-list>


Without those pseudo-classes my-articles-list needs to modify light DOM, or at
least CSS properties of child nodes, which seems very intrusive to me.

Use of ".first", ".second", ... classes also does not seem right. As the user
of my-article-list should now be aware how long should he count, and as for
ordered list nodes order already serves this information.

I know that it was removed via 21924, but unfortunately I have no idea how hard
it would be to implement it, and how it could affect performance. I just guess
it could be not much worse than `:not()`.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Monday, 11 August 2014 11:11:58 UTC