[gtk+] cssselector: Support :not() for position pseudoclasses
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] cssselector: Support :not() for position pseudoclasses
- Date: Wed, 10 Dec 2014 03:05:04 +0000 (UTC)
commit 8b3f25ab963c8b3b4af3dacea0a54455bbb07865
Author: Benjamin Otte <otte redhat com>
Date: Mon Dec 8 05:42:11 2014 +0100
cssselector: Support :not() for position pseudoclasses
This is simple now that the latest commit used the macro and
autogenerates the SelectorClass to use.
gtk/gtkcssselector.c | 21 ++++-----------------
1 files changed, 4 insertions(+), 17 deletions(-)
---
diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c
index ee1a0de..c3d8afb 100644
--- a/gtk/gtkcssselector.c
+++ b/gtk/gtkcssselector.c
@@ -1536,14 +1536,6 @@ parse_selector_pseudo_class_nth_child (GtkCssParser *parser,
{
int a, b;
- if (negate)
- {
- _gtk_css_parser_error (parser, "position pseudoclases not yet supported for :not()");
- if (selector)
- _gtk_css_selector_free (selector);
- return NULL;
- }
-
if (!_gtk_css_parser_try (parser, "(", TRUE))
{
_gtk_css_parser_error (parser, "Missing opening bracket for pseudo-class");
@@ -1648,7 +1640,8 @@ parse_selector_pseudo_class_nth_child (GtkCssParser *parser,
return NULL;
}
- selector = gtk_css_selector_new (>K_CSS_SELECTOR_PSEUDOCLASS_POSITION,
+ selector = gtk_css_selector_new (negate ? >K_CSS_SELECTOR_NOT_PSEUDOCLASS_POSITION
+ : >K_CSS_SELECTOR_PSEUDOCLASS_POSITION,
selector);
selector->position.type = type;
selector->position.a = a;
@@ -1731,16 +1724,10 @@ parse_selector_pseudo_class (GtkCssParser *parser,
selector);
selector->state.state = pseudo_classes[i].state_flag;
}
- else if (negate)
- {
- _gtk_css_parser_error (parser, "position pseudoclases not yet supported for :not()");
- if (selector)
- _gtk_css_selector_free (selector);
- return NULL;
- }
else
{
- selector = gtk_css_selector_new (>K_CSS_SELECTOR_PSEUDOCLASS_POSITION,
+ selector = gtk_css_selector_new (negate ? >K_CSS_SELECTOR_NOT_PSEUDOCLASS_POSITION
+ : >K_CSS_SELECTOR_PSEUDOCLASS_POSITION,
selector);
selector->position.type = pseudo_classes[i].position_type;
selector->position.a = pseudo_classes[i].position_a;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]