summaryrefslogtreecommitdiff
path: root/render/box_construct.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2005-05-21 23:30:19 +0000
committerJames Bursa <james@netsurf-browser.org>2005-05-21 23:30:19 +0000
commitff74a126f7a0b37ca81e5bd78d691aea1436884a (patch)
tree394d6d916102b24aee58a2af72ba776dc4bcaea4 /render/box_construct.c
parent9edb2fb92ca5d02406142edc8443b6d3e54e8ac5 (diff)
downloadnetsurf-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/box_construct.c')
-rw-r--r--render/box_construct.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index a9d642449..57046120f 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -456,8 +456,8 @@ bool box_construct_element(xmlNode *n, struct content *content,
xmlFree(s);
}
}
-
-
+
+
/* fetch any background image for this box */
if (style->background_image.type == CSS_BACKGROUND_IMAGE_URI) {
if (!html_fetch_object(content, style->background_image.uri,
@@ -663,13 +663,7 @@ struct css_style * box_get_style(struct content *c,
style_new = talloc_memdup(c, &css_blank_style, sizeof *style_new);
if (!style_new)
return 0;
-
- for (i = 0; i != stylesheet_count; i++) {
- if (stylesheet[i]) {
- assert(stylesheet[i]->type == CONTENT_CSS);
- css_get_style(stylesheet[i], n, style_new);
- }
- }
+ css_get_style(c->data.html.working_stylesheet, n, style_new);
css_cascade(style, style_new);
/* style_new isn't needed past this point */
@@ -701,7 +695,7 @@ struct css_style * box_get_style(struct content *c,
}
}
- if (((s = (char *) xmlGetProp(n, (const xmlChar *) "bgcolor"))) &&
+ if (((s = (char *) xmlGetProp(n, (const xmlChar *) "bgcolor"))) &&
(style->background_color == TRANSPARENT)) {
unsigned int r, g, b;
if (s[0] == '#' && sscanf(s + 1, "%2x%2x%2x", &r, &g, &b) == 3)