I want to fix slow text selection

Lars Knoll lars at trolltech.com
Thu Sep 18 14:54:09 BST 2003


Hi Leo,

please also have a short look at WebCore. IIRC, they also implemented some 
"bool immediate" flag for repaint requests. It would probably be nice if we 
could use the same API.

Lars

On Thursday 18 September 2003 14:31, Leo Savernik wrote:
> Hello,
>
> In order to fix a double repaint problem on selection text in khtml I
> introduced an "urgent repaint" flag which schedules the repaint to be done
> the next time the event loop is entered. While this fixes the double
> repaint, it has a severe drawback: It slows down text selection so much
> that it becomes intolerable.
>
> I investigated the text selection algorithm, and noticed that first all
> previously selected render objects are marked non-selected, and repainted,
> then all newly selected render objects marked selected, and repainted.
> These repaints are not done immediately but coalesced, and scheduled for a
> later repaint. Repaints are scheduled every 20ms, which is per se
> sufficient, but makes text selection feel slow when moving the mouse
> quickly over the page. Also, by coalescing the events, a much bigger part
> is repainted as would be actually needed.
>
> So would anyone object if I implemented a means that really only repaints
> those render objects whose selection state is changed, and immediately (i.
> e., the next time the event loop is entered, otherwise we get again a
> double repaint problem)?
>
> mfg
> 	Leo





More information about the kfm-devel mailing list