From 9bdbab27811d631db9c321380dea0842ec0af392 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Wed, 25 Sep 2013 11:57:00 +0200 Subject: CSS attribute 'background-attachment' (not implemented in dw::core::style). --- src/cssparser.cc | 7 ++++++- src/styleengine.cc | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cssparser.cc b/src/cssparser.cc index 19eb95a5..a67e98d3 100644 --- a/src/cssparser.cc +++ b/src/cssparser.cc @@ -47,6 +47,10 @@ typedef struct { const char *const *enum_symbols; } CssPropertyInfo; +static const char *const Css_background_attachment_enum_vals[] = { + "scroll", "fixed", NULL +}; + static const char *const Css_background_repeat_enum_vals[] = { "repeat", "repeat-x", "repeat-y", "no-repeat", NULL }; @@ -143,7 +147,8 @@ static const char *const Css_word_spacing_enum_vals[] = { }; const CssPropertyInfo Css_property_info[CSS_PROPERTY_LAST] = { - {"background-attachment", {CSS_TYPE_UNUSED}, NULL}, + {"background-attachment", {CSS_TYPE_ENUM, CSS_TYPE_UNUSED}, + Css_background_attachment_enum_vals}, {"background-color", {CSS_TYPE_COLOR, CSS_TYPE_UNUSED}, NULL}, {"background-image", {CSS_TYPE_URI, CSS_TYPE_UNUSED}, NULL}, {"background-position", {CSS_TYPE_UNUSED}, NULL}, diff --git a/src/styleengine.cc b/src/styleengine.cc index 2cdb6e2c..6b35e33c 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -445,6 +445,10 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props, switch (p->name) { /* \todo missing cases */ + case CSS_PROPERTY_BACKGROUND_ATTACHMENT: + attrs->backgroundAttachment = + (BackgroundAttachment) p->value.intVal; + break; case CSS_PROPERTY_BACKGROUND_COLOR: if (prefs.allow_white_bg || p->value.intVal != 0xffffff) attrs->backgroundColor = Color::create(layout, p->value.intVal); -- cgit v1.2.3