API call to replace parts in html

Zack Rusin zack at kde.org
Mon Jun 21 23:32:59 BST 2004


On Friday 07 May 2004 13:53, Carsten Burghardt wrote:
> Hi,
>
> when an email (html page in this case) is displayed in kmail that
> contains images and you selected an inline attachment style those
> images are displayed. They reference a tmp file (<img
> src="file://...>). Now if you use imap and activate load-on-demand
> those images exist but are empty. They get loaded one by one and with
> each image the email is completely repainted which is extremely ugly.
> So I want khtml to repaint the page once the image is complete so
> that it doesn't flicker that much. Is there anything that could be
> used for this? Replace the image, tell the node to repaint, tell the
> complete page to repaint, ...? A generic approach would be very good
> as this might also be used for other parts e.g. text attachments
> (<div> or <p> in this case AFAIK).

Well, the simplest and most effective solution would be to simply cache 
the email contents somewhere and when the images are there post a 
reload request to the KHTMLPart browserextension:)

Otherwise you can:
1) disable autoloading images before constructing any img elements but 
after constructing the document itself with 
m_part->setAutoloadImages( false );
2) when you have all images call m_part->setAutoloadImages( true );
3) call m_part->htmlDocument().updateRendering(); and
m_part->view()->layout(); to relayout the document.


Zack

-- 
"There is hope... but not for us." -Kafka 




More information about the kfm-devel mailing list