summaryrefslogtreecommitdiff
path: root/css/ruleset.c
diff options
context:
space:
mode:
Diffstat (limited to 'css/ruleset.c')
-rw-r--r--css/ruleset.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/css/ruleset.c b/css/ruleset.c
index 345b86225..a3d43c679 100644
--- a/css/ruleset.c
+++ b/css/ruleset.c
@@ -539,7 +539,13 @@ void parse_background_image(struct css_style * const s, const struct css_node *
else
*(t + 1) = 0;
- s->background_image.uri = url_join(url, v->stylesheet->url);
+ /* for inline style attributes, the stylesheet
+ * content is the parent HTML content
+ */
+ if (v->stylesheet->type == CONTENT_HTML)
+ s->background_image.uri = url_join(url, v->stylesheet->data.html.base_url);
+ else
+ s->background_image.uri = url_join(url, v->stylesheet->url);
free(url);
if (!s->background_image.uri) return;
s->background_image.type = CSS_BACKGROUND_IMAGE_URI;