function readCSS(&$state) { parent::readCSS($state); $this->_readCSS($state, array(CSS_TEXT_DECORATION, CSS_TEXT_TRANSFORM)); // '-html2ps-link-target' global $g_config; if ($g_config["renderlinks"]) { $this->_readCSS($state, array(CSS_HTML2PS_LINK_TARGET)); } }
function readCSS(&$state) { parent::readCSS($state); /** * We treat BR as a block box; as default value of 'display' property is not 'block', we should * set it up manually. */ $this->setCSSProperty(CSS_DISPLAY, 'block'); $this->_readCSS($state, array(CSS_CLEAR)); $this->_readCSSLengths($state, array(CSS_MARGIN, CSS_LINE_HEIGHT)); }
function readCSS(&$state) { parent::readCSS($state); $this->_readCSS($state, array(CSS_OVERFLOW, CSS_PAGE_BREAK_AFTER, CSS_PAGE_BREAK_BEFORE, CSS_PAGE_BREAK_INSIDE, CSS_ORPHANS, CSS_WIDOWS, CSS_POSITION, CSS_TEXT_ALIGN, CSS_WHITE_SPACE, CSS_CLEAR, CSS_CONTENT, CSS_HTML2PS_PSEUDOELEMENTS, CSS_FLOAT, CSS_Z_INDEX, CSS_HTML2PS_ALIGN, CSS_HTML2PS_NOWRAP, CSS_DIRECTION, CSS_PAGE)); $this->_readCSSLengths($state, array(CSS_BACKGROUND, CSS_BORDER, CSS_BOTTOM, CSS_TOP, CSS_LEFT, CSS_RIGHT, CSS_MARGIN, CSS_PADDING, CSS_TEXT_INDENT, CSS_HTML2PS_COMPOSITE_WIDTH, CSS_HEIGHT, CSS_MIN_HEIGHT, CSS_MAX_HEIGHT, CSS_LETTER_SPACING)); /** * CSS 2.1, p 8.5.2: * * If an element's border color is not specified with a border * property, user agents must use the value of the element's * 'color' property as the computed value for the border color. */ $border =& $this->getCSSProperty(CSS_BORDER); $color =& $this->getCSSProperty(CSS_COLOR); if ($border) { if ($border->top->isDefaultColor()) { $border->top->setColor($color); } if ($border->right->isDefaultColor()) { $border->right->setColor($color); } if ($border->bottom->isDefaultColor()) { $border->bottom->setColor($color); } if ($border->left->isDefaultColor()) { $border->left->setColor($color); } $this->setCSSProperty(CSS_BORDER, $border); } $this->_height_constraint =& HCConstraint::create($this); $this->height = 0; // 'width' $wc =& $this->getCSSProperty(CSS_WIDTH); if ($wc) { $this->width = $wc->apply(0, 0); } // 'PSEUDO-CSS' properties // '-localalign' switch ($state->getProperty(CSS_HTML2PS_LOCALALIGN)) { case LA_LEFT: break; case LA_RIGHT: $margin =& $this->getCSSProperty(CSS_MARGIN); $margin->left->auto = true; $this->setCSSProperty(CSS_MARGIN, $margin); break; case LA_CENTER: $margin =& $this->getCSSProperty(CSS_MARGIN); $margin->left->auto = true; $margin->right->auto = true; $this->setCSSProperty(CSS_MARGIN, $margin); break; } }