changeset 1999:586c7a6f61aa

fix handling of CSS length values of 0 without unit Reported by: "Rob S." <mr_semantics@hotmail.com> Submitted by: corvid <corvid@lavabit.com>
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Sun, 01 May 2011 22:57:59 +0200
parents 5b4c489423d2
children 05efd54ba3ef d7782c42bdda
files src/styleengine.cc
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/styleengine.cc	Wed Apr 20 02:45:55 2011 +0000
+++ b/src/styleengine.cc	Sun May 01 22:57:59 2011 +0200
@@ -619,6 +619,13 @@
       case CSS_LENGTH_TYPE_EX:
          *dest = roundInt (CSS_LENGTH_VALUE(value) * font->xHeight);
         return true;
+       case CSS_LENGTH_TYPE_NONE:
+         // length values other than 0 without unit are only allowed
+         // in special cases (line-height) and have to be handled
+         // separately.
+         assert ((int) CSS_LENGTH_VALUE (value) == 0);
+         *dest = 0;
+         return true;
       default:
          break;
    }