Commit a9d02a7f authored by Piotr Tworek's avatar Piotr Tworek

[embedlite-components] Remove no longer needed zoomToRect calls. Fixes JB#27546.

The code was added originally in PR #35 to fix viewport update problems
in cases where the keyboard was open. The original issue is no longer
reproducible without the patch, but the code added by it causes serious
problems on twitter.com. It triggers additional scrolls after the
viewport size is changed due to page custom HTML dialogs being shown.
parent a792c833
......@@ -46,7 +46,6 @@ function EmbedHelper() {
this.inputItemSize = 38;
this.zoomMargin = 14;
this.vkbOpenCompositionMetrics = null;
this.returnToBoundsRequested = false;
this.inFullScreen = false;
this.viewportChangesSinceVkbUpdate = 0;
this._init();
......@@ -317,18 +316,6 @@ EmbedHelper.prototype = {
this._viewportLastResolution = this._viewportData.resolution.width;
}
// Floor cssCompositedRect.height and ceil cssPageRect.height that there needs to be more than 1px difference.
// Background reason being that TabChildHelper floors viewport x and y values.
if (!this.inFullScreen && !this.returnToBoundsRequested && this._viewportData.y + Math.floor(this._viewportData.cssCompositedRect.height) > Math.ceil(this._viewportData.cssPageRect.height)) {
let y = -this._viewportData.cssCompositedRect.height + this._viewportData.cssPageRect.height
var winid = Services.embedlite.getIDByWindow(content);
Services.embedlite.zoomToRect(winid, this._viewportData.x, y,
this._viewportData.cssCompositedRect.width, this._viewportData.cssCompositedRect.height);
this.returnToBoundsRequested = true;
} else {
this.returnToBoundsRequested = false;
}
let epsilon = 0.999;
// Facebook generates two Viewport:Change's after an input field is tapped. And only
// the second one is valid because Facebook's JS makes the page longer after the tap.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment