Page inconsistently scrolls to the beginning horizontally and vertically when I focus it

NEW
Unassigned

Status

()

Core
Keyboard: Navigation
P2
normal
10 months ago
9 months ago

People

(Reporter: arni2033, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox50 wontfix, firefox51 wontfix, firefox52 wontfix, firefox53 affected)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

10 months ago
>>>   My Info:   Win7_64, Nightly 49, 32bit, ID 20160526082509
STR_1:
1. Open url   data:text/html,<a href="http://a.b">Link</a><style>body{height:10000px;width:10000px}
2. Scroll the page by 2 screens to the bottom and a by 2 screens to the right
3. Click in searchbar or press Ctrl+K
4. Press Tab or F6 to focus the page

AR:  The page is scrolled to the beginning (only horizontally)
ER:  The page shouldn't scroll


STR_2:  (reference of good behavior; difference between STR_1 and STR_2 is only Step 2)
1. Open url   data:text/html,<a href="http://a.b">Link</a><style>body{height:10000px;width:10000px}
2. Scroll the page by ~100px to the bottom and a by ~100px to the right
3. Click in searchbar or press Ctrl+K
4. Press Tab or F6 to focus the page

AR:  The page doesn't scroll anyhow, just as expected


STR_3:
1. Log in on https://vk.com/
2. Open https://vk.com/im, start a conversation with somebody
  (e.g. yourself: https://vk.com/im?sel=<your_id> )
3. Write a lot of comments, at least 10 screens in height
4. Reload the page
5. Click in urlbar
6. Press F6 (or Tab several times, depending on the new buggy searchbar state) to focus content area

AR:  The page is scrolled to beginning (vertically); it causes the site to load lots of old messages
ER:  The page should stay still; the browser shouldn't cause site to load old messages


STR_4:  (testcase)
1. Open url [1], press PageDown twice to scroll the page
2. Click in urlbar
3. Press F6 (or Tab several times, depending on the new buggy searchbar state) to focus content area

AR:  The page is scrolled to the very beginning (vertically)
ER:  The page should stay still

> [1] data:text/html,<div class="d0"><div class="d1"><div class="d2"><style>body{height:100%}.d0{height:10000px;}.d1{position:fixed;top:50px;height:150px;left:50px;width:150px;background:lightgray;}.d2{position:absolute;top:50px;height:50px;left:50px;width:50px;background:black;}


Note:
 Actually, expectations are "either never scroll the page, or always scroll it"
 I haven't mentioned the latter, because it's just a bad UI.
(Reporter)

Updated

10 months ago
No longer blocks: 1277113
(Reporter)

Updated

10 months ago
Component: Untriaged → Untriaged
Product: Firefox → Core
User Agent 	Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID 	20170115030210

The issue is reproducible on the latest Firefox release (50.1.0) and the latest Nightly (53.0a1).
status-firefox50: --- → affected
status-firefox51: --- → affected
status-firefox52: --- → affected
status-firefox53: --- → affected
Component: Untriaged → Panning and Zooming
Created attachment 8827624 [details]
Backtrace to ScrollTo

I got a backtrace on OS X of the call to the ScrollToWithOrigin that's shifting the scroll position back to x=0. Note that this happens with or without APZ, it seems to be focus-related.
I'm assuming the call to MoveFocus at [1] might need tweaking, and that was added in bug 1176239 by Neil.

[1] http://searchfox.org/mozilla-central/rev/790b2cb423ea1ecb5746722d51633caec9bab95a/dom/ipc/TabChild.cpp#2453
Component: Panning and Zooming → DOM: Events
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #3)
> I'm assuming the call to MoveFocus at [1] might need tweaking, and that was
> added in bug 1176239 by Neil.
> 
> [1]
> http://searchfox.org/mozilla-central/rev/
> 790b2cb423ea1ecb5746722d51633caec9bab95a/dom/ipc/TabChild.cpp#2453

hello Neil, do you have ideas of what we shall do here? Thanks.
status-firefox50: affected → wontfix
status-firefox51: affected → wontfix
status-firefox52: affected → wontfix
Flags: needinfo?(enndeakin)

Comment 5

9 months ago
I guess what we would want to do is when a root node of a document is being focused via keyboard navigation, scroll the parent frame into view instead of that node. That should also not regress bug 1328043.
Flags: needinfo?(enndeakin)

Updated

9 months ago
Component: DOM: Events → Keyboard: Navigation
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.