Are TextRuns always sorted?
Matt Newell
newellm at blur.com
Thu Aug 14 18:59:34 CEST 2003
On Thursday 14 August 2003 12:26, Leo Savernik wrote:
> Am Donnerstag, 7. August 2003 20:09 schrieb Matt Newell:
> [...]
>
> > I've sent this patch before. It fixes one of the problems wrt text
> > selection speed. In khtmlPart::htmlMouseMoveEvent, after the selection
> > nodes are found, it currently does a linear search from the first node to
> > either the end, or the second node, whichever comes first. This means
> > that selecting from right to left on a large page causes an unnecessary
> > traversal of the tree for every pixel that the mouse is moved. My patch
> > finds the first common anscestor of each node, and then iterates through
> > its children to see which comes first.
> >
> > Simply put, the worst case complexity of that function goes from O(n) to
> > O(depth of tree).
>
> Could you make this patch available (again), please? I'd like to
> incorporate it into khtml.
>
Here it is.
Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: khtml_sel.patch
Type: text/x-diff
Size: 3043 bytes
Desc: not available
Url : http://mail.kde.org/mailman/private/khtml-devel/attachments/20030814/d7cee72f/khtml_sel.bin
More information about the Khtml-devel
mailing list