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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutImageResource.cpp

Issue 1458083002: Support fragment URLs for more kinds of SVG images (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplification wasn't simple enough Created 5 years, 1 month 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
Index: third_party/WebKit/Source/core/layout/LayoutImageResource.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutImageResource.cpp b/third_party/WebKit/Source/core/layout/LayoutImageResource.cpp
index beb97934d72db52a1eacc616826caa8c15beed51..80677b60f171704706a092026e161b191d19c79d 100644
--- a/third_party/WebKit/Source/core/layout/LayoutImageResource.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutImageResource.cpp
@@ -28,7 +28,7 @@
#include "config.h"
#include "core/layout/LayoutImageResource.h"
-#include "core/html/HTMLImageElement.h"
+#include "core/dom/Element.h"
#include "core/layout/LayoutImage.h"
#include "core/svg/graphics/SVGImageForContainer.h"
@@ -104,14 +104,14 @@ PassRefPtr<Image> LayoutImageResource::image(const IntSize& containerSize, float
{
RefPtr<Image> image = m_cachedImage ? m_cachedImage->image() : Image::nullImage();
if (image->isSVGImage()) {
+ KURL url;
SVGImage* svgImage = toSVGImage(image.get());
Node* node = m_layoutObject->node();
- if (node && isHTMLImageElement(node)) {
- const AtomicString& urlString = toHTMLImageElement(node)->imageSourceURL();
- KURL url = node->document().completeURL(urlString);
- svgImage->setURL(url);
+ if (node && node->isElementNode()) {
+ const AtomicString& urlString = toElement(node)->imageSourceURL();
+ url = node->document().completeURL(urlString);
}
- return SVGImageForContainer::create(svgImage, containerSize, zoom);
+ return SVGImageForContainer::create(svgImage, containerSize, zoom, url);
}
return image;
}
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSImageValue.cpp ('k') | third_party/WebKit/Source/core/style/StyleFetchedImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698