* @author Helmut Tischer * @author Fabien Ménager * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ /** * The location of the default built-in CSS file. * {@link Stylesheet::DEFAULT_STYLESHEET} */ define('__DEFAULT_STYLESHEET', DOMPDF_LIB_DIR . DIRECTORY_SEPARATOR . "res" . DIRECTORY_SEPARATOR . "html.css"); /** * The master stylesheet class * * The Stylesheet class is responsible for parsing stylesheets and style * tags/attributes. It also acts as a registry of the individual Style * objects generated by the current set of loaded CSS files and style * elements. * * @see Style * @package dompdf */ class Stylesheet { /** * The location of the default built-in CSS file. */ const DEFAULT_STYLESHEET = __DEFAULT_STYLESHEET; /** * User agent stylesheet origin * * @var int */ const ORIG_UA = 1; /** * User normal stylesheet origin * * @var int */ const ORIG_USER = 2; /** * Author normal stylesheet origin * * @var int */ const ORIG_AUTHOR = 3; private static $_stylesheet_origins = array( self::ORIG_UA => -0x0FFFFFFF, // user agent style sheets self::ORIG_USER => -0x0000FFFF, // user normal style sheets self::ORIG_AUTHOR => 0x00000000, // author normal style sheets ); /** * Current dompdf instance * * @var DOMPDF */ private $_dompdf; /** * Array of currently defined styles * * @var Style[] */ private $_styles; /** * Base protocol of the document being parsed * Used to handle relative urls. * * @var string */ private $_protocol; /** * Base hostname of the document being parsed * Used to handle relative urls. * * @var string */ private $_base_host; /** * Base path of the document being parsed * Used to handle relative urls. * * @var string */ private $_base_path; /** * The styles defined by @page rules * * @var array