Bug 606567 - go back to using executeSoon in addition to mozRequestAnimationFrame. a=...

This commit is contained in:
Dão Gottwald 2010-10-25 12:06:45 +02:00
Родитель ab6debb49d
Коммит 57605a36b8
1 изменённых файлов: 24 добавлений и 12 удалений

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

@ -1,19 +1,31 @@
var tab;
var performedTest = false;
function test() {
waitForExplicitFinish();
var tab = gBrowser.addTab();
tab = gBrowser.addTab();
isnot(tab.getAttribute("fadein"), "true", "newly opened tab is yet to fade in");
// Remove the tab right before the opening animation's first frame
window.mozRequestAnimationFrame(function () {
if (tab.getAttribute("fadein") != "true") {
window.mozRequestAnimationFrame(arguments.callee);
return;
}
info(window.getComputedStyle(tab).maxWidth);
gBrowser.removeTab(tab, {animate:true});
ok(!tab.parentNode, "tab successfully removed");
finish();
});
window.mozRequestAnimationFrame(checkAnimationState);
executeSoon(checkAnimationState);
}
function checkAnimationState() {
if (performedTest)
return;
if (tab.getAttribute("fadein") != "true") {
window.mozRequestAnimationFrame(checkAnimationState);
executeSoon(checkAnimationState);
return;
}
performedTest = true;
info(window.getComputedStyle(tab).maxWidth);
gBrowser.removeTab(tab, {animate:true});
ok(!tab.parentNode, "tab successfully removed");
finish();
}