Open Bug 1544660 Opened 5 years ago Updated 1 year ago

Support preventScroll for element.focus on GeckoView

Categories

(Core :: DOM: Core & HTML, defect, P2)

Unspecified
Android
defect

Tracking

()

Tracking Status
firefox68 --- affected

People

(Reporter: m_kato, Unassigned)

References

Details

When using element.focus(), Fennec and GeckoView will scroll content page via APZC for zoom to input after showing software keyboard.

I guess that we may require additional flags for nsIWidget::SetInputContext.

Also, this option doesn't work on Chrome/Android. (https://bugs.chromium.org/p/chromium/issues/detail?id=953169).

Flags: needinfo?(mbrodesser)
Priority: -- → P2

Yesterday, I already chat with Mirko about this issue. Since Chrome/Android is also broken, so this doesn't become webcompat issue until they fixes it.

To give more context, it seems that GeckoEditable.icNotifyIME calls GeckoEditable.softInput, which calls GeckoViewContentChild.receiveMessage, which calls nsDOMWindowUtils.ZoomToFocusedInput which also scrolls to the element. At the latter place, scrolling needs to be prevented. The place could probably be notified by using a new flag EditableListener.NOTIFY_IME_OPEN_VKB_PREVENT_SCROLL.

Flags: needinfo?(mbrodesser)

I doubt this is element.focus() specific.
All focus handling needs to go through FocusManager.

(In reply to Olli Pettay [:smaug] from comment #3)

I doubt this is element.focus() specific.
All focus handling needs to go through FocusManager.

I also guess it's not element.focus specific. In nsFocusManager::Focus, IMEStateManager::OnChangeFocus is already called. I guess all focus handling goes through nsFocusManager already. Presumably, a new argument preventScroll will have to be passed to IMEStateManager::OnChangeFocus and that'll have to handle it properly. Which includes adapting the call-chain in comment #2.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.