aboutsummaryrefslogtreecommitdiff
path: root/src/styleengine.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-10-15 11:37:44 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-10-15 11:37:44 +0200
commitb52e67fd0ddec3263a73edf04fa7aeb616120435 (patch)
tree9517e8b80d5eee11072afb294042ec20fc4dbedf /src/styleengine.cc
parent573d04aecfd5eb4869f9cb02c2f87ddf1fd44d21 (diff)
don't try to set lineHeight if illegal value 'auto' is specified
Testcase: <div style="line-height: auto"> foo<br>foo<br>foo<br> </div> This only fixes the use of uninitialzed values in this case. The real fix will be to drop the invalid declaration in the CSS parser. This needs to be implemented with a later commit. Reported-by: Jeremy Henty <onepoint@starurchin.org>
Diffstat (limited to 'src/styleengine.cc')
-rw-r--r--src/styleengine.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 67212fb7..e078542c 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -451,9 +451,8 @@ void StyleEngine::apply (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);
}
}