Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Unified Diff: third_party/WebKit/Source/core/html/HTMLImageElement.cpp

Issue 1532473002: Add a origin clean flag in ImageBitmap class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compilation error Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLImageElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
index f1fed9601c61eea8650d6e53b48030f4e416452d..6568ae88ae5097b7810ce79817c7b751a56dedb1 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -699,16 +699,7 @@ ScriptPromise HTMLImageElement::createImageBitmap(ScriptState* scriptState, Even
exceptionState.throwDOMException(IndexSizeError, String::format("The source %s provided is 0.", sw ? "height" : "width"));
return ScriptPromise();
}
- if (!cachedImage()->image()->currentFrameHasSingleSecurityOrigin()) {
- exceptionState.throwSecurityError("The source image contains image data from multiple origins.");
- return ScriptPromise();
- }
- Document* document = eventTarget.toDOMWindow()->document();
- if (!cachedImage()->passesAccessControlCheck(document->securityOrigin()) && document->securityOrigin()->taintsCanvas(src())) {
- exceptionState.throwSecurityError("Cross-origin access to the source image is denied.");
- return ScriptPromise();
- }
- return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::create(this, IntRect(sx, sy, sw, sh)));
+ return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::create(this, IntRect(sx, sy, sw, sh), eventTarget.toDOMWindow()->document()));
}
void HTMLImageElement::selectSourceURL(ImageLoader::UpdateFromElementBehavior behavior)
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLVideoElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698