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 41c825d84ca957b1463a538137e5949b0f027cd2..13630d9761e94f2ac2f815d41ea9a0423b94e782 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
@@ -48,6 +48,7 @@ |
#include "core/layout/LayoutImage.h" |
#include "core/page/Page.h" |
#include "core/style/ContentData.h" |
+#include "core/svg/graphics/SVGImageForContainer.h" |
#include "platform/ContentType.h" |
#include "platform/EventDispatchForbiddenScope.h" |
#include "platform/MIMETypeRegistry.h" |
@@ -604,11 +605,13 @@ PassRefPtr<Image> HTMLImageElement::getSourceImageForCanvas(SourceImageStatus* s |
return nullptr; |
} |
- RefPtr<Image> sourceImage = cachedImage()->image(); |
- |
- // We need to synthesize a container size if a layoutObject is not available to provide one. |
- if (!layoutObject() && sourceImage->usesContainerSize()) |
- sourceImage->setContainerSize(sourceImage->size()); |
+ RefPtr<Image> sourceImage; |
+ if (cachedImage()->image()->isSVGImage()) { |
+ sourceImage = SVGImageForContainer::create(toSVGImage(cachedImage()->image()), |
fs
2015/12/01 14:23:21
I get a feeling that it would be better to do the
davve
2015/12/01 14:54:16
Extracting the url would have to go though the Can
davve
2015/12/01 14:57:38
Oh, CanvasImageSource has sourceURL already. I dou
fs
2015/12/01 14:59:22
Cumbersome, yes...
fs
2015/12/01 15:12:17
Considering how it's used I'd suspect it doesn't,
|
+ cachedImage()->image()->size(), 1, document().completeURL(imageSourceURL())); |
+ } else { |
+ sourceImage = cachedImage()->image(); |
+ } |
*status = NormalSourceImageStatus; |
return sourceImage->imageForDefaultFrame(); |