Bug 1349459 part 1 - mark element as tainted when CreateImageBitmap() is used; r=jwwang,mattwoodrow

In this patch, we simply modify the ImageBitmap::createInternal(..., HTMLMediaElement&, ...) method to use
HTMLMediaElement::GetCurrentImage() utility and HTMLMediaElement::GetCurrentImage() marks the
videl element as tainted.

MozReview-Commit-ID: KyN2xRqKVrr

--HG--
extra : rebase_source : 5e0e0400f1848823751cd88f2bbe734bc5aec5fe
This commit is contained in:
Kaku Kuo 2017-03-22 15:21:44 +08:00
parent 871c76462e
commit 1ae5278f6a

View File

@ -827,15 +827,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLVideoElement& aVideoEl
}
// Create ImageBitmap.
ImageContainer *container = aVideoEl.GetImageContainer();
if (!container) {
aRv.Throw(NS_ERROR_NOT_AVAILABLE);
return nullptr;
}
AutoLockImage lockImage(container);
layers::Image* data = lockImage.GetImage();
RefPtr<layers::Image> data = aVideoEl.GetCurrentImage();
if (!data) {
aRv.Throw(NS_ERROR_NOT_AVAILABLE);
return nullptr;