Pelago\Emogrifier
CssInliner::existsMatchForCssSelector() private WC 1.0
Checks whether there is at least one matching element for $cssSelector. When not in debug mode, it returns true also for invalid selectors (because they may be valid, just not implemented/recognized yet by Emogrifier).
{} It's a method of the class: CssInliner{}
No Hooks.
Return
true/false.
Usage
// private - for code of main (parent) class only $result = $this->existsMatchForCssSelector( $cssSelector );
- $cssSelector(string) (required)
- -
Code of CssInliner::existsMatchForCssSelector() CssInliner::existsMatchForCssSelector WC 5.0.0
private function existsMatchForCssSelector($cssSelector)
{
try {
$nodesMatchingSelector = $this->xPath->query($this->getCssSelectorConverter()->toXPath($cssSelector));
} catch (SyntaxErrorException $e) {
if ($this->debug) {
throw $e;
}
return true;
}
return $nodesMatchingSelector !== false && $nodesMatchingSelector->length !== 0;
}