mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 706207 - Fix incorrect pageWidth in viewport update [r=dougt]
Missing pieces of the document resulted in pageWidth getting assigned to NaN, which was serialized as null by JSON. This resulted in an exception over in Java-land when deserialization was attempted, and killed the viewport update entirely.
This commit is contained in:
parent
98e78974cf
commit
da116c45a0
@ -155,6 +155,7 @@ public class GeckoSoftwareLayerClient extends LayerClient implements GeckoEventL
|
||||
});
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
Log.e(LOGTAG, "Bad viewport description: " + viewportDescription);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
@ -1100,10 +1100,10 @@ Tab.prototype = {
|
||||
let pageWidth = this._viewport.width;
|
||||
let pageHeight = this._viewport.height;
|
||||
if (doc != null) {
|
||||
let body = doc.body || {};
|
||||
let html = doc.documentElement || {};
|
||||
pageWidth = Math.max(body.scrollWidth || 1, html.scrollWidth);
|
||||
pageHeight = Math.max(body.scrollHeight || 1, html.scrollHeight);
|
||||
let body = doc.body || { scrollWidth: pageWidth, scrollHeight: pageHeight };
|
||||
let html = doc.documentElement || { scrollWidth: pageWidth, scrollHeight: pageHeight };
|
||||
pageWidth = Math.max(body.scrollWidth, html.scrollWidth);
|
||||
pageHeight = Math.max(body.scrollHeight, html.scrollHeight);
|
||||
}
|
||||
|
||||
// Transform coordinates based on zoom
|
||||
|
Loading…
Reference in New Issue
Block a user