summaryrefslogtreecommitdiff
path: root/dom/canvas/CanvasRenderingContext2D.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-06-04 23:58:47 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-06-04 23:58:47 +0200
commitf47d45be4b6c8a1fc758d50497a964fc7a75154b (patch)
tree497657ef7d2d3dc2e2c752146a524a2c725dd26a /dom/canvas/CanvasRenderingContext2D.cpp
parent363bfeb2c06e5f57136ebdab8da1ebeba0591520 (diff)
downloaduxp-f47d45be4b6c8a1fc758d50497a964fc7a75154b.tar.gz
Revert "Improve origin-clean algorithm"
This reverts commit e69b3f567c4b8957cc09ba4359e84939f77781c5.
Diffstat (limited to 'dom/canvas/CanvasRenderingContext2D.cpp')
-rw-r--r--dom/canvas/CanvasRenderingContext2D.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp
index 2bf40732a9..4849fda57e 100644
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -2406,11 +2406,7 @@ CanvasRenderingContext2D::SetStyleFromUnion(const StringOrCanvasGradientOrCanvas
}
if (aValue.IsCanvasPattern()) {
- CanvasPattern& pattern = aValue.GetAsCanvasPattern();
- SetStyleFromPattern(pattern, aWhichStyle);
- if (pattern.mForceWriteOnly) {
- SetWriteOnly();
- }
+ SetStyleFromPattern(aValue.GetAsCanvasPattern(), aWhichStyle);
return;
}
@@ -2585,12 +2581,11 @@ CanvasRenderingContext2D::CreatePattern(const CanvasImageSource& aSource,
nsLayoutUtils::SurfaceFromElement(element,
nsLayoutUtils::SFE_WANT_FIRST_FRAME, mTarget);
- RefPtr<SourceSurface> surface = res.GetSourceSurface();
- if (!surface) {
+ if (!res.GetSourceSurface()) {
return nullptr;
}
- RefPtr<CanvasPattern> pat = new CanvasPattern(this, surface, repeatMode,
+ RefPtr<CanvasPattern> pat = new CanvasPattern(this, res.GetSourceSurface(), repeatMode,
res.mPrincipal, res.mIsWriteOnly,
res.mCORSUsed);
return pat.forget();
@@ -4900,8 +4895,8 @@ CanvasRenderingContext2D::CachedSurfaceFromElement(Element* aElement)
res.mSize = res.mSourceSurface->GetSize();
res.mPrincipal = principal.forget();
+ res.mIsWriteOnly = false;
res.mImageRequest = imgRequest.forget();
- res.mIsWriteOnly = CheckWriteOnlySecurity(res.mCORSUsed, res.mPrincipal);
return res;
}