Bug 850441 - Allow BlockOnload/UnblockOnload from both the current and pending request. r=khuey

--HG--
extra : rebase_source : cd7bdc9f91b478be60fed5572dc8ee5e3faae380
This commit is contained in:
Joe Drew 2013-03-12 18:13:40 -04:00
Родитель 0295cdf922
Коммит 1a423d62ea
1 изменённых файлов: 18 добавлений и 10 удалений

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

@ -626,14 +626,18 @@ NS_IMETHODIMP nsImageLoadingContent::ForceReload()
NS_IMETHODIMP
nsImageLoadingContent::BlockOnload(imgIRequest* aRequest)
{
if (aRequest != mCurrentRequest) {
if (aRequest == mCurrentRequest) {
NS_ASSERTION(!(mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD),
"Double BlockOnload!?");
mCurrentRequestFlags |= REQUEST_BLOCKS_ONLOAD;
} else if (aRequest == mPendingRequest) {
NS_ASSERTION(!(mPendingRequestFlags & REQUEST_BLOCKS_ONLOAD),
"Double BlockOnload!?");
mPendingRequestFlags |= REQUEST_BLOCKS_ONLOAD;
} else {
return NS_OK;
}
NS_ASSERTION(!(mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD),
"Double BlockOnload!?");
mCurrentRequestFlags |= REQUEST_BLOCKS_ONLOAD;
nsIDocument* doc = GetOurCurrentDoc();
if (doc) {
doc->BlockOnload();
@ -645,14 +649,18 @@ nsImageLoadingContent::BlockOnload(imgIRequest* aRequest)
NS_IMETHODIMP
nsImageLoadingContent::UnblockOnload(imgIRequest* aRequest)
{
if (aRequest != mCurrentRequest) {
if (aRequest == mCurrentRequest) {
NS_ASSERTION(mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD,
"Double UnblockOnload!?");
mCurrentRequestFlags &= ~REQUEST_BLOCKS_ONLOAD;
} else if (aRequest == mPendingRequest) {
NS_ASSERTION(mPendingRequestFlags & REQUEST_BLOCKS_ONLOAD,
"Double UnblockOnload!?");
mPendingRequestFlags &= ~REQUEST_BLOCKS_ONLOAD;
} else {
return NS_OK;
}
NS_ASSERTION(mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD,
"Double UnblockOnload!?");
mCurrentRequestFlags &= ~REQUEST_BLOCKS_ONLOAD;
nsIDocument* doc = GetOurCurrentDoc();
if (doc) {
doc->UnblockOnload(false);