Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 76c1251

Browse filesBrowse files
committed
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
2 parents 1616d36 + 16e86bc commit 76c1251
Copy full SHA for 76c1251

File tree

2 files changed

+2
-1
lines changed
Filter options

2 files changed

+2
-1
lines changed

‎src/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct()
4444
$this->nonAsciiPattern = '[^\x00-\x7F]';
4545
$this->nmCharPattern = '[_a-z0-9-]|'.$this->escapePattern.'|'.$this->nonAsciiPattern;
4646
$this->nmStartPattern = '[_a-z]|'.$this->escapePattern.'|'.$this->nonAsciiPattern;
47-
$this->identifierPattern = '(?:'.$this->nmStartPattern.')(?:'.$this->nmCharPattern.')*';
47+
$this->identifierPattern = '-?(?:'.$this->nmStartPattern.')(?:'.$this->nmCharPattern.')*';
4848
$this->hashPattern = '#((?:'.$this->nmCharPattern.')+)';
4949
$this->numberPattern = '[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)';
5050
$this->quotedStringPattern = '([^\n\r\f%s]|'.$this->stringEscapePattern.')*';

‎src/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ public function getPseudoElementsTestData()
186186
array('foo:after', 'Element[foo]', 'after'),
187187
array('foo::selection', 'Element[foo]', 'selection'),
188188
array('lorem#ipsum ~ a#b.c[href]:empty::selection', 'CombinedSelector[Hash[Element[lorem]#ipsum] ~ Pseudo[Attribute[Class[Hash[Element[a]#b].c][href]]:empty]]', 'selection'),
189+
array('video::-webkit-media-controls', 'Element[video]', '-webkit-media-controls'),
189190
);
190191
}
191192

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.