Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2166)

Unified Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 813133004: [svg] Reset the initial view properly in SVGImage. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase + add comment Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/SVGSVGElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/graphics/SVGImage.cpp
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp
index ff5b6279222c5758590ede2015b45306dc4a1b7f..26c23850bb05d9b42aa20cc44b9e2ccdae2318f7 100644
--- a/Source/core/svg/graphics/SVGImage.cpp
+++ b/Source/core/svg/graphics/SVGImage.cpp
@@ -303,8 +303,11 @@ void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const Fl
FrameView* view = frameView();
view->resize(containerSize());
- if (!m_url.isEmpty())
- view->scrollToFragment(m_url);
+
+ // Always call scrollToFragment, even if the url is empty, because
+ // there may have been a previous url/fragment that needs to be reset.
+ view->scrollToFragment(m_url);
+
view->updateLayoutAndStyleForPainting();
view->paint(&recordingContext, enclosingIntRect(srcRect));
ASSERT(!view->needsLayout());
« no previous file with comments | « Source/core/svg/SVGSVGElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698