Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow selector array for chaining selectors #10

Open
gajus opened this issue Jan 18, 2017 · 0 comments
Open

allow selector array for chaining selectors #10

gajus opened this issue Jan 18, 2017 · 0 comments

Comments

@gajus
Copy link
Owner

gajus commented Jan 18, 2017

Consider the following example:

selector: [
  '.movie[data-id="1"]',
  '.item-list a[href^="/reservation"]'
]

We want to ensure .movie[data-id="1"] selector matches 1 element, then we want to select the descending .item-list a[href^="/reservation"] element.

This is different from .movie[data-id="1"] .item-list a[href^="/reservation"]. The latter would match:

<div data-id="1"></div>
<div data-id="1">
  <div class="list-item">
    <a href="/reservation"></a>
  </div>
</div>

The former would not.

An alternative is to allow use of the quantifier expression anywhere in the selector, e.g.

.movie[data-id="1"] {1}[0] .item-list a[href^="/reservation"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant