$OpenBSD$ index be77bce..1c5247d 100644 --- layout/generic/nsImageFrame.cpp.orig Fri Feb 20 15:40:37 2015 +++ layout/generic/nsImageFrame.cpp Fri Feb 20 15:40:37 2015 @@ -52,6 +52,7 @@ #include "nsError.h" #include "nsBidiUtils.h" #include "nsBidiPresUtils.h" +#include "mozIThirdPartyUtil.h" #include "gfxRect.h" #include "ImageLayers.h" @@ -1812,6 +1813,7 @@ nsImageFrame::LoadIcon(const nsAString& aSpec, { nsresult rv = NS_OK; NS_PRECONDITION(!aSpec.IsEmpty(), "What happened??"); + NS_PRECONDITION(aPresContext, "NULL PresContext"); if (!sIOService) { rv = CallGetService(NS_IOSERVICE_CONTRACTID, &sIOService); @@ -1830,18 +1832,26 @@ nsImageFrame::LoadIcon(const nsAString& aSpec, // For icon loads, we don't need to merge with the loadgroup flags nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL; - return il->LoadImage(realURI, /* icon URI */ - nullptr, /* initial document URI; this is only - relevant for cookies, so does not - apply to icons. */ - nullptr, /* referrer (not relevant for icons) */ - nullptr, /* principal (not relevant for icons) */ + nsCOMPtr firstPartyIsolationURI; + nsCOMPtr thirdPartySvc + = do_GetService(THIRDPARTYUTIL_CONTRACTID); + // XXX: Should we pass the loadgroup, too? Is document ever likely + // to be unset? + thirdPartySvc->GetFirstPartyIsolationURI(nullptr, aPresContext->Document(), + getter_AddRefs(firstPartyIsolationURI)); + + return il->LoadImage(realURI, /* icon URI */ + firstPartyIsolationURI, /* initial document URI; this is only + relevant for cookies, so does not + apply to icons. */ + nullptr, /* referrer (not relevant for icons) */ + nullptr, /* principal (not relevant for icons) */ loadGroup, gIconLoad, - nullptr, /* Not associated with any particular document */ + nullptr, /* Not associated with any particular document */ loadFlags, nullptr, - nullptr, /* channel policy not needed */ + nullptr, /* channel policy not needed */ EmptyString(), aRequest); }