public function visitEnterSelectorSimplePseudoClass(Ast\Selector\Simple\PseudoClass $pseudoClass)
{
switch ($pseudoClass->name) {
case 'not':
$this->addCondition('not(');
$this->status(self::STATUS_PSEUDOCLASS);
return TRUE;
case 'nth-child':
$this->addCondition('(');
$this->status(self::STATUS_PSEUDOCLASS);
$this->_expressions['position'] = 'position()';
$this->_expressions['count'] = 'last()';
return TRUE;
case 'nth-last-child':
$this->addCondition('(');
$this->status(self::STATUS_PSEUDOCLASS);
$this->_expressions['position'] = '(last() - position() + 1)';
$this->_expressions['count'] = 'count()';
return TRUE;
case 'nth-of-type':
$this->addCondition('(');
$this->status(self::STATUS_PSEUDOCLASS);
$this->_expressions['position'] = '(count(preceding-sibling::' . $this->_element . ') + 1)';
$this->_expressions['count'] = 'count(parent::*/' . $this->_element . ')';
return TRUE;
case 'nth-last-of-type':
$this->addCondition('(');
$this->status(self::STATUS_PSEUDOCLASS);
$this->_expressions['position'] = '(count(following-sibling::' . $this->_element . ') + 1)';
$this->_expressions['count'] = 'count(parent::*/' . $this->_element . ')';
return TRUE;
}
return FALSE;
}