summaryrefslogtreecommitdiff
path: root/src/styleengine.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-10-17 14:20:16 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-10-17 14:20:16 +0200
commite0f49e146d2fc54d9f69d698089dc7b903b96ee0 (patch)
tree562f6b000cc60bd6e69dc930403402bdc73594be /src/styleengine.cc
parent725c6dab378eab3716d41606ee23cacf17c39d8f (diff)
parentdfed92dee228ad426baeb89dd8896ce4db80278a (diff)
merge
Diffstat (limited to 'src/styleengine.cc')
-rw-r--r--src/styleengine.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 790f1bd1..b5553973 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -240,14 +240,19 @@ void StyleEngine::postprocessAttrs (dw::core::style::StyleAttrs *attrs) {
attrs->borderColor.left = attrs->color;
if (attrs->borderColor.right == NULL)
attrs->borderColor.right = attrs->color;
- /* computed value of border-width is 0 if border-style is 'none' */
- if (attrs->borderStyle.top == BORDER_NONE)
+ /* computed value of border-width is 0 if border-style
+ is 'none' or 'hidden' */
+ if (attrs->borderStyle.top == BORDER_NONE ||
+ attrs->borderStyle.top == BORDER_HIDDEN)
attrs->borderWidth.top = 0;
- if (attrs->borderStyle.bottom == BORDER_NONE)
+ if (attrs->borderStyle.bottom == BORDER_NONE ||
+ attrs->borderStyle.bottom == BORDER_HIDDEN)
attrs->borderWidth.bottom = 0;
- if (attrs->borderStyle.left == BORDER_NONE)
+ if (attrs->borderStyle.left == BORDER_NONE ||
+ attrs->borderStyle.left == BORDER_HIDDEN)
attrs->borderWidth.left = 0;
- if (attrs->borderStyle.right == BORDER_NONE)
+ if (attrs->borderStyle.right == BORDER_NONE ||
+ attrs->borderStyle.right == BORDER_HIDDEN)
attrs->borderWidth.right = 0;
}
@@ -478,9 +483,8 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props) {
if (CSS_LENGTH_TYPE (p->value.intVal) == CSS_LENGTH_TYPE_NONE) {
attrs->lineHeight =
createPerLength(CSS_LENGTH_VALUE(p->value.intVal));
- } else {
- computeValue (&lineHeight, p->value.intVal, attrs->font,
- attrs->font->size);
+ } else if (computeValue (&lineHeight, p->value.intVal,
+ attrs->font, attrs->font->size)) {
attrs->lineHeight = createAbsLength(lineHeight);
}
}