Automattic\WooCommerce\Vendor\Pelago\Emogrifier

CssInliner::selectorPartHasUnsupportedOfTypePseudoClassprivateWC 1.0

Tests if part of a selector contains an ...of-type pseudo-class such that it cannot be converted to an XPath expression.

Method of the class: CssInliner{}

No Hooks.

Returns

true|false. true if the selector part does not have a type but does have an ...of-type pseudo-class

Usage

// private - for code of main (parent) class only
$result = $this->selectorPartHasUnsupportedOfTypePseudoClass( $selectorPart ): bool;
$selectorPart(string) (required)
part of a selector which has been split up at combinators.

CssInliner::selectorPartHasUnsupportedOfTypePseudoClass() code WC 10.8.1

private function selectorPartHasUnsupportedOfTypePseudoClass(string $selectorPart): bool
{
    $preg = (new Preg())->throwExceptions($this->debug);

    if ($preg->match('/^[\\w\\-]/', $selectorPart) !== 0) {
        return false;
    }

    return $preg->match('/:(?:' . self::OF_TYPE_PSEUDO_CLASS_MATCHER . ')/i', $selectorPart) !== 0;
}