[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    [patch] load images delayed
From:       "Tobias Anton" <tobias () ke ! informatik ! tu-darmstadt ! de>
Date:       2006-02-24 14:44:25
Message-ID: 010001c63950$cf58d470$1202a8c0 () Terroristencamp
[Download RAW message or body]

Hello,

attached is a patch that modifies KHTML's image loading behaviour: image
loading is deferred until the main document is loaded completely. It is
merely a proof-of-concept, designed for integration into conqueror
embedded and I don't aim at getting this very patch into the KDE
repository, but I'd like to have it reviewed and discussed.

This behaviour makes sense in environments of limited bandwidth or CPU,
because 
a) if an image is loaded in parallel to the main HTML page, both requests
must share the available bandwidth, leading to a slower loading of the
HTML page
b) if the image arrives, a relayout is triggered. In pages that contain
many images, this may lead to a significant increase of the number of
relayouts while the HTML is being parsed, which themselves, are
CPU-intensive.

Is this behaviour of common interest, i.e. should I integrate it into
KHTML's setAutoloadImages-API or should I rather keep it
separate in konq-embed's set of patches?

Cheers
-- Tobias Anton


["khtml-load-images-delayed.diff" (application/octet-stream)]

Index: khtml_part.cpp
===================================================================
--- khtml_part.cpp	(revision 501883)
+++ khtml_part.cpp	(working copy)
@@ -687,6 +687,8 @@
   // copy to m_workingURL after fixing m_url above
   d->m_workingURL = m_url;
 
+  setAutoloadImages(false);
+
   args.metaData().insert("main_frame_request", parentPart() == 0 ? "TRUE" : "FALSE" );
   args.metaData().insert("ssl_parent_ip", d->m_ssl_parent_ip);
   args.metaData().insert("ssl_parent_cert", d->m_ssl_parent_cert);
@@ -2233,6 +2235,11 @@
     return;
   }
 
+  if (!autoloadImages())
+  {
+     setAutoloadImages(true);
+  }
+
   // OK, completed.
   // Now do what should be done when we are really completed.
   d->m_bComplete = true;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic