mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 850163 - use mozRequestAnimationFrame to start the tab opening animation asynchronously but without missing the next possible frame. r=ttaubert
--HG-- extra : rebase_source : 5274b1f1a8b5b5d0e4b7f3d369b0a91f3fb0655d
This commit is contained in:
parent
f04a7ceb34
commit
c3d508a9c5
@ -1454,17 +1454,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (animate) {
|
if (animate) {
|
||||||
this.tabContainer._handleTabTelemetryStart(t, aURI);
|
mozRequestAnimationFrame(function () {
|
||||||
|
this.tabContainer._handleTabTelemetryStart(t, aURI);
|
||||||
|
|
||||||
// kick the animation off
|
// kick the animation off
|
||||||
t.clientTop;
|
t.setAttribute("fadein", "true");
|
||||||
t.setAttribute("fadein", "true");
|
|
||||||
|
|
||||||
// This call to adjustTabstrip is redundant but needed so that
|
// This call to adjustTabstrip is redundant but needed so that
|
||||||
// when opening a second tab, the first tab's close buttons
|
// when opening a second tab, the first tab's close buttons
|
||||||
// appears immediately rather than when the transition ends.
|
// appears immediately rather than when the transition ends.
|
||||||
if (this.tabContainer.childNodes.length == 2)
|
if (this.tabContainer.childNodes.length == 2)
|
||||||
this.tabContainer.adjustTabstrip();
|
this.tabContainer.adjustTabstrip();
|
||||||
|
}.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
|
@ -4,13 +4,15 @@ function test() {
|
|||||||
waitForExplicitFinish();
|
waitForExplicitFinish();
|
||||||
|
|
||||||
tab = gBrowser.addTab();
|
tab = gBrowser.addTab();
|
||||||
is(tab.getAttribute("fadein"), "true", "tab opening animation initiated");
|
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
|
// Try to remove the tab right before the opening animation's first frame
|
||||||
window.mozRequestAnimationFrame(checkAnimationState);
|
window.mozRequestAnimationFrame(checkAnimationState);
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkAnimationState() {
|
function checkAnimationState() {
|
||||||
|
is(tab.getAttribute("fadein"), "true", "tab opening animation initiated");
|
||||||
|
|
||||||
info(window.getComputedStyle(tab).maxWidth);
|
info(window.getComputedStyle(tab).maxWidth);
|
||||||
gBrowser.removeTab(tab, { animate: true });
|
gBrowser.removeTab(tab, { animate: true });
|
||||||
if (!tab.parentNode) {
|
if (!tab.parentNode) {
|
||||||
|
Loading…
Reference in New Issue
Block a user