mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1231517 - part 5, Update scrollToFocusedInput in browser.js to use nsDOMWindowUtils.zoomToFocusedInput when APZ is enabled r=snorp
This commit is contained in:
parent
1bb772ec45
commit
1060a6ac5a
@ -1776,15 +1776,22 @@ var BrowserApp = {
|
||||
if (formHelperMode == kFormHelperModeDisabled)
|
||||
return;
|
||||
|
||||
let focused = this.getFocusedInput(aBrowser);
|
||||
|
||||
if (focused) {
|
||||
let shouldZoom = Services.prefs.getBoolPref("formhelper.autozoom");
|
||||
if (formHelperMode == kFormHelperModeDynamic && this.isTablet)
|
||||
shouldZoom = false;
|
||||
// ZoomHelper.zoomToElement will handle not sending any message if this input is already mostly filling the screen
|
||||
ZoomHelper.zoomToElement(focused, -1, false,
|
||||
aAllowZoom && shouldZoom && !ViewportHandler.isViewportSpecified(aBrowser.contentWindow));
|
||||
if (!AppConstants.MOZ_ANDROID_APZ) {
|
||||
let focused = this.getFocusedInput(aBrowser);
|
||||
if (focused) {
|
||||
let shouldZoom = Services.prefs.getBoolPref("formhelper.autozoom");
|
||||
if (formHelperMode == kFormHelperModeDynamic && this.isTablet)
|
||||
shouldZoom = false;
|
||||
// ZoomHelper.zoomToElement will handle not sending any message if this input is already mostly filling the screen
|
||||
ZoomHelper.zoomToElement(focused, -1, false,
|
||||
aAllowZoom && shouldZoom && !ViewportHandler.isViewportSpecified(aBrowser.contentWindow));
|
||||
}
|
||||
} else {
|
||||
// Using a timeout to let the viewport propagate to the compositor thread before requesting a pan and zoom animation
|
||||
// so the element will end up in the middle of the correctly sized viewport. See Bug 1231517.
|
||||
setTimeout(function(e) {
|
||||
aBrowser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).zoomToFocusedInput();
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user