Commit d9519130 authored by Andrea Iacovitti's avatar Andrea Iacovitti

Fix url comparison.

parent 351f7ab9
......@@ -430,12 +430,17 @@ void RenderImage::updateFromElement()
DOMString u = element()->id() == ID_OBJECT ?
element()->getAttribute(ATTR_DATA) : element()->getAttribute(ATTR_SRC);
if (!u.isEmpty() &&
( !m_cachedImage || m_cachedImage->url() != u ) ) {
CachedImage *new_image = element()->document()->docLoader()->requestImage(u);
if(new_image && new_image != m_cachedImage)
updateImage( new_image );
if (!u.isEmpty()) {
// Need to compute completeURL, as 'u' can be relative
// while m_cachedImage->url() is always full url
DocumentImpl *docImpl = element()->document();
const QString fullUrl = docImpl->completeURL(u.string());
if (!m_cachedImage || m_cachedImage->url() != fullUrl) {
CachedImage *new_image = docImpl->docLoader()->requestImage(fullUrl);
if (new_image && new_image != m_cachedImage) {
updateImage(new_image);
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment