Automattic\WooCommerce\Vendor\Pelago\Emogrifier

CssInliner::existsMatchForSelectorInCssRuleprivateWC 1.0

Checks whether there is at least one matching element for the CSS selector contained in the selector element of the provided CSS rule.

Any dynamic pseudo-classes will be assumed to apply. If the selector matches a pseudo-element, it will test for a match with its originating element.

Method of the class: CssInliner{}

No Hooks.

Returns

true|false.

Usage

// private - for code of main (parent) class only
$result = $this->existsMatchForSelectorInCssRule( $cssRule ): bool;
$cssRule(array) (required)
.

CssInliner::existsMatchForSelectorInCssRule() code WC 10.5.0

private function existsMatchForSelectorInCssRule(array $cssRule): bool
{
    $selector = $cssRule['selector'];
    if ($cssRule['hasUnmatchablePseudo']) {
        $selector = $this->removeUnmatchablePseudoComponents($selector);
    }
    return $this->existsMatchForCssSelector($selector);
}