. */ /* * A class to inline CSS. * * It honours !important attributes and doesn't choke on complex styles. * * */ class CSS { /* * The core of the algorithm, takes a URL and returns the HTML found there with the CSS inlined. * If you pass $contents then the original HTML is not downloaded and $contents is used instead. * $url is mandatory as it is used to resolve the links to the stylesheets found in the HTML. */ /** * @return DomNode */ function inlineCSS($url, $contents = null) { $html = pQuery::parseStr($contents); if (!$html instanceof DomNode) { throw new \InvalidArgumentException('Error parsing contents.'); } $css_blocks = ''; // Find all