diff --git a/gtk/gtkcssdeclaration.c b/gtk/gtkcssdeclaration.c index 50245d90ee..319c1fa64f 100644 --- a/gtk/gtkcssdeclaration.c +++ b/gtk/gtkcssdeclaration.c @@ -21,10 +21,13 @@ #include "gtkcssdeclarationprivate.h" +#include "gtkstylepropertyprivate.h" + typedef struct _GtkCssDeclarationPrivate GtkCssDeclarationPrivate; struct _GtkCssDeclarationPrivate { GtkCssStyleDeclaration *style; char *name; + GtkStyleProperty *prop; char *value; }; @@ -86,15 +89,24 @@ gtk_css_declaration_new_parse (GtkCssStyleDeclaration *style, gtk_css_token_source_set_consumer (source, G_OBJECT (decl)); + gtk_css_token_source_consume_whitespace (source); priv->style = style; token = gtk_css_token_source_get_token (source); if (!gtk_css_token_is (token, GTK_CSS_TOKEN_IDENT)) { + gtk_css_token_source_error (source, "Expected a property name"); gtk_css_token_source_consume_all (source); g_object_unref (decl); return NULL; } priv->name = g_strdup (token->string.string); + priv->prop = _gtk_style_property_lookup (priv->name); + if (priv->prop == NULL) + gtk_css_token_source_unknown (source, "Unknown property name '%s'", priv->name); + else if (!g_str_equal (priv->name, _gtk_style_property_get_name (priv->prop))) + gtk_css_token_source_deprecated (source, + "The '%s' property has been renamed to '%s'", + priv->name, _gtk_style_property_get_name (priv->prop)); gtk_css_token_source_consume_token (source); gtk_css_token_source_consume_whitespace (source); token = gtk_css_token_source_get_token (source);