Chromium Code Reviews| 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 f389f1c896feb67db1e795a1258b107e610022bf..e2880f904591b01db741933a5336ac579574c0bc 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
| @@ -690,8 +690,11 @@ ScriptPromise HTMLImageElement::createImageBitmap(ScriptState* scriptState, Even |
| return ScriptPromise(); |
| } |
| if (cachedImage()->getImage()->isSVGImage()) { |
| - exceptionState.throwDOMException(InvalidStateError, "The image element contains an SVG image, which is unsupported."); |
| - return ScriptPromise(); |
| + SVGImage* image = toSVGImage(cachedImage()->getImage()); |
| + if (!image->hasIntrinsicDimensions()) { |
| + exceptionState.throwDOMException(InvalidStateError, "The image element contains an SVG image without intrinsic size."); |
|
davve
2016/04/15 12:34:12
nit: To align with the specification, you might wa
|
| + return ScriptPromise(); |
| + } |
| } |
| if (!sw || !sh) { |
| exceptionState.throwDOMException(IndexSizeError, String::format("The source %s provided is 0.", sw ? "height" : "width")); |