[XForms] fetching blocked by cross-domain checks should trigger xforms-link-error. Bug 338788, r=smaug+aaronr

This commit is contained in:
allan%beaufour.dk 2006-05-23 08:27:18 +00:00
Родитель 9088d59680
Коммит 2b03260d71
1 изменённых файлов: 4 добавлений и 7 удалений

Просмотреть файл

@ -420,7 +420,9 @@ nsXFormsMessageElement::HandleAction(nsIDOMEvent* aEvent,
// to use that we can't reach right now. If it won't load, then might as
// well stop here. We don't want to be popping up empty windows
// or windows that will just end up showing 404 messages.
if (mStopType == eStopType_LinkError) {
// We also stop if we were not allowed to access the given resource.
if (mStopType == eStopType_LinkError ||
mStopType == eStopType_Security) {
// we couldn't successfully link to our external resource. Better throw
// the xforms-link-error event
nsCOMPtr<nsIModelElementPrivate> modelPriv =
@ -430,12 +432,6 @@ nsXFormsMessageElement::HandleAction(nsIDOMEvent* aEvent,
return NS_OK;
}
// If we couldn't test the external link due to it not living in an
// acceptable domain, then no sense going any further down this path.
if (mStopType == eStopType_Security) {
return NS_OK;
}
// If there is still a channel, then someone must have changed the value of
// the src attribute since the document finished loading and we haven't yet
// determined whether the new link is valid or not. For now we'll assume
@ -1033,6 +1029,7 @@ nsXFormsMessageElement::OnChannelRedirect(nsIChannel *OldChannel,
const PRUnichar *strings[] = { tagName.get() };
nsXFormsUtils::ReportError(NS_LITERAL_STRING("externalLinkLoadOrigin"),
strings, 1, mElement, mElement);
mStopType = eStopType_Security;
return NS_ERROR_ABORT;
}