Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor

AbstractHtmlProcessor::ensureExistenceOfBodyElementprivateWC 1.0

Checks that $this->domDocument has a BODY element and adds it if it is missing.

Method of the class: AbstractHtmlProcessor{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->ensureExistenceOfBodyElement(): void;

AbstractHtmlProcessor::ensureExistenceOfBodyElement() code WC 10.5.0

private function ensureExistenceOfBodyElement(): void
{
    if ($this->getDomDocument()->getElementsByTagName('body')->item(0) instanceof \DOMElement) {
        return;
    }

    $this->getHtmlElement()->appendChild($this->getDomDocument()->createElement('body'));
}