芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/www/wp-content/plugins/fluentform/app/Services/Emogrifier/Emogrifier.php
* @author Roman Ožana
* @author Sander Kruger
* @author Zoli Szabó
*/ class Emogrifier { /** * @var int */ const CACHE_KEY_CSS = 0; /** * @var int */ const CACHE_KEY_SELECTOR = 1; /** * @var int */ const CACHE_KEY_XPATH = 2; /** * @var int */ const CACHE_KEY_CSS_DECLARATIONS_BLOCK = 3; /** * @var int */ const CACHE_KEY_COMBINED_STYLES = 4; /** * for calculating nth-of-type and nth-child selectors * * @var int */ const INDEX = 0; /** * for calculating nth-of-type and nth-child selectors * * @var int */ const MULTIPLIER = 1; /** * @var string */ const ID_ATTRIBUTE_MATCHER = '/(\\w+)?\\#([\\w\\-]+)/'; /** * @var string */ const CLASS_ATTRIBUTE_MATCHER = '/(\\w+|[\\*\\]])?((\\.[\\w\\-]+)+)/'; /** * @var string */ const CONTENT_TYPE_META_TAG = '
'; /** * @var string */ const DEFAULT_DOCUMENT_TYPE = ''; /** * @var string */ private $html = ''; /** * @var string */ private $css = ''; /** * @var bool[] */ private $excludedSelectors = []; /** * @var string[] */ private $unprocessableHtmlTags = ['wbr']; /** * @var bool[] */ private $allowedMediaTypes = ['all' => true, 'screen' => true, 'print' => true]; /** * @var mixed[] */ private $caches = [ self::CACHE_KEY_CSS => [], self::CACHE_KEY_SELECTOR => [], self::CACHE_KEY_XPATH => [], self::CACHE_KEY_CSS_DECLARATIONS_BLOCK => [], self::CACHE_KEY_COMBINED_STYLES => [], ]; /** * the visited nodes with the XPath paths as array keys * * @var \DOMElement[] */ private $visitedNodes = []; /** * the styles to apply to the nodes with the XPath paths as array keys for the outer array * and the attribute names/values as key/value pairs for the inner array * * @var string[][] */ private $styleAttributesForNodes = []; /** * Determines whether the "style" attributes of tags in the the HTML passed to this class should be preserved. * If set to false, the value of the style attributes will be discarded. * * @var bool */ private $isInlineStyleAttributesParsingEnabled = true; /** * Determines whether the