Skip to content

Commit 3a810e4

Browse files
committed
Backed out changeset 0a133d5fd155 (bug 1864534) for causing screenshot related failures. CLOSED TREE
1 parent 4e3e591 commit 3a810e4

20 files changed

+118
-58
lines changed

browser/app/profile/firefox.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,7 @@ pref("browser.tabs.tooltipsShowPidAndActiveness", false);
905905
#endif
906906

907907
pref("browser.tabs.firefox-view", true);
908+
pref("browser.tabs.firefox-view-next", true);
908909
pref("browser.tabs.firefox-view-newIcon", true);
909910
pref("browser.tabs.firefox-view.logLevel", "Warn");
910911
pref("browser.tabs.firefox-view.notify-for-tabs", false);

browser/base/content/browser.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ var gInitialPages = [
718718
"about:blank",
719719
"about:home",
720720
"about:firefoxview",
721+
"about:firefoxview-next",
721722
"about:newtab",
722723
"about:privatebrowsing",
723724
"about:sessionrestore",
@@ -9962,6 +9963,7 @@ var FirefoxViewHandler = {
99629963
this._updateEnabledState = this._updateEnabledState.bind(this);
99639964
this._updateEnabledState();
99649965
NimbusFeatures.majorRelease2022.onUpdate(this._updateEnabledState);
9966+
NimbusFeatures.firefoxViewNext.onUpdate(this._updateEnabledState);
99659967

99669968
ChromeUtils.defineESModuleGetters(this, {
99679969
SyncedTabs: "resource://services-sync/SyncedTabs.sys.mjs",
@@ -9972,9 +9974,12 @@ var FirefoxViewHandler = {
99729974
CustomizableUI.removeListener(this);
99739975
Services.obs.removeObserver(this, "firefoxview-notification-dot-update");
99749976
NimbusFeatures.majorRelease2022.offUpdate(this._updateEnabledState);
9977+
NimbusFeatures.firefoxViewNext.offUpdate(this._updateEnabledState);
99759978
},
99769979
_updateEnabledState() {
9977-
this._enabled = NimbusFeatures.majorRelease2022.getVariable("firefoxView");
9980+
this._enabled =
9981+
NimbusFeatures.majorRelease2022.getVariable("firefoxView") ||
9982+
NimbusFeatures.firefoxViewNext.getVariable("enabled");
99789983
// We use a root attribute because there's no guarantee the button is in the
99799984
// DOM, and visibility changes need to take effect even if it isn't in the DOM
99809985
// right now.
@@ -10009,7 +10014,9 @@ var FirefoxViewHandler = {
1000910014
CustomizableUI.getPlacementOfWidget("tabbrowser-tabs").position
1001010015
);
1001110016
}
10012-
const viewURL = "about:firefoxview";
10017+
const viewURL = NimbusFeatures.firefoxViewNext.getVariable("enabled")
10018+
? "about:firefoxview-next"
10019+
: "about:firefoxview";
1001310020
// Need to account for navigation to Firefox View pages
1001410021
if (
1001510022
this.tab &&
@@ -10104,11 +10111,18 @@ var FirefoxViewHandler = {
1010410111
const PREF_NAME = "browser.firefox-view.view-count";
1010510112
const MAX_VIEW_COUNT = 10;
1010610113
let viewCount = Services.prefs.getIntPref(PREF_NAME, 0);
10114+
let isFirefoxViewNext = Services.prefs.getBoolPref(
10115+
"browser.tabs.firefox-view-next",
10116+
false
10117+
);
1010710118

1010810119
// Record telemetry
10109-
Services.telemetry.setEventRecordingEnabled("firefoxview_next", true);
10120+
Services.telemetry.setEventRecordingEnabled(
10121+
isFirefoxViewNext ? "firefoxview_next" : "firefoxview",
10122+
true
10123+
);
1011010124
Services.telemetry.recordEvent(
10111-
"firefoxview_next",
10125+
isFirefoxViewNext ? "firefoxview_next" : "firefoxview",
1011210126
"tab_selected",
1011310127
"toolbarbutton",
1011410128
null,

browser/base/content/test/static/browser_all_files_referenced.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,6 @@ var allowlist = [
282282
{ file: "chrome://browser/content/screenshots/copy.svg" },
283283
{ file: "chrome://browser/content/screenshots/download.svg" },
284284
{ file: "chrome://browser/content/screenshots/download-white.svg" },
285-
286-
// Files removed in child patch for Bug 1869833
287-
{ file: "chrome://browser/content/firefoxview/firefoxview.css" },
288-
{ file: "chrome://browser/content/firefoxview/firefoxview.html" },
289-
{ file: "chrome://browser/content/firefoxview/firefoxview.mjs" },
290-
{ file: "chrome://browser/content/firefoxview/recently-closed-empty.svg" },
291-
{ file: "chrome://browser/content/firefoxview/recently-closed-tabs.mjs" },
292-
{ file: "chrome://browser/content/firefoxview/tab-pickup-container.mjs" },
293-
{ file: "chrome://browser/content/firefoxview/tab-pickup-empty.svg" },
294-
{ file: "chrome://browser/content/firefoxview/tab-pickup-list.mjs" },
295285
];
296286

297287
if (AppConstants.platform != "win") {

browser/components/BrowserGlue.sys.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ let JSWINDOWACTORS = {
588588
"chrome://browser/content/places/historySidebar.xhtml",
589589
"chrome://browser/content/places/bookmarksSidebar.xhtml",
590590
"about:firefoxview",
591+
"about:firefoxview-next",
591592
],
592593
},
593594

browser/components/about/AboutRedirector.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ static const RedirEntry kRedirMap[] = {
7474
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
7575
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
7676
nsIAboutModule::IS_SECURE_CHROME_UI},
77-
{"firefoxview",
77+
{"firefoxview", "chrome://browser/content/firefoxview/firefoxview.html",
78+
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI |
79+
nsIAboutModule::HIDE_FROM_ABOUTABOUT},
80+
{"firefoxview-next",
7881
"chrome://browser/content/firefoxview/firefoxview-next.html",
7982
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI |
8083
nsIAboutModule::HIDE_FROM_ABOUTABOUT},

browser/components/firefoxview/card-container.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class CardContainer extends MozLitElement {
154154
<slot name="secondary-header"></slot>
155155
</span>
156156
<a
157-
href="about:firefoxview#${this.shortPageName}"
157+
href="about:firefoxview-next#${this.shortPageName}"
158158
@click=${this.viewAllClicked}
159159
class="view-all-link"
160160
data-l10n-id="firefoxview-view-all-link"
@@ -188,7 +188,7 @@ class CardContainer extends MozLitElement {
188188
<slot name="header"></slot>
189189
</summary>
190190
<a
191-
href="about:firefoxview#${this.shortPageName}"
191+
href="about:firefoxview-next#${this.shortPageName}"
192192
@click=${this.viewAllClicked}
193193
class="view-all-link"
194194
data-l10n-id="firefoxview-view-all-link"

browser/components/firefoxview/firefox-view-tabs-setup-manager.sys.mjs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ function openTabInWindow(window, url) {
5454
switchToTabHavingURI(url, true, {});
5555
}
5656

57+
function isFirefoxViewNext(window) {
58+
return window.location.pathname === "firefoxview-next";
59+
}
60+
5761
export const TabsSetupFlowManager = new (class {
5862
constructor() {
5963
this.QueryInterface = ChromeUtils.generateQI(["nsIObserver"]);
@@ -617,12 +621,10 @@ export const TabsSetupFlowManager = new (class {
617621
);
618622
this.didFxaTabOpen = true;
619623
openTabInWindow(window, url, true);
620-
Services.telemetry.recordEvent(
621-
"firefoxview_next",
622-
"fxa_continue",
623-
"sync",
624-
null
625-
);
624+
const category = isFirefoxViewNext(window)
625+
? "firefoxview_next"
626+
: "firefoxview";
627+
Services.telemetry.recordEvent(category, "fxa_continue", "sync", null);
626628
}
627629

628630
async openFxAPairDevice(window) {
@@ -631,15 +633,12 @@ export const TabsSetupFlowManager = new (class {
631633
});
632634
this.didFxaTabOpen = true;
633635
openTabInWindow(window, url, true);
634-
Services.telemetry.recordEvent(
635-
"firefoxview_next",
636-
"fxa_mobile",
637-
"sync",
638-
null,
639-
{
640-
has_devices: this.secondaryDeviceConnected.toString(),
641-
}
642-
);
636+
const category = isFirefoxViewNext(window)
637+
? "firefoxview_next"
638+
: "firefoxview";
639+
Services.telemetry.recordEvent(category, "fxa_mobile", "sync", null, {
640+
has_devices: this.secondaryDeviceConnected.toString(),
641+
});
643642
}
644643

645644
syncOpenTabs(containerElem) {

browser/components/firefoxview/recentlyclosed.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class RecentlyClosedTabsInView extends ViewPage {
306306
"firefoxview-recentlyclosed-empty-description-two",
307307
];
308308
descriptionLink = {
309-
url: "about:firefoxview#history",
309+
url: "about:firefoxview-next#history",
310310
name: "history-url",
311311
sameTarget: "true",
312312
};

browser/components/firefoxview/syncedtabs.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ class SyncedTabsInView extends ViewPage {
679679
sendTabTelemetry(numTabs) {
680680
/*
681681
Services.telemetry.recordEvent(
682-
"firefoxview_next",
682+
"firefoxview-next",
683683
"synced_tabs",
684684
"tabs",
685685
null,

browser/components/firefoxview/tests/browser/FirefoxViewTestUtils.sys.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ function init(scope) {
1818
}
1919

2020
function getFirefoxViewURL() {
21-
return "about:firefoxview";
21+
return Services.prefs.getBoolPref("browser.tabs.firefox-view-next", true)
22+
? "about:firefoxview-next"
23+
: "about:firefoxview";
2224
}
2325

2426
function assertFirefoxViewTab(win) {

browser/components/firefoxview/tests/browser/firefoxview-next/browser_firefoxview_next.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,36 @@
33

44
/* import-globals-from ../head.js */
55

6+
const FXVIEW_NEXT_ENABLED_PREF = "browser.tabs.firefox-view-next";
67
const FXVIEW_ENABLED_PREF = "browser.tabs.firefox-view";
78

8-
add_task(async function test_aria_roles() {
9+
add_task(async function about_firefoxview_next_pref() {
10+
// Verify pref enables new Firefox view
11+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_NEXT_ENABLED_PREF, true]] });
12+
await withFirefoxView({}, async browser => {
13+
const { document } = browser.contentWindow;
14+
is(document.location.href, "about:firefoxview-next");
15+
});
16+
// Verify pref enables new Firefox view even when old is disabled
17+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_ENABLED_PREF, false]] });
18+
await withFirefoxView({}, async browser => {
19+
const { document } = browser.contentWindow;
20+
is(document.location.href, "about:firefoxview-next");
21+
});
22+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_ENABLED_PREF, true]] });
23+
// Verify pref disables new Firefox view
24+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_NEXT_ENABLED_PREF, false]] });
925
await withFirefoxView({}, async browser => {
1026
const { document } = browser.contentWindow;
1127
is(document.location.href, "about:firefoxview");
28+
});
29+
});
30+
31+
add_task(async function test_aria_roles() {
32+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_NEXT_ENABLED_PREF, true]] });
33+
await withFirefoxView({}, async browser => {
34+
const { document } = browser.contentWindow;
35+
is(document.location.href, "about:firefoxview-next");
1236

1337
is(
1438
document.querySelector("main").getAttribute("role"),
@@ -75,6 +99,12 @@ add_task(async function test_aria_roles() {
7599
"Focus should be on button element of the synced tabs empty state"
76100
);
77101
});
102+
// Verify pref disables new Firefox view
103+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_NEXT_ENABLED_PREF, false]] });
104+
await withFirefoxView({}, async browser => {
105+
const { document } = browser.contentWindow;
106+
is(document.location.href, "about:firefoxview");
107+
});
78108
});
79109

80110
add_task(async function firefoxview_next_icon() {

browser/components/firefoxview/tests/browser/firefoxview-next/browser_firefoxview_next_general_telemetry.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
/* import-globals-from ../head.js */
55

6+
const FXVIEW_NEXT_ENABLED_PREF = "browser.tabs.firefox-view-next";
67
const CARD_COLLAPSED_EVENT = [
78
["firefoxview_next", "card_collapsed", "card_container", undefined],
89
];
@@ -25,6 +26,7 @@ let enteredTelemetry = [
2526
];
2627

2728
add_setup(async () => {
29+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_NEXT_ENABLED_PREF, true]] });
2830
registerCleanupFunction(async () => {
2931
await SpecialPowers.popPrefEnv();
3032
clearHistory();
@@ -37,7 +39,7 @@ add_task(async function firefox_view_entered_telemetry() {
3739
const { document } = browser.contentWindow;
3840
is(
3941
document.location.href,
40-
"about:firefoxview",
42+
"about:firefoxview-next",
4143
"The Recent browsing page is showing."
4244
);
4345
let enteredAndTabSelectedEvents = [tabSelectedTelemetry, enteredTelemetry];
@@ -69,7 +71,7 @@ add_task(async function test_collapse_and_expand_card() {
6971
const { document } = browser.contentWindow;
7072
is(
7173
document.location.href,
72-
"about:firefoxview",
74+
"about:firefoxview-next",
7375
"The Recent browsing page is showing."
7476
);
7577

@@ -111,7 +113,7 @@ add_task(async function test_change_page_telemetry() {
111113
const { document } = browser.contentWindow;
112114
is(
113115
document.location.href,
114-
"about:firefoxview",
116+
"about:firefoxview-next",
115117
"The Recent browsing page is showing."
116118
);
117119
let changePageEvent = [
@@ -150,12 +152,13 @@ add_task(async function test_change_page_telemetry() {
150152
});
151153

152154
add_task(async function test_browser_context_menu_telemetry() {
155+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_NEXT_ENABLED_PREF, true]] });
153156
const menu = document.getElementById("contentAreaContextMenu");
154157
await withFirefoxView({}, async browser => {
155158
const { document } = browser.contentWindow;
156159
is(
157160
document.location.href,
158-
"about:firefoxview",
161+
"about:firefoxview-next",
159162
"The Recent browsing page is showing."
160163
);
161164
await clearAllParentTelemetryEvents();
@@ -206,7 +209,7 @@ add_task(async function test_context_menu_new_window_telemetry() {
206209
const { document } = browser.contentWindow;
207210
is(
208211
document.location.href,
209-
"about:firefoxview",
212+
"about:firefoxview-next",
210213
"The Recent browsing page is showing."
211214
);
212215

@@ -262,7 +265,7 @@ add_task(async function test_context_menu_private_window_telemetry() {
262265
const { document } = browser.contentWindow;
263266
is(
264267
document.location.href,
265-
"about:firefoxview",
268+
"about:firefoxview-next",
266269
"The Recent browsing page is showing."
267270
);
268271

@@ -330,7 +333,7 @@ add_task(async function test_context_menu_delete_from_history_telemetry() {
330333
const { document } = browser.contentWindow;
331334
is(
332335
document.location.href,
333-
"about:firefoxview",
336+
"about:firefoxview-next",
334337
"The Recent browsing page is showing."
335338
);
336339

browser/components/firefoxview/tests/browser/firefoxview-next/browser_firefoxview_next_navigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/* import-globals-from ../head.js */
55

6-
const URL_BASE = "about:firefoxview#";
6+
const URL_BASE = "about:firefoxview-next#";
77

88
function assertCorrectPage(document, name, event) {
99
is(

browser/components/firefoxview/tests/browser/firefoxview-next/browser_history_firefoxview_next.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const SHOW_ALL_HISTORY_EVENT = [
1818
["firefoxview_next", "show_all_history", "tabs", undefined],
1919
];
2020

21+
const FXVIEW_NEXT_ENABLED_PREF = "browser.tabs.firefox-view-next";
2122
const NEVER_REMEMBER_HISTORY_PREF = "browser.privatebrowsing.autostart";
2223
const DAY_MS = 24 * 60 * 60 * 1000;
2324
const today = new Date();
@@ -152,7 +153,10 @@ async function addHistoryItems(dateAdded) {
152153

153154
add_setup(async () => {
154155
await SpecialPowers.pushPrefEnv({
155-
set: [["browser.firefox-view.search.enabled", true]],
156+
set: [
157+
[FXVIEW_NEXT_ENABLED_PREF, true],
158+
["browser.firefox-view.search.enabled", true],
159+
],
156160
});
157161
registerCleanupFunction(async () => {
158162
await SpecialPowers.popPrefEnv();
@@ -170,7 +174,7 @@ add_task(async function test_list_ordering() {
170174
await addHistoryItems(oneMonthAgo);
171175
await withFirefoxView({}, async browser => {
172176
const { document } = browser.contentWindow;
173-
is(document.location.href, "about:firefoxview");
177+
is(document.location.href, "about:firefoxview-next");
174178

175179
await navigateToCategoryAndWait(document, "history");
176180

@@ -264,7 +268,7 @@ add_task(async function test_empty_states() {
264268
await PlacesUtils.history.clear();
265269
await withFirefoxView({}, async browser => {
266270
const { document } = browser.contentWindow;
267-
is(document.location.href, "about:firefoxview");
271+
is(document.location.href, "about:firefoxview-next");
268272

269273
await navigateToCategoryAndWait(document, "history");
270274

@@ -402,7 +406,7 @@ add_task(async function test_show_all_history_telemetry() {
402406
await addHistoryItems(oneMonthAgo);
403407
await withFirefoxView({}, async browser => {
404408
const { document } = browser.contentWindow;
405-
is(document.location.href, "about:firefoxview");
409+
is(document.location.href, "about:firefoxview-next");
406410

407411
await navigateToCategoryAndWait(document, "history");
408412

0 commit comments

Comments
 (0)