Bug 961832 - GCLI screenshot shows fixed position element in wrong position. r=pbrosset.

This commit is contained in:
Sébastien Blin 2014-06-30 17:46:20 +02:00
parent 94b2961f58
commit 418bbcb24a

View File

@ -106,6 +106,8 @@ exports.items = [
let width;
let height;
let div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
let currentX = window.scrollX;
let currentY = window.scrollY;
if (!fullpage) {
if (!node) {
@ -122,6 +124,7 @@ exports.items = [
height = rect.height;
}
} else {
window.scrollTo(0,0);
width = window.innerWidth + window.scrollMaxX;
height = window.innerHeight + window.scrollMaxY;
}
@ -132,6 +135,10 @@ exports.items = [
ctx.drawWindow(window, left, top, width, height, "#fff");
let data = canvas.toDataURL("image/png", "");
if(fullpage) {
window.scrollTo(currentX, currentY);
}
let loadContext = document.defaultView
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)