Text Selection Speed

Koos Vriezen koos.vriezen at xs4all.nl
Sun Jun 23 22:26:11 BST 2002



On Sun, 23 Jun 2002, Dirk Mueller wrote:

> On Son, 23 Jun 2002, Koos Vriezen wrote:
>
> > > - what you hacked together with QValueList<QRect> is handled MUCH more
> > >   efficiently in QRegion. Please use that instead.
> > Didn't know that. Why isn't it used then?
>
> Because repainting a boundary rect is probably faster than repainting a
> complex region.

Not if you have one of those news pages, that have left and right gif
movies. The whole page is repainted all the time when repainting is
delayed to 40 ms (which speed up text selection).
BTW what do you think of not re-rescheduling repainting of rectangles?

>
> > Already had
> >   if (d->cachedInnerNode &&
> >       d->cachedInnerNode->innerNode()->renderer()->nodeAtPoint(......)) {
> >          if (d->cachedInnerNode->URLElement() && !renderInfo.URLElement())
> >             renderInfo.setURLElement(d->cachedInnerNode->URLElement());
> >          *d->cachedInnerNode = renderInfo;
> >          isInside = true;
> >   } else
> > in my tree, which always updates the cache.
>
> No, not quite. there might be specialobjects "up" in the tree that are
> "inside".

RenderObject::nodeAtPoint suggest always the most deep object is the
innerNode:

for (RenderObject* child = lastChild(); child; child = child->previousSibling())
    if (!child->isPositioned() && child->nodeAtPoint(info, ...))
....
if (inside && element()) {
    if (!info.innerNode())
        info.setInnerNode(element(), _tx, _ty);

In case of an more upper node which should be inside,
d->cachedInnerNode->innerNode()->renderer()->nodeAtPoint should return
false.

> > Also an invalidation
> > of the cache in 'DocumentImpl::close' was necessary.
>
> euhm?

Cache could 'hang' with a RenderObject that was 'isHTML' with a yx set
to -500000.

Koos





More information about the kfm-devel mailing list