Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor

CssToAttributeConverter::mapComplexCssPropertyprivateWC 1.0

Maps CSS properties that need special transformation to an HTML attribute.

Method of the class: CssToAttributeConverter{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->mapComplexCssProperty( $property, $value, $node ): void;
$property(string) (required)
the name of the CSS property to map.
$value(string) (required)
the value of the style rule to map.
$node(DOMElement) (required)
node to apply styles to.

CssToAttributeConverter::mapComplexCssProperty() code WC 10.5.0

private function mapComplexCssProperty(string $property, string $value, \DOMElement $node): void
{
    switch ($property) {
        case 'background':
            $this->mapBackgroundProperty($node, $value);
            break;
        case 'width':
            // intentional fall-through
        case 'height':
            $this->mapWidthOrHeightProperty($node, $value, $property);
            break;
        case 'margin':
            $this->mapMarginProperty($node, $value);
            break;
        case 'border':
            $this->mapBorderProperty($node, $value);
            break;
        default:
    }
}