diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/accessible/ipc/RemoteAccessibleBase.cpp firefox-trunk-111.0~a1~hg20230206r651831/accessible/ipc/RemoteAccessibleBase.cpp --- firefox-trunk-111.0~a1~hg20230203r651602/accessible/ipc/RemoteAccessibleBase.cpp 2023-02-03 07:17:35.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/accessible/ipc/RemoteAccessibleBase.cpp 2023-02-06 09:50:59.000000000 +0000 @@ -557,6 +557,7 @@ template bool RemoteAccessibleBase::IsFixedPos() const { + MOZ_ASSERT(mCachedFields); if (auto maybePosition = mCachedFields->GetAttribute>(nsGkAtoms::position)) { return *maybePosition == nsGkAtoms::fixed; @@ -640,12 +641,13 @@ bounds.MoveBy(remoteBounds.X(), remoteBounds.Y()); Unused << remoteAcc->ApplyTransform(bounds, remoteBounds); } + + if (remoteAcc->IsFixedPos()) { + encounteredFixedContainer = true; + } + // we can't just break here if we're scroll suppressed because we still + // need to find the top doc. } - if (remoteAcc->IsFixedPos()) { - encounteredFixedContainer = true; - } - // we can't just break here if we're scroll suppressed because we still - // need to find the top doc acc = acc->Parent(); } diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/base/content/test/about/browser_aboutNetError_trr.js firefox-trunk-111.0~a1~hg20230206r651831/browser/base/content/test/about/browser_aboutNetError_trr.js --- firefox-trunk-111.0~a1~hg20230203r651602/browser/base/content/test/about/browser_aboutNetError_trr.js 1970-01-01 00:00:00.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/base/content/test/about/browser_aboutNetError_trr.js 2023-02-06 09:50:59.000000000 +0000 @@ -0,0 +1,67 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +let oldProxyType = Services.prefs.getIntPref("network.proxy.type"); +function resetPrefs() { + Services.prefs.clearUserPref("network.trr.mode"); + Services.prefs.clearUserPref("network.dns.native-is-localhost"); + Services.prefs.setIntPref("network.proxy.type", oldProxyType); +} + +// This test makes sure that the Add exception button only shows up +// when the skipReason indicates that the domain could not be resolved. +// If instead there is a problem with the TRR connection, then we don't +// show the exception button. +add_task(async function exceptionButtonTRROnly() { + Services.prefs.setBoolPref("network.dns.native-is-localhost", true); + Services.prefs.setIntPref("network.trr.mode", Ci.nsIDNSService.MODE_TRRONLY); + // We need to disable proxy, otherwise TRR isn't used for name resolution. + Services.prefs.setIntPref("network.proxy.type", 0); + registerCleanupFunction(resetPrefs); + + let browser; + let pageLoaded; + await BrowserTestUtils.openNewForegroundTab( + gBrowser, + () => { + gBrowser.selectedTab = BrowserTestUtils.addTab( + gBrowser, + "https://does-not-exist.test" + ); + browser = gBrowser.selectedBrowser; + pageLoaded = BrowserTestUtils.waitForErrorPage(browser); + }, + false + ); + + info("Loading and waiting for the net error"); + await pageLoaded; + + await SpecialPowers.spawn(browser, [], function() { + const doc = content.document; + ok( + doc.documentURI.startsWith("about:neterror"), + "Should be showing error page" + ); + + const titleEl = doc.querySelector(".title-text"); + const actualDataL10nID = titleEl.getAttribute("data-l10n-id"); + is( + actualDataL10nID, + "dns-not-found-trr-only-title", + "Correct error page title is set" + ); + + let trrExceptionButton = doc.getElementById("trrExceptionButton"); + Assert.equal( + trrExceptionButton.hidden, + true, + "Exception button should be hidden for TRR service failures" + ); + }); + + BrowserTestUtils.removeTab(gBrowser.selectedTab); + resetPrefs(); +}); diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/base/content/test/about/browser.ini firefox-trunk-111.0~a1~hg20230206r651831/browser/base/content/test/about/browser.ini --- firefox-trunk-111.0~a1~hg20230203r651602/browser/base/content/test/about/browser.ini 2023-02-03 07:17:35.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/base/content/test/about/browser.ini 2023-02-06 09:50:59.000000000 +0000 @@ -20,7 +20,10 @@ [browser_aboutHome_search_composing.js] [browser_aboutHome_search_searchbar.js] [browser_aboutHome_search_suggestion.js] -skip-if = os == "mac" || (os == "linux" && (!debug || bits == 64)) || (os == 'win' && os_version == '10.0' && bits == 64 && !debug) # Bug 1399648, bug 1402502 +skip-if = + os == "mac" + os == "linux" && (!debug || bits == 64) + os == 'win' && os_version == '10.0' && bits == 64 && !debug # Bug 1399648, bug 1402502 [browser_aboutHome_search_telemetry.js] [browser_aboutNetError.js] [browser_aboutNetError_csp_iframe.js] @@ -33,6 +36,9 @@ support-files = iframe_page_xfo.html xfo_iframe.sjs +[browser_aboutNetError_trr.js] +skip-if = + socketprocess_networking [browser_aboutNewTab_bookmarksToolbar.js] [browser_aboutNewTab_bookmarksToolbarEmpty.js] skip-if = tsan # Bug 1676326, highly frequent on TSan diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/base/content/test/contextMenu/browser_contextmenu_badiframe.js firefox-trunk-111.0~a1~hg20230206r651831/browser/base/content/test/contextMenu/browser_contextmenu_badiframe.js --- firefox-trunk-111.0~a1~hg20230203r651602/browser/base/content/test/contextMenu/browser_contextmenu_badiframe.js 2023-02-03 07:17:35.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/base/content/test/contextMenu/browser_contextmenu_badiframe.js 2023-02-06 09:50:59.000000000 +0000 @@ -14,34 +14,44 @@ '">'; async function openTestPage() { - // Waiting for the error page to load in the subframe - await BrowserTestUtils.openNewForegroundTab(gBrowser, testPage, true, true); - await BrowserTestUtils.waitForCondition(() => { - return ( - gBrowser.selectedBrowser.browsingContext.children[1].currentWindowGlobal - .documentURI.spec != "about:blank" - ); - }); - - await SpecialPowers.spawn( - gBrowser.selectedBrowser.browsingContext.children[1], - [], - () => { - if (!content.document.body.classList.length) { - return new Promise(resolve => { - content.addEventListener( - "AboutNetErrorLoad", - () => { - resolve(); - }, - { once: true } - ); - }); - } + let tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "about:blank", + true, + true + ); + let browser = tab.linkedBrowser; - return undefined; - } + // The test page has a top-level document and two subframes. One of + // those subframes is an error page, which doesn't fire a load event. + // We'll use BrowserTestUtils.browserLoaded and have it wait for all + // 3 loads before resolving. + let expectedLoads = 3; + let pageAndIframesLoaded = BrowserTestUtils.browserLoaded( + browser, + true /* includeSubFrames */, + url => { + expectedLoads--; + return !expectedLoads; + }, + true /* maybeErrorPage */ ); + BrowserTestUtils.loadURIString(browser, testPage); + await pageAndIframesLoaded; + + // Make sure both the top-level document and the iframe documents have + // had a chance to present. We need this so that the context menu event + // gets dispatched properly. + for (let bc of [ + ...browser.browsingContext.children, + browser.browsingContext, + ]) { + await SpecialPowers.spawn(bc, [], async function() { + await new Promise(resolve => { + content.requestAnimationFrame(resolve); + }); + }); + } } async function selectFromFrameMenu(frameNumber, menuId) { @@ -74,7 +84,17 @@ frameItem.openMenu(true); await subPopupShownPromise; + let subPopupHiddenPromise = BrowserTestUtils.waitForEvent( + framePopup, + "popuphidden" + ); + let contextMenuHiddenPromise = BrowserTestUtils.waitForEvent( + contextMenu, + "popuphidden" + ); contextMenu.activateItem(document.getElementById(menuId)); + await subPopupHiddenPromise; + await contextMenuHiddenPromise; } add_task(async function testOpenFrame() { @@ -113,7 +133,11 @@ info("open frame in tab for " + expectedResultURI); - let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, null, false); + let newTabPromise = BrowserTestUtils.waitForNewTab( + gBrowser, + expectedResultURI, + false + ); await selectFromFrameMenu(frameNumber, "context-openframeintab"); let newTab = await newTabPromise; diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/base/content/test/performance/browser_preferences_usage.js firefox-trunk-111.0~a1~hg20230206r651831/browser/base/content/test/performance/browser_preferences_usage.js --- firefox-trunk-111.0~a1~hg20230203r651602/browser/base/content/test/performance/browser_preferences_usage.js 2023-02-03 07:17:35.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/base/content/test/performance/browser_preferences_usage.js 2023-02-06 09:50:59.000000000 +0000 @@ -190,13 +190,6 @@ }, }; - if (AppConstants.NIGHTLY_BUILD) { - knownProblematicPrefs["toolkit.telemetry.cachedClientID"] = { - // Bug 1712391: Only an issue in tests where pref is not populated early on - // in startup. Code path is only accessed in Nightly builds. - }; - } - if (SpecialPowers.useRemoteSubframes) { // We access this when considering starting a new content process. // Because there is no complete list of content process types, diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/components/BrowserGlue.sys.mjs firefox-trunk-111.0~a1~hg20230206r651831/browser/components/BrowserGlue.sys.mjs --- firefox-trunk-111.0~a1~hg20230203r651602/browser/components/BrowserGlue.sys.mjs 2023-02-03 07:17:35.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/components/BrowserGlue.sys.mjs 2023-02-06 09:50:59.000000000 +0000 @@ -4396,6 +4396,7 @@ id: data?.id || "ABOUT_WELCOME_MODAL", backdrop: data?.backdrop, screens: data?.screens, + UTMTerm: data?.UTMTerm, }, }, }; diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/components/newtab/aboutwelcome/lib/AboutWelcomeTelemetry.jsm firefox-trunk-111.0~a1~hg20230206r651831/browser/components/newtab/aboutwelcome/lib/AboutWelcomeTelemetry.jsm --- firefox-trunk-111.0~a1~hg20230203r651602/browser/components/newtab/aboutwelcome/lib/AboutWelcomeTelemetry.jsm 2023-02-03 07:17:36.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/components/newtab/aboutwelcome/lib/AboutWelcomeTelemetry.jsm 2023-02-06 09:50:59.000000000 +0000 @@ -110,7 +110,8 @@ const ping = await this._createPing(event); this.pingCentre.sendStructuredIngestionPing( ping, - this._generateStructuredIngestionEndpoint() + this._generateStructuredIngestionEndpoint(), + STRUCTURED_INGESTION_NAMESPACE_MS ); } } diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/components/newtab/lib/OnboardingMessageProvider.jsm firefox-trunk-111.0~a1~hg20230206r651831/browser/components/newtab/lib/OnboardingMessageProvider.jsm --- firefox-trunk-111.0~a1~hg20230203r651602/browser/components/newtab/lib/OnboardingMessageProvider.jsm 2023-02-03 07:17:36.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/components/newtab/lib/OnboardingMessageProvider.jsm 2023-02-06 09:50:59.000000000 +0000 @@ -926,6 +926,7 @@ layout: "icon_and_message", icon: "chrome://browser/skin/controlcenter/3rdpartycookies.svg", icon_class: "cfr-doorhanger-small-icon", + persistent_doorhanger: true, heading_text: { string_id: "cfr-cookiebanner-header", }, @@ -968,6 +969,9 @@ }, }, }, + { + type: "RELOAD_BROWSER", + }, ], }, }, diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/components/newtab/lib/TelemetryFeed.jsm firefox-trunk-111.0~a1~hg20230206r651831/browser/components/newtab/lib/TelemetryFeed.jsm --- firefox-trunk-111.0~a1~hg20230203r651602/browser/components/newtab/lib/TelemetryFeed.jsm 2023-02-03 07:17:36.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/components/newtab/lib/TelemetryFeed.jsm 2023-02-06 09:50:59.000000000 +0000 @@ -840,7 +840,8 @@ if (this.telemetryEnabled) { this.pingCentre.sendStructuredIngestionPing( eventObject, - this._generateStructuredIngestionEndpoint(namespace, pingType, version) + this._generateStructuredIngestionEndpoint(namespace, pingType, version), + namespace ); } } diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_experimentAPI.js firefox-trunk-111.0~a1~hg20230206r651831/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_experimentAPI.js --- firefox-trunk-111.0~a1~hg20230203r651602/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_experimentAPI.js 2023-02-03 07:17:36.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_experimentAPI.js 2023-02-06 09:50:59.000000000 +0000 @@ -522,3 +522,76 @@ await doExperimentCleanup(); }); + +add_task(async function test_multistage_aboutwelcome_utm_term() { + const sandbox = sinon.createSandbox(); + + const TEST_CONTENT = [ + { + id: "TEST_SCREEN", + content: { + position: "split", + logo: {}, + title: "test", + secondary_button_top: { + label: "test", + style: "link", + action: { + type: "OPEN_URL", + data: { + args: "https://www.mozilla.org/", + }, + }, + }, + }, + }, + ]; + await setAboutWelcomePref(true); + await ExperimentAPI.ready(); + + const doExperimentCleanup = await ExperimentFakes.enrollWithFeatureConfig({ + featureId: "aboutwelcome", + value: { + id: "my-mochitest-experiment", + screens: TEST_CONTENT, + UTMTerm: "test", + }, + }); + + const tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "about:welcome", + true + ); + + const browser = tab.linkedBrowser; + const aboutWelcomeActor = await getAboutWelcomeParent(browser); + + sandbox.stub(aboutWelcomeActor, "onContentMessage"); + + await onButtonClick(browser, "button[value='secondary_button_top']"); + + let actionCall; + + const { callCount } = aboutWelcomeActor.onContentMessage; + for (let i = 0; i < callCount; i++) { + const call = aboutWelcomeActor.onContentMessage.getCall(i); + info(`Call #${i}: ${call.args[0]} ${JSON.stringify(call.args[1])}`); + if (call.calledWithMatch("SPECIAL")) { + actionCall = call; + } + } + + Assert.equal( + actionCall.args[1].data.args, + "https://www.mozilla.org/?utm_source=activity-stream&utm_campaign=firstrun&utm_medium=referral&utm_term=aboutwelcome-test-screen", + "UTMTerm set in mobile" + ); + + registerCleanupFunction(() => { + sandbox.restore(); + BrowserTestUtils.removeTab(tab); + }); + + await doExperimentCleanup(); +}); diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/components/places/tests/browser/browser_bookmark_change_location.js firefox-trunk-111.0~a1~hg20230206r651831/browser/components/places/tests/browser/browser_bookmark_change_location.js --- firefox-trunk-111.0~a1~hg20230203r651602/browser/components/places/tests/browser/browser_bookmark_change_location.js 2023-02-03 07:17:35.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/components/places/tests/browser/browser_bookmark_change_location.js 2023-02-06 09:50:59.000000000 +0000 @@ -102,6 +102,9 @@ "InstantEditBookmark: The location is the expected one." ); + // To check whether the lastModified field will be updated correctly. + let lastModified = _getLastModified(toolbarBookmark.guid); + let promiseLocationChange = PlacesTestUtils.waitForNotification( "bookmark-url-changed", events => events.some(e => e.url === TEST_URL2), @@ -120,11 +123,17 @@ ); locationPicker.blur(); await promiseLocationChange; + Assert.equal( dialogWin.gEditItemOverlay.uri.spec, TEST_URL2, "InstantEditBookmark: The location is the expected one." ); + await TestUtils.waitForCondition( + () => _getLastModified(toolbarBookmark.guid) > lastModified, + "InstantEditBookmark: The lastModified will be greater than before updating." + ); + locationPicker.focus(); // Confirm and close the dialog. EventUtils.synthesizeKey("VK_RETURN", {}, dialogWin); @@ -176,6 +185,9 @@ "EditBookmark: The current location is the expected one." ); + // To check whether the lastModified field will be updated correctly. + let lastModified = _getLastModified(toolbarBookmark.guid); + // Update the "location" field. fillBookmarkTextField( "editBMPanel_locationField", @@ -195,6 +207,11 @@ locationPicker.focus(); // Confirm and close the dialog. EventUtils.synthesizeKey("VK_RETURN", {}, dialogWin); + + await TestUtils.waitForCondition( + () => _getLastModified(toolbarBookmark.guid) > lastModified, + "EditBookmark: The lastModified will be greater than before updating." + ); } ); @@ -232,6 +249,9 @@ "Sidebar - InstantEditBookmark: The current location is the expected one." ); + // To check whether the lastModified field will be updated correctly. + let lastModified = _getLastModified(bm.guid); + let promiseLocationChange = PlacesTestUtils.waitForNotification( "bookmark-url-changed", events => events.some(e => e.url === TEST_URL3), @@ -254,6 +274,11 @@ EventUtils.synthesizeKey("VK_RETURN", {}, dialogWin); await promiseLocationChange; + await TestUtils.waitForCondition( + () => _getLastModified(bm.guid) > lastModified, + "Sidebar - InstantEditBookmark: The lastModified will be greater than before updating." + ); + let updatedBm = await PlacesUtils.bookmarks.fetch(bm.guid); Assert.equal( updatedBm.url, @@ -285,13 +310,15 @@ let locationPicker = dialogWin.document.getElementById( "editBMPanel_locationField" ); - Assert.equal( locationPicker.value, TEST_URL3, "Sidebar - EditBookmark: The current location is the expected one." ); + // To check whether the lastModified field will be updated correctly. + let lastModified = _getLastModified(bm.guid); + // Update the "location" field. fillBookmarkTextField( "editBMPanel_locationField", @@ -308,6 +335,11 @@ // Confirm and close the dialog. EventUtils.synthesizeKey("VK_RETURN", {}, dialogWin); + + await TestUtils.waitForCondition( + () => _getLastModified(bm.guid) > lastModified, + "Sidebar - EditBookmark: The lastModified will be greater than before updating." + ); } ); @@ -320,3 +352,22 @@ }); }); }); + +function _getLastModified(guid) { + const toolbarNode = PlacesUtils.getFolderContents( + PlacesUtils.bookmarks.toolbarGuid + ).root; + + try { + for (let i = 0; i < toolbarNode.childCount; i++) { + const node = toolbarNode.getChild(i); + if (node.bookmarkGuid === guid) { + return node.lastModified; + } + } + + throw new Error(`Node for ${guid} was not found`); + } finally { + toolbarNode.containerOpen = false; + } +} diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/components/places/tests/browser/browser_library_new_bookmark.js firefox-trunk-111.0~a1~hg20230206r651831/browser/components/places/tests/browser/browser_library_new_bookmark.js --- firefox-trunk-111.0~a1~hg20230203r651602/browser/components/places/tests/browser/browser_library_new_bookmark.js 2023-02-03 07:17:36.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/components/places/tests/browser/browser_library_new_bookmark.js 2023-02-06 09:50:59.000000000 +0000 @@ -76,6 +76,8 @@ "places" ); + let beforeUpdatedPRTime = Date.now() * 1000; + fillBookmarkTextField( "editBMPanel_locationField", "https://example4.com/", @@ -93,6 +95,11 @@ "https://example4.com/", "InstantEditBookmark: Should have selected the newly created bookmark" ); + Assert.greater( + node.lastModified, + beforeUpdatedPRTime, + "InstantEditBookmark: The lastModified should be greater than the time of before updating" + ); } ); await PlacesUtils.bookmarks.eraseEverything(); @@ -124,6 +131,7 @@ library.ContentTree.view.selectNode(bmLibrary); + let beforeUpdatedPRTime; await withBookmarksDialog( false, async () => { @@ -145,6 +153,8 @@ placesContext.activateItem(properties, {}); }, async dialogWin => { + beforeUpdatedPRTime = Date.now() * 1000; + fillBookmarkTextField( "editBMPanel_locationField", "https://example4.com/", @@ -162,5 +172,10 @@ "https://example4.com/", "EditBookmark: Should have selected the newly created bookmark" ); + Assert.greater( + node.lastModified, + beforeUpdatedPRTime, + "EditBookmark: The lastModified should be greater than the time of before updating" + ); await PlacesUtils.bookmarks.eraseEverything(); }); diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/components/pocket/content/pktTelemetry.jsm firefox-trunk-111.0~a1~hg20230206r651831/browser/components/pocket/content/pktTelemetry.jsm --- firefox-trunk-111.0~a1~hg20230203r651602/browser/components/pocket/content/pktTelemetry.jsm 2023-02-03 07:17:36.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/components/pocket/content/pktTelemetry.jsm 2023-02-06 09:50:59.000000000 +0000 @@ -119,7 +119,8 @@ sendStructuredIngestionEvent(eventObject) { lazy.pingCentre.sendStructuredIngestionPing( eventObject, - this._generateStructuredIngestionEndpoint() + this._generateStructuredIngestionEndpoint(), + STRUCTURED_INGESTION_NAMESPACE_AS ); }, }; diff -Nru firefox-trunk-111.0~a1~hg20230203r651602/browser/components/preferences/dialogs/fonts.xhtml firefox-trunk-111.0~a1~hg20230206r651831/browser/components/preferences/dialogs/fonts.xhtml --- firefox-trunk-111.0~a1~hg20230203r651602/browser/components/preferences/dialogs/fonts.xhtml 2023-02-03 07:17:36.000000000 +0000 +++ firefox-trunk-111.0~a1~hg20230206r651831/browser/components/preferences/dialogs/fonts.xhtml 2023-02-06 09:50:59.000000000 +0000 @@ -135,10 +135,10 @@