Bug 904616 - Ensure that sizes for preload browsers are applied correctly; r=jaws

This commit is contained in:
Tim Taubert 2013-08-14 06:59:49 +02:00
parent 1fe519eef8
commit 42ba28509a

View File

@ -343,13 +343,9 @@ HiddenBrowser.prototype = {
},
resize: function (width, height) {
if (this._browser) {
this._browser.style.width = width + "px";
this._browser.style.height = height + "px";
} else {
this._width = width;
this._height = height;
}
this._width = width;
this._height = height;
this._applySize();
},
destroy: function () {
@ -357,12 +353,20 @@ HiddenBrowser.prototype = {
this._timer = clearTimer(this._timer);
},
_applySize: function () {
if (this._browser) {
this._browser.style.width = this._width + "px";
this._browser.style.height = this._height + "px";
}
},
_createBrowser: function () {
HostFrame.get().then(aFrame => {
let doc = aFrame.document;
this._browser = doc.createElementNS(XUL_NS, "browser");
this._browser.setAttribute("type", "content");
this._browser.setAttribute("src", NEWTAB_URL);
this._applySize();
doc.getElementById("win").appendChild(this._browser);
});
},