Open Bug 408226 Opened 17 years ago Updated 3 years ago

Scrolling to anchor does not work when IFRAME is before anchor

Categories

(Core :: Layout, defect)

defect

Tracking

()

People

(Reporter: bugzzilla, Unassigned)

Details

(Keywords: testcase)

Attachments

(8 files, 2 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9b1) Gecko/2007110904 Firefox/3.0b1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9b1) Gecko/2007110904 Firefox/3.0b1 Go to http://spiders.mhohner.de/stats.php#findlist to reproduce. Firefox scrolls only to the map, which is an IFRAME. But the referenced anchor is further down, at the next heading. You can also go to the top of the page and click on the "Fundliste" link. Same result. Reproducible: Always Steps to Reproduce: 1. Go to http://spiders.mhohner.de/stats.php#findlist Actual Results: Scrolls to IFRAME. Expected Results: Scroll to named anchor. Also happens with Firefox 2.0.0.11 and IE 7. No problem with Opera 9.22.
Assignee: nobody → mats.palmgren
Status: UNCONFIRMED → NEW
Component: General → Layout: Misc Code
Ever confirmed: true
Keywords: testcase
OS: Windows XP → All
Product: Firefox → Core
Hardware: PC → All
Attached file Testcase #1
Attached file Testcase #2
Attached file Testcase #3
Attached file Testcase #4
Attached file Testcase #5
Attached patch Patch rev. 1 (obsolete) — Splinter Review
The problem with the URL is that the target anchor is a block-in-inline, causing an IB split chain where the first frame is empty and thus fits next to the IFRAME on the line above where the perceived link content is. (see the Frame dump) I think it makes sense to include all non-empty frames in an IB split chain when calculating the union rect of the frames.
Attachment #293085 - Flags: superreview?(roc)
Attachment #293085 - Flags: review?(roc)
QA Contact: general → layout.misc-code
Why don't you just call nsLayoutUtils::GetNextContinuationOrSpecialSibling instead of GetNextContinuation?
Attached file Testcase #6
Attached patch Patch rev. 2 (obsolete) — Splinter Review
GetNextContinuationOrSpecialSibling() version. This patch does not fix Testcase #6 though.
Attachment #293085 - Attachment is obsolete: true
Attachment #295560 - Flags: superreview?(roc)
Attachment #295560 - Flags: review?(roc)
Attachment #293085 - Flags: superreview?(roc)
Attachment #293085 - Flags: review?(roc)
Attached patch Patch rev. 3Splinter Review
It's the helper function UnionRectForClosestScrolledView() that explicitly adds the empty frame rects. An alternative solution would be to only include non-empty frame rects (instead of using nsIFrame::IsEmpty()), but still use the position of an empty frame rect if we can't find a non-empty one. This patch also fixes Testcase #6. Both patches pass mochitests (which covers bug 388019 and bug 66619). Feel free to pick the one you prefer.
Attachment #295561 - Flags: superreview?(roc)
Attachment #295561 - Flags: review?(roc)
Hmm, could it make sense to use GetClientRects here or at least share code with it?
This bug is still not fixed. It is also present in Firefox 3.0. Will it ever work?
Mats, would you like to use nsLayoutUtils::GetAllInFlowRects here?
Product: Core → Core Graveyard
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: MatsPalmgren_bugz → nobody
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: