mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-13 06:38:48 +02:00
This patch implements a new, preffed-off tab opening/closing animation where the tab slides up and down in place. In addition, it adjusts some tests and code that were relying on the max-width transitionend event happening. The intent of the patch is to land it preffed-off and iterate on the design in the tree Differential Revision: https://phabricator.services.mozilla.com/D15955 --HG-- extra : moz-landing-system : lando
32 lines
1,009 B
JavaScript
32 lines
1,009 B
JavaScript
var tab;
|
|
|
|
function test() {
|
|
waitForExplicitFinish();
|
|
|
|
tab = BrowserTestUtils.addTab(gBrowser);
|
|
isnot(tab.getAttribute("fadein"), "true", "newly opened tab is yet to fade in");
|
|
|
|
// Try to remove the tab right before the opening animation's first frame
|
|
window.requestAnimationFrame(checkAnimationState);
|
|
}
|
|
|
|
function checkAnimationState() {
|
|
is(tab.getAttribute("fadein"), "true", "tab opening animation initiated");
|
|
|
|
info(window.getComputedStyle(tab).maxWidth);
|
|
gBrowser.removeTab(tab, { animate: true });
|
|
if (!tab.parentNode) {
|
|
ok(true, "tab removed synchronously since the opening animation hasn't moved yet");
|
|
finish();
|
|
return;
|
|
}
|
|
|
|
info("tab didn't close immediately, so the tab opening animation must have started moving");
|
|
info("waiting for the tab to close asynchronously");
|
|
tab.addEventListener("TabAnimationEnd", function listener() {
|
|
executeSoon(function() {
|
|
ok(!tab.parentNode, "tab removed asynchronously");
|
|
finish();
|
|
});
|
|
}, {once: true});
|
|
}
|