Automattic\WooCommerce\Vendor\Pelago\Emogrifier

CssInliner::existsMatchForSelectorInCssRule │ private │ WC 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

bool.

Usage

// private - for code of main (parent) class only
$result = $this->existsMatchForSelectorInCssRule( $cssRule ): bool;
$cssRule *(array{
media: string,
selector: string,
hasUnmatchablePseudo: bool,
declarationsBlock: string,
line: int
}) (required)*
.

CssInliner::existsMatchForSelectorInCssRule() code WC 11.1.2

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