From 83941da263d03bdfc97ff48780af6881a250f3bc Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 31 Jan 2008 01:47:57 +0000 Subject: Add function to dump working stylesheets svn path=/trunk/netsurf/; revision=3811 --- css/css.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/css/css.c b/css/css.c index 1853d272f..cb007978a 100644 --- a/css/css.c +++ b/css/css.c @@ -130,6 +130,8 @@ static bool css_match_first_child(const struct css_selector *detail, xmlNode *element); static void css_dump_length(const struct css_length * const length); static void css_dump_selector(const struct css_selector *r); +static void css_dump_working_stylesheet( + const struct css_working_stylesheet *ws); /** Default style for a document. These are the 'Initial values' from the * spec. */ @@ -1012,6 +1014,8 @@ struct css_working_stylesheet *css_make_working_stylesheet( talloc_free(rule_scratch); + /*css_dump_working_stylesheet(working_stylesheet);*/ + return working_stylesheet; } @@ -2403,6 +2407,24 @@ void css_dump_length(const struct css_length * const length) css_unit_name[length->unit]); } +/** + * Dump a complete css_working_stylesheet to stderr in CSS syntax. + */ + +void css_dump_working_stylesheet(const struct css_working_stylesheet *ws) +{ + unsigned int i, j; + + for (i = 0; i != HASH_SIZE; i++) { + /*fprintf(stderr, "hash %i:\n", i);*/ + for (j = 0; ws->rule[i][j]; j++) { + css_dump_selector(ws->rule[i][j]); + fprintf(stderr, " <%lx> ", ws->rule[i][j]->specificity); + css_dump_style(ws->rule[i][j]->style); + fprintf(stderr, "\n"); + } + } +} /** * Dump a complete css_stylesheet to stderr in CSS syntax. -- cgit v1.2.3