Bug 196520 - Opening a local link with an anchor/reference in a new tab does not scroll to the right position
Summary: Opening a local link with an anchor/reference in a new tab does not scroll to...
Status: CONFIRMED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: 4.8.3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 227774 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-14 20:29 UTC by Frank Reininghaus
Modified: 2012-10-24 16:11 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Reininghaus 2009-06-14 20:29:33 UTC
Version:           4.2.91 (KDE 4.2.91 (KDE 4.3 >= 20090609)) (using 4.2.91 (KDE 4.2.91 (KDE 4.3 >= 20090609)), compiled sources)
Compiler:          gcc
OS:                Linux (i686) release 2.6.28-11-generic

I encountered this problem in 4.2.4 and trunk rev. 981138 when browsing the Qt documentation locally. For example, download

http://doc.qtsoftware.com/4.5/qabstractitemview.html

and open the link "DragDropMode" below "Public Types" in a new tab. If I do that in my local copy of the page, the view in the new tab is not scrolled to the right position, but to the end of the page. This does not happen when opening the link in the same window, in a new window, when the URL with anchor is entered in the location bar, or when I try that with the remote page.

I looked a bit into the code and found out that the KHTMLPart::gotoAnchor() call goes wrong in the described use case. In this function,

a->getUpperLeftCorner(x, y);

where "a" is the anchor, returns a "y" value which is much too large, but I don't know why :-(
Comment 1 Anselmo L. S. Melo (anselmolsm) 2009-06-21 00:47:09 UTC
I could reproduce the described behavior using
Konqueror Version 4.2.92 (KDE 4.2.92 (KDE 4.3 >= 20090617))
Using KDE 4.2.92 (KDE 4.2.92 (KDE 4.3 >= 20090617)) - svn r984201
qt-copy r978427
Comment 2 Graeme Hewson 2012-05-16 16:36:44 UTC
Problem is still present in 4.8.3.

For instance, open https://en.wikipedia.org/wiki/Kde#cite_ref-0 in a new tab. This should go to the first line of the article (at least, with the current version of the article), but in my browser it goes to near the "Origins" heading.

I don't believe the problem is to do with KHTML (the assigned component of this bug), though, because the problem appears using WebKit as well.
Comment 3 Graeme Hewson 2012-10-24 05:26:34 UTC
The problem is still present in 4.9.2, but only in KHTML, not WebKit.
Comment 4 Dawit Alemayehu 2012-10-24 16:11:32 UTC
*** Bug 227774 has been marked as a duplicate of this bug. ***