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 858b47ac3fcf904668c8797fc5d24b541e5e6fc5..4f6361b01b3853d8f03de67340e43b253b504aa2 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
@@ -700,16 +700,10 @@ 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), |
+ !(!cachedImage()->image()->currentFrameHasSingleSecurityOrigin() |
+ || (!cachedImage()->passesAccessControlCheck(document->securityOrigin()) && document->securityOrigin()->taintsCanvas(src()))))); |
} |
void HTMLImageElement::selectSourceURL(ImageLoader::UpdateFromElementBehavior behavior) |