diff options
-rw-r--r-- | src/cssparser.cc | 1 | ||||
-rw-r--r-- | src/styleengine.cc | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/cssparser.cc b/src/cssparser.cc index 53ca2d08..a50ef9da 100644 --- a/src/cssparser.cc +++ b/src/cssparser.cc @@ -696,6 +696,7 @@ static bool Css_parse_value(CssParser * parser, val->intVal = CSS_CREATE_LENGTH(fval, lentype); } else if (parser->ttype == CSS_TK_SYMBOL && strcmp(parser->tval, "auto") == 0) { + ret = true; val->intVal = CSS_LENGTH_TYPE_AUTO; Css_next_token(parser); } diff --git a/src/styleengine.cc b/src/styleengine.cc index c25ac669..fbf9c8ee 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -377,10 +377,13 @@ bool StyleEngine::computeLength (dw::core::style::Length *dest, if (CSS_LENGTH_TYPE (value) == CSS_LENGTH_TYPE_PERCENTAGE) { *dest = createPerLength (CSS_LENGTH_VALUE (value)); return true; - } else if (computeValue (&v, value, font)) { - *dest = createAbsLength (v); - return true; - } + } else if (CSS_LENGTH_TYPE (value) == CSS_LENGTH_TYPE_AUTO) { + *dest = dw::core::style::LENGTH_AUTO; + return true; + } else if (computeValue (&v, value, font)) { + *dest = createAbsLength (v); + return true; + } return false; } |