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

IBX-6230: Added validation of CSS selectors #69

Merged
merged 3 commits into from
Aug 23, 2023
Merged

Conversation

mnocon
Copy link
Contributor

@mnocon mnocon commented Jul 21, 2023

JIRA: https://issues.ibexa.co/browse/IBX-6230

This PR makes sure that it's not possible to use selectors that are not fully supported by the Symfony CssSelector component.

See: https://symfony.com/doc/current/components/css_selector.html#limitations-of-the-cssselector-component

Pseudo-classes are partially supported:

    Not supported: *:first-of-type, *:last-of-type, *:nth-of-type and *:nth-last-of-type (all these work with an element name (e.g. li:first-of-type) but not with the * selector).

After this PR is merged it will be impossible to use a selector that is not supported - currently they can be used, but they are incorrectly translated into XPath and result in hard to debug issues.

Error:

Zrzut ekranu 2023-07-23 o 10 22 47

Status:

@sonarcloud
Copy link

sonarcloud bot commented Aug 18, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 9 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mnocon mnocon marked this pull request as ready for review August 21, 2023 10:38
@mnocon mnocon changed the title Added validation of CSS selectors IBX-6230: Added validation of CSS selectors Aug 21, 2023
@micszo micszo merged commit e937754 into main Aug 23, 2023
14 of 15 checks passed
@micszo micszo deleted the add-css-validator branch August 23, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants