Automattic\WooCommerce\Vendor\Pelago\Emogrifier

CssInliner::fillStyleAttributesWithMergedStyles │ private │ WC 1.0

Merges styles from styles attributes and style nodes and applies them to the attribute nodes

Метод класса: CssInliner{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->fillStyleAttributesWithMergedStyles(): void;

Код CssInliner::fillStyleAttributesWithMergedStyles() WC 11.2.1

private function fillStyleAttributesWithMergedStyles(): void
{
    $declarationBlockParser = new DeclarationBlockParser();
    foreach ($this->styleAttributesForNodes as $nodePath => $styleAttributesForNode) {
        $node = $this->visitedNodes[$nodePath];
        $currentStyleAttributes = $declarationBlockParser->parse($node->getAttribute('style'));
        $node->setAttribute(
            'style',
            $this->generateStyleStringFromDeclarationsArrays(
                $currentStyleAttributes,
                $styleAttributesForNode
            )
        );
    }
}