mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 870105 - In BackgroundPageThumbs.jsm, size the browser once using browser.style rather than after each page load using nsIDOMWindowUtils.setCSSViewport. r=ttaubert
This commit is contained in:
parent
76072f4667
commit
300957cc47
@ -129,6 +129,11 @@ const BackgroundPageThumbs = {
|
||||
browser.setAttribute("type", "content");
|
||||
browser.setAttribute("remote", "true");
|
||||
browser.setAttribute("privatebrowsing", "true");
|
||||
|
||||
let [width, height] = PageThumbs._getThumbnailSize();
|
||||
browser.style.width = width + "px";
|
||||
browser.style.height = height + "px";
|
||||
|
||||
this._parentWin.document.documentElement.appendChild(browser);
|
||||
|
||||
browser.messageManager.loadFrameScript(FRAME_SCRIPT_URL, false);
|
||||
|
@ -34,8 +34,6 @@ const backgroundPageThumbsContent = {
|
||||
removeEventListener("load", this._onLoad, true);
|
||||
delete this._onLoad;
|
||||
|
||||
// The viewport is always reset to a small size after load, so resize it.
|
||||
this._sizeViewport();
|
||||
let canvas = PageThumbs._createCanvas(content);
|
||||
PageThumbs._captureToCanvas(content, canvas);
|
||||
|
||||
@ -56,19 +54,6 @@ const backgroundPageThumbsContent = {
|
||||
this._webNav.loadURI(msg.json.url, Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
|
||||
null, null, null);
|
||||
},
|
||||
|
||||
_sizeViewport: function () {
|
||||
let width = {};
|
||||
let height = {};
|
||||
Cc["@mozilla.org/gfx/screenmanager;1"].
|
||||
getService(Ci.nsIScreenManager).
|
||||
primaryScreen.
|
||||
GetRect({}, {}, width, height);
|
||||
content.
|
||||
QueryInterface(Ci.nsIInterfaceRequestor).
|
||||
getInterface(Ci.nsIDOMWindowUtils).
|
||||
setCSSViewport(width.value, height.value);
|
||||
},
|
||||
};
|
||||
|
||||
backgroundPageThumbsContent.init();
|
||||
|
Loading…
Reference in New Issue
Block a user