Compare commits

...

27 Commits

Author SHA1 Message Date
Matthias Clasen
13e2445adb css: Track hover and active state changes separately
The idea is that this reduce the amount of frequently
changing state that css nodes are sensitive to.

This is going to reduce the amount of style recomputation.
2020-01-15 15:56:05 -05:00
Matthias Clasen
67fd975d77 Adwaita: Drop global pseudostate selectors
These cause massive style recomputation whenever the
window state changes.
2020-01-15 15:22:54 -05:00
Matthias Clasen
686dacf5be Adwaita: drop backdrop 2020-01-15 15:22:54 -05:00
Matthias Clasen
fba444b945 Revert "main: debug spew"
This reverts commit deeda017d7ba487bc1b5b89665fc31887a90df4e.
2020-01-15 15:22:54 -05:00
Matthias Clasen
5f277ed013 main: debug spew 2020-01-15 15:22:54 -05:00
Matthias Clasen
b413662ae2 cssnode: debug spew 2020-01-15 14:04:21 -05:00
Matthias Clasen
02cd36afb7 testsuite: Don't print default styles
This somewhat defeats the point that we want
to verify the regulars styles, not some weird
initial conditions.
2020-01-15 14:03:51 -05:00
Matthias Clasen
04fa4b15fe css: Mark the default style in debug dumps
This helps identifying unexpected situations,
since the default style should never be seen
in the wild.
2020-01-15 14:03:51 -05:00
Matthias Clasen
a8e9cc27d9 css: Don't got to the selector tree for change
The tree is optimized for mimizing the decisions, and
that prevents us from taking advantage of the more exact
superset matching that we can do now. So, instead do what
we used to do for verifiation: use the tree for finding the
superset matches, then just walk the rulesets to collect the
changes.
2020-01-15 14:03:51 -05:00
Matthias Clasen
305fbd2a5d css: Avoid computing change too often
Most of the time when styles need to be recreated,
the name and classes of the css node haven't changed.
In this case, the change value will not either, since
we are computing change under the assumption that
name and classes are unchanged, so there is no need
to recompute the change.
2020-01-15 12:45:23 -05:00
Matthias Clasen
a7323ed190 Make the superset matcher more exact
When the superset matcher is built from a node matcher,
we can make the parent matcher be a superset matchers for
the corresponding node, with the same relevant parts.
This is more precise than the ANY matcher that we were
returning previously.
2020-01-15 12:44:18 -05:00
Matthias Clasen
b928bdf428 Allow printing css matchers
This can help in debugging css matching.
2020-01-15 11:24:10 -05:00
Matthias Clasen
75b88b4385 cssmatcher: Add a type enum
For now, this just replaces the is_any boolean
by a type field in the class, and does away with
the unused Superset struct.supserset matcher fixup
2020-01-15 11:24:10 -05:00
Matthias Clasen
e2bbf83f01 Add selector statistics to the debug output 2020-01-15 11:24:10 -05:00
Matthias Clasen
791a81f092 cssstyle: Try harder to skip initial values
Compare values against the computed value of their
properties initial value. This works for fine for
all expect the border-width properties, whose special
handling defeats this.
2020-01-15 11:24:10 -05:00
Matthias Clasen
7c02f7ff2f testsuite: Update expected output for css style tests
These now include the change values.
2020-01-15 11:24:10 -05:00
Matthias Clasen
5c57f7b4fc testsuite: Include change in css style tests
This will help debugging css change tracking.
2020-01-15 11:24:10 -05:00
Matthias Clasen
7321719e97 Add a way to dump css node change values
Add a GTK_STYLE_CONTEXT_PRINT_SHOW_CHANGE flag that
tells gtk_style_context_to_string to include the
change values of nodes in the output. This will
help debugging css change tracking.
2020-01-15 11:24:10 -05:00
Matthias Clasen
c57aba0ac5 inspector: Show change in the css node tree
This is useful for debugging why we update to damn much
css on enter/leave.
2020-01-15 11:24:10 -05:00
Matthias Clasen
7888033e28 Revert "wip: reimplement css matching from scratch"
This reverts commit 7047a2e9c6f32da068bbfef78c6a4bda2d7d39f2.
2020-01-15 11:24:09 -05:00
Matthias Clasen
602d29a51a wip: reimplement css matching from scratch
First step: Strip out all optimizations.
2020-01-15 11:23:56 -05:00
Matthias Clasen
7e3842c3ea Add some css style tests
These are meant to test selectors.
2020-01-15 11:14:51 -05:00
Matthias Clasen
8394b93acf css: Add gtk_css_style_get_static_style
This lets us avoid poking directly at the GtkCssAnimatedStyle
struct in gtkcssnode.c.
2020-01-15 11:14:51 -05:00
Matthias Clasen
d803149fd2 Revert "css: Faster matching for simple selectors"
This reverts commit 05f7d68e29.
2020-01-15 11:14:51 -05:00
Matthias Clasen
436af79fa7 css: Faster matching for simple selectors
Inline simple selectors for node matchers.
A bit ugly, but works.
2020-01-15 11:14:51 -05:00
Matthias Clasen
a9e599d720 css: Implement the superset matcher smarter
Instead of wrapping the individual vfuncs, and having
a branch in the inner loop, rewrite the matcher class.
2020-01-15 11:14:51 -05:00
Matthias Clasen
7a5ab6eea0 css: Compute selector tree changes ahead of time
These only depend on the selector tree, so we can
compute them while constructing the tree.
2020-01-15 11:14:51 -05:00
32 changed files with 1036 additions and 1026 deletions

View File

@@ -79,6 +79,15 @@ gtk_css_animated_style_is_static (GtkCssStyle *style)
return TRUE;
}
static GtkCssStyle *
gtk_css_animated_style_get_static_style (GtkCssStyle *style)
{
/* This is called a lot, so we avoid a dynamic type check here */
GtkCssAnimatedStyle *animated = (GtkCssAnimatedStyle *) style;
return animated->style;
}
static void
gtk_css_animated_style_dispose (GObject *object)
{
@@ -123,6 +132,7 @@ gtk_css_animated_style_class_init (GtkCssAnimatedStyleClass *klass)
style_class->get_value = gtk_css_animated_style_get_value;
style_class->get_section = gtk_css_animated_style_get_section;
style_class->is_static = gtk_css_animated_style_is_static;
style_class->get_static_style = gtk_css_animated_style_get_static_style;
}
static void

View File

@@ -22,6 +22,7 @@
#include "gtkcssnodedeclarationprivate.h"
#include "gtkcssnodeprivate.h"
#include "gtkwidgetpath.h"
#include "gtkprivate.h"
/* GTK_CSS_MATCHER_WIDGET_PATH */
@@ -158,7 +159,17 @@ gtk_css_matcher_widget_path_has_position (const GtkCssMatcher *matcher,
return x / a >= 0;
}
static void
gtk_css_matcher_widget_path_print (const GtkCssMatcher *matcher,
GString *string)
{
char *s = gtk_widget_path_to_string (matcher->path.path);
g_string_append (string, s);
g_free (s);
}
static const GtkCssMatcherClass GTK_CSS_MATCHER_WIDGET_PATH = {
GTK_CSS_MATCHER_TYPE_WIDGET_PATH,
gtk_css_matcher_widget_path_get_parent,
gtk_css_matcher_widget_path_get_previous,
gtk_css_matcher_widget_path_get_state,
@@ -166,7 +177,7 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_WIDGET_PATH = {
gtk_css_matcher_widget_path_has_class,
gtk_css_matcher_widget_path_has_id,
gtk_css_matcher_widget_path_has_position,
FALSE
gtk_css_matcher_widget_path_print
};
gboolean
@@ -334,7 +345,15 @@ gtk_css_matcher_node_has_position (const GtkCssMatcher *matcher,
a, b);
}
static void
gtk_css_matcher_node_print (const GtkCssMatcher *matcher,
GString *string)
{
gtk_css_node_print (matcher->node.node, 0, string, 0);
}
static const GtkCssMatcherClass GTK_CSS_MATCHER_NODE = {
GTK_CSS_MATCHER_TYPE_NODE,
gtk_css_matcher_node_get_parent,
gtk_css_matcher_node_get_previous,
gtk_css_matcher_node_get_state,
@@ -342,7 +361,7 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_NODE = {
gtk_css_matcher_node_has_class,
gtk_css_matcher_node_has_id,
gtk_css_matcher_node_has_position,
FALSE
gtk_css_matcher_node_print
};
void
@@ -419,7 +438,15 @@ gtk_css_matcher_any_has_position (const GtkCssMatcher *matcher,
return TRUE;
}
static void
gtk_css_matcher_any_print (const GtkCssMatcher *matcher,
GString *string)
{
g_string_append (string, "ANY");
}
static const GtkCssMatcherClass GTK_CSS_MATCHER_ANY = {
GTK_CSS_MATCHER_TYPE_ANY,
gtk_css_matcher_any_get_parent,
gtk_css_matcher_any_get_previous,
gtk_css_matcher_any_get_state,
@@ -427,7 +454,7 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_ANY = {
gtk_css_matcher_any_has_class,
gtk_css_matcher_any_has_id,
gtk_css_matcher_any_has_position,
TRUE
gtk_css_matcher_any_print
};
void
@@ -442,9 +469,17 @@ static gboolean
gtk_css_matcher_superset_get_parent (GtkCssMatcher *matcher,
const GtkCssMatcher *child)
{
_gtk_css_matcher_any_init (matcher);
gboolean ret = TRUE;
return TRUE;
if (child->klass->type == GTK_CSS_MATCHER_TYPE_NODE)
{
ret = gtk_css_matcher_node_get_parent (matcher, child);
matcher->klass = child->klass;
}
else
_gtk_css_matcher_any_init (matcher);
return ret;
}
static gboolean
@@ -459,12 +494,7 @@ gtk_css_matcher_superset_get_previous (GtkCssMatcher *matcher,
static GtkStateFlags
gtk_css_matcher_superset_get_state (const GtkCssMatcher *matcher)
{
/* XXX: This gets tricky when we implement :not() */
if (matcher->superset.relevant & GTK_CSS_CHANGE_STATE)
return _gtk_css_matcher_get_state (matcher->superset.subset);
else
return GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED
return GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED
| GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_INCONSISTENT
| GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_BACKDROP | GTK_STATE_FLAG_LINK
| GTK_STATE_FLAG_VISITED;
@@ -474,30 +504,21 @@ static gboolean
gtk_css_matcher_superset_has_name (const GtkCssMatcher *matcher,
/*interned*/ const char *name)
{
if (matcher->superset.relevant & GTK_CSS_CHANGE_NAME)
return _gtk_css_matcher_has_name (matcher->superset.subset, name);
else
return TRUE;
return TRUE;
}
static gboolean
gtk_css_matcher_superset_has_class (const GtkCssMatcher *matcher,
GQuark class_name)
{
if (matcher->superset.relevant & GTK_CSS_CHANGE_CLASS)
return _gtk_css_matcher_has_class (matcher->superset.subset, class_name);
else
return TRUE;
return TRUE;
}
static gboolean
gtk_css_matcher_superset_has_id (const GtkCssMatcher *matcher,
const char *id)
{
if (matcher->superset.relevant & GTK_CSS_CHANGE_NAME)
return _gtk_css_matcher_has_id (matcher->superset.subset, id);
else
return TRUE;
return TRUE;
}
static gboolean
@@ -506,13 +527,23 @@ gtk_css_matcher_superset_has_position (const GtkCssMatcher *matcher,
int a,
int b)
{
if (matcher->superset.relevant & GTK_CSS_CHANGE_POSITION)
return _gtk_css_matcher_has_position (matcher->superset.subset, forward, a, b);
return TRUE;
}
static void
gtk_css_matcher_superset_print (const GtkCssMatcher *matcher,
GString *string)
{
g_string_append (string, "SUPERSET(");
if (matcher->klass->type == GTK_CSS_MATCHER_TYPE_NODE)
gtk_css_node_print (matcher->node.node, 0, string, 0);
else
return TRUE;
g_string_append (string, "...");
g_string_append (string, ")");
}
static const GtkCssMatcherClass GTK_CSS_MATCHER_SUPERSET = {
0,
gtk_css_matcher_superset_get_parent,
gtk_css_matcher_superset_get_previous,
gtk_css_matcher_superset_get_state,
@@ -520,19 +551,61 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_SUPERSET = {
gtk_css_matcher_superset_has_class,
gtk_css_matcher_superset_has_id,
gtk_css_matcher_superset_has_position,
FALSE
gtk_css_matcher_superset_print
};
void
_gtk_css_matcher_superset_init (GtkCssMatcher *matcher,
const GtkCssMatcher *subset,
GtkCssMatcherClass *klass,
GtkCssChange relevant)
{
g_return_if_fail (subset != NULL);
g_return_if_fail ((relevant & ~(GTK_CSS_CHANGE_CLASS | GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_STATE)) == 0);
g_return_if_fail ((relevant & ~(GTK_CSS_CHANGE_CLASS | GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_STATE | GTK_CSS_CHANGE_HOVER)) == 0);
matcher->superset.klass = &GTK_CSS_MATCHER_SUPERSET;
matcher->superset.subset = subset;
matcher->superset.relevant = relevant;
switch (subset->klass->type)
{
case GTK_CSS_MATCHER_TYPE_NODE:
matcher->node = subset->node;
break;
case GTK_CSS_MATCHER_TYPE_WIDGET_PATH:
matcher->path = subset->path;
break;
case GTK_CSS_MATCHER_TYPE_ANY:
break;
default:
g_assert_not_reached ();
break;
}
*klass = GTK_CSS_MATCHER_SUPERSET;
klass->type = subset->klass->type;
if (relevant & GTK_CSS_CHANGE_CLASS)
klass->has_class = subset->klass->has_class;
if (relevant & GTK_CSS_CHANGE_NAME)
klass->has_name = subset->klass->has_name;
if (relevant & GTK_CSS_CHANGE_NAME)
klass->has_id = subset->klass->has_id;
if (relevant & GTK_CSS_CHANGE_POSITION)
klass->has_position = subset->klass->has_position;
if (relevant & GTK_CSS_CHANGE_STATE)
klass->get_state = subset->klass->get_state;
matcher->klass = klass;
}
void
gtk_css_matcher_print (const GtkCssMatcher *matcher,
GString *string)
{
matcher->klass->print (matcher, string);
}
char *
gtk_css_matcher_to_string (const GtkCssMatcher *matcher)
{
GString *string = g_string_new ("");
gtk_css_matcher_print (matcher, string);
return g_string_free (string, FALSE);
}

View File

@@ -29,7 +29,14 @@ typedef struct _GtkCssMatcherSuperset GtkCssMatcherSuperset;
typedef struct _GtkCssMatcherWidgetPath GtkCssMatcherWidgetPath;
typedef struct _GtkCssMatcherClass GtkCssMatcherClass;
typedef enum {
GTK_CSS_MATCHER_TYPE_NODE,
GTK_CSS_MATCHER_TYPE_WIDGET_PATH,
GTK_CSS_MATCHER_TYPE_ANY
} GtkCssMatcherType;
struct _GtkCssMatcherClass {
GtkCssMatcherType type;
gboolean (* get_parent) (GtkCssMatcher *matcher,
const GtkCssMatcher *child);
gboolean (* get_previous) (GtkCssMatcher *matcher,
@@ -46,7 +53,8 @@ struct _GtkCssMatcherClass {
gboolean forward,
int a,
int b);
gboolean is_any;
void (* print) (const GtkCssMatcher *matcher,
GString *string);
};
struct _GtkCssMatcherWidgetPath {
@@ -67,17 +75,10 @@ struct _GtkCssMatcherNode {
guint n_classes;
};
struct _GtkCssMatcherSuperset {
const GtkCssMatcherClass *klass;
const GtkCssMatcher *subset;
GtkCssChange relevant;
};
union _GtkCssMatcher {
const GtkCssMatcherClass *klass;
GtkCssMatcherWidgetPath path;
GtkCssMatcherNode node;
GtkCssMatcherSuperset superset;
};
gboolean _gtk_css_matcher_init (GtkCssMatcher *matcher,
@@ -88,6 +89,7 @@ void _gtk_css_matcher_node_init (GtkCssMatcher *match
void _gtk_css_matcher_any_init (GtkCssMatcher *matcher);
void _gtk_css_matcher_superset_init (GtkCssMatcher *matcher,
const GtkCssMatcher *subset,
GtkCssMatcherClass *klass,
GtkCssChange relevant);
@@ -144,9 +146,12 @@ _gtk_css_matcher_has_position (const GtkCssMatcher *matcher,
static inline gboolean
_gtk_css_matcher_matches_any (const GtkCssMatcher *matcher)
{
return matcher->klass->is_any;
return matcher->klass->type == GTK_CSS_MATCHER_TYPE_ANY;
}
void gtk_css_matcher_print (const GtkCssMatcher *matcher,
GString *string);
char * gtk_css_matcher_to_string (const GtkCssMatcher *matcher);
G_END_DECLS

View File

@@ -19,6 +19,7 @@
#include "gtkcssnodeprivate.h"
#include "gtkcssstaticstyleprivate.h"
#include "gtkcssanimatedstyleprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkintl.h"
@@ -110,6 +111,40 @@ enum {
static guint cssnode_signals[LAST_SIGNAL] = { 0 };
static GParamSpec *cssnode_properties[NUM_PROPERTIES];
static int recreated_styles;
static int recomputed_change;
static int self_change;
static int parent_style_change;
static int other_radical_change;
static int changes[64];
void print_recreated_styles (void);
void print_recreated_styles (void)
{
int i;
g_print ("recreated styles: %d, recomputed change: %d, self: %d parent: %d, other %d\n",
recreated_styles,
recomputed_change,
self_change,
parent_style_change,
other_radical_change);
for (i = 0; i < 64; i++)
{
if (changes[i])
{
char *s = gtk_css_change_to_string (1 << i);
g_print (" %s %d\n", s, changes[i]);
g_free (s);
changes[i] = 0;
}
}
recreated_styles = 0;
recomputed_change = 0;
self_change = 0;
parent_style_change = 0;
other_radical_change = 0;
}
static GtkStyleProvider *
gtk_css_node_get_style_provider_or_null (GtkCssNode *cssnode)
{
@@ -348,12 +383,14 @@ store_in_global_parent_cache (GtkCssNode *node,
}
static GtkCssStyle *
gtk_css_node_create_style (GtkCssNode *cssnode)
gtk_css_node_create_style (GtkCssNode *cssnode,
GtkCssChange change)
{
const GtkCssNodeDeclaration *decl;
GtkCssMatcher matcher;
GtkCssStyle *parent;
GtkCssStyle *style;
gboolean compute_change;
decl = gtk_css_node_get_declaration (cssnode);
@@ -363,14 +400,38 @@ gtk_css_node_create_style (GtkCssNode *cssnode)
parent = cssnode->parent ? cssnode->parent->style : NULL;
compute_change = change & (GTK_CSS_CHANGE_ID | GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_CLASS | GTK_CSS_CHANGE_SOURCE);
if (gtk_css_node_init_matcher (cssnode, &matcher))
style = gtk_css_static_style_new_compute (gtk_css_node_get_style_provider (cssnode),
&matcher,
parent);
parent,
compute_change);
else
style = gtk_css_static_style_new_compute (gtk_css_node_get_style_provider (cssnode),
NULL,
parent);
parent,
compute_change);
recreated_styles++;
if (compute_change)
recomputed_change++;
#if 0
{
char *s = gtk_css_node_declaration_to_string (cssnode->decl);
char *c = gtk_css_change_to_string (((GtkCssStaticStyle *)style)->change);
g_print ("create style for %s: change %s (%s)\n", s, c, compute_change ? "recomputed" : "cached");
g_free (c);
g_free (s);
}
#endif
if (!compute_change)
{
GtkCssStyle *old_style = gtk_css_style_get_static_style (cssnode->style);
((GtkCssStaticStyle *)style)->change = ((GtkCssStaticStyle *)old_style)->change;
}
store_in_global_parent_cache (cssnode, decl, style);
@@ -391,12 +452,30 @@ gtk_css_style_needs_recreation (GtkCssStyle *style,
/* Try to avoid invalidating if we can */
if (change & GTK_CSS_RADICAL_CHANGE)
return TRUE;
{
if (change & GTK_CSS_CHANGE_PARENT_STYLE)
parent_style_change++;
else
other_radical_change++;
return TRUE;
}
if (gtk_css_static_style_get_change (GTK_CSS_STATIC_STYLE (style)) & change)
return TRUE;
else
return FALSE;
{
int i;
GtkCssChange e = gtk_css_static_style_get_change (GTK_CSS_STATIC_STYLE (style)) & change;
self_change++;
for (i = 0; i < 64; i++)
{
if (e & (1 << i))
changes[i]++;
}
return TRUE;
}
return FALSE;
}
static GtkCssStyle *
@@ -407,17 +486,10 @@ gtk_css_node_real_update_style (GtkCssNode *cssnode,
{
GtkCssStyle *static_style, *new_static_style, *new_style;
if (GTK_IS_CSS_ANIMATED_STYLE (style))
{
static_style = GTK_CSS_ANIMATED_STYLE (style)->style;
}
else
{
static_style = style;
}
static_style = gtk_css_style_get_static_style (style);
if (gtk_css_style_needs_recreation (static_style, change))
new_static_style = gtk_css_node_create_style (cssnode);
new_static_style = gtk_css_node_create_style (cssnode, change);
else
new_static_style = g_object_ref (static_style);
@@ -436,7 +508,7 @@ gtk_css_node_real_update_style (GtkCssNode *cssnode,
}
else if (static_style != style && (change & GTK_CSS_CHANGE_TIMESTAMP))
{
new_style = gtk_css_animated_style_new_advance (GTK_CSS_ANIMATED_STYLE (style),
new_style = gtk_css_animated_style_new_advance ((GtkCssAnimatedStyle *)style,
static_style,
timestamp);
}
@@ -1138,9 +1210,23 @@ void
gtk_css_node_set_state (GtkCssNode *cssnode,
GtkStateFlags state_flags)
{
GtkStateFlags old_state;
old_state = gtk_css_node_declaration_get_state (cssnode->decl);
if (gtk_css_node_declaration_set_state (&cssnode->decl, state_flags))
{
gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_STATE);
GtkStateFlags states = old_state ^ state_flags;
GtkCssChange change = 0;
if (states & GTK_STATE_FLAG_PRELIGHT)
change |= GTK_CSS_CHANGE_HOVER;
if (states & GTK_STATE_FLAG_ACTIVE)
change |= GTK_CSS_CHANGE_ACTIVE;
if (states & ~(GTK_STATE_FLAG_PRELIGHT|GTK_STATE_FLAG_ACTIVE))
change |= GTK_CSS_CHANGE_STATE;
gtk_css_node_invalidate (cssnode, change);
g_object_notify_by_pspec (G_OBJECT (cssnode), cssnode_properties[PROP_STATE]);
}
}
@@ -1398,6 +1484,19 @@ gtk_css_node_print (GtkCssNode *cssnode,
if (!cssnode->visible)
g_string_append_c (string, ']');
if (flags & GTK_STYLE_CONTEXT_PRINT_SHOW_CHANGE)
{
GtkCssStyle *style = gtk_css_node_get_style (cssnode);
GtkCssChange change;
if (!GTK_IS_CSS_STATIC_STYLE (style))
style = GTK_CSS_ANIMATED_STYLE (style)->style;
change = gtk_css_static_style_get_change (GTK_CSS_STATIC_STYLE (style));
g_string_append (string, " ");
gtk_css_change_print (change, string);
}
g_string_append_c (string, '\n');
if (flags & GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE)

View File

@@ -425,61 +425,43 @@ verify_tree_match_results (GtkCssProvider *provider,
#endif
}
static void
verify_tree_get_change_results (GtkCssProvider *provider,
const GtkCssMatcher *matcher,
GtkCssChange change)
static GtkCssChange
get_change (GtkCssProvider *provider,
const GtkCssMatcher *matcher)
{
#ifdef VERIFY_TREE
GtkCssProviderPrivate *priv = gtk_css_provider_get_instance_private (provider);
GtkCssChange change = 0;
GPtrArray *tree_rules;
int i;
tree_rules = _gtk_css_selector_tree_match_all (priv->tree, matcher);
if (tree_rules)
{
for (i = tree_rules->len - 1; i >= 0; i--)
{
GtkCssRuleset *ruleset;
ruleset = tree_rules->pdata[i];
change |= _gtk_css_selector_get_change (ruleset->selector);
}
g_ptr_array_free (tree_rules, TRUE);
}
#if 0
{
GtkCssProviderPrivate *priv = gtk_css_provider_get_instance_private (provider);
GtkCssChange verify_change = 0;
GPtrArray *tree_rules;
int i;
tree_rules = _gtk_css_selector_tree_match_all (priv->tree, matcher);
if (tree_rules)
{
verify_tree_match_results (provider, matcher, tree_rules);
for (i = tree_rules->len - 1; i >= 0; i--)
{
GtkCssRuleset *ruleset;
ruleset = tree_rules->pdata[i];
verify_change |= _gtk_css_selector_get_change (ruleset->selector);
}
g_ptr_array_free (tree_rules, TRUE);
}
if (change != verify_change)
{
GString *s;
s = g_string_new ("");
g_string_append (s, "expected change ");
gtk_css_change_print (verify_change, s);
g_string_append (s, ", but it was ");
gtk_css_change_print (change, s);
if ((change & ~verify_change) != 0)
{
g_string_append (s, ", unexpectedly set: ");
gtk_css_change_print (change & ~verify_change, s);
}
if ((~change & verify_change) != 0)
{
g_string_append_printf (s, ", unexpectedly not set: ");
gtk_css_change_print (~change & verify_change, s);
}
g_warning (s->str);
g_string_free (s, TRUE);
}
char *s = gtk_css_matcher_to_string (matcher);
char *d = gtk_css_change_to_string (change);
int n = tree_rules ? tree_rules->len : 0;
g_print ("change for %s from %d rules: %s\n", s, n, d);
g_free (s);
g_free (d);
}
#endif
}
return change;
}
static GtkCssValue *
gtk_css_style_provider_get_color (GtkStyleProvider *provider,
@@ -553,11 +535,11 @@ gtk_css_style_provider_lookup (GtkStyleProvider *provider,
if (change)
{
GtkCssMatcher change_matcher;
GtkCssMatcherClass matcher_class;
_gtk_css_matcher_superset_init (&change_matcher, matcher, GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_CLASS);
_gtk_css_matcher_superset_init (&change_matcher, matcher, &matcher_class, GTK_CSS_CHANGE_CLASS | GTK_CSS_CHANGE_NAME);
*change = _gtk_css_selector_tree_get_change_all (priv->tree, &change_matcher);
verify_tree_get_change_results (css_provider, &change_matcher, *change);
*change = get_change (css_provider, &change_matcher);
}
}
@@ -1048,6 +1030,7 @@ gtk_css_provider_postprocess (GtkCssProvider *css_provider)
priv->tree = _gtk_css_selector_tree_builder_build (builder);
_gtk_css_selector_tree_builder_free (builder);
#if 0
#ifndef VERIFY_TREE
for (i = 0; i < priv->rulesets->len; i++)
{
@@ -1059,6 +1042,7 @@ gtk_css_provider_postprocess (GtkCssProvider *css_provider)
ruleset->selector = NULL;
}
#endif
#endif
}
static void

View File

@@ -30,13 +30,15 @@
# include <intrin.h>
#endif
#undef PRINT_TREE
typedef struct _GtkCssSelectorClass GtkCssSelectorClass;
typedef gboolean (* GtkCssSelectorForeachFunc) (const GtkCssSelector *selector,
const GtkCssMatcher *matcher,
gpointer data);
struct _GtkCssSelectorClass {
const char *name;
const char *name;
void (* print) (const GtkCssSelector *selector,
GString *string);
@@ -104,6 +106,7 @@ union _GtkCssSelector
struct _GtkCssSelectorTree
{
GtkCssSelector selector;
GtkCssChange change;
gint32 parent_offset;
gint32 previous_offset;
gint32 sibling_offset;
@@ -728,6 +731,18 @@ comp_pseudoclass_state (const GtkCssSelector *a,
return a->state.state - b->state.state;
}
#define GTK_CSS_CHANGE_PSEUDOCLASS_HOVER GTK_CSS_CHANGE_HOVER
DEFINE_SIMPLE_SELECTOR(pseudoclass_hover, PSEUDOCLASS_HOVER, print_pseudoclass_state,
match_pseudoclass_state, hash_pseudoclass_state, comp_pseudoclass_state,
FALSE, TRUE, FALSE)
#undef GTK_CSS_CHANGE_PSEUDOCLASS_HOVER
#define GTK_CSS_CHANGE_PSEUDOCLASS_ACTIVE GTK_CSS_CHANGE_ACTIVE
DEFINE_SIMPLE_SELECTOR(pseudoclass_active, PSEUDOCLASS_ACTIVE, print_pseudoclass_state,
match_pseudoclass_state, hash_pseudoclass_state, comp_pseudoclass_state,
FALSE, TRUE, FALSE)
#undef GTK_CSS_CHANGE_PSEUDOCLASS_ACTIVE
#define GTK_CSS_CHANGE_PSEUDOCLASS_STATE GTK_CSS_CHANGE_STATE
DEFINE_SIMPLE_SELECTOR(pseudoclass_state, PSEUDOCLASS_STATE, print_pseudoclass_state,
match_pseudoclass_state, hash_pseudoclass_state, comp_pseudoclass_state,
@@ -1269,8 +1284,6 @@ gtk_css_selector_parse_selector_pseudo_class (GtkCssParser *parser,
{ "first-child", 0, POSITION_FORWARD, 0, 1 },
{ "last-child", 0, POSITION_BACKWARD, 0, 1 },
{ "only-child", 0, POSITION_ONLY, 0, 0 },
{ "active", GTK_STATE_FLAG_ACTIVE, },
{ "hover", GTK_STATE_FLAG_PRELIGHT, },
{ "selected", GTK_STATE_FLAG_SELECTED, },
{ "disabled", GTK_STATE_FLAG_INSENSITIVE, },
{ "indeterminate", GTK_STATE_FLAG_INCONSISTENT, },
@@ -1306,6 +1319,26 @@ gtk_css_selector_parse_selector_pseudo_class (GtkCssParser *parser,
return selector;
}
}
if (g_ascii_strcasecmp ("hover", token->string.string) == 0)
{
selector = gtk_css_selector_new (negate ? &GTK_CSS_SELECTOR_NOT_PSEUDOCLASS_HOVER
: &GTK_CSS_SELECTOR_PSEUDOCLASS_HOVER,
selector);
selector->state.state = GTK_STATE_FLAG_PRELIGHT;
gtk_css_parser_consume_token (parser);
return selector;
}
if (g_ascii_strcasecmp ("active", token->string.string) == 0)
{
selector = gtk_css_selector_new (negate ? &GTK_CSS_SELECTOR_NOT_PSEUDOCLASS_ACTIVE
: &GTK_CSS_SELECTOR_PSEUDOCLASS_ACTIVE,
selector);
selector->state.state = GTK_STATE_FLAG_ACTIVE;
gtk_css_parser_consume_token (parser);
return selector;
}
gtk_css_parser_error (parser,
GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
@@ -1874,7 +1907,7 @@ gtk_css_selector_tree_get_change (const GtkCssSelectorTree *tree,
return 0;
if (!tree->selector.class->is_simple)
return gtk_css_selector_tree_collect_change (tree) | GTK_CSS_CHANGE_GOT_MATCH;
return tree->change | GTK_CSS_CHANGE_GOT_MATCH;
for (prev = gtk_css_selector_tree_get_previous (tree);
prev != NULL;
@@ -1911,11 +1944,16 @@ _gtk_css_selector_tree_get_change_all (const GtkCssSelectorTree *tree,
}
#ifdef PRINT_TREE
static void
_gtk_css_selector_tree_print (const GtkCssSelectorTree *tree, GString *str, char *prefix)
_gtk_css_selector_tree_print_recurse (const GtkCssSelectorTree *tree,
GString *str,
const char *prefix,
GHashTable *counts)
{
gboolean first = TRUE;
int len, i;
int count;
for (; tree != NULL; tree = gtk_css_selector_tree_get_sibling (tree), first = FALSE)
{
@@ -1941,6 +1979,10 @@ _gtk_css_selector_tree_print (const GtkCssSelectorTree *tree, GString *str, char
tree->selector.class->print (&tree->selector, str);
len = str->len - len;
count = GPOINTER_TO_INT (g_hash_table_lookup (counts, (gpointer)tree->selector.class->name));
count++;
g_hash_table_insert (counts, (gpointer)tree->selector.class->name, GINT_TO_POINTER (count));
if (gtk_css_selector_tree_get_previous (tree))
{
GString *prefix2 = g_string_new (prefix);
@@ -1952,13 +1994,35 @@ _gtk_css_selector_tree_print (const GtkCssSelectorTree *tree, GString *str, char
for (i = 0; i < len; i++)
g_string_append_c (prefix2, ' ');
_gtk_css_selector_tree_print (gtk_css_selector_tree_get_previous (tree), str, prefix2->str);
_gtk_css_selector_tree_print_recurse (gtk_css_selector_tree_get_previous (tree), str, prefix2->str, counts);
g_string_free (prefix2, TRUE);
}
else
g_string_append (str, "\n");
}
}
static void
_gtk_css_selector_tree_print (const GtkCssSelectorTree *tree, GString *str, const char *prefix)
{
GHashTable *counts;
GHashTableIter iter;
const char *key;
gpointer value;
counts = g_hash_table_new (g_str_hash, g_str_equal);
_gtk_css_selector_tree_print_recurse (tree, str, prefix, counts);
g_string_append (str, "\n\nSelector counts:\n");
g_hash_table_iter_init (&iter, counts);
while (g_hash_table_iter_next (&iter, (gpointer *)&key, &value))
g_string_append_printf (str, "%-*s %4d\n", (int)strlen ("not_pseudoclass_position"), key, GPOINTER_TO_INT (value));
g_string_append (str, "\n");
g_hash_table_unref (counts);
}
#endif
void
@@ -2084,6 +2148,7 @@ subdivide_infos (GByteArray *array, GList *infos, gint32 parent_offset)
remaining = NULL;
tree = alloc_tree (array, &tree_offset);
tree->change = 0;
tree->parent_offset = parent_offset;
tree->selector = max_selector;
@@ -2193,6 +2258,20 @@ fixup_offsets (GtkCssSelectorTree *tree, guint8 *data)
}
}
static void
compute_change (GtkCssSelectorTree *tree)
{
for (; tree != NULL;
tree = (GtkCssSelectorTree *)gtk_css_selector_tree_get_sibling (tree))
{
GtkCssSelectorTree *prev = (GtkCssSelectorTree *)gtk_css_selector_tree_get_previous (tree);
tree->change = gtk_css_selector_tree_collect_change (tree);
compute_change (prev);
}
}
GtkCssSelectorTree *
_gtk_css_selector_tree_builder_build (GtkCssSelectorTreeBuilder *builder)
{
@@ -2216,6 +2295,8 @@ _gtk_css_selector_tree_builder_build (GtkCssSelectorTreeBuilder *builder)
fixup_offsets (tree, data);
compute_change (tree);
/* Convert offsets to final pointers */
for (l = builder->infos; l != NULL; l = l->next)
{

View File

@@ -158,7 +158,8 @@ gtk_css_static_style_get_default (void)
settings = gtk_settings_get_default ();
default_style = gtk_css_static_style_new_compute (GTK_STYLE_PROVIDER (settings),
NULL,
NULL);
NULL,
TRUE);
g_object_set_data_full (G_OBJECT (settings), I_("gtk-default-style"),
default_style, clear_default_style);
}
@@ -169,7 +170,8 @@ gtk_css_static_style_get_default (void)
GtkCssStyle *
gtk_css_static_style_new_compute (GtkStyleProvider *provider,
const GtkCssMatcher *matcher,
GtkCssStyle *parent)
GtkCssStyle *parent,
gboolean compute_change)
{
GtkCssStaticStyle *result;
GtkCssLookup lookup;
@@ -181,7 +183,7 @@ gtk_css_static_style_new_compute (GtkStyleProvider *provider,
gtk_style_provider_lookup (provider,
matcher,
&lookup,
&change);
compute_change ? &change : NULL);
result = g_object_new (GTK_TYPE_CSS_STATIC_STYLE, NULL);

View File

@@ -55,7 +55,8 @@ GType gtk_css_static_style_get_type (void) G_GNUC_CO
GtkCssStyle * gtk_css_static_style_get_default (void);
GtkCssStyle * gtk_css_static_style_new_compute (GtkStyleProvider *provider,
const GtkCssMatcher *matcher,
GtkCssStyle *parent);
GtkCssStyle *parent,
gboolean compute_change);
void gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
GtkStyleProvider *provider,

View File

@@ -37,6 +37,7 @@
#include "gtkstyleanimationprivate.h"
#include "gtkstylepropertyprivate.h"
#include "gtkstyleproviderprivate.h"
#include "gtksettings.h"
G_DEFINE_ABSTRACT_TYPE (GtkCssStyle, gtk_css_style, G_TYPE_OBJECT)
@@ -53,11 +54,18 @@ gtk_css_style_real_is_static (GtkCssStyle *style)
return TRUE;
}
static GtkCssStyle *
gtk_css_style_real_get_static_style (GtkCssStyle *style)
{
return style;
}
static void
gtk_css_style_class_init (GtkCssStyleClass *klass)
{
klass->get_section = gtk_css_style_real_get_section;
klass->is_static = gtk_css_style_real_is_static;
klass->get_static_style = gtk_css_style_real_get_static_style;
}
static void
@@ -89,6 +97,14 @@ gtk_css_style_is_static (GtkCssStyle *style)
return GTK_CSS_STYLE_GET_CLASS (style)->is_static (style);
}
GtkCssStyle *
gtk_css_style_get_static_style (GtkCssStyle *style)
{
gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
return GTK_CSS_STYLE_GET_CLASS (style)->get_static_style (style);
}
/*
* gtk_css_style_print:
* @style: a #GtkCssStyle
@@ -110,11 +126,17 @@ gtk_css_style_print (GtkCssStyle *style,
gboolean skip_initial)
{
guint i;
GtkCssStyle *default_style;
gboolean retval = FALSE;
g_return_val_if_fail (GTK_IS_CSS_STYLE (style), FALSE);
g_return_val_if_fail (string != NULL, FALSE);
default_style = gtk_css_static_style_get_default ();
if (style == default_style)
g_string_append_printf (string, "%*sDEFAULT STYLE\n", indent, "");
for (i = 0; i < _gtk_css_style_property_get_n_properties (); i++)
{
GtkCssSection *section;
@@ -122,13 +144,23 @@ gtk_css_style_print (GtkCssStyle *style,
GtkCssValue *value;
const char *name;
section = gtk_css_style_get_section (style, i);
if (!section && skip_initial)
continue;
prop = _gtk_css_style_property_lookup_by_id (i);
name = _gtk_style_property_get_name (GTK_STYLE_PROPERTY (prop));
value = gtk_css_style_get_value (style, i);
prop = _gtk_css_style_property_lookup_by_id (i);
if (skip_initial)
{
GtkCssValue *initial = _gtk_css_style_property_get_initial_value (prop);
GtkCssValue *computed = _gtk_css_value_compute (initial, i,
GTK_STYLE_PROVIDER (gtk_settings_get_default ()),
default_style,
default_style);
gboolean is_initial = _gtk_css_value_equal (value, computed);
gtk_css_value_unref (computed);
if (is_initial)
continue;
}
section = gtk_css_style_get_section (style, i);
name = _gtk_style_property_get_name (GTK_STYLE_PROPERTY (prop));
g_string_append_printf (string, "%*s%s: ", indent, "", name);
_gtk_css_value_print (value, string);

View File

@@ -56,6 +56,8 @@ struct _GtkCssStyleClass
guint id);
/* TRUE if this style will require changes based on timestamp */
gboolean (* is_static) (GtkCssStyle *style);
GtkCssStyle * (* get_static_style) (GtkCssStyle *style);
};
GType gtk_css_style_get_type (void) G_GNUC_CONST;
@@ -74,6 +76,7 @@ gboolean gtk_css_style_print (GtkCssStyle
PangoAttrList * gtk_css_style_get_pango_attributes (GtkCssStyle *style);
PangoFontDescription * gtk_css_style_get_pango_font (GtkCssStyle *style);
GtkCssStyle * gtk_css_style_get_static_style (GtkCssStyle *style);
G_END_DECLS

View File

@@ -74,19 +74,18 @@ _gtk_css_change_for_sibling (GtkCssChange match)
| GTK_CSS_CHANGE_LAST_CHILD \
| GTK_CSS_CHANGE_NTH_CHILD \
| GTK_CSS_CHANGE_NTH_LAST_CHILD \
| GTK_CSS_CHANGE_STATE )
| GTK_CSS_CHANGE_STATE \
| GTK_CSS_CHANGE_HOVER \
| GTK_CSS_CHANGE_ACTIVE )
#define KEEP_STATES ( ~(BASE_STATES|GTK_CSS_CHANGE_SOURCE|GTK_CSS_CHANGE_PARENT_STYLE) \
| GTK_CSS_CHANGE_NTH_CHILD \
| GTK_CSS_CHANGE_NTH_LAST_CHILD)
#define SIBLING_SHIFT 8
return (match & KEEP_STATES) | ((match & BASE_STATES) << SIBLING_SHIFT);
return (match & KEEP_STATES) | ((match & BASE_STATES) << GTK_CSS_CHANGE_SIBLING_SHIFT);
#undef BASE_STATES
#undef KEEP_STATES
#undef SIBLING_SHIFT
}
GtkCssChange
@@ -100,6 +99,8 @@ _gtk_css_change_for_child (GtkCssChange match)
| GTK_CSS_CHANGE_NTH_CHILD \
| GTK_CSS_CHANGE_NTH_LAST_CHILD \
| GTK_CSS_CHANGE_STATE \
| GTK_CSS_CHANGE_HOVER \
| GTK_CSS_CHANGE_ACTIVE \
| GTK_CSS_CHANGE_SIBLING_CLASS \
| GTK_CSS_CHANGE_SIBLING_NAME \
| GTK_CSS_CHANGE_SIBLING_ID \
@@ -107,14 +108,16 @@ _gtk_css_change_for_child (GtkCssChange match)
| GTK_CSS_CHANGE_SIBLING_LAST_CHILD \
| GTK_CSS_CHANGE_SIBLING_NTH_CHILD \
| GTK_CSS_CHANGE_SIBLING_NTH_LAST_CHILD \
| GTK_CSS_CHANGE_SIBLING_STATE )
| GTK_CSS_CHANGE_SIBLING_STATE \
| GTK_CSS_CHANGE_SIBLING_HOVER \
| GTK_CSS_CHANGE_SIBLING_ACTIVE )
#define PARENT_SHIFT 16
#define KEEP_STATES (~(BASE_STATES|GTK_CSS_CHANGE_SOURCE|GTK_CSS_CHANGE_PARENT_STYLE))
return (match & ~(BASE_STATES|GTK_CSS_CHANGE_SOURCE|GTK_CSS_CHANGE_PARENT_STYLE)) | ((match & BASE_STATES) << PARENT_SHIFT);
return (match & KEEP_STATES) | ((match & BASE_STATES) << GTK_CSS_CHANGE_PARENT_SHIFT);
#undef BASE_STATES
#undef PARENT_SHIFT
#undef KEEP_STATES
}
void
@@ -133,6 +136,8 @@ gtk_css_change_print (GtkCssChange change,
{ GTK_CSS_CHANGE_NTH_CHILD, "nth-child" },
{ GTK_CSS_CHANGE_NTH_LAST_CHILD, "nth-last-child" },
{ GTK_CSS_CHANGE_STATE, "state" },
{ GTK_CSS_CHANGE_HOVER, "hover" },
{ GTK_CSS_CHANGE_ACTIVE, "active" },
{ GTK_CSS_CHANGE_SIBLING_CLASS, "sibling-class" },
{ GTK_CSS_CHANGE_SIBLING_NAME, "sibling-name" },
{ GTK_CSS_CHANGE_SIBLING_ID, "sibling-id" },
@@ -141,6 +146,8 @@ gtk_css_change_print (GtkCssChange change,
{ GTK_CSS_CHANGE_SIBLING_NTH_CHILD, "sibling-nth-child" },
{ GTK_CSS_CHANGE_SIBLING_NTH_LAST_CHILD, "sibling-nth-last-child" },
{ GTK_CSS_CHANGE_SIBLING_STATE, "sibling-state" },
{ GTK_CSS_CHANGE_SIBLING_HOVER, "sibling-hover" },
{ GTK_CSS_CHANGE_SIBLING_ACTIVE, "sibling-active" },
{ GTK_CSS_CHANGE_PARENT_CLASS, "parent-class" },
{ GTK_CSS_CHANGE_PARENT_NAME, "parent-name" },
{ GTK_CSS_CHANGE_PARENT_ID, "parent-id" },
@@ -149,6 +156,8 @@ gtk_css_change_print (GtkCssChange change,
{ GTK_CSS_CHANGE_PARENT_NTH_CHILD, "parent-nth-child" },
{ GTK_CSS_CHANGE_PARENT_NTH_LAST_CHILD, "parent-nth-last-child" },
{ GTK_CSS_CHANGE_PARENT_STATE, "parent-state" },
{ GTK_CSS_CHANGE_PARENT_HOVER, "parent-hover" },
{ GTK_CSS_CHANGE_PARENT_ACTIVE, "parent-active" },
{ GTK_CSS_CHANGE_PARENT_SIBLING_CLASS, "parent-sibling-" },
{ GTK_CSS_CHANGE_PARENT_SIBLING_NAME, "parent-sibling-name" },
{ GTK_CSS_CHANGE_PARENT_SIBLING_ID, "parent-sibling-id" },
@@ -157,6 +166,8 @@ gtk_css_change_print (GtkCssChange change,
{ GTK_CSS_CHANGE_PARENT_SIBLING_NTH_CHILD, "parent-sibling-nth-child" },
{ GTK_CSS_CHANGE_PARENT_SIBLING_NTH_LAST_CHILD, "parent-sibling-nth-last-child" },
{ GTK_CSS_CHANGE_PARENT_SIBLING_STATE, "parent-sibling-state" },
{ GTK_CSS_CHANGE_PARENT_SIBLING_HOVER, "parent-sibling-hover" },
{ GTK_CSS_CHANGE_PARENT_SIBLING_ACTIVE, "parent-sibling-active" },
{ GTK_CSS_CHANGE_SOURCE, "source" },
{ GTK_CSS_CHANGE_PARENT_STYLE, "parent-style" },
{ GTK_CSS_CHANGE_TIMESTAMP, "timestamp" },

View File

@@ -36,61 +36,83 @@ typedef struct _GtkCssStyle GtkCssStyle;
#define GTK_CSS_CHANGE_NTH_CHILD (1ULL << 5)
#define GTK_CSS_CHANGE_NTH_LAST_CHILD (1ULL << 6)
#define GTK_CSS_CHANGE_STATE (1ULL << 7)
#define GTK_CSS_CHANGE_SIBLING_CLASS (1ULL << 8)
#define GTK_CSS_CHANGE_SIBLING_NAME (1ULL << 9)
#define GTK_CSS_CHANGE_SIBLING_ID (1ULL << 10)
#define GTK_CSS_CHANGE_SIBLING_FIRST_CHILD (1ULL << 11)
#define GTK_CSS_CHANGE_SIBLING_LAST_CHILD (1ULL << 12)
#define GTK_CSS_CHANGE_SIBLING_NTH_CHILD (1ULL << 13)
#define GTK_CSS_CHANGE_SIBLING_NTH_LAST_CHILD (1ULL << 14)
#define GTK_CSS_CHANGE_SIBLING_STATE (1ULL << 15)
#define GTK_CSS_CHANGE_PARENT_CLASS (1ULL << 16)
#define GTK_CSS_CHANGE_PARENT_NAME (1ULL << 17)
#define GTK_CSS_CHANGE_PARENT_ID (1ULL << 18)
#define GTK_CSS_CHANGE_PARENT_FIRST_CHILD (1ULL << 19)
#define GTK_CSS_CHANGE_PARENT_LAST_CHILD (1ULL << 20)
#define GTK_CSS_CHANGE_PARENT_NTH_CHILD (1ULL << 21)
#define GTK_CSS_CHANGE_PARENT_NTH_LAST_CHILD (1ULL << 22)
#define GTK_CSS_CHANGE_PARENT_STATE (1ULL << 23)
#define GTK_CSS_CHANGE_PARENT_SIBLING_CLASS (1ULL << 24)
#define GTK_CSS_CHANGE_PARENT_SIBLING_ID (1ULL << 25)
#define GTK_CSS_CHANGE_PARENT_SIBLING_NAME (1ULL << 26)
#define GTK_CSS_CHANGE_PARENT_SIBLING_FIRST_CHILD (1ULL << 27)
#define GTK_CSS_CHANGE_PARENT_SIBLING_LAST_CHILD (1ULL << 28)
#define GTK_CSS_CHANGE_PARENT_SIBLING_NTH_CHILD (1ULL << 29)
#define GTK_CSS_CHANGE_PARENT_SIBLING_NTH_LAST_CHILD (1ULL << 30)
#define GTK_CSS_CHANGE_PARENT_SIBLING_STATE (1ULL << 31)
#define GTK_CSS_CHANGE_HOVER (1ULL << 8)
#define GTK_CSS_CHANGE_ACTIVE (1ULL << 9)
#define GTK_CSS_CHANGE_SIBLING_SHIFT 10
#define GTK_CSS_CHANGE_SIBLING_CLASS (1ULL << 10)
#define GTK_CSS_CHANGE_SIBLING_NAME (1ULL << 11)
#define GTK_CSS_CHANGE_SIBLING_ID (1ULL << 12)
#define GTK_CSS_CHANGE_SIBLING_FIRST_CHILD (1ULL << 13)
#define GTK_CSS_CHANGE_SIBLING_LAST_CHILD (1ULL << 14)
#define GTK_CSS_CHANGE_SIBLING_NTH_CHILD (1ULL << 15)
#define GTK_CSS_CHANGE_SIBLING_NTH_LAST_CHILD (1ULL << 16)
#define GTK_CSS_CHANGE_SIBLING_STATE (1ULL << 17)
#define GTK_CSS_CHANGE_SIBLING_HOVER (1ULL << 18)
#define GTK_CSS_CHANGE_SIBLING_ACTIVE (1ULL << 19)
#define GTK_CSS_CHANGE_PARENT_SHIFT (GTK_CSS_CHANGE_SIBLING_SHIFT + GTK_CSS_CHANGE_SIBLING_SHIFT)
#define GTK_CSS_CHANGE_PARENT_CLASS (1ULL << 20)
#define GTK_CSS_CHANGE_PARENT_NAME (1ULL << 21)
#define GTK_CSS_CHANGE_PARENT_ID (1ULL << 22)
#define GTK_CSS_CHANGE_PARENT_FIRST_CHILD (1ULL << 23)
#define GTK_CSS_CHANGE_PARENT_LAST_CHILD (1ULL << 24)
#define GTK_CSS_CHANGE_PARENT_NTH_CHILD (1ULL << 25)
#define GTK_CSS_CHANGE_PARENT_NTH_LAST_CHILD (1ULL << 26)
#define GTK_CSS_CHANGE_PARENT_STATE (1ULL << 27)
#define GTK_CSS_CHANGE_PARENT_HOVER (1ULL << 28)
#define GTK_CSS_CHANGE_PARENT_ACTIVE (1ULL << 29)
#define GTK_CSS_CHANGE_PARENT_SIBLING_SHIFT (GTK_CSS_CHANGE_PARENT_SHIFT + GTK_CSS_CHANGE_SIBLING_SHIFT)
#define GTK_CSS_CHANGE_PARENT_SIBLING_CLASS (1ULL << 30)
#define GTK_CSS_CHANGE_PARENT_SIBLING_ID (1ULL << 31)
#define GTK_CSS_CHANGE_PARENT_SIBLING_NAME (1ULL << 32)
#define GTK_CSS_CHANGE_PARENT_SIBLING_FIRST_CHILD (1ULL << 33)
#define GTK_CSS_CHANGE_PARENT_SIBLING_LAST_CHILD (1ULL << 34)
#define GTK_CSS_CHANGE_PARENT_SIBLING_NTH_CHILD (1ULL << 35)
#define GTK_CSS_CHANGE_PARENT_SIBLING_NTH_LAST_CHILD (1ULL << 36)
#define GTK_CSS_CHANGE_PARENT_SIBLING_STATE (1ULL << 37)
#define GTK_CSS_CHANGE_PARENT_SIBLING_HOVER (1ULL << 38)
#define GTK_CSS_CHANGE_PARENT_SIBLING_ACTIVE (1ULL << 39)
/* add more */
#define GTK_CSS_CHANGE_SOURCE (1ULL << 32)
#define GTK_CSS_CHANGE_PARENT_STYLE (1ULL << 33)
#define GTK_CSS_CHANGE_TIMESTAMP (1ULL << 34)
#define GTK_CSS_CHANGE_ANIMATIONS (1ULL << 35)
#define GTK_CSS_CHANGE_SOURCE (1ULL << 40)
#define GTK_CSS_CHANGE_PARENT_STYLE (1ULL << 41)
#define GTK_CSS_CHANGE_TIMESTAMP (1ULL << 42)
#define GTK_CSS_CHANGE_ANIMATIONS (1ULL << 43)
#define GTK_CSS_CHANGE_RESERVED_BIT (1ULL << 62) /* Used internally in gtkcssselector.c */
typedef guint64 GtkCssChange;
#define GTK_CSS_CHANGE_POSITION (GTK_CSS_CHANGE_FIRST_CHILD | GTK_CSS_CHANGE_LAST_CHILD | \
GTK_CSS_CHANGE_NTH_CHILD | GTK_CSS_CHANGE_NTH_LAST_CHILD)
#define GTK_CSS_CHANGE_SIBLING_POSITION (GTK_CSS_CHANGE_SIBLING_FIRST_CHILD | GTK_CSS_CHANGE_SIBLING_LAST_CHILD | \
GTK_CSS_CHANGE_SIBLING_NTH_CHILD | GTK_CSS_CHANGE_SIBLING_NTH_LAST_CHILD)
#define GTK_CSS_CHANGE_PARENT_POSITION (GTK_CSS_CHANGE_PARENT_FIRST_CHILD | GTK_CSS_CHANGE_PARENT_LAST_CHILD | \
GTK_CSS_CHANGE_PARENT_NTH_CHILD | GTK_CSS_CHANGE_PARENT_NTH_LAST_CHILD)
#define GTK_CSS_CHANGE_PARENT_SIBLING_POSITION (GTK_CSS_CHANGE_PARENT_SIBLING_FIRST_CHILD | GTK_CSS_CHANGE_PARENT_SIBLING_LAST_CHILD | \
GTK_CSS_CHANGE_PARENT_SIBLING_NTH_CHILD | GTK_CSS_CHANGE_PARENT_SIBLING_NTH_LAST_CHILD)
#define GTK_CSS_CHANGE_POSITION (GTK_CSS_CHANGE_FIRST_CHILD | \
GTK_CSS_CHANGE_LAST_CHILD | \
GTK_CSS_CHANGE_NTH_CHILD | \
GTK_CSS_CHANGE_NTH_LAST_CHILD)
#define GTK_CSS_CHANGE_SIBLING_POSITION (GTK_CSS_CHANGE_POSITION << GTK_CSS_CHANGE_SIBLING_SHIFT)
#define GTK_CSS_CHANGE_ANY_SELF (GTK_CSS_CHANGE_CLASS | \
GTK_CSS_CHANGE_NAME | \
GTK_CSS_CHANGE_ID | \
GTK_CSS_CHANGE_POSITION | \
GTK_CSS_CHANGE_STATE | \
GTK_CSS_CHANGE_HOVER | \
GTK_CSS_CHANGE_ACTIVE)
#define GTK_CSS_CHANGE_ANY_SIBLING (GTK_CSS_CHANGE_ANY_SELF << GTK_CSS_CHANGE_SIBLING_SHIFT)
#define GTK_CSS_CHANGE_ANY_PARENT (GTK_CSS_CHANGE_ANY_SELF << GTK_CSS_CHANGE_PARENT_SHIFT)
#define GTK_CSS_CHANGE_ANY_PARENT_SIBLING (GTK_CSS_CHANGE_ANY_SELF << GTK_CSS_CHANGE_PARENT_SIBLING_SHIFT)
#define GTK_CSS_CHANGE_ANY ((1 << 19) - 1)
#define GTK_CSS_CHANGE_ANY_SELF (GTK_CSS_CHANGE_CLASS | GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_ID | GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_STATE)
#define GTK_CSS_CHANGE_ANY_SIBLING (GTK_CSS_CHANGE_SIBLING_CLASS | GTK_CSS_CHANGE_SIBLING_NAME | \
GTK_CSS_CHANGE_SIBLING_ID | \
GTK_CSS_CHANGE_SIBLING_POSITION | GTK_CSS_CHANGE_SIBLING_STATE)
#define GTK_CSS_CHANGE_ANY_PARENT (GTK_CSS_CHANGE_PARENT_CLASS | GTK_CSS_CHANGE_PARENT_SIBLING_CLASS | \
GTK_CSS_CHANGE_PARENT_NAME | GTK_CSS_CHANGE_PARENT_SIBLING_NAME | \
GTK_CSS_CHANGE_PARENT_ID | GTK_CSS_CHANGE_PARENT_SIBLING_ID | \
GTK_CSS_CHANGE_PARENT_POSITION | GTK_CSS_CHANGE_PARENT_SIBLING_POSITION | \
GTK_CSS_CHANGE_PARENT_STATE | GTK_CSS_CHANGE_PARENT_SIBLING_STATE)
#define GTK_CSS_CHANGE_ANY (GTK_CSS_CHANGE_ANY_SELF | \
GTK_CSS_CHANGE_ANY_SIBLING | \
GTK_CSS_CHANGE_ANY_PARENT | \
GTK_CSS_CHANGE_ANY_PARENT_SIBLING | \
GTK_CSS_CHANGE_SOURCE | \
GTK_CSS_CHANGE_PARENT_STYLE | \
GTK_CSS_CHANGE_TIMESTAMP | \
GTK_CSS_CHANGE_ANIMATIONS)
/*
* GtkCssAffects:

View File

@@ -1053,7 +1053,8 @@ void gtk_render_insertion_cursor
typedef enum {
GTK_STYLE_CONTEXT_PRINT_NONE = 0,
GTK_STYLE_CONTEXT_PRINT_RECURSE = 1 << 0,
GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE = 1 << 1
GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE = 1 << 1,
GTK_STYLE_CONTEXT_PRINT_SHOW_CHANGE = 1 << 2
} GtkStyleContextPrintFlags;
GDK_AVAILABLE_IN_ALL

View File

@@ -6008,11 +6008,14 @@ surface_size_changed (GtkWidget *widget,
gtk_window_configure (GTK_WINDOW (widget), width, height);
}
extern void print_recreated_styles (void);
static gboolean
surface_render (GdkSurface *surface,
cairo_region_t *region,
GtkWidget *widget)
{
print_recreated_styles ();
gtk_widget_render (widget, surface, region);
return TRUE;
}

View File

@@ -52,6 +52,7 @@ enum {
COLUMN_NODE_CLASSES,
COLUMN_NODE_ID,
COLUMN_NODE_STATE,
COLUMN_NODE_CHANGE,
/* add more */
N_NODE_COLUMNS
};
@@ -337,6 +338,15 @@ gtk_inspector_css_node_tree_get_node_value (GtkTreeModelCssNode *model,
g_value_take_string (value, format_state_flags (gtk_css_node_get_state (node)));
break;
case COLUMN_NODE_CHANGE:
{
GtkCssStyle *style = gtk_css_node_get_style (node);
GtkCssStaticStyle *static_style = GTK_CSS_STATIC_STYLE (gtk_css_style_get_static_style (style));
GtkCssChange change = gtk_css_static_style_get_change (static_style);
g_value_take_string (value, gtk_css_change_to_string (change));
}
break;
default:
g_assert_not_reached ();
break;
@@ -359,6 +369,7 @@ gtk_inspector_css_node_tree_init (GtkInspectorCssNodeTree *cnt)
G_TYPE_BOOLEAN,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING);
gtk_tree_view_set_model (GTK_TREE_VIEW (priv->node_tree), priv->node_model);
g_object_unref (priv->node_model);

View File

@@ -5,6 +5,7 @@
<column type="gchararray"/>
<column type="gchararray"/>
<column type="gint"/>
<column type="gchararray"/>
</columns>
</object>
<template class="GtkInspectorCssNodeTree" parent="GtkBox">
@@ -80,6 +81,19 @@
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="node_change_column">
<property name="resizable">1</property>
<property name="title" translatable="yes">Change</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">5</attribute>
<attribute name="sensitive">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>

View File

@@ -83,8 +83,8 @@ gtk_private_sources = files([
'gtkcsspositionvalue.c',
'gtkcssrepeatvalue.c',
'gtkcssrgbavalue.c',
'gtkcssselector.c',
'gtkcssshadowsvalue.c',
'gtkcssselector.c',
'gtkcssshadowvalue.c',
'gtkcssshorthandproperty.c',
'gtkcssshorthandpropertyimpl.c',

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,13 @@
[window.background:dir(ltr)]
decoration:dir(ltr)
box.horizontal:dir(ltr)
box.horizontal:dir(ltr)
checkbutton:dir(ltr):checked
check:dir(ltr):checked
label#label1:dir(ltr)
[window.background:dir(ltr)] class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
decoration:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
box.horizontal:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
box.horizontal:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
checkbutton:dir(ltr):checked class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
check:dir(ltr):checked class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
label#label1:dir(ltr) name|sibling-name|sibling-state
color: rgb(255,0,0); /* adjacent-states.css:2:3-14 */
box.horizontal:dir(ltr)
checkbutton:dir(ltr)
check:dir(ltr)
label#label2:dir(ltr)
box.horizontal:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
checkbutton:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
check:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
label#label2:dir(ltr) name|sibling-name|sibling-state
color: rgb(0,0,255); /* adjacent-states.css:6:3-15 */

View File

@@ -0,0 +1,172 @@
color {
bounds: 0 60 171 22;
color: rgb(0,255,0);
}
transform {
child: container {
blend {
bottom: blend {
bottom: color {
bounds: 0 0 149 0;
color: rgb(255,0,0);
}
mode: multiply;
top: color {
bounds: 0 0 149 0;
color: rgba(0,0,0,0);
}
}
mode: multiply;
top: color {
bounds: -10 -10 84.5 20;
color: rgb(255,255,0);
}
}
border {
colors: rgb(0,0,255);
outline: -11 -11 171 22;
}
}
transform: translate(11, 71);
}
container {
transform {
child: container {
blend {
bottom: blend {
bottom: color {
bounds: 0 0 0 38;
color: rgb(255,0,0);
}
mode: multiply;
top: color {
bounds: 0 0 0 38;
color: rgba(0,0,0,0);
}
}
mode: multiply;
top: color {
bounds: -10 -10 10 58;
color: rgb(255,255,0);
}
}
border {
colors: rgb(0,0,255);
outline: -11 -11 22 60;
}
}
transform: translate(11, 11);
}
transform {
child: container {
blend {
bottom: blend {
bottom: color {
bounds: 0 0 67 18;
color: rgb(255,0,0);
}
mode: multiply;
top: clip {
child: color {
bounds: -10 -10 87 19;
color: rgb(255,255,255);
}
clip: 0 0 67 18;
}
}
mode: multiply;
top: color {
bounds: -10 -10 43.5 38;
color: rgb(255,255,0);
}
}
border {
colors: rgb(0,0,255);
outline: -11 -11 89 40;
}
container {
text {
color: rgb(255,255,255);
font: "Cantarell 11";
glyphs: 312 8, 430 5, 345 7, 828 7, 272 8, 438 8, 324 4, 349 4;
offset: 3 14.418;
}
text {
color: rgb(255,255,255);
font: "Cantarell 11";
glyphs: 809 10;
offset: 54 14.418;
}
}
}
transform: translate(33, 21);
}
transform {
child: container {
blend {
bottom: blend {
bottom: color {
bounds: 0 0 38 38;
color: rgb(255,0,0);
}
mode: multiply;
top: clip {
child: color {
bounds: -10 -10 58 29;
color: rgb(255,255,255);
}
clip: 0 0 38 38;
}
}
mode: multiply;
top: color {
bounds: -10 -10 29 58;
color: rgb(255,255,0);
}
}
border {
colors: rgb(0,0,255);
outline: -11 -11 60 60;
}
transform {
child: container {
blend {
bottom: blend {
bottom: color {
bounds: 0 0 16 16;
color: rgb(255,0,0);
}
mode: multiply;
top: clip {
child: color {
bounds: -10 -10 36 18;
color: rgb(255,255,255);
}
clip: 0 0 16 16;
}
}
mode: multiply;
top: color {
bounds: -10 -10 18 36;
color: rgb(255,255,0);
}
}
border {
colors: rgb(0,0,255);
outline: -11 -11 38 38;
}
color-matrix {
child: texture {
bounds: 0 0 16 16;
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAAfUlEQVQ4je3RMQoCMRBG4Q+voEIKC/H+d7Cwd1GULSzEUyg2azOyQ1gxB9gHgcnknxdCmJliwAHr1FtiH2d/uUTwHJIVuuj1LYINbklyivqObYuglgx4YDcVXPwQvPFM+1esJgquxjf3qS4tgmM1UJKkaxF8g/m2YvyJmYoPk2IlW2Wofj0AAAAASUVORK5CYII=");
}
matrix: matrix3d(-0.8, -0.180392, -0.521569, 0, -0.0392157, -0.52549, -1, 0, -0.2, -1, -1, 0, 0, 0, 0, 1);
offset: 1 1 1 0;
}
}
transform: translate(11, 11);
}
}
transform: translate(122, 11);
}
}

View File

@@ -1,298 +1,298 @@
[window.background:dir(ltr)]
decoration:dir(ltr)
box.horizontal:dir(ltr)
label#aliceblue:dir(ltr)
[window.background:dir(ltr)] class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
decoration:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
box.horizontal:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
label#aliceblue:dir(ltr) name|id
color: rgb(240,248,255); /* colornames.css:1:19-36 */
label#antiquewhite:dir(ltr)
label#antiquewhite:dir(ltr) name|id
color: rgb(250,235,215); /* colornames.css:2:22-42 */
label#aqua:dir(ltr)
label#aqua:dir(ltr) name|id
color: rgb(0,255,255); /* colornames.css:3:14-26 */
label#aquamarine:dir(ltr)
label#aquamarine:dir(ltr) name|id
color: rgb(127,255,212); /* colornames.css:4:20-38 */
label#azure:dir(ltr)
label#azure:dir(ltr) name|id
color: rgb(240,255,255); /* colornames.css:5:15-28 */
label#beige:dir(ltr)
label#beige:dir(ltr) name|id
color: rgb(245,245,220); /* colornames.css:6:15-28 */
label#bisque:dir(ltr)
label#bisque:dir(ltr) name|id
color: rgb(255,228,196); /* colornames.css:7:16-30 */
label#black:dir(ltr)
label#black:dir(ltr) name|id
color: rgb(0,0,0); /* colornames.css:8:15-28 */
label#blanchedalmond:dir(ltr)
label#blanchedalmond:dir(ltr) name|id
color: rgb(255,235,205); /* colornames.css:9:24-46 */
label#blue:dir(ltr)
label#blue:dir(ltr) name|id
color: rgb(0,0,255); /* colornames.css:10:14-26 */
label#blueviolet:dir(ltr)
label#blueviolet:dir(ltr) name|id
color: rgb(138,43,226); /* colornames.css:11:20-38 */
label#brown:dir(ltr)
label#brown:dir(ltr) name|id
color: rgb(165,42,42); /* colornames.css:12:15-28 */
label#burlywood:dir(ltr)
label#burlywood:dir(ltr) name|id
color: rgb(222,184,135); /* colornames.css:13:19-36 */
label#cadetblue:dir(ltr)
label#cadetblue:dir(ltr) name|id
color: rgb(95,158,160); /* colornames.css:14:19-36 */
label#chartreuse:dir(ltr)
label#chartreuse:dir(ltr) name|id
color: rgb(127,255,0); /* colornames.css:15:20-38 */
label#chocolate:dir(ltr)
label#chocolate:dir(ltr) name|id
color: rgb(210,105,30); /* colornames.css:16:19-36 */
label#coral:dir(ltr)
label#coral:dir(ltr) name|id
color: rgb(255,127,80); /* colornames.css:17:15-28 */
label#cornflowerblue:dir(ltr)
label#cornflowerblue:dir(ltr) name|id
color: rgb(100,149,237); /* colornames.css:18:24-46 */
label#cornsilk:dir(ltr)
label#cornsilk:dir(ltr) name|id
color: rgb(255,248,220); /* colornames.css:19:18-34 */
label#crimson:dir(ltr)
label#crimson:dir(ltr) name|id
color: rgb(220,20,60); /* colornames.css:20:17-32 */
label#cyan:dir(ltr)
label#cyan:dir(ltr) name|id
color: rgb(0,255,255); /* colornames.css:21:14-26 */
label#darkblue:dir(ltr)
label#darkblue:dir(ltr) name|id
color: rgb(0,0,139); /* colornames.css:22:18-34 */
label#darkcyan:dir(ltr)
label#darkcyan:dir(ltr) name|id
color: rgb(0,139,139); /* colornames.css:23:18-34 */
label#darkgoldenrod:dir(ltr)
label#darkgoldenrod:dir(ltr) name|id
color: rgb(184,134,11); /* colornames.css:24:23-44 */
label#darkgray:dir(ltr)
label#darkgray:dir(ltr) name|id
color: rgb(169,169,169); /* colornames.css:25:18-34 */
label#darkgreen:dir(ltr)
label#darkgreen:dir(ltr) name|id
color: rgb(0,100,0); /* colornames.css:26:19-36 */
label#darkgrey:dir(ltr)
label#darkgrey:dir(ltr) name|id
color: rgb(169,169,169); /* colornames.css:27:18-34 */
label#darkkhaki:dir(ltr)
label#darkkhaki:dir(ltr) name|id
color: rgb(189,183,107); /* colornames.css:28:19-36 */
label#darkmagenta:dir(ltr)
label#darkmagenta:dir(ltr) name|id
color: rgb(139,0,139); /* colornames.css:29:21-40 */
label#darkolivegreen:dir(ltr)
label#darkolivegreen:dir(ltr) name|id
color: rgb(85,107,47); /* colornames.css:30:24-46 */
label#darkorange:dir(ltr)
label#darkorange:dir(ltr) name|id
color: rgb(255,140,0); /* colornames.css:31:20-38 */
label#darkorchid:dir(ltr)
label#darkorchid:dir(ltr) name|id
color: rgb(153,50,204); /* colornames.css:32:20-38 */
label#darkred:dir(ltr)
label#darkred:dir(ltr) name|id
color: rgb(139,0,0); /* colornames.css:33:17-32 */
label#darksalmon:dir(ltr)
label#darksalmon:dir(ltr) name|id
color: rgb(233,150,122); /* colornames.css:34:20-38 */
label#darkseagreen:dir(ltr)
label#darkseagreen:dir(ltr) name|id
color: rgb(143,188,143); /* colornames.css:35:22-42 */
label#darkslateblue:dir(ltr)
label#darkslateblue:dir(ltr) name|id
color: rgb(72,61,139); /* colornames.css:36:23-44 */
label#darkslategray:dir(ltr)
label#darkslategray:dir(ltr) name|id
color: rgb(47,79,79); /* colornames.css:37:23-44 */
label#darkslategrey:dir(ltr)
label#darkslategrey:dir(ltr) name|id
color: rgb(47,79,79); /* colornames.css:38:23-44 */
label#darkturquoise:dir(ltr)
label#darkturquoise:dir(ltr) name|id
color: rgb(0,206,209); /* colornames.css:39:23-44 */
label#darkviolet:dir(ltr)
label#darkviolet:dir(ltr) name|id
color: rgb(148,0,211); /* colornames.css:40:20-38 */
label#deeppink:dir(ltr)
label#deeppink:dir(ltr) name|id
color: rgb(255,20,147); /* colornames.css:41:18-34 */
label#deepskyblue:dir(ltr)
label#deepskyblue:dir(ltr) name|id
color: rgb(0,191,255); /* colornames.css:42:21-40 */
label#dimgray:dir(ltr)
label#dimgray:dir(ltr) name|id
color: rgb(105,105,105); /* colornames.css:43:17-32 */
label#dimgrey:dir(ltr)
label#dimgrey:dir(ltr) name|id
color: rgb(105,105,105); /* colornames.css:44:17-32 */
label#dodgerblue:dir(ltr)
label#dodgerblue:dir(ltr) name|id
color: rgb(30,144,255); /* colornames.css:45:20-38 */
label#firebrick:dir(ltr)
label#firebrick:dir(ltr) name|id
color: rgb(178,34,34); /* colornames.css:46:19-36 */
label#floralwhite:dir(ltr)
label#floralwhite:dir(ltr) name|id
color: rgb(255,250,240); /* colornames.css:47:21-40 */
label#forestgreen:dir(ltr)
label#forestgreen:dir(ltr) name|id
color: rgb(34,139,34); /* colornames.css:48:21-40 */
label#fuchsia:dir(ltr)
label#fuchsia:dir(ltr) name|id
color: rgb(255,0,255); /* colornames.css:49:17-32 */
label#gainsboro:dir(ltr)
label#gainsboro:dir(ltr) name|id
color: rgb(220,220,220); /* colornames.css:50:19-36 */
label#ghostwhite:dir(ltr)
label#ghostwhite:dir(ltr) name|id
color: rgb(248,248,255); /* colornames.css:51:20-38 */
label#gold:dir(ltr)
label#gold:dir(ltr) name|id
color: rgb(255,215,0); /* colornames.css:52:14-26 */
label#goldenrod:dir(ltr)
label#goldenrod:dir(ltr) name|id
color: rgb(218,165,32); /* colornames.css:53:19-36 */
label#gray:dir(ltr)
label#gray:dir(ltr) name|id
color: rgb(128,128,128); /* colornames.css:54:14-26 */
label#green:dir(ltr)
label#green:dir(ltr) name|id
color: rgb(0,128,0); /* colornames.css:55:15-28 */
label#greenyellow:dir(ltr)
label#greenyellow:dir(ltr) name|id
color: rgb(173,255,47); /* colornames.css:56:21-40 */
label#grey:dir(ltr)
label#grey:dir(ltr) name|id
color: rgb(128,128,128); /* colornames.css:57:14-26 */
label#honeydew:dir(ltr)
label#honeydew:dir(ltr) name|id
color: rgb(240,255,240); /* colornames.css:58:18-34 */
label#hotpink:dir(ltr)
label#hotpink:dir(ltr) name|id
color: rgb(255,105,180); /* colornames.css:59:17-32 */
label#indianred:dir(ltr)
label#indianred:dir(ltr) name|id
color: rgb(205,92,92); /* colornames.css:60:19-36 */
label#indigo:dir(ltr)
label#indigo:dir(ltr) name|id
color: rgb(75,0,130); /* colornames.css:61:16-30 */
label#ivory:dir(ltr)
label#ivory:dir(ltr) name|id
color: rgb(255,255,240); /* colornames.css:62:15-28 */
label#khaki:dir(ltr)
label#khaki:dir(ltr) name|id
color: rgb(240,230,140); /* colornames.css:63:15-28 */
label#lavender:dir(ltr)
label#lavender:dir(ltr) name|id
color: rgb(230,230,250); /* colornames.css:64:18-34 */
label#lavenderblush:dir(ltr)
label#lavenderblush:dir(ltr) name|id
color: rgb(255,240,245); /* colornames.css:65:23-44 */
label#lawngreen:dir(ltr)
label#lawngreen:dir(ltr) name|id
color: rgb(124,252,0); /* colornames.css:66:19-36 */
label#lemonchiffon:dir(ltr)
label#lemonchiffon:dir(ltr) name|id
color: rgb(255,250,205); /* colornames.css:67:22-42 */
label#lightblue:dir(ltr)
label#lightblue:dir(ltr) name|id
color: rgb(173,216,230); /* colornames.css:68:19-36 */
label#lightcoral:dir(ltr)
label#lightcoral:dir(ltr) name|id
color: rgb(240,128,128); /* colornames.css:69:20-38 */
label#lightcyan:dir(ltr)
label#lightcyan:dir(ltr) name|id
color: rgb(224,255,255); /* colornames.css:70:19-36 */
label#lightgoldenrodyellow:dir(ltr)
label#lightgoldenrodyellow:dir(ltr) name|id
color: rgb(250,250,210); /* colornames.css:71:30-58 */
label#lightgray:dir(ltr)
label#lightgray:dir(ltr) name|id
color: rgb(211,211,211); /* colornames.css:72:19-36 */
label#lightgreen:dir(ltr)
label#lightgreen:dir(ltr) name|id
color: rgb(144,238,144); /* colornames.css:73:20-38 */
label#lightgrey:dir(ltr)
label#lightgrey:dir(ltr) name|id
color: rgb(211,211,211); /* colornames.css:74:19-36 */
label#lightpink:dir(ltr)
label#lightpink:dir(ltr) name|id
color: rgb(255,182,193); /* colornames.css:75:19-36 */
label#lightsalmon:dir(ltr)
label#lightsalmon:dir(ltr) name|id
color: rgb(255,160,122); /* colornames.css:76:21-40 */
label#lightseagreen:dir(ltr)
label#lightseagreen:dir(ltr) name|id
color: rgb(32,178,170); /* colornames.css:77:23-44 */
label#lightskyblue:dir(ltr)
label#lightskyblue:dir(ltr) name|id
color: rgb(135,206,250); /* colornames.css:78:22-42 */
label#lightslategray:dir(ltr)
label#lightslategray:dir(ltr) name|id
color: rgb(119,136,153); /* colornames.css:79:24-46 */
label#lightslategrey:dir(ltr)
label#lightslategrey:dir(ltr) name|id
color: rgb(119,136,153); /* colornames.css:80:24-46 */
label#lightsteelblue:dir(ltr)
label#lightsteelblue:dir(ltr) name|id
color: rgb(176,196,222); /* colornames.css:81:24-46 */
label#lightyellow:dir(ltr)
label#lightyellow:dir(ltr) name|id
color: rgb(255,255,224); /* colornames.css:82:21-40 */
label#lime:dir(ltr)
label#lime:dir(ltr) name|id
color: rgb(0,255,0); /* colornames.css:83:14-26 */
label#limegreen:dir(ltr)
label#limegreen:dir(ltr) name|id
color: rgb(50,205,50); /* colornames.css:84:19-36 */
label#linen:dir(ltr)
label#linen:dir(ltr) name|id
color: rgb(250,240,230); /* colornames.css:85:15-28 */
label#magenta:dir(ltr)
label#magenta:dir(ltr) name|id
color: rgb(255,0,255); /* colornames.css:86:17-32 */
label#maroon:dir(ltr)
label#maroon:dir(ltr) name|id
color: rgb(128,0,0); /* colornames.css:87:16-30 */
label#mediumaquamarine:dir(ltr)
label#mediumaquamarine:dir(ltr) name|id
color: rgb(102,205,170); /* colornames.css:88:26-50 */
label#mediumblue:dir(ltr)
label#mediumblue:dir(ltr) name|id
color: rgb(0,0,205); /* colornames.css:89:20-38 */
label#mediumorchid:dir(ltr)
label#mediumorchid:dir(ltr) name|id
color: rgb(186,85,211); /* colornames.css:90:22-42 */
label#mediumpurple:dir(ltr)
label#mediumpurple:dir(ltr) name|id
color: rgb(147,112,219); /* colornames.css:91:22-42 */
label#mediumseagreen:dir(ltr)
label#mediumseagreen:dir(ltr) name|id
color: rgb(60,179,113); /* colornames.css:92:24-46 */
label#mediumslateblue:dir(ltr)
label#mediumslateblue:dir(ltr) name|id
color: rgb(123,104,238); /* colornames.css:93:25-48 */
label#mediumspringgreen:dir(ltr)
label#mediumspringgreen:dir(ltr) name|id
color: rgb(0,250,154); /* colornames.css:94:27-52 */
label#mediumturquoise:dir(ltr)
label#mediumturquoise:dir(ltr) name|id
color: rgb(72,209,204); /* colornames.css:95:25-48 */
label#mediumvioletred:dir(ltr)
label#mediumvioletred:dir(ltr) name|id
color: rgb(199,21,133); /* colornames.css:96:25-48 */
label#midnightblue:dir(ltr)
label#midnightblue:dir(ltr) name|id
color: rgb(25,25,112); /* colornames.css:97:22-42 */
label#mintcream:dir(ltr)
label#mintcream:dir(ltr) name|id
color: rgb(245,255,250); /* colornames.css:98:19-36 */
label#mistyrose:dir(ltr)
label#mistyrose:dir(ltr) name|id
color: rgb(255,228,225); /* colornames.css:99:19-36 */
label#moccasin:dir(ltr)
label#moccasin:dir(ltr) name|id
color: rgb(255,228,181); /* colornames.css:100:18-34 */
label#navajowhite:dir(ltr)
label#navajowhite:dir(ltr) name|id
color: rgb(255,222,173); /* colornames.css:101:21-40 */
label#navy:dir(ltr)
label#navy:dir(ltr) name|id
color: rgb(0,0,128); /* colornames.css:102:14-26 */
label#oldlace:dir(ltr)
label#oldlace:dir(ltr) name|id
color: rgb(253,245,230); /* colornames.css:103:17-32 */
label#olive:dir(ltr)
label#olive:dir(ltr) name|id
color: rgb(128,128,0); /* colornames.css:104:15-28 */
label#olivedrab:dir(ltr)
label#olivedrab:dir(ltr) name|id
color: rgb(107,142,35); /* colornames.css:105:19-36 */
label#orange:dir(ltr)
label#orange:dir(ltr) name|id
color: rgb(255,165,0); /* colornames.css:106:16-30 */
label#orangered:dir(ltr)
label#orangered:dir(ltr) name|id
color: rgb(255,69,0); /* colornames.css:107:19-36 */
label#orchid:dir(ltr)
label#orchid:dir(ltr) name|id
color: rgb(218,112,214); /* colornames.css:108:16-30 */
label#palegoldenrod:dir(ltr)
label#palegoldenrod:dir(ltr) name|id
color: rgb(238,232,170); /* colornames.css:109:23-44 */
label#palegreen:dir(ltr)
label#palegreen:dir(ltr) name|id
color: rgb(152,251,152); /* colornames.css:110:19-36 */
label#paleturquoise:dir(ltr)
label#paleturquoise:dir(ltr) name|id
color: rgb(175,238,238); /* colornames.css:111:23-44 */
label#palevioletred:dir(ltr)
label#palevioletred:dir(ltr) name|id
color: rgb(219,112,147); /* colornames.css:112:23-44 */
label#papayawhip:dir(ltr)
label#papayawhip:dir(ltr) name|id
color: rgb(255,239,213); /* colornames.css:113:20-38 */
label#peachpuff:dir(ltr)
label#peachpuff:dir(ltr) name|id
color: rgb(255,218,185); /* colornames.css:114:19-36 */
label#peru:dir(ltr)
label#peru:dir(ltr) name|id
color: rgb(205,133,63); /* colornames.css:115:14-26 */
label#pink:dir(ltr)
label#pink:dir(ltr) name|id
color: rgb(255,192,203); /* colornames.css:116:14-26 */
label#plum:dir(ltr)
label#plum:dir(ltr) name|id
color: rgb(221,160,221); /* colornames.css:117:14-26 */
label#powderblue:dir(ltr)
label#powderblue:dir(ltr) name|id
color: rgb(176,224,230); /* colornames.css:118:20-38 */
label#purple:dir(ltr)
label#purple:dir(ltr) name|id
color: rgb(128,0,128); /* colornames.css:119:16-30 */
label#rebeccapurple:dir(ltr)
label#rebeccapurple:dir(ltr) name|id
color: rgb(102,51,153); /* colornames.css:120:23-44 */
label#red:dir(ltr)
label#red:dir(ltr) name|id
color: rgb(255,0,0); /* colornames.css:121:13-24 */
label#rosybrown:dir(ltr)
label#rosybrown:dir(ltr) name|id
color: rgb(188,143,143); /* colornames.css:122:19-36 */
label#royalblue:dir(ltr)
label#royalblue:dir(ltr) name|id
color: rgb(65,105,225); /* colornames.css:123:19-36 */
label#saddlebrown:dir(ltr)
label#saddlebrown:dir(ltr) name|id
color: rgb(139,69,19); /* colornames.css:124:21-40 */
label#salmon:dir(ltr)
label#salmon:dir(ltr) name|id
color: rgb(250,128,114); /* colornames.css:125:16-30 */
label#sandybrown:dir(ltr)
label#sandybrown:dir(ltr) name|id
color: rgb(244,164,96); /* colornames.css:126:20-38 */
label#seagreen:dir(ltr)
label#seagreen:dir(ltr) name|id
color: rgb(46,139,87); /* colornames.css:127:18-34 */
label#seashell:dir(ltr)
label#seashell:dir(ltr) name|id
color: rgb(255,245,238); /* colornames.css:128:18-34 */
label#sienna:dir(ltr)
label#sienna:dir(ltr) name|id
color: rgb(160,82,45); /* colornames.css:129:16-30 */
label#silver:dir(ltr)
label#silver:dir(ltr) name|id
color: rgb(192,192,192); /* colornames.css:130:16-30 */
label#skyblue:dir(ltr)
label#skyblue:dir(ltr) name|id
color: rgb(135,206,235); /* colornames.css:131:17-32 */
label#slateblue:dir(ltr)
label#slateblue:dir(ltr) name|id
color: rgb(106,90,205); /* colornames.css:132:19-36 */
label#slategray:dir(ltr)
label#slategray:dir(ltr) name|id
color: rgb(112,128,144); /* colornames.css:133:19-36 */
label#slategrey:dir(ltr)
label#slategrey:dir(ltr) name|id
color: rgb(112,128,144); /* colornames.css:134:19-36 */
label#snow:dir(ltr)
label#snow:dir(ltr) name|id
color: rgb(255,250,250); /* colornames.css:135:14-26 */
label#springgreen:dir(ltr)
label#springgreen:dir(ltr) name|id
color: rgb(0,255,127); /* colornames.css:136:21-40 */
label#steelblue:dir(ltr)
label#steelblue:dir(ltr) name|id
color: rgb(70,130,180); /* colornames.css:137:19-36 */
label#tan:dir(ltr)
label#tan:dir(ltr) name|id
color: rgb(210,180,140); /* colornames.css:138:13-24 */
label#teal:dir(ltr)
label#teal:dir(ltr) name|id
color: rgb(0,128,128); /* colornames.css:139:14-26 */
label#thistle:dir(ltr)
label#thistle:dir(ltr) name|id
color: rgb(216,191,216); /* colornames.css:140:17-32 */
label#tomato:dir(ltr)
label#tomato:dir(ltr) name|id
color: rgb(255,99,71); /* colornames.css:141:16-30 */
label#turquoise:dir(ltr)
label#turquoise:dir(ltr) name|id
color: rgb(64,224,208); /* colornames.css:142:19-36 */
label#violet:dir(ltr)
label#violet:dir(ltr) name|id
color: rgb(238,130,238); /* colornames.css:143:16-30 */
label#wheat:dir(ltr)
label#wheat:dir(ltr) name|id
color: rgb(245,222,179); /* colornames.css:144:15-28 */
label#white:dir(ltr)
label#whitesmoke:dir(ltr)
label#white:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
label#whitesmoke:dir(ltr) name|id
color: rgb(245,245,245); /* colornames.css:146:20-38 */
label#yellow:dir(ltr)
label#yellow:dir(ltr) name|id
color: rgb(255,255,0); /* colornames.css:147:16-30 */
label#yellowgreen:dir(ltr)
label#yellowgreen:dir(ltr) name|id
color: rgb(154,205,50); /* colornames.css:148:21-40 */

View File

@@ -1,7 +1,7 @@
[window.background:dir(ltr)]
decoration:dir(ltr)
box.horizontal:dir(ltr)
[window.background:dir(ltr)] class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
decoration:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
box.horizontal:dir(ltr) name
color: rgb(255,0,0); /* currentcolor.css:2:3-14 */
label:dir(ltr)
label:dir(ltr) name
background-color: rgb(255,0,0); /* currentcolor.css:6:3-34 */

View File

@@ -1,6 +1,6 @@
[window.background:dir(ltr)]
decoration:dir(ltr)
box.horizontal:dir(ltr)
[window.background:dir(ltr)] class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
decoration:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
box.horizontal:dir(ltr) name
font-size: 10px; /* font.css:2:3-27 */
font-family: "Comic Sans"; /* font.css:2:3-27 */
font-style: normal; /* font.css:2:3-27 */
@@ -8,30 +8,30 @@
font-stretch: normal; /* font.css:2:3-27 */
font-variant-caps: normal; /* font.css:2:3-27 */
label#label1:dir(ltr)
label#label1:dir(ltr) id
font-size: 8.3333333333333339px; /* font.css:6:3-22 */
label#label2:dir(ltr)
label#label2:dir(ltr) id
font-size: 13.333333333333334px; /* font.css:10:3-36 */
font-family: "Cantarell", "sans-serif"; /* font.css:10:3-36 */
font-style: normal; /* font.css:10:3-36 */
font-weight: 400; /* font.css:10:3-36 */
font-stretch: normal; /* font.css:10:3-36 */
font-variant-caps: normal; /* font.css:10:3-36 */
label#label3:dir(ltr)
label#label3:dir(ltr) id
font-size: 8px; /* font.css:14:3-35 */
font-family: "monospace"; /* font.css:14:3-35 */
font-style: italic; /* font.css:14:3-35 */
font-weight: 700; /* font.css:14:3-35 */
font-stretch: normal; /* font.css:14:3-35 */
font-variant-caps: normal; /* font.css:14:3-35 */
label#label4:dir(ltr)
label#label4:dir(ltr) id
font-size: 8px; /* font.css:18:3-41 */
font-family: "serif"; /* font.css:18:3-41 */
font-style: oblique; /* font.css:18:3-41 */
font-weight: 400; /* font.css:18:3-41 */
font-stretch: expanded; /* font.css:18:3-41 */
font-variant-caps: normal; /* font.css:18:3-41 */
label#label5:dir(ltr)
label#label5:dir(ltr) id
font-size: 75.590551181102356px; /* font.css:22:3-29 */
font-family: "21st Century"; /* font.css:22:3-29 */
font-style: normal; /* font.css:22:3-29 */

View File

@@ -1,9 +1,9 @@
[window.background:dir(ltr)]
[window.background:dir(ltr)] name
background-image: linear-gradient(75deg, rgb(255,0,0), rgb(0,128,0) 20%, rgb(0,0,255) 40px); /* gradient.css:2:3-71 */
decoration:dir(ltr)
box.horizontal:dir(ltr)
decoration:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
box.horizontal:dir(ltr) name
background-image: repeating-linear-gradient(to top right, rgba(255,100,60,0.5), rgb(255,0,255) 100%); /* gradient.css:6:3-97 */
label:dir(ltr)
label:dir(ltr) name
background-image: radial-gradient(ellipse farthest-corner at center 30px, rgb(255,255,0), rgb(255,0,0) 30%, rgb(0,0,255)); /* gradient.css:10:3-89 */

View File

@@ -1,10 +1,10 @@
[window.background:dir(ltr)]
decoration:dir(ltr)
box.horizontal:dir(ltr)
[window.background:dir(ltr)] class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
decoration:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
box.horizontal:dir(ltr) name
color: rgb(255,0,0); /* inherit.css:2:3-14 */
opacity: 0.5; /* inherit.css:3:3-16 */
label#label1:dir(ltr)
label#label1:dir(ltr) name|id
color: rgb(255,255,255); /* inherit.css:7:3-18 */
opacity: 0.5; /* inherit.css:8:3-20 */
label#label2:dir(ltr)
label#label2:dir(ltr)

View File

@@ -1,7 +1,7 @@
[window.background:dir(ltr)]
decoration:dir(ltr)
box.horizontal:dir(ltr)
[window.background:dir(ltr)] class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
decoration:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
box.horizontal:dir(ltr) name
font-size: 10px; /* label.css:3:3-19 */
font-family: "Comic Sans"; /* label.css:2:3-29 */
label:dir(ltr)
label:dir(ltr)

View File

@@ -52,6 +52,9 @@ test_data = [
'nth-child.css',
'nth-child.nodes',
'nth-child.ui',
'simple-selectors.css',
'simple-selectors.nodes',
'simple-selectors.ui'
]
if get_option('install-tests')

View File

@@ -1,13 +1,13 @@
[window.background:dir(ltr)]
decoration:dir(ltr)
box.horizontal:dir(ltr)
box.horizontal:dir(ltr)
label:dir(ltr)
[window.background:dir(ltr)] class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
decoration:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
box.horizontal:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
box.horizontal:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
label:dir(ltr) name|first-child|last-child
font-size: 20px; /* nth-child.css:2:3-19 */
label:dir(ltr)
label:dir(ltr) name|first-child|last-child
font-size: 30px; /* nth-child.css:5:3-19 */
label:dir(ltr)
label:dir(ltr) name|first-child|last-child
font-size: 40px; /* nth-child.css:8:3-19 */
box.horizontal:dir(ltr)
label:dir(ltr)
box.horizontal:dir(ltr) class|name|id|first-child|last-child|nth-child|nth-last-child|state|sibling-class|sibling-name|sibling-id|sibling-first-child|sibling-last-child|sibling-nth-child|sibling-nth-last-child|sibling-state|parent-class|parent-name|parent-id|parent-first-child|parent-last-child|parent-nth-child|parent-nth-last-child|parent-state|parent-sibling-|parent-sibling-name|parent-sibling-id|parent-sibling-first-child|parent-sibling-last-child|parent-sibling-nth-child|parent-sibling-nth-last-child|parent-sibling-state
label:dir(ltr) name|first-child|last-child
font-size: 50px; /* nth-child.css:11:3-19 */

View File

@@ -0,0 +1,23 @@
label {
color: red;
}
*:not(label) {
background-color: red;
}
.normal-icons {
color: green;
}
*:not(.normal-icons) {
background-color: green;
}
*:disabled {
color: blue;
}
*:not(:disabled) {
background-color: blue;
}

View File

@@ -0,0 +1,17 @@
[window.background:dir(ltr)] class|name|state
background-color: rgb(0,0,255); /* simple-selectors.css:22:3-26 */
decoration:dir(ltr) class|name|state
background-color: rgb(0,0,255); /* simple-selectors.css:22:3-26 */
box.horizontal:dir(ltr) class|name|state
background-color: rgb(0,0,255); /* simple-selectors.css:22:3-26 */
label:dir(ltr) class|name|state
color: rgb(255,0,0); /* simple-selectors.css:2:3-14 */
background-color: rgb(0,0,255); /* simple-selectors.css:22:3-26 */
image.normal-icons:dir(ltr) class|name|state
color: rgb(0,128,0); /* simple-selectors.css:10:3-16 */
background-color: rgb(0,0,255); /* simple-selectors.css:22:3-26 */
spinner:disabled:dir(ltr) class|name|state
color: rgb(0,0,255); /* simple-selectors.css:18:3-15 */
background-color: rgb(0,128,0); /* simple-selectors.css:14:3-27 */

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<property name="type">popup</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
</object>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-size">normal</property>
</object>
</child>
<child>
<object class="GtkSpinner">
<property name="visible">True</property>
<property name="sensitive">0</property>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@@ -98,12 +98,25 @@ done:
return diff;
}
static void
style_context_changed (GtkWidget *window, const char **output)
{
GtkStyleContext *context;
g_print ("style updated\n");
context = gtk_widget_get_style_context (window);
*output = gtk_style_context_to_string (context, GTK_STYLE_CONTEXT_PRINT_RECURSE |
GTK_STYLE_CONTEXT_PRINT_SHOW_CHANGE |
GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE);
g_main_context_wakeup (NULL);
}
static void
load_ui_file (GFile *file, gboolean generate)
{
GtkBuilder *builder;
GtkWidget *window;
GtkStyleContext *context;
char *output, *diff;
char *ui_file, *css_file, *reference_file;
GtkCssProvider *provider;
@@ -125,10 +138,13 @@ load_ui_file (GFile *file, gboolean generate)
g_assert (window != NULL);
context = gtk_widget_get_style_context (window);
output = NULL;
g_signal_connect (window, "map", G_CALLBACK (style_context_changed), &output);
output = gtk_style_context_to_string (context, GTK_STYLE_CONTEXT_PRINT_RECURSE |
GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE);
gtk_widget_show (window);
while (!output)
g_main_context_iteration (NULL, FALSE);
if (generate)
{
@@ -273,6 +289,7 @@ main (int argc, char **argv)
load_ui_file (file, TRUE);
g_object_unref (file);
return 0;
}
}
else