diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-06-04 18:21:04 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-06-04 18:21:04 +0200 |
commit | dee00a8a79394559e0e868cc72464c2de24583ac (patch) | |
tree | 18dc2e3db8127ceabcf9b03416b135bced2976ad /dom/canvas/CanvasRenderingContext2D.cpp | |
parent | 851cfd198bc01020cd411d4f1cd6586222700269 (diff) | |
parent | 363bfeb2c06e5f57136ebdab8da1ebeba0591520 (diff) | |
download | UXP-dee00a8a79394559e0e868cc72464c2de24583ac.tar UXP-dee00a8a79394559e0e868cc72464c2de24583ac.tar.gz UXP-dee00a8a79394559e0e868cc72464c2de24583ac.tar.lz UXP-dee00a8a79394559e0e868cc72464c2de24583ac.tar.xz UXP-dee00a8a79394559e0e868cc72464c2de24583ac.zip |
Merge branch 'master' into Basilisk-release
Diffstat (limited to 'dom/canvas/CanvasRenderingContext2D.cpp')
-rw-r--r-- | dom/canvas/CanvasRenderingContext2D.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 4849fda57..2bf40732a 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -2406,7 +2406,11 @@ CanvasRenderingContext2D::SetStyleFromUnion(const StringOrCanvasGradientOrCanvas } if (aValue.IsCanvasPattern()) { - SetStyleFromPattern(aValue.GetAsCanvasPattern(), aWhichStyle); + CanvasPattern& pattern = aValue.GetAsCanvasPattern(); + SetStyleFromPattern(pattern, aWhichStyle); + if (pattern.mForceWriteOnly) { + SetWriteOnly(); + } return; } @@ -2581,11 +2585,12 @@ CanvasRenderingContext2D::CreatePattern(const CanvasImageSource& aSource, nsLayoutUtils::SurfaceFromElement(element, nsLayoutUtils::SFE_WANT_FIRST_FRAME, mTarget); - if (!res.GetSourceSurface()) { + RefPtr<SourceSurface> surface = res.GetSourceSurface(); + if (!surface) { return nullptr; } - RefPtr<CanvasPattern> pat = new CanvasPattern(this, res.GetSourceSurface(), repeatMode, + RefPtr<CanvasPattern> pat = new CanvasPattern(this, surface, repeatMode, res.mPrincipal, res.mIsWriteOnly, res.mCORSUsed); return pat.forget(); @@ -4895,8 +4900,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; } |