function css_line_height($value, $root)
{
    pop_line_height();
    // <Number>
    // The used value of the property is this number multiplied by the element's font size.
    // Negative values are illegal. The computed value is the same as the specified value.
    if (preg_match("/^\\d+(\\.\\d+)?\$/", $value)) {
        push_line_height(new LineHeight_Relative((double) $value));
        return;
    }
    // <percentage>
    // The computed value of the property is this percentage multiplied by the element's
    // computed font size. Negative values are illegal.
    if (preg_match("/^\\d+%\$/", $value)) {
        push_line_height(new LineHeight_Relative((double) $value / 100));
        return;
    }
    // normal
    // Tells user agents to set the used value to a "reasonable" value based on the font of the element.
    // The value has the same meaning as <number>. We recommend a used value for 'normal' between 1.0 to 1.2.
    // The computed value is 'normal'.
    if (trim($value) === "normal") {
        push_line_height(default_line_height());
        return;
    }
    // <length>
    // The specified length is used in the calculation of the line box height.
    // Negative values are illegal.
    push_line_height(new LineHeight_Absolute($value));
}
示例#2
0
function pop_css_defaults()
{
    pop_border();
    pop_font_family();
    pop_font_size();
    pop_font_style();
    pop_font_weight();
    pop_line_height();
    global $g_css_handlers;
    $keys = array_keys($g_css_handlers);
    foreach ($keys as $key) {
        $g_css_handlers[$key]->pop();
    }
}