public function evaluate($new, $current) {
        switch ($new->tagName) {
            case 'li':
                return $this->handleLI($new, $current);
            case 'dt':
            case 'dd':
                return $this->handleDT($new, $current);
            case 'rt':
            case 'rp':
                return $this->handleRT($new, $current);
            case 'optgroup':
                return $this->closeIfCurrentMatches($new, $current, array(
                            'optgroup'
                ));
            case 'option':
                return $this->closeIfCurrentMatches($new, $current, array(
                            'option',
                            'optgroup'
                ));
            case 'tr':
                return $this->closeIfCurrentMatches($new, $current, array(
                            'tr'
                ));
            case 'td':
            case 'th':
                return $this->closeIfCurrentMatches($new, $current, array(
                            'th',
                            'td'
                ));
            case 'tbody':
            case 'thead':
            case 'tfoot':
            case 'table': // Spec isn't explicit about this, but it's necessary.

                return $this->closeIfCurrentMatches($new, $current, array(
                            'thead',
                            'tfoot',
                            'tbody'
                ));
        }

        return $current;
    }
public function evaluate($new, $current) {
        switch ($new->tagName) {
            case 'li':
                return $this->handleLI($new, $current);
            case 'dt':
            case 'dd':
                return $this->handleDT($new, $current);
            case 'rt':
            case 'rp':
                return $this->handleRT($new, $current);
            case 'optgroup':
                return $this->closeIfCurrentMatches($new, $current, array(
                            'optgroup'
                ));
            case 'option':
                return $this->closeIfCurrentMatches($new, $current, array(
                            'option',
                            'optgroup'
                ));
            case 'tr':
                return $this->closeIfCurrentMatches($new, $current, array(
                            'tr'
                ));
            case 'td':
            case 'th':
                return $this->closeIfCurrentMatches($new, $current, array(
                            'th',
                            'td'
                ));
            case 'tbody':
            case 'thead':
            case 'tfoot':
            case 'table': // Spec isn't explicit about this, but it's necessary.

                return $this->closeIfCurrentMatches($new, $current, array(
                            'thead',
                            'tfoot',
                            'tbody'
                ));
        }

        return $current;
    }
public function evaluate ( $ new , $ current ) { switch ( $ new -> tagName ) { case 'li' : return $ this -> handleLI ( $ new , $ current ) ; case 'dt' : case 'dd' : return $ this -> handleDT ( $ new , $ current ) ; case 'rt' : case 'rp' : return $ this -> handleRT ( $ new , $ current ) ; case 'optgroup' : return $ this -> closeIfCurrentMatches ( $ new , $ current , array ( 'optgroup' ) ) ; case 'option' : return $ this -> closeIfCurrentMatches ( $ new , $ current , array ( 'option' , 'optgroup' ) ) ; case 'tr' : return $ this -> closeIfCurrentMatches ( $ new , $ current , array ( 'tr' ) ) ; case 'td' : case 'th' : return $ this -> closeIfCurrentMatches ( $ new , $ current , array ( 'th' , 'td' ) ) ; case 'tbody' : case 'thead' : case 'tfoot' : case 'table' : // Spec isn't explicit about this, but it's necessary. return $ this -> closeIfCurrentMatches ( $ new , $ current , array ( 'thead' , 'tfoot' , 'tbody' ) ) ; } return $ current ; }
Evaluate the rule for the current tag name.

This may modify the existing DOM.

@return \DOMElement The new Current DOM element.
Evaluate the rule for the current tag name .