Index: Source/core/html/HTMLCanvasElement.cpp |
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp |
index 877341769042f56b0d36fe167ff39637dcd64a18..9d87d30753e29dd865683d9c353ee12369866121 100644 |
--- a/Source/core/html/HTMLCanvasElement.cpp |
+++ b/Source/core/html/HTMLCanvasElement.cpp |
@@ -375,13 +375,13 @@ String HTMLCanvasElement::toEncodingMimeType(const String& mimeType) |
return lowercaseMimeType; |
} |
-String HTMLCanvasElement::toDataURL(const String& mimeType, const double* quality, ExceptionState& exceptionState) |
+const AtomicString HTMLCanvasElement::imageSourceURL() const |
{ |
- if (!m_originClean) { |
- exceptionState.throwSecurityError("Tainted canvases may not be exported."); |
- return String(); |
- } |
+ return AtomicString(toDataURLInternal("image/png", 0)); |
+} |
+String HTMLCanvasElement::toDataURLInternal(const String& mimeType, const double* quality) const |
+{ |
if (m_size.isEmpty() || !buffer()) |
return String("data:,"); |
@@ -399,7 +399,17 @@ String HTMLCanvasElement::toDataURL(const String& mimeType, const double* qualit |
return buffer()->toDataURL(encodingMimeType, quality); |
} |
-PassRefPtrWillBeRawPtr<ImageData> HTMLCanvasElement::getImageData() |
+String HTMLCanvasElement::toDataURL(const String& mimeType, const double* quality, ExceptionState& exceptionState) const |
+{ |
+ if (!m_originClean) { |
+ exceptionState.throwSecurityError("Tainted canvases may not be exported."); |
+ return String(); |
+ } |
+ |
+ return toDataURLInternal(mimeType, quality); |
+} |
+ |
+PassRefPtrWillBeRawPtr<ImageData> HTMLCanvasElement::getImageData() const |
{ |
if (!m_context || !m_context->is3d()) |
return nullptr; |