diff options
author | James Bursa <james@netsurf-browser.org> | 2005-05-21 23:30:19 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2005-05-21 23:30:19 +0000 |
commit | ff74a126f7a0b37ca81e5bd78d691aea1436884a (patch) | |
tree | 394d6d916102b24aee58a2af72ba776dc4bcaea4 /render/html.c | |
parent | 9edb2fb92ca5d02406142edc8443b6d3e54e8ac5 (diff) | |
download | netsurf-ff74a126f7a0b37ca81e5bd78d691aea1436884a.tar.gz netsurf-ff74a126f7a0b37ca81e5bd78d691aea1436884a.tar.bz2 |
[project @ 2005-05-21 23:30:19 by bursa]
Improve selector specificity support by adding "working stylesheets" with pre-sorted lists of rules. This also simplifies css_get_style(). The stylesheet origin is now encoded in the specificity. Improve output of css_dump_style().
svn path=/import/netsurf/; revision=1729
Diffstat (limited to 'render/html.c')
-rw-r--r-- | render/html.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/render/html.c b/render/html.c index 583faf138..93b986ba5 100644 --- a/render/html.c +++ b/render/html.c @@ -628,6 +628,24 @@ bool html_find_stylesheets(struct content *c, xmlNode *head) /* content_broadcast(c, CONTENT_MSG_STATUS, msg_data); */ /* } */ + css_set_origin(c->data.html.stylesheet_content[STYLESHEET_BASE], + CSS_ORIGIN_UA); + if (c->data.html.stylesheet_content[STYLESHEET_ADBLOCK]) + css_set_origin(c->data.html.stylesheet_content[ + STYLESHEET_ADBLOCK], CSS_ORIGIN_UA); + if (c->data.html.stylesheet_content[STYLESHEET_STYLE]) + css_set_origin(c->data.html.stylesheet_content[ + STYLESHEET_STYLE], CSS_ORIGIN_AUTHOR); + for (i = STYLESHEET_START; i != c->data.html.stylesheet_count; i++) + css_set_origin(c->data.html.stylesheet_content[i], + CSS_ORIGIN_AUTHOR); + + c->data.html.working_stylesheet = css_make_working_stylesheet( + c->data.html.stylesheet_content, + c->data.html.stylesheet_count); + if (!c->data.html.working_stylesheet) + return false; + return true; } @@ -1137,6 +1155,8 @@ void html_destroy(struct content *c) } } + talloc_free(c->data.html.working_stylesheet); + /*if (c->data.html.style) css_free_style(c->data.html.style);*/ |