Bug 1305148: Ignore panel.resize when the panel isn't visible. r=gabor

MozReview-Commit-ID: BFPZm3wUKf2

--HG--
extra : rebase_source : c25c3808c0dc8ae7c3eebfba85713c1cbad75784
extra : histedit_source : c480b0d5465587aef9835483f3379cfc08067bab
This commit is contained in:
Kris Maglione 2016-09-28 22:18:09 +01:00
Родитель 3074a514df
Коммит 9d78611105
2 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -106,8 +106,10 @@ exports.close = close
function resize(panel, width, height) {
// Resize the iframe instead of using panel.sizeTo
// because sizeTo doesn't work with arrow panels
panel.firstChild.style.width = width + "px";
panel.firstChild.style.height = height + "px";
if (panel.firstChild) {
panel.firstChild.style.width = width + "px";
panel.firstChild.style.height = height + "px";
}
}
exports.resize = resize

Просмотреть файл

@ -254,6 +254,10 @@ exports["test Resize Panel"] = function(assert, done) {
height: 10,
width: 10,
onMessage: function (message) {
// Make sure that attempting to resize a panel while it isn't
// visible doesn't cause an error.
panel.resize(1, 1);
panel.show();
},
onShow: function () {
@ -335,7 +339,7 @@ exports["test Several Show Hides"] = function(assert, done) {
panel.show();
};
exports["test Anchor And Arrow"] = function(assert, done) {
exports["test Anchor And Arrow"] = function*(assert, done) {
let { loader } = LoaderWithHookedConsole(module, ignorePassingDOMNodeWarning);
let { Panel } = loader.require('sdk/panel');