DOM::Node::getRect problem. Help please.

Leo Savernik l.savernik at aon.at
Tue Jul 20 16:34:02 BST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Dienstag 20 Juli 2004 12:33 schrieb Michael A. Borisov:
[...]
> Ok. I'll do it later today. 

I couldn't reproduce the issue with the following testcase:
data:text/html,lala<br><img alt="p" width="2000" height="1500" title="showme">

> But I need an immediate solution. So I'm 
> using the following trick.
>
[...]
>   rect->setRect(
>     htmlPart->executeScript(node, jsGetX).asInt(),
>     htmlPart->executeScript(node, jsGetY).asInt(),
>     htmlPart->executeScript(node, "this.offsetWidth;").asInt(),
>     htmlPart->executeScript(node, "this.offsetHeight;").asInt()
>   );
[...]

Wow, cool hack. No wonder it's slow ;-).

>
> This trick works fine with KDE libs 3.2.x but does not work with libs
> 3.1.x. What's wrong in my code? Will it faster to preload these
> functions after document loading finished and invoke these functions later?

You certainly can precalculate the values, but you have to ensure that the 
layout cannot be changed afterwards (i. e. no resize happens, and the 
document structure is not changed dynamically).

The best way to make it work is to fix it.
>
[...]

mfg
	Leo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFA/Ttrj5jssenUYTsRAtLaAJ9zOpFc0tfL2aRwTlyimjylqLwkAQCfW5wt
fKkCLt5+YAMl8ObuPNvDEts=
=JA3V
-----END PGP SIGNATURE-----




More information about the kfm-devel mailing list