cssnode: Implement the style cache

This essentially copies the previous cache implementation. With one
caveat: It is now attached to and maintained by the CssNode, not by the
CssStyle.

And this is important because styles may be reused in incompatible
situations which would cause cache collisions and lead to broken CSS in
weird situations.
This commit is contained in:
Benjamin Otte
2016-01-16 04:48:58 +01:00
parent 5d562b6a2a
commit 024429f76f
2 changed files with 97 additions and 2 deletions

View File

@ -18,6 +18,7 @@
#ifndef __GTK_CSS_NODE_STYLE_CACHE_PRIVATE_H__
#define __GTK_CSS_NODE_STYLE_CACHE_PRIVATE_H__
#include "gtkcssnodedeclarationprivate.h"
#include "gtkcssstyleprivate.h"
G_BEGIN_DECLS
@ -25,6 +26,7 @@ G_BEGIN_DECLS
typedef struct _GtkCssNodeStyleCache GtkCssNodeStyleCache;
GtkCssNodeStyleCache * gtk_css_node_style_cache_new (GtkCssStyle *style);
GtkCssNodeStyleCache * gtk_css_node_style_cache_ref (GtkCssNodeStyleCache *cache);
void gtk_css_node_style_cache_unref (GtkCssNodeStyleCache *cache);
GtkCssStyle * gtk_css_node_style_cache_get_style (GtkCssNodeStyleCache *cache);