summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/select/computed.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/select/computed.c b/src/select/computed.c
index 4b44f56..8881d2c 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -289,8 +289,11 @@ css_error compute_absolute_values(const css_computed_style *parent,
return error;
/* Convert ex size into ems */
- ex_size.data.length.value = FDIV(ex_size.data.length.value,
- size.data.length.value);
+ if (size.data.length.value != 0)
+ ex_size.data.length.value = FDIV(ex_size.data.length.value,
+ size.data.length.value);
+ else
+ ex_size.data.length.value = 0;
ex_size.data.length.unit = CSS_UNIT_EM;
/* Fix up background-position */