private function normalizeStyleAttributes(\DOMElement $node)
    {
        $normalizedOriginalStyle = preg_replace_callback(
            '/[A-z\\-]+(?=\\:)/S',
            function (array $m) {
                return strtolower($m[0]);
            },
            $node->getAttribute('style')
        );

        // in order to not overwrite existing style attributes in the HTML, we
        // have to save the original HTML styles
        $nodePath = $node->getNodePath();
        if (!isset($this->styleAttributesForNodes[$nodePath])) {
            $this->styleAttributesForNodes[$nodePath] = $this->parseCssDeclarationsBlock($normalizedOriginalStyle);
            $this->visitedNodes[$nodePath] = $node;
        }

        $node->setAttribute('style', $normalizedOriginalStyle);
    }
private function normalizeStyleAttributes(\DOMElement $node)
    {
        $normalizedOriginalStyle = preg_replace_callback(
            '/[A-z\\-]+(?=\\:)/S',
            function (array $m) {
                return strtolower($m[0]);
            },
            $node->getAttribute('style')
        );

        // in order to not overwrite existing style attributes in the HTML, we
        // have to save the original HTML styles
        $nodePath = $node->getNodePath();
        if (!isset($this->styleAttributesForNodes[$nodePath])) {
            $this->styleAttributesForNodes[$nodePath] = $this->parseCssDeclarationsBlock($normalizedOriginalStyle);
            $this->visitedNodes[$nodePath] = $node;
        }

        $node->setAttribute('style', $normalizedOriginalStyle);
    }
private function normalizeStyleAttributes ( \ DOMElement $ node ) { $ normalizedOriginalStyle = preg_replace_callback ( '/[A-z\\-]+(?=\\:)/S' , function ( array $ m ) { return strtolower ( $ m [ 0 ] ) ; } , $ node -> getAttribute ( 'style' ) ) ; // in order to not overwrite existing style attributes in the HTML, we // have to save the original HTML styles $ nodePath = $ node -> getNodePath ( ) ; if ( ! isset ( $ this -> styleAttributesForNodes [ $ nodePath ] ) ) { $ this -> styleAttributesForNodes [ $ nodePath ] = $ this -> parseCssDeclarationsBlock ( $ normalizedOriginalStyle ) ; $ this -> visitedNodes [ $ nodePath ] = $ node ; } $ node -> setAttribute ( 'style' , $ normalizedOriginalStyle ) ; }
Normalizes the value of the "style" attribute and saves it.

@param \DOMElement $node

@return void
Normalizes the value of the style attribute and saves it .