summaryrefslogtreecommitdiff
path: root/layout
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-05-27 19:19:27 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-05-27 19:19:27 +0200
commitfb1b45e5fcb82e76e303665fbb9d04fb2a800b31 (patch)
tree97baa867e3534b1bd5153067d2bd853462a4b12b /layout
parent47c52f2dc2cc4eb4f5582a7ca50b682548b1708c (diff)
downloaduxp-fb1b45e5fcb82e76e303665fbb9d04fb2a800b31.tar.gz
Improve origin-clean algorithm
Diffstat (limited to 'layout')
-rw-r--r--layout/base/nsLayoutUtils.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp
index 07befdc812..17ece8e61c 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"
@@ -7285,10 +7286,10 @@ nsLayoutUtils::SurfaceFromElement(nsIImageLoadingContent* aElement,
}
result.mPrincipal = principal.forget();
- // no images, including SVG images, can load content from another domain.
- result.mIsWriteOnly = false;
result.mImageRequest = imgRequest.forget();
return result;
+ result.mIsWriteOnly =
+ CanvasUtils::CheckWriteOnlySecurity(result.mCORSUsed, result.mPrincipal);
}
nsLayoutUtils::SurfaceFromElementResult
@@ -7400,7 +7401,8 @@ nsLayoutUtils::SurfaceFromElement(HTMLVideoElement* aElement,
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;
}