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

List:       kde-commits
Subject:    Re: kdelibs/khtml/html
From:       Peter Kelly <pmk () post ! com>
Date:       2000-06-26 12:02:54
[Download RAW message or body]

The problem with this is that every time a DOM element gets changed or
added, relayouting/repainting gets done which is slow if a script makes
a lot of changes to the DOM (e.g. the DOM test suite, where it adds a
line to the output for each test it does). The way I had it is very fast
running the test suite, but slow if only one change is made to a small
part of the page, e.g. rollovers :(

What I was sort of half-way through implementing was a scheme where if a
DOM element gets changed in some way, e.g. a child inserted/deleted or
one of the display-affecting properties gets changed, then that element
is marked as "changed", and after the script has finished executing the
changes become visible. That way you could basically reconstruct an
entire page in javascript, and have it update once at the end.

But I ran into trouble getting it to decide what parts of the page need
updating - e.g. if you just change an image, or the colour of some text,
you do not need to relayout the page (although some recalculating is
needed in the appropriate rendering object), and then just the part of
the window that was affected is updated.

CVS by knoll wrote:
> kdelibs/khtml/html html_imageimpl.cpp,1.52,1.53
> Author: knoll
> CVSROOT: /home/kde
> Sun Jun 25 13:48:48 UTC 2000
> Update of /home/kde/kdelibs/khtml/html
> cvs.kde.org hosted by sourceforge.net
> 
> Modified Files:
>         html_imageimpl.cpp 
> Log Message:
> do not check the _whole_ document for changes after each jscript call,
> but only the elements and children that actuall ygot changed.
> Speeds up jscript calls by a factor of 10-100. The jscript code on
> www.linuxtag.de is actually fast now... :-)

-- 
Peter Kelly
pmk@post.com

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

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