diff options
Diffstat (limited to 'src/styleengine.cc')
-rw-r--r-- | src/styleengine.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc index 5b88798a..285da3f5 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -58,7 +58,8 @@ void StyleImageDeletionReceiver::deleted (lout::signal::ObservedObject *object) // ---------------------------------------------------------------------- -StyleEngine::StyleEngine (dw::core::Layout *layout, const DilloUrl *baseUrl) { +StyleEngine::StyleEngine (dw::core::Layout *layout, + const DilloUrl *pageUrl, const DilloUrl *baseUrl) { StyleAttrs style_attrs; FontAttrs font_attrs; @@ -67,7 +68,8 @@ StyleEngine::StyleEngine (dw::core::Layout *layout, const DilloUrl *baseUrl) { cssContext = new CssContext (); buildUserStyle (); this->layout = layout; - this->baseUrl = baseUrl; + this->pageUrl = pageUrl ? a_Url_dup(pageUrl) : NULL; + this->baseUrl = baseUrl ? a_Url_dup(baseUrl) : NULL; importDepth = 0; stackPush (); @@ -100,6 +102,9 @@ StyleEngine::~StyleEngine () { stackPop (); // dummy node on the bottom of the stack assert (stack->size () == 0); + a_Url_free(pageUrl); + a_Url_free(baseUrl); + delete stack; delete doctree; delete cssContext; @@ -535,7 +540,9 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props, ->getMainImgRenderer(), 0xffffff); - DilloWeb *web = a_Web_new(bw, imgUrl, baseUrl); + // 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; |