summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-12-24 18:08:20 -0500
committerMatthias Clasen <mclasen@redhat.com>2015-12-25 22:58:28 -0500
commitc998fae5ac68745660e6b984f66c175ff0468d30 (patch)
treeefe6fc2abecdfe60c8eb930192754ee57f2df9cd
parent158dbbc88f2c2735c417d27bbc96dbecd7a67656 (diff)
downloadgtk+-c998fae5ac68745660e6b984f66c175ff0468d30.tar.gz
Add deprecation warnings for pseudo states
Emit a deprecation error in the cases where we have a CSS name for a custom pseudo class.
-rw-r--r--gtk/gtkcssselector.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c
index e41dc0f766..d5517e8a3e 100644
--- a/gtk/gtkcssselector.c
+++ b/gtk/gtkcssselector.c
@@ -1177,23 +1177,23 @@ parse_selector_pseudo_class (GtkCssParser *parser,
{ "only-child", 0, POSITION_ONLY, 0, 0 },
{ "sorted", 0, POSITION_SORTED, 0, 0 },
{ "active", GTK_STATE_FLAG_ACTIVE, },
- { "prelight", GTK_STATE_FLAG_PRELIGHT, },
{ "hover", GTK_STATE_FLAG_PRELIGHT, },
+ { "prelight", GTK_STATE_FLAG_PRELIGHT, },
{ "selected", GTK_STATE_FLAG_SELECTED, },
- { "insensitive", GTK_STATE_FLAG_INSENSITIVE, },
{ "disabled", GTK_STATE_FLAG_INSENSITIVE, },
- { "inconsistent", GTK_STATE_FLAG_INCONSISTENT, },
+ { "insensitive", GTK_STATE_FLAG_INSENSITIVE, },
{ "indeterminate",GTK_STATE_FLAG_INCONSISTENT, },
- { "focused", GTK_STATE_FLAG_FOCUSED, },
+ { "inconsistent", GTK_STATE_FLAG_INCONSISTENT, },
{ "focus", GTK_STATE_FLAG_FOCUSED, },
+ { "focused", GTK_STATE_FLAG_FOCUSED, },
{ "backdrop", GTK_STATE_FLAG_BACKDROP, },
{ "dir(ltr)", GTK_STATE_FLAG_DIR_LTR, },
{ "dir(rtl)", GTK_STATE_FLAG_DIR_RTL, },
{ "link", GTK_STATE_FLAG_LINK, },
{ "visited", GTK_STATE_FLAG_VISITED, },
{ "checked", GTK_STATE_FLAG_CHECKED, },
- { "dnd", GTK_STATE_FLAG_DROP_ACTIVE, },
- { "drop(active)", GTK_STATE_FLAG_DROP_ACTIVE, }
+ { "drop(active)", GTK_STATE_FLAG_DROP_ACTIVE, },
+ { "dnd", GTK_STATE_FLAG_DROP_ACTIVE, }
};
guint i;
@@ -1213,6 +1213,14 @@ parse_selector_pseudo_class (GtkCssParser *parser,
: &GTK_CSS_SELECTOR_PSEUDOCLASS_STATE,
selector);
selector->state.state = pseudo_classes[i].state_flag;
+ if (pseudo_classes[i].state_flag == pseudo_classes[i - 1].state_flag)
+ {
+ _gtk_css_parser_error_full (parser,
+ GTK_CSS_PROVIDER_ERROR_DEPRECATED,
+ "The :%s pseudo-class is deprecated. Use :%s instead.",
+ pseudo_classes[i].name,
+ pseudo_classes[i - 1].name);
+ }
}
else
{