diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-01-21 21:40:00 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-01-21 21:40:00 +0100 |
commit | 79ded836438ef2ea69361acccd530701234ab9c1 (patch) | |
tree | c8525d6ed2ff8fb506057e112437aa658efc70aa | |
parent | f982706f6671e7b156a4ad014d3cac5656084916 (diff) |
start supporting "auto" value in CSS
-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; } |