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..de143f1deff263aece4b8f4924a22e614cd2a338 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 = static_cast<SVGImage*>(cachedImage()->getImage()); |
|
jbroman
2016/04/13 21:13:22
Prefer using toSVGImage:
SVGImage* image = toSVGI
xidachen
2016/04/14 01:12:39
Done.
|
| + if (!image->hasIntrinsicSize()) { |
| + exceptionState.throwDOMException(InvalidStateError, "The image element is an SVG image without intrinsic size."); |
|
jbroman
2016/04/13 21:13:22
nit: technically the image element isn't an SVG im
xidachen
2016/04/14 01:12:39
Done.
|
| + return ScriptPromise(); |
| + } |
| } |
| if (!sw || !sh) { |
| exceptionState.throwDOMException(IndexSizeError, String::format("The source %s provided is 0.", sw ? "height" : "width")); |