Bug 1526218 - transferFromImageBitmap() should propage the origin-clean state to the canvas element. r=aosmond, a=RyanVM
authorAndrea Marchesini <amarchesini@mozilla.com>
Mon, 11 Feb 2019 16:54:05 +0000
changeset 509641 129c513995ea
parent 509640 be2b97abeeff
child 509642 12b02216df64
push id1936
push userryanvm@gmail.com
push dateMon, 11 Feb 2019 19:09:17 +0000
treeherdermozilla-release@d98c887912e4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond, RyanVM
bugs1526218
milestone65.0.1
Bug 1526218 - transferFromImageBitmap() should propage the origin-clean state to the canvas element. r=aosmond, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D19371
dom/canvas/ImageBitmapRenderingContext.cpp
--- a/dom/canvas/ImageBitmapRenderingContext.cpp
+++ b/dom/canvas/ImageBitmapRenderingContext.cpp
@@ -55,16 +55,20 @@ void ImageBitmapRenderingContext::Transf
     ImageBitmap& aImageBitmap) {
   Reset();
   mImage = aImageBitmap.TransferAsImage();
 
   if (!mImage) {
     return;
   }
 
+  if (aImageBitmap.IsWriteOnly() && mCanvasElement) {
+    mCanvasElement->SetWriteOnly();
+  }
+
   Redraw(gfxRect(0, 0, mWidth, mHeight));
 }
 
 NS_IMETHODIMP
 ImageBitmapRenderingContext::SetDimensions(int32_t aWidth, int32_t aHeight) {
   mWidth = aWidth;
   mHeight = aHeight;
   return NS_OK;