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

[CssSelector] Fix CSS identifiers parsing - they can start with dash #26450

Merged
merged 1 commit into from Mar 8, 2018

Conversation

Projects
None yet
4 participants
@jakubkulhan
Copy link
Contributor

commented Mar 7, 2018

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

Vendor prefixes use - (dash) at the start of CSS identifiers.

@@ -43,7 +43,7 @@ public function __construct()
$this->stringEscapePattern = $this->newLineEscapePattern.'|'.$this->escapePattern;
$this->nonAsciiPattern = '[^\x00-\x7F]';
$this->nmCharPattern = '[_a-z0-9-]|'.$this->escapePattern.'|'.$this->nonAsciiPattern;
$this->nmStartPattern = '[_a-z]|'.$this->escapePattern.'|'.$this->nonAsciiPattern;
$this->nmStartPattern = '[_a-z-]|'.$this->escapePattern.'|'.$this->nonAsciiPattern;

This comment has been minimized.

Copy link
@javiereguiluz

javiereguiluz Mar 8, 2018

Member

Checking the official CSS grammar I found this:

nmstart		[_a-z]|{nonascii}|{escape}
nmchar		[_a-z0-9-]|{nonascii}|{escape}
ident		-?{nmstart}{nmchar}*

So maybe we should move the optional starting - to $this->identifierPattern?

This comment has been minimized.

Copy link
@jakubkulhan

jakubkulhan Mar 8, 2018

Author Contributor

Sure, fixed according to CSS grammar.

@jakubkulhan jakubkulhan force-pushed the jakubkulhan:fix-css-selector branch from 346be01 to 16e86bc Mar 8, 2018

@stof

stof approved these changes Mar 8, 2018

@stof

This comment has been minimized.

Copy link
Member

commented Mar 8, 2018

Good catch, thanks @jakubkulhan.

@stof stof merged commit 16e86bc into symfony:2.7 Mar 8, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

stof added a commit that referenced this pull request Mar 8, 2018

bug #26450 [CssSelector] Fix CSS identifiers parsing - they can start…
… with dash (jakubkulhan)

This PR was merged into the 2.7 branch.

Discussion
----------

[CssSelector] Fix CSS identifiers parsing - they can start with dash

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Vendor prefixes use `-` (dash) at the start of CSS identifiers.

Commits
-------

16e86bc [CssSelector] Fix CSS identifiers parsing - they can start with dash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.