Automattic\WooCommerce\Vendor\Pelago\Emogrifier
CssInliner::normalizeStyleAttributesOfAllNodes
Parses the document and normalizes all existing CSS attributes. This changes 'DISPLAY: none' to 'display: none'. We wouldn't have to do this if DOMXPath supported XPath 2.0. Also stores a reference of nodes with existing inline styles so we don't overwrite them.
Метод класса: CssInliner{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->normalizeStyleAttributesOfAllNodes(): void;
Код CssInliner::normalizeStyleAttributesOfAllNodes() CssInliner::normalizeStyleAttributesOfAllNodes WC 10.4.3
private function normalizeStyleAttributesOfAllNodes(): void
{
/** @var \DOMElement $node */
foreach ($this->getAllNodesWithStyleAttribute() as $node) {
if ($this->isInlineStyleAttributesParsingEnabled) {
$this->normalizeStyleAttributes($node);
}
// Remove style attribute in every case, so we can add them back (if inline style attributes
// parsing is enabled) to the end of the style list, thus keeping the right priority of CSS rules;
// else original inline style rules may remain at the beginning of the final inline style definition
// of a node, which may give not the desired results
$node->removeAttribute('style');
}
}