protected function manipulateRuleValues(array $rules) {
        $finalrules = [];

        foreach ($rules as $rule) {
            $property = $rule->getRule();
            $value = $rule->getValue();

            if ($property === 'position' && $value === 'sticky') {
                $newrule = clone $rule;
                $newrule->setValue('-webkit-sticky');
                $finalrules[] = $newrule;

            } else if ($property === 'background-image' &&
                    $value instanceof CSSFunction &&
                    $value->getName() === 'linear-gradient') {

                foreach (['-webkit-', '-o-'] as $prefix) {
                    $newfunction = clone $value;
                    $newfunction->setName($prefix . $value->getName());
                    $newrule = clone $rule;
                    $newrule->setValue($newfunction);
                    $finalrules[] = $newrule;
                }
            }

            $finalrules[] = $rule;
        }

        return $finalrules;
    }
protected function manipulateRuleValues(array $rules) {
        $finalrules = [];

        foreach ($rules as $rule) {
            $property = $rule->getRule();
            $value = $rule->getValue();

            if ($property === 'position' && $value === 'sticky') {
                $newrule = clone $rule;
                $newrule->setValue('-webkit-sticky');
                $finalrules[] = $newrule;

            } else if ($property === 'background-image' &&
                    $value instanceof CSSFunction &&
                    $value->getName() === 'linear-gradient') {

                foreach (['-webkit-', '-o-'] as $prefix) {
                    $newfunction = clone $value;
                    $newfunction->setName($prefix . $value->getName());
                    $newrule = clone $rule;
                    $newrule->setValue($newfunction);
                    $finalrules[] = $newrule;
                }
            }

            $finalrules[] = $rule;
        }

        return $finalrules;
    }
protected function manipulateRuleValues ( array $ rules ) { $ finalrules = [ ] ; foreach ( $ rules as $ rule ) { $ property = $ rule -> getRule ( ) ; $ value = $ rule -> getValue ( ) ; if ( $ property === 'position' && $ value === 'sticky' ) { $ newrule = clone $ rule ; $ newrule -> setValue ( '-webkit-sticky' ) ; $ finalrules [ ] = $ newrule ; } else if ( $ property === 'background-image' && $ value instanceof CSSFunction && $ value -> getName ( ) === 'linear-gradient' ) { foreach ( [ '-webkit-' , '-o-' ] as $ prefix ) { $ newfunction = clone $ value ; $ newfunction -> setName ( $ prefix . $ value -> getName ( ) ) ; $ newrule = clone $ rule ; $ newrule -> setValue ( $ newfunction ) ; $ finalrules [ ] = $ newrule ; } } $ finalrules [ ] = $ rule ; } return $ finalrules ; }
Manipulate an array of rules to adapt their values.

@param array $rules The rules.
@return New array of rules.
Manipulate an array of rules to adapt their values .