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);
        }
    }