Chromium Code Reviews| Index: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp |
| diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp |
| index 525ee8c9a0279b03e1184b6255214832ca2158ff..2589760bc1b4aeddd209a304bb03908c75d61205 100644 |
| --- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp |
| +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp |
| @@ -338,11 +338,17 @@ void SVGImage::drawInternal(SkCanvas* canvas, const SkPaint& paint, const FloatR |
| RespectImageOrientationEnum, ImageClampingMode, const KURL& url) |
| { |
| FrameView* view = frameView(); |
| - view->resize(containerSize()); |
| + bool needsLifecycleUpdateForResize = view->resize(containerSize()); |
| // Always call processUrlFragment, even if the url is empty, because |
| // there may have been a previous url/fragment that needs to be reset. |
| - view->processUrlFragment(url); |
| + bool needsLifecycleUpdateForUrl = view->processUrlFragment(url); |
| + |
| + bool needsLifecycleUpdate = needsLifecycleUpdateForResize || needsLifecycleUpdateForUrl; |
| + |
| + // This is the lifecycle for the SVG document, not what HTML document might contain it. |
| + if (needsLifecycleUpdate) |
| + view->updateAllLifecyclePhasesExceptPaint(); |
|
fs
2016/05/23 21:25:56
Maybe add some assert too to verify lifecycle assu
|
| SkPictureBuilder imagePicture(dstRect); |
| { |
| @@ -357,7 +363,6 @@ void SVGImage::drawInternal(SkCanvas* canvas, const SkPaint& paint, const FloatR |
| transform.scale(scale.width(), scale.height()); |
| TransformRecorder transformRecorder(imagePicture.context(), imagePicture, transform); |
| - view->updateAllLifecyclePhasesExceptPaint(); |
| view->paint(imagePicture.context(), CullRect(enclosingIntRect(srcRect))); |
| ASSERT(!view->needsLayout()); |
| } |