QueryPath\CSS\DOMTraverser::matchPseudoElements PHP Method

matchPseudoElements() protected method

If any pseudo-elements are passed, this will test to see if conditions obtain that would allow the pseudo-element to be created. This does not modify the match in any way.
protected matchPseudoElements ( $node, $pseudoElements )
    protected function matchPseudoElements($node, $pseudoElements)
    {
        if (empty($pseudoElements)) {
            return true;
        }
        foreach ($pseudoElements as $pse) {
            switch ($pse) {
                case 'first-line':
                case 'first-letter':
                case 'before':
                case 'after':
                    return strlen($node->textContent) > 0;
                case 'selection':
                    throw new \QueryPath\CSS\NotImplementedException("::{$name} is not implemented.");
            }
        }
    }