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

add "has" function (parent selector) #8

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

add "has" function (parent selector) #8

gajus opened this issue Jan 18, 2017 · 0 comments

Comments

@gajus
Copy link
Owner

gajus commented Jan 18, 2017

  • CSS does not have a parent selector.
  • cheerio has has() selector.

Since we want Surgeon to work across different environment (i.e. browser), we'd need to implement this on the Surgeon level.

Use case

Sometimes it is required to know whether an element has a descending element to know if it is the right element, e.g. http://www.mk2.com/salles/mk2-gambetta.

To select all table rows that contain movie information, we can check if a table row includes information about the movie name.

#seances .l-mk2-tables .l-session-table .fiche-film-info::has(.fiche-film-title)
@gajus gajus changed the title add "has" function (parent selector) add "filter" function Jan 18, 2017
@gajus gajus changed the title add "filter" function add "has" function (parent selector) Jan 18, 2017
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