[CssSelector] ignored an optional whitespace after a combinator
This commit is contained in:
parent
d34383f10b
commit
c642a5ec19
@ -153,6 +153,11 @@ class CssSelector
|
||||
} elseif (in_array($peek, array('+', '>', '~'))) {
|
||||
// A combinator
|
||||
$combinator = (string) $stream->next();
|
||||
|
||||
// Ignore optional whitespace after a combinator
|
||||
while (' ' == $stream->peek()) {
|
||||
$stream->next();
|
||||
}
|
||||
} else {
|
||||
$combinator = ' ';
|
||||
}
|
||||
|
@ -64,6 +64,8 @@ class CssSelectorTest extends \PHPUnit_Framework_TestCase
|
||||
array('h1 .foo', "h1/descendant::*[contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
|
||||
array('h1 #foo', "h1/descendant::*[@id = 'foo']"),
|
||||
array('h1 [class*=foo]', "h1/descendant::*[contains(@class, 'foo')]"),
|
||||
array('div>.foo', "div/*[contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
|
||||
array('div > .foo', "div/*[contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user