Index: Source/core/layout/LayoutImage.cpp |
diff --git a/Source/core/layout/LayoutImage.cpp b/Source/core/layout/LayoutImage.cpp |
index 53fa66bdae50ef55887434f8153c654b47680a81..d668d917ea09b972795df1558bfacf445e8cdae5 100644 |
--- a/Source/core/layout/LayoutImage.cpp |
+++ b/Source/core/layout/LayoutImage.cpp |
@@ -38,6 +38,7 @@ |
#include "core/html/HTMLImageElement.h" |
#include "core/html/HTMLInputElement.h" |
#include "core/html/HTMLMapElement.h" |
+#include "core/html/parser/HTMLParserIdioms.h" |
#include "core/layout/HitTestResult.h" |
#include "core/layout/LayoutView.h" |
#include "core/layout/TextRunConstructor.h" |
@@ -214,12 +215,27 @@ void LayoutImage::notifyFinished(Resource* newImage) |
void LayoutImage::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
{ |
- ImagePainter(*this).paintReplaced(paintInfo, paintOffset); |
+ KURL url; |
+ if (node() && node()->isHTMLElement()) { |
+ AtomicString urlString = toHTMLElement(node())->imageSourceURL(); |
+ if (!urlString.isEmpty()) |
+ url = node()->document().completeURL(stripLeadingAndTrailingHTMLSpaces(urlString)); |
+ } |
+ |
+ ImagePainter(*this, url).paintReplaced(paintInfo, paintOffset); |
} |
void LayoutImage::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
{ |
- ImagePainter(*this).paint(paintInfo, paintOffset); |
+ // TODO(davve): code duplication v ^ |
+ KURL url; |
+ if (node() && node()->isHTMLElement()) { |
+ AtomicString urlString = toHTMLElement(node())->imageSourceURL(); |
+ if (!urlString.isEmpty()) |
+ url = node()->document().completeURL(stripLeadingAndTrailingHTMLSpaces(urlString)); |
+ } |
+ |
+ ImagePainter(*this, url).paint(paintInfo, paintOffset); |
} |
void LayoutImage::areaElementFocusChanged(HTMLAreaElement* areaElement) |