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

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

Issue 180973005: Respect SVG fragment identifiers in <img> src attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove include Created 6 years, 8 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/graphics/SVGImage.cpp ('k') | Source/core/svg/graphics/SVGImageForContainer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/graphics/SVGImageCache.cpp
diff --git a/Source/core/svg/graphics/SVGImageCache.cpp b/Source/core/svg/graphics/SVGImageCache.cpp
index 059bbb42b4f1fd8cd553878ad909171d621aa090..26143b6de8547d3458fc490aae6ac16e0d7d2dad 100644
--- a/Source/core/svg/graphics/SVGImageCache.cpp
+++ b/Source/core/svg/graphics/SVGImageCache.cpp
@@ -23,6 +23,7 @@
#include "core/fetch/ImageResource.h"
#include "core/frame/FrameView.h"
+#include "core/html/HTMLImageElement.h"
#include "core/page/Page.h"
#include "core/rendering/svg/RenderSVGRoot.h"
#include "core/svg/graphics/SVGImage.h"
@@ -89,6 +90,14 @@ Image* SVGImageCache::imageForRenderer(const RenderObject* renderer)
RefPtr<SVGImageForContainer> imageForContainer = it->value;
ASSERT(!imageForContainer->size().isEmpty());
+
+ Node* node = renderer->node();
+ if (node && isHTMLImageElement(node)) {
+ const AtomicString& urlString = toHTMLImageElement(node)->imageSourceURL();
+ KURL url = node->document().completeURL(urlString);
+ imageForContainer->setURL(url);
+ }
+
return imageForContainer.get();
}
« no previous file with comments | « Source/core/svg/graphics/SVGImage.cpp ('k') | Source/core/svg/graphics/SVGImageForContainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698