summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cssparser.cc19
-rw-r--r--src/styleengine.cc6
2 files changed, 20 insertions, 5 deletions
diff --git a/src/cssparser.cc b/src/cssparser.cc
index c02d817e..c400a8e6 100644
--- a/src/cssparser.cc
+++ b/src/cssparser.cc
@@ -273,7 +273,7 @@ const CssPropertyInfo Css_property_info[CSS_PROPERTY_LAST] = {
{"width", {CSS_TYPE_LENGTH_PERCENTAGE, CSS_TYPE_AUTO, CSS_TYPE_UNUSED}, NULL},
{"word-spacing", {CSS_TYPE_ENUM, CSS_TYPE_SIGNED_LENGTH, CSS_TYPE_UNUSED},
Css_word_spacing_enum_vals},
- {"z-index", {CSS_TYPE_UNUSED}, NULL},
+ {"z-index", {CSS_TYPE_INTEGER, CSS_TYPE_AUTO, CSS_TYPE_UNUSED}, NULL},
/* These are extensions, for internal used, and never parsed. */
{"x-link", {CSS_TYPE_INTEGER, CSS_TYPE_UNUSED}, NULL},
@@ -789,9 +789,12 @@ bool CssParser::tokenMatchesProperty(CssPropertyName prop, CssValueType *type)
return true;
break;
- case CSS_TYPE_UNUSED:
case CSS_TYPE_INTEGER:
- /* Not used for parser values. */
+ if (ttype == CSS_TK_DECINT)
+ return true;
+ break;
+
+ case CSS_TYPE_UNUSED:
default:
assert(false);
break;
@@ -1170,12 +1173,18 @@ bool CssParser::parseValue(CssPropertyName prop,
}
break;
+ case CSS_TYPE_INTEGER:
+ if (ttype == CSS_TK_DECINT) {
+ val->intVal = strtol(tval, NULL, 10);
+ ret = true;
+ nextToken();
+ }
+ break;
+
case CSS_TYPE_UNUSED:
/* nothing */
break;
- case CSS_TYPE_INTEGER:
- /* Not used for parser values. */
default:
assert(false); /* not reached */
}
diff --git a/src/styleengine.cc b/src/styleengine.cc
index f5f0a315..706340b6 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -725,6 +725,12 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props,
case CSS_PROPERTY_MAX_HEIGHT:
computeLength (&attrs->maxHeight, p->value.intVal, attrs->font);
break;
+ case CSS_PROPERTY_Z_INDEX:
+ if (p->type == CSS_LENGTH_TYPE_AUTO)
+ attrs->zIndex = dw::core::style::Z_INDEX_AUTO;
+ else
+ attrs->zIndex = p->value.intVal;
+ break;
case PROPERTY_X_LINK:
attrs->x_link = p->value.intVal;
break;