private function mapWidthOrHeightProperty(\DOMElement $node, $value, $property)
    {
        // only parse values in px and %, but not values like "auto"
        if (\preg_match('/^\\d+(px|%)$/', $value)) {
            // Remove 'px'. This regex only conserves numbers and %.
            $number = \preg_replace('/[^0-9.%]/', '', $value);
            $node->setAttribute($property, $number);
        }
    }
private function mapWidthOrHeightProperty(\DOMElement $node, $value, $property)
    {
        // only parse values in px and %, but not values like "auto"
        if (\preg_match('/^\\d+(px|%)$/', $value)) {
            // Remove 'px'. This regex only conserves numbers and %.
            $number = \preg_replace('/[^0-9.%]/', '', $value);
            $node->setAttribute($property, $number);
        }
    }
private function mapWidthOrHeightProperty ( \ DOMElement $ node , $ value , $ property ) { // only parse values in px and %, but not values like "auto" if ( \ preg_match ( '/^\\d+(px|%)$/' , $ value ) ) { // Remove 'px'. This regex only conserves numbers and %. $ number = \ preg_replace ( '/[^0-9.%]/' , '' , $ value ) ; $ node -> setAttribute ( $ property , $ number ) ; } }
Maps the "width" or "height" CSS properties to visual HTML attributes.

@param \DOMElement $node node to apply styles to
@param string $value the value of the style rule to map
@param string $property the name of the CSS property to map

@return void
Maps the width or height CSS properties to visual HTML attributes .