Bug 1407229 - Temporary fix for changes in
bug 1406278: Changed parameters of HTMLImageElement::SetSrc/GetSrc() and HTMLLinkElement::SetHref(). rs=bustage-fix
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -77,16 +77,17 @@
#include "mozilla/dom/HTMLLinkElement.h"
#include "nsStreamConverter.h"
#include "nsISelection.h"
#include "nsJSEnvironment.h"
#include "nsIObserverService.h"
#include "nsIProtocolHandler.h"
#include "nsContentUtils.h"
#include "nsIFileURL.h"
+#include "nsIPrincipal.h" // XXX TEMPORARY
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::mailnews;
static nsresult GetReplyHeaderInfo(int32_t* reply_header_type,
nsString& reply_header_authorwrote,
nsString& reply_header_ondateauthorwrote,
@@ -266,17 +267,17 @@ bool nsMsgCompose::IsEmbeddedObjectSafe(
return false;
nsCOMPtr<Element> objectAsElement = do_QueryInterface(object);
RefPtr<HTMLImageElement> image = HTMLImageElement::FromContentOrNull(objectAsElement);
RefPtr<HTMLLinkElement> link = HTMLLinkElement::FromContentOrNull(objectAsElement);
RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::FromContentOrNull(objectAsElement);
if (image)
- image->GetSrc(objURL);
+ { uint64_t ignored; image->GetSrc(objURL, *(nsIPrincipal*)(&ignored)); } // XXX TEMPORARY
else if (link)
link->GetHref(objURL);
else if (anchor)
anchor->GetHref(objURL);
else
return false;
if (!objURL.IsEmpty())
@@ -369,17 +370,17 @@ nsresult nsMsgCompose::ResetUrisForEmbed
RefPtr<mozilla::dom::HTMLImageElement> image =
mozilla::dom::HTMLImageElement::FromContentOrNull(imageElement);
if (!image)
continue;
nsCString partNum;
mMsgSend->GetPartForDomIndex(i, partNum);
// do we care about anything besides images?
nsAutoString objURL;
- image->GetSrc(objURL);
+ uint64_t ignored; image->GetSrc(objURL, *(nsIPrincipal*)(&ignored)); // XXX TEMPORARY
// First we need to make sure that the URL is associated with a message
// protocol so we don't accidentally manipulate a URL like:
// http://www.site.com/retrieve.html?C=image.jpg.
nsCOMPtr<nsIIOService> ioService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoCString scheme;
ioService->ExtractScheme(NS_ConvertUTF16toUTF8(objURL), scheme);
@@ -437,17 +438,17 @@ nsresult nsMsgCompose::ResetUrisForEmbed
bool specHasQ = (spec.FindChar('?') != kNotFound);
if (specHasQ && restOfUrl.CharAt(0) == '?')
restOfUrl.SetCharAt('&', 0);
else if (!specHasQ && restOfUrl.CharAt(0) == '&')
restOfUrl.SetCharAt('?', 0);
AppendUTF8toUTF16(spec, newSrc);
newSrc.Append(restOfUrl);
IgnoredErrorResult rv2;
- image->SetSrc(newSrc, rv2);
+ image->SetSrc(newSrc, *nsContentUtils::GetSystemPrincipal(), rv2); // XXX TEMPORARY
}
}
}
return NS_OK;
}
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -78,16 +78,17 @@
#include "mozilla/dom/HTMLBodyElement.h"
#include "mozilla/dom/HTMLImageElement.h"
#include "mozilla/dom/HTMLLinkElement.h"
#include "nsIMutableArray.h"
#include "nsIMsgFilterService.h"
#include "nsIMsgProtocolInfo.h"
#include "mozIDOMWindow.h"
#include "mozilla/Preferences.h"
+#include "nsIPrincipal.h" // XXX TEMPORARY
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::mailnews;
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
#define PREF_MAIL_SEND_STRUCT "mail.send_struct"
@@ -1309,17 +1310,17 @@ nsMsgComposeAndSend::GetEmbeddedObjectIn
}
else if (image) // Is this an image?
{
nsString tUrl;
nsString tName;
nsString tDesc;
// Create the URI
- image->GetSrc(tUrl);
+ uint64_t ignored; image->GetSrc(tUrl, *(nsIPrincipal*)(&ignored)); // XXX TEMPORARY
if (tUrl.IsEmpty())
return NS_OK;
nsAutoCString turlC;
CopyUTF16toUTF8(tUrl, turlC);
if (NS_FAILED(nsMsgNewURL(getter_AddRefs(attachment->m_url), turlC)))
{
// Well, the first time failed...which means we probably didn't get
@@ -1833,22 +1834,22 @@ nsMsgComposeAndSend::ProcessMultipartRel
if (anchor)
{
anchor->GetHref(domURL);
anchor->SetHref(newSpec, rv2);
}
else if (link)
{
link->GetHref(domURL);
- link->SetHref(newSpec, rv2);
+ link->SetHref(newSpec, *nsContentUtils::GetSystemPrincipal(), rv2); // XXX TEMPORARY
}
else if (image)
{
- image->GetSrc(domURL);
- image->SetSrc(newSpec, rv2);
+ uint64_t ignored; image->GetSrc(domURL, *(nsIPrincipal*)(&ignored)); // XXX TEMPORARY
+ image->SetSrc(newSpec, *nsContentUtils::GetSystemPrincipal(), rv2); // XXX TEMPORARY
}
else if (body)
{
body->GetBackground(domURL);
body->SetBackground(newSpec, rv2);
}
if (!domURL.IsEmpty())
@@ -1877,19 +1878,19 @@ nsMsgComposeAndSend::ProcessMultipartRel
RefPtr<HTMLBodyElement> body = HTMLBodyElement::FromContentOrNull(nodeAsElement);
// STRING USE WARNING: hoisting the following conversion might save code-space, since it happens along every path
IgnoredErrorResult rv2;
if (anchor) {
anchor->SetHref(NS_ConvertASCIItoUTF16(domSaveArray[i].url), rv2);
} else if (link) {
- link->SetHref(NS_ConvertASCIItoUTF16(domSaveArray[i].url), rv2);
+ link->SetHref(NS_ConvertASCIItoUTF16(domSaveArray[i].url), *nsContentUtils::GetSystemPrincipal(), rv2); // XXX TEMPORARY
} else if (image) {
- image->SetSrc(NS_ConvertASCIItoUTF16(domSaveArray[i].url), rv2);
+ image->SetSrc(NS_ConvertASCIItoUTF16(domSaveArray[i].url), *nsContentUtils::GetSystemPrincipal(), rv2); // XXX TEMPORARY
}
else if (body) {
body->SetBackground(NS_ConvertASCIItoUTF16(domSaveArray[i].url), rv2);
}
free(domSaveArray[i].url);
}