Bug 1182120 - Fix Request mode for XMLDocument.load(). r=bkelly

This commit is contained in:
Albert Crespell 2015-08-12 06:30:36 +02:00
Родитель 455c60a5ea
Коммит ee4c08d4bb
1 изменённых файлов: 9 добавлений и 1 удалений

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

@ -22,7 +22,7 @@
#include "nsIDOMDocumentType.h"
#include "nsCOMPtr.h"
#include "nsXPIDLString.h"
#include "nsIHttpChannel.h"
#include "nsIHttpChannelInternal.h"
#include "nsIURI.h"
#include "nsIServiceManager.h"
#include "nsNetUtil.h"
@ -421,6 +421,14 @@ XMLDocument::Load(const nsAString& aUrl, ErrorResult& aRv)
return false;
}
// TODO Bug 1189945: Remove nsIChannel CorsMode flag and set Request.mode
// based on nsILoadInfo securityFlags instead. This block will be removed
// when Request.mode set correctly.
nsCOMPtr<nsIHttpChannelInternal> httpChannel = do_QueryInterface(channel);
if (httpChannel) {
httpChannel->SetCorsMode(nsIHttpChannelInternal::CORS_MODE_SAME_ORIGIN);
}
// StartDocumentLoad asserts that readyState is uninitialized, so
// uninitialize it. SetReadyStateInternal make this transition invisible to
// Web content. But before doing that, assert that the current readyState