protected function convertPercentageDimensions(Node $node) { $parentWidth = $node->getParent() ? $node->getParent()->getWidthWithoutPaddings() : null; $parentHeight = $node->getParent() ? $node->getParent()->getHeightWithoutPaddings() : null; $node->convertScalarAttribute('width', $parentWidth); $node->convertScalarAttribute('height', $parentHeight); $node->convertScalarAttribute('max-width', $parentWidth); $node->convertScalarAttribute('max-height', $parentHeight); }