diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 691bc131893..1b8362c9904 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -1264,8 +1264,10 @@ setTimeout(function (tabContainer) { if (t.pinned) tabContainer._handleNewTab(t); - else + else { + t._animStartTime = Date.now(); t.setAttribute("fadein", "true"); + } }, 0, this.tabContainer); } @@ -1526,6 +1528,8 @@ return; } + aTab._animStartTime = Date.now(); + this._blurTab(aTab); aTab.style.maxWidth = ""; // ensure that fade-out transition happens aTab.removeAttribute("fadein"); @@ -3257,6 +3261,14 @@ var tab = event.target; + if (tab._animStartTime) { + Services.telemetry.getHistogramById(tab.closing ? + "FX_TAB_ANIM_CLOSE_MS" : + "FX_TAB_ANIM_OPEN_MS") + .add(Date.now() - tab._animStartTime); + tab._animStartTime = 0; + } + if (tab.getAttribute("fadein") == "true") { if (tab._fullyOpen) this.adjustTabstrip(); diff --git a/toolkit/components/telemetry/TelemetryHistograms.h b/toolkit/components/telemetry/TelemetryHistograms.h index a11b77a520c..ab797eda9c7 100644 --- a/toolkit/components/telemetry/TelemetryHistograms.h +++ b/toolkit/components/telemetry/TelemetryHistograms.h @@ -294,7 +294,9 @@ HISTOGRAM(THUNDERBIRD_INDEXING_RATE_MSG_PER_S, 1, 100, 20, LINEAR, "Gloda: index * Firefox-specific telemetry. */ #ifdef MOZ_PHOENIX -HISTOGRAM(FX_CONTEXT_SEARCH_AND_TAB_SELECT, 0, 1, 2, BOOLEAN, "Firefox: Background tab was selected within 5 seconds of searching from the context menu") +HISTOGRAM(FX_TAB_ANIM_OPEN_MS, 1, 3000, 10, EXPONENTIAL, "Firefox: Time taken by the tab opening animation") +HISTOGRAM(FX_TAB_ANIM_CLOSE_MS, 1, 3000, 10, EXPONENTIAL, "Firefox: Time taken by the tab closing animation") +HISTOGRAM_BOOLEAN(FX_CONTEXT_SEARCH_AND_TAB_SELECT, "Firefox: Background tab was selected within 5 seconds of searching from the context menu") #endif HISTOGRAM_BOOLEAN(INNERWINDOWS_WITH_MUTATION_LISTENERS, "Deleted or to-be-reused innerwindow which has had mutation event listeners.")