mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-08 19:50:21 +00:00
css: Fix * selector to also match regions
Fixes css-match-region-matches-star.ui reftest.
This commit is contained in:
parent
c6e25c6326
commit
bea4ee0a2c
@ -71,32 +71,6 @@ gtk_css_selector_previous (const GtkCssSelector *selector)
|
|||||||
return selector->class ? selector : NULL;
|
return selector->class ? selector : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ANY */
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_css_selector_any_print (const GtkCssSelector *selector,
|
|
||||||
GString *string)
|
|
||||||
{
|
|
||||||
g_string_append_c (string, '*');
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gtk_css_selector_any_match (const GtkCssSelector *selector,
|
|
||||||
GtkStateFlags state,
|
|
||||||
const GtkWidgetPath *path,
|
|
||||||
guint id,
|
|
||||||
guint sibling)
|
|
||||||
{
|
|
||||||
return gtk_css_selector_match (gtk_css_selector_previous (selector), state, path, id, sibling);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const GtkCssSelectorClass GTK_CSS_SELECTOR_ANY = {
|
|
||||||
"any",
|
|
||||||
gtk_css_selector_any_print,
|
|
||||||
gtk_css_selector_any_match,
|
|
||||||
FALSE, FALSE, FALSE
|
|
||||||
};
|
|
||||||
|
|
||||||
/* DESCENDANT */
|
/* DESCENDANT */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -235,6 +209,44 @@ static const GtkCssSelectorClass GTK_CSS_SELECTOR_ADJACENT = {
|
|||||||
FALSE, FALSE, FALSE
|
FALSE, FALSE, FALSE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* ANY */
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_css_selector_any_print (const GtkCssSelector *selector,
|
||||||
|
GString *string)
|
||||||
|
{
|
||||||
|
g_string_append_c (string, '*');
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gtk_css_selector_any_match (const GtkCssSelector *selector,
|
||||||
|
GtkStateFlags state,
|
||||||
|
const GtkWidgetPath *path,
|
||||||
|
guint id,
|
||||||
|
guint sibling)
|
||||||
|
{
|
||||||
|
const GtkCssSelector *previous = gtk_css_selector_previous (selector);
|
||||||
|
GSList *regions;
|
||||||
|
|
||||||
|
if (previous &&
|
||||||
|
previous->class == >K_CSS_SELECTOR_DESCENDANT &&
|
||||||
|
(regions = gtk_widget_path_iter_list_regions (path, id)) != NULL)
|
||||||
|
{
|
||||||
|
g_slist_free (regions);
|
||||||
|
if (gtk_css_selector_match (gtk_css_selector_previous (previous), state, path, id, sibling))
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return gtk_css_selector_match (previous, state, path, id, sibling);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const GtkCssSelectorClass GTK_CSS_SELECTOR_ANY = {
|
||||||
|
"any",
|
||||||
|
gtk_css_selector_any_print,
|
||||||
|
gtk_css_selector_any_match,
|
||||||
|
FALSE, FALSE, FALSE
|
||||||
|
};
|
||||||
|
|
||||||
/* NAME */
|
/* NAME */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user