src/Nodes/SVGNode.php
public function getComputedStyle($name)
    {
        $style = $this->getStyle($name);

        // If no immediate style then get style from container/global style rules
        if ($style === null && isset($this->parent)) {
            $containerStyles = $this->parent->getContainerStyleForNode($this);
            $style = isset($containerStyles[$name]) ? $containerStyles[$name] : null;
        }

        // If still no style then get parent's style
        if (($style === null || $style === 'inherit') && isset($this->parent)) {
            return $this->parent->getComputedStyle($name);
        }

        // 'inherit' is not what we want. Either get the real style, or
        // nothing at all.
        return $style !== 'inherit' ? $style : null;
    }
public function getComputedStyle($name)
    {
        $style = $this->getStyle($name);

        // If no immediate style then get style from container/global style rules
        if ($style === null && isset($this->parent)) {
            $containerStyles = $this->parent->getContainerStyleForNode($this);
            $style = isset($containerStyles[$name]) ? $containerStyles[$name] : null;
        }

        // If still no style then get parent's style
        if (($style === null || $style === 'inherit') && isset($this->parent)) {
            return $this->parent->getComputedStyle($name);
        }

        // 'inherit' is not what we want. Either get the real style, or
        // nothing at all.
        return $style !== 'inherit' ? $style : null;
    }
public function getComputedStyle ( $ name ) { $ style = $ this -> getStyle ( $ name ) ; // If no immediate style then get style from container/global style rules if ( $ style === null && isset ( $ this -> parent ) ) { $ containerStyles = $ this -> parent -> getContainerStyleForNode ( $ this ) ; $ style = isset ( $ containerStyles [ $ name ] ) ? $ containerStyles [ $ name ] : null ; } // If still no style then get parent's style if ( ( $ style === null || $ style === 'inherit' ) && isset ( $ this -> parent ) ) { return $ this -> parent -> getComputedStyle ( $ name ) ; } // 'inherit' is not what we want. Either get the real style, or // nothing at all. return $ style !== 'inherit' ? $ style : null ; }
Obtains the computed style with the given name. The 'computed style' is
the one in effect; taking inheritance and default styles into account.

@param string $name The name of the style to compute.

@return string|null The style value if specified anywhere, else null.
Obtains the computed style with the given name . The computed style is the one in effect ; taking inheritance and default styles into account .