[webkit-help] Forcing image reload in WebKit

MT mt at theescapers.com
Fri Mar 5 04:06:37 PST 2010


I use a WebView that loads a HTML file that uses various resources like
images, CSS files etc...

Sometimes, the images can change, and I want the WebView to reflect that,
but I don't want to refresh the entire page, just let a DOMHTMLImageElement
to reload the image.

At the moment, I'm changing the 'src' attribute of the DOMHTMLImageElement
to nothing, then changing it back using an NSTimer to the correct URL. This,
in principle, works, but is unreliable, often crashing.

#1  0x0097d840 in WebCore::CSSParser::parseValue (this=0xbfffe354,
declaration=0x161d0900, id=1005, string=@0xbfffe484, important=false) at
#2  0x00974d33 in WebCore::CSSMutableStyleDeclaration::setProperty
(this=0x161d0900, propertyID=1005, value=@0xbfffe484, important=<value
temporarily unavailable, due to optimizations>, notifyChanged=true) at
#3  0x00a1e4e7 in ~RefPtr [inlined] () at
#4  ~String [inlined] () at text/PlatformString.h:53
#5  ~String [inlined] () at
#6  0x00a1e4e7 in -[DOMCSSStyleDeclaration setProperty:value:priority:]
(self=0xfb76790, _cmd=0x918f7781, propertyName=0x183e88, value=0x13f78e18,
priority=0x1815c8) at
#7  0x00035b55 in -[WindowController putImageInDivBack:] (self=0x29dd200,
_cmd=0x152af9, bits=0xf8b5e50) at

Is there a better, cleaner way to do this?

Thanks for any ideas.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20100305/d8491e47/attachment.html>

More information about the webkit-help mailing list