Bug 1163911 - Make responsive images block the document load event while the load task is queued. r=jst

This commit is contained in:
Josh Matthews 2015-06-06 09:21:56 -04:00
parent 22cd407301
commit 2d4b5d63e1
2 changed files with 7 additions and 3 deletions

View File

@ -85,7 +85,10 @@ class ImageLoadTask : public nsRunnable
public:
explicit ImageLoadTask(HTMLImageElement *aElement) :
mElement(aElement)
{}
{
mDocument = aElement->OwnerDoc();
mDocument->BlockOnload();
}
NS_IMETHOD Run()
{
@ -93,12 +96,14 @@ public:
mElement->mPendingImageLoadTask = nullptr;
mElement->LoadSelectedImage(true, true);
}
mDocument->UnblockOnload(false);
return NS_OK;
}
private:
~ImageLoadTask() {}
nsRefPtr<HTMLImageElement> mElement;
nsCOMPtr<nsIDocument> mDocument;
};
HTMLImageElement::HTMLImageElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)

View File

@ -594,5 +594,4 @@ support-files = file_bug871161-1.html file_bug871161-2.html
[test_window_open_close.html]
skip-if = buildapp == 'b2g' # bug 1129014
[test_img_complete.html]
[test_viewport_resize.html]
skip-if = os == 'win' || os == 'mac' # bug 1163911
[test_viewport_resize.html]