mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Bug 961832 - GCLI screenshot shows fixed position element in wrong position. r=pbrosset.
This commit is contained in:
parent
94b2961f58
commit
418bbcb24a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user