зеркало из https://github.com/mozilla/gecko-dev.git
Bug 850441 - Allow BlockOnload/UnblockOnload from both the current and pending request. r=khuey
--HG-- extra : rebase_source : cd7bdc9f91b478be60fed5572dc8ee5e3faae380
This commit is contained in:
Родитель
0295cdf922
Коммит
1a423d62ea
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче