From 09fa36f89df9a2461c2204b53ee986deb5236a40 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 7 Apr 2014 22:57:58 +0200 Subject: prepare 3.0.4-rc2 --- configure.ac | 2 +- src/styleengine.cc | 57 +++++++++++++++++++++++++++--------------------------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/configure.ac b/configure.ac index ce49de7e..d22355ea 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with aclocal, autoconf and automake. -AC_INIT([dillo], [3.0.4-rc1]) +AC_INIT([dillo], [3.0.4-rc2]) dnl Detect the canonical target build environment AC_CANONICAL_TARGET diff --git a/src/styleengine.cc b/src/styleengine.cc index 285da3f5..a5c43bf4 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -361,6 +361,7 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props, Font *parentFont = stack->get (i - 1).style->font; char *c, *fontName; int lineHeight; + DilloUrl *imgUrl = NULL; /* Determine font first so it can be used to resolve relative lengths. */ for (int i = 0; i < props->size (); i++) { @@ -528,35 +529,8 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props, Color::create(layout, prefs.white_bg_replacement); break; case CSS_PROPERTY_BACKGROUND_IMAGE: - if (prefs.load_background_images) - { - // p->value.strVal should be absolute, so baseUrl is not needed - DilloUrl *imgUrl = a_Url_new (p->value.strVal, NULL); - - attrs->backgroundImage = StyleImage::create(); - DilloImage *image = - a_Image_new(layout, - (void*)attrs->backgroundImage - ->getMainImgRenderer(), - 0xffffff); - - // we use the pageUrl as requester to prevent cross - // domain requests as specified in domainrc - DilloWeb *web = a_Web_new(bw, imgUrl, pageUrl); - web->Image = image; - a_Image_ref(image); - web->flags |= WEB_Image; - - int clientKey; - if ((clientKey = a_Capi_open_url(web, NULL, NULL)) != 0) { - a_Bw_add_client(bw, clientKey, 0); - a_Bw_add_url(bw, imgUrl); - attrs->backgroundImage->connectDeletion - (new StyleImageDeletionReceiver (clientKey)); - } - - a_Url_free (imgUrl); - } + // p->value.strVal should be absolute, so baseUrl is not needed + imgUrl = a_Url_new (p->value.strVal, NULL); break; case CSS_PROPERTY_BACKGROUND_POSITION: computeLength (&attrs->backgroundPositionX, p->value.posVal->posX, @@ -734,6 +708,31 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props, } } + if (imgUrl && prefs.load_background_images && attrs->display != DISPLAY_NONE) + { + attrs->backgroundImage = StyleImage::create(); + DilloImage *image = + a_Image_new(layout, + (void*)attrs->backgroundImage + ->getMainImgRenderer(), + 0xffffff); + + // we use the pageUrl as requester to prevent cross + // domain requests as specified in domainrc + DilloWeb *web = a_Web_new(bw, imgUrl, pageUrl); + web->Image = image; + a_Image_ref(image); + web->flags |= WEB_Image; + + int clientKey; + if ((clientKey = a_Capi_open_url(web, NULL, NULL)) != 0) { + a_Bw_add_client(bw, clientKey, 0); + a_Bw_add_url(bw, imgUrl); + attrs->backgroundImage->connectDeletion + (new StyleImageDeletionReceiver (clientKey)); + } + } + a_Url_free (imgUrl); } /** -- cgit v1.2.3