Persona is no longer an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 696319 - Scroll web content input into view
: Scroll web content input into view
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: unspecified
: ARM Android
: P1 normal (vote)
: ---
Assigned To: Kartikaya Gupta (
: Sebastian Kaspari (:sebastian)
: 701687 (view as bug list)
Depends on: 707132
Blocks: 694413
  Show dependency treegraph
Reported: 2011-10-20 21:47 PDT by Mark Finkle (:mfinkle) (use needinfo?)
Modified: 2016-07-29 14:20 PDT (History)
9 users (show)
catalin.suciu: in‑litmus+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Scroll any focused input/textarea elements into view (4.30 KB, patch)
2011-10-26 11:36 PDT, Kartikaya Gupta (
mark.finkle: review+
Details | Diff | Splinter Review
Pop the text input field into view (4.09 KB, patch)
2011-12-02 09:08 PST, Kartikaya Gupta (
mark.finkle: review+
Details | Diff | Splinter Review
Pop the text input field into view (v2) (8.59 KB, patch)
2011-12-02 13:24 PST, Kartikaya Gupta (
mark.finkle: review+
Details | Diff | Splinter Review

Description Mark Finkle (:mfinkle) (use needinfo?) 2011-10-20 21:47:07 PDT
When the software keyboard appears, the window is not resized, so I can't pan to the bottom of content. was my test page
Comment 1 Kartikaya Gupta ( 2011-10-26 11:28:50 PDT
Update title as per discussion with mfinkle on IRC
Comment 2 Kartikaya Gupta ( 2011-10-26 11:36:28 PDT
Created attachment 569746 [details] [diff] [review]
Scroll any focused input/textarea elements into view

Additional test case at if needed (scroll to bottom and put focus on the text field, ensure it remains visible when the virtual keyboard comes up).
Comment 3 Mark Finkle (:mfinkle) (use needinfo?) 2011-10-26 13:47:13 PDT
Comment 4 Alex Pakhotin (:alexp) 2011-11-01 15:38:30 PDT
Any idea why focused.scrollIntoView(false) from this fix would not work on the
STR: open that site, select Air Reservations -> Book Air, try to enter the Promotion Code at the bottom of the page - it doesn't scroll into view, though the method is called.
Comment 5 Kartikaya Gupta ( 2011-11-02 07:12:39 PDT
Not really sure. It works fine on the desktop browser (if I throw up the Firebug console so that it hides the text field, and then do document.getElementById("textfieldpromocode").scrollIntoView() it will scroll into view. Also on mobile it does seem to scroll the page to a particular point, it just doesn't scroll to the *right* point, so I'm guessing that there's a regression in the layout code that makes gecko think the text input box is somewhere different than it actually is.
Comment 6 Camelia Urian 2011-11-09 05:04:06 PST
Build ID: Mozilla/5.0 (Android; Linux armv7l; rv:10.0a1) Gecko/20111108 Firefox/10.0a1 Fennec/10.0a1 - Native Fennec build
Device: HTC Desire Z - Android 2.3

Verified bug on, and test page from comment2. When focus on a text field(anywhere on the page:top, bottom, middle) virtual keyboard is opened and text field remains visible with focus on text field.
Comment 7 Alex Pakhotin (:alexp) 2011-11-14 17:17:15 PST
This fix was in GeckoSurfaceView, and now needs to be reimplemented for the latest pan/zoom layers architecture. Probably just need to send the same "ScrollTo:FocusedInput" message from LayerView.setScreenSize().
Comment 8 Alex Pakhotin (:alexp) 2011-11-14 17:18:37 PST
*** Bug 701687 has been marked as a duplicate of this bug. ***
Comment 9 Patrick Walton (:pcwalton) 2011-11-14 17:19:46 PST
What really needs to be implemented here is allowing Gecko to trigger a scrollTo(), instead of only having Java able to trigger it.
Comment 10 Kartikaya Gupta ( 2011-12-02 09:08:16 PST
Created attachment 578610 [details] [diff] [review]
Pop the text input field into view
Comment 11 Kartikaya Gupta ( 2011-12-02 13:24:41 PST
Created attachment 578700 [details] [diff] [review]
Pop the text input field into view (v2)

While debugging bug 707285 I realized my first patch also had a race condition, and could call scrollIntoView() before the browser element had been resized, so the scrollIntoView() would effectively be a no-op. Patch updated to fix that by ensuring the scrollIntoView() always happens afterwards. I was able to consistently repro the problem by increasing the throttle timer from 350ms to 3500ms to force it into that state.

I also changed the isIMEEnabled() method to check for != DISABLED instead of == ENABLED since passwords are a separate state there and the first patch didn't work on password input fields.
Comment 12 Kartikaya Gupta ( 2011-12-03 20:01:37 PST
Comment 13 Catalin Suciu [:csuciu] 2011-12-07 06:19:07 PST
verified fixed on:
Build ID: Mozilla/5.0 (Android; Linux armv7l; rv:11.0a1) Gecko/20111207 Firefox/11.0a1 Fennec/11.0a1 - Native Fennec build
Device: Samsung GalaxyS, Android 2.2
TC created:
Comment 14 Kevin Brosnan [:kbrosnan] 2011-12-09 08:23:30 PST
Catalin please check to make sure we have a test case that covers scrolling an input into view when a letter is tapped on a keyboard.

Note You need to log in before you can comment on or make changes to this bug.