Skip to content

Supporting CSS selectors #1979

Description

@fivefilters

Hi all,

We're considering creating a new repository for these site-specific selectors to use CSS selectors, with XPath as an option if CSS selectors are not expressive enough. I wanted to get your thoughts on such a move.

The mains reasons are:

  1. CSS selectors are more concise and more people are familiar with them than XPath selectors
Image
  • For contains() applied to text content (second to last line in the image above), which the CSS spec does not support, we can use CSS to XPath convertors like Symfony's CSS select which has support for it.
  • For more complicated selectors, we'd probably still want to allow XPath expressions to be entered somehow, but I assume this would not be used so much.
  1. PHP 8.4+ has native CSS selector support, so for most selectors, converting to XPath is not necessary.

The reason we're thinking of doing this in a new repo is so any code dependent on this repo can continue to function. And any new applications can use the new repo if they want. I'm thinking we may even be able to create a regular one-way sync if need be, from new repo to old, if there are no conflicts, as CSS to XPath isn't so difficult.

If anyone has any thoughts or suggestions, please do share. @j0k3r @HolgerAusB @Kdecherf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions