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

List:       kfm-devel
Subject:    Re: tabbing regression?
From:       Peter Kelly <pmk () post ! com>
Date:       2002-02-24 8:45:00
[Download RAW message or body]

The attach patch removes the code that was causing the odd scrolling 
behaviour. Now when you tab it just goes to the next or previous link 
based on the tab index rather than what is present on the screen, and 
scrolls appropriately.

On Sun, 17 Feb 2002, Tobias Anton wrote:

> Hi Peter !
> 
> Go to www.heise.de with testkhtml and try tabbing forward and backward (mixed).
> You'll find that when you once reached the last link, tabbing forward won't cause \
> KHTML to jump to the beginning of the HTML page as it's supposed to. 
> Some other bugs on which I spent quite some time before reappeared, but they're \
> complicated to describe, so only one example here: 
> Let's say there's a long page that contains two links: one with a high tabindex on \
> the  very top of the page, and one with a low tabindex on the bottom.
> Now the view should begin on top of the document, scroll down to the link with the \
> low tabindex, then should scroll up again to the anchor with the high tabindex and \
> finally it should scroll to the bottom of the page before releasing focus to the \
> parent part or whatever. 
> Note that on such a page, a direction change (suddenly pressing shift-tab after \
> having tabbed forward before to approach a non-visible node) does behave like \
> tabbing forward in your new implementation. This worked before. 
> I'm a bit confused about the fundamental rewrite of the tabbing code that worked \
> before; i.e. did it already respect the tabindex attribute, so there has been no \
> improvement to that feature. 
> I also didn't find any correspondence about that topic on kfm-devel, maybe you can \
> bring me up-to-date? 
> Cheers,
> Tobias
> 

-- 
Peter Kelly
pmk@post.com


["tab.diff" (TEXT/PLAIN)]

? a
Index: khtmlview.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtmlview.cpp,v
retrieving revision 1.450
diff -u -p -r1.450 khtmlview.cpp
--- khtmlview.cpp	2002/02/14 16:15:32	1.450
+++ khtmlview.cpp	2002/02/24 08:11:35
@@ -886,31 +886,6 @@ void KHTMLView::focusNextPrevNode(bool n
     else
         newFocusNode = doc->previousFocusNode(oldFocusNode);
 
-    // If there was previously no focus node and the user has scrolled the document, \
                then instead of picking the first
-    // focusable node in the document, use the first one that lies within the \
                visible area (if possible).
-    if (!oldFocusNode && newFocusNode) {
-        bool visible = false;
-        NodeImpl *toFocus = newFocusNode;
-        while (!visible && toFocus) {
-            QRect focusNodeRect = toFocus->getRect();
-            if ((focusNodeRect.left() > contentsX()) && (focusNodeRect.right() < \
                contentsX() + visibleWidth()) &&
-                (focusNodeRect.top() > contentsY()) && (focusNodeRect.bottom() < \
                contentsY() + visibleHeight())) {
-                // toFocus is visible in the contents area
-                visible = true;
-            }
-            else {
-                // toFocus is _not_ visible in the contents area, pick the next node
-                if (next)
-                    toFocus = doc->nextFocusNode(toFocus);
-                else
-                    toFocus = doc->previousFocusNode(toFocus);
-            }
-        }
-
-        if (toFocus)
-            newFocusNode = toFocus;
-    }
-
     // Set focus node on the document
     m_part->xmlDocImpl()->setFocusNode(newFocusNode);
     emit m_part->nodeActivated(Node(newFocusNode));



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

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