1. Visit a page in bugzilla that is long enough to scroll. 2. Click in the search box at the very top of the page so it is focused. 3. Use the mouse wheel to scroll down the page so the search box is no longer visible, but it is still focused. 4. Focus any another application by clicking on it or with the task switcher. 5. Focus Firefox by clicking in a blank area of the page or with the task switcher. Now the page will jump back up to the top so the search box is visible again. This doesn't happen on the 1.9.1 branch. This seems to happen on any webpage and for any focusable element.
Regression range would be very useful.
Same issue Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090507 Minefield/3.6a1pre ID:20090507043638
Looks like we're failing to null out mContentToScrollTo somewhere. Looking into it.
OS: All → Mac OS X
Er, or not. Something else weird is happening. mContentToScrollTo is in fact null, we suppress the focus scroll... but something ends up scrolling our view or something.
Oh, the change bug 67752 made to PresShell::ScrollContentIntoView is just buggy. Here's the stack to where the scroll happens: #0 nsScrollPortView::ScrollToImpl (this=0x1c0aa530, aX=0, aY=4029) at /Users/bzbarsky/mozilla/reflow/mozilla/view/src/nsScrollPortView.cpp:598 #1 0x11db72be in nsScrollPortView::ScrollTo (this=0x1c0aa530, aDestinationX=0, aDestinationY=4029, aUpdateFlags=0) at /Users/bzbarsky/mozilla/reflow/mozilla/view/src/nsScrollPortView.cpp:255 #2 0x118811ba in ScrollViewToShowRect (aScrollingView=0x1c0aa584, aRect=@0xbfffcac8, aVPercent=-2, aHPercent=-2) at /Users/bzbarsky/mozilla/reflow/mozilla/layout/base/nsPresShell.cpp:4130 #3 0x11886004 in PresShell::DoScrollContentIntoView (this=0x1f8b0600, aContent=0x18516f70, aVPercent=-2, aHPercent=-2) at /Users/bzbarsky/mozilla/reflow/mozilla/layout/base/nsPresShell.cpp:4211 #4 0x11895432 in PresShell::FlushPendingNotifications (this=0x1f8b0600, aType=Flush_InterruptibleLayout) at /Users/bzbarsky/mozilla/reflow/mozilla/layout/base/nsPresShell.cpp:4774 #5 0x11b3023e in nsDocument::FlushPendingNotifications (this=0x1f3bd400, aType=Flush_InterruptibleLayout) at /Users/bzbarsky/mozilla/reflow/mozilla/content/base/src/nsDocument.cpp:6268 #6 0x11886196 in PresShell::ScrollContentIntoView (this=0x1f8b0600, aContent=0x18516f70, aVPercent=-2, aHPercent=-2) at /Users/bzbarsky/mozilla/reflow/mozilla/layout/base/nsPresShell.cpp:4146 We shouldn't be scrolling here because we want to suppress this scroll, but we end up doing it inside the flush. The right thing is probably to check for the focus suppression before doing the flush.
Summary: Focusing Firefox will scroll the page to the currently focused element → [FIX]Focusing Firefox will scroll the page to the currently focused element
10 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Component: Event Handling → User events and focus handling
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.