summaryrefslogtreecommitdiffstats
path: root/layout/base/nsLayoutUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layout/base/nsLayoutUtils.cpp')
-rw-r--r--layout/base/nsLayoutUtils.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp
index dce40ca..b4b756b 100644
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -8,6 +8,7 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/BasicEvents.h"
+#include "mozilla/dom/CanvasUtils.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/EffectCompositor.h"
#include "mozilla/EffectSet.h"
@@ -7306,9 +7307,10 @@ nsLayoutUtils::SurfaceFromElementResult nsLayoutUtils::SurfaceFromElement(
}
result.mPrincipal = principal.forget();
- // no images, including SVG images, can load content from another domain.
- result.mIsWriteOnly = false;
result.mImageRequest = imgRequest.forget();
+ result.mIsWriteOnly =
+ CanvasUtils::CheckWriteOnlySecurity(result.mCORSUsed, result.mPrincipal);
+
return result;
}
@@ -7401,7 +7403,8 @@ nsLayoutUtils::SurfaceFromElementResult nsLayoutUtils::SurfaceFromElement(
result.mHasSize = true;
result.mSize = result.mLayersImage->GetSize();
result.mPrincipal = principal.forget();
- result.mIsWriteOnly = false;
+ result.mIsWriteOnly =
+ CanvasUtils::CheckWriteOnlySecurity(result.mCORSUsed, result.mPrincipal);
return result;
}