diff --git a/browser/actors/moz.build b/browser/actors/moz.build index 87ba6ef0c2a81..34f274a453e73 100644 --- a/browser/actors/moz.build +++ b/browser/actors/moz.build @@ -23,7 +23,7 @@ with Files("PageStyleChild.jsm"): BUG_COMPONENT = ("Firefox", "Menus") with Files("PluginChild.jsm"): - BUG_COMPONENT = ("Core", "Plug-ins") + BUG_COMPONENT = ("Core", "Audio/Video: GMP") with Files("ScreenshotsComponentChild.jsm"): BUG_COMPONENT = ("Firefox", "Screenshots") diff --git a/browser/base/content/browser-box.inc.xhtml b/browser/base/content/browser-box.inc.xhtml index 2c8edad944b52..ae5b1979921a9 100644 --- a/browser/base/content/browser-box.inc.xhtml +++ b/browser/base/content/browser-box.inc.xhtml @@ -5,20 +5,16 @@ diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css index ec0a85c6dcabb..7dc9b08af57a1 100644 --- a/browser/base/content/browser.css +++ b/browser/base/content/browser.css @@ -32,8 +32,21 @@ body { min-width: -moz-fit-content; } -/* Prevent shrinking the page content to 0 height and width */ +/* We set large flex on both containers to allow the devtools toolbox to + * set a flex value itself. We don't want the toolbox to actually take up free + * space, but we do want it to collapse when the window shrinks, and with + * flex: 0 it can't. + * + * When the toolbox is on the bottom it's a sibling of browserStack, and when + * it's on the side it's a sibling of browserContainer. + */ +.browserContainer { + -moz-box-flex: 10000; +} + .browserStack { + -moz-box-flex: 10000; + /* Prevent shrinking the page content to 0 height and width */ min-height: 25px; min-width: 25px; } diff --git a/browser/base/content/moz.build b/browser/base/content/moz.build index 84cd0211ec0dc..9ed93b95e353b 100644 --- a/browser/base/content/moz.build +++ b/browser/base/content/moz.build @@ -56,7 +56,7 @@ with Files("test/permissions/**"): BUG_COMPONENT = ("Firefox", "Site Permissions") with Files("test/plugins/**"): - BUG_COMPONENT = ("Core", "Plug-ins") + BUG_COMPONENT = ("Core", "Audio/Video: GMP") with Files("test/popupNotifications/**"): BUG_COMPONENT = ("Toolkit", "Notifications and Alerts") diff --git a/browser/base/content/navigator-toolbox.inc.xhtml b/browser/base/content/navigator-toolbox.inc.xhtml index 0bc1ec3603d0e..3873365655f40 100644 --- a/browser/base/content/navigator-toolbox.inc.xhtml +++ b/browser/base/content/navigator-toolbox.inc.xhtml @@ -155,7 +155,7 @@ - @@ -654,7 +654,6 @@ class="chromeclass-toolbar-additional" data-l10n-id="navbar-search" align="center" - flex="175" persist="width"> diff --git a/browser/base/content/pageinfo/pageInfo.js b/browser/base/content/pageinfo/pageInfo.js index 86adb7b7fb6c6..f94caf043cecf 100644 --- a/browser/base/content/pageinfo/pageInfo.js +++ b/browser/base/content/pageinfo/pageInfo.js @@ -833,17 +833,17 @@ function onImageSelect() { previewBox.collapsed = true; mediaSaveBox.collapsed = true; splitter.collapsed = true; - tree.flex = 1; + tree.setAttribute("flex", "1"); } else if (count > 1) { splitter.collapsed = true; previewBox.collapsed = true; mediaSaveBox.collapsed = false; - tree.flex = 1; + tree.setAttribute("flex", "1"); } else { mediaSaveBox.collapsed = true; splitter.collapsed = false; previewBox.collapsed = false; - tree.flex = 0; + tree.setAttribute("flex", "0"); makePreview(getSelectedRows(tree)[0]); } } diff --git a/browser/base/content/pageinfo/pageInfo.xhtml b/browser/base/content/pageinfo/pageInfo.xhtml index 4fe7f49091805..7cf284a384832 100644 --- a/browser/base/content/pageinfo/pageInfo.xhtml +++ b/browser/base/content/pageinfo/pageInfo.xhtml @@ -152,11 +152,11 @@ @@ -172,23 +172,23 @@ - - - diff --git a/browser/base/content/tabbrowser.js b/browser/base/content/tabbrowser.js index 8989f91c60809..898fe40a36244 100644 --- a/browser/base/content/tabbrowser.js +++ b/browser/base/content/tabbrowser.js @@ -2161,22 +2161,14 @@ let notificationbox = document.createXULElement("notificationbox"); notificationbox.setAttribute("notificationside", "top"); - // We set large flex on both containers to allow the devtools toolbox to - // set a flex attribute. We don't want the toolbox to actually take up free - // space, but we do want it to collapse when the window shrinks, and with - // flex=0 it can't. When the toolbox is on the bottom it's a sibling of - // browserStack, and when it's on the side it's a sibling of - // browserContainer. let stack = document.createXULElement("stack"); stack.className = "browserStack"; stack.appendChild(b); - stack.setAttribute("flex", "10000"); let browserContainer = document.createXULElement("vbox"); browserContainer.className = "browserContainer"; browserContainer.appendChild(notificationbox); browserContainer.appendChild(stack); - browserContainer.setAttribute("flex", "10000"); let browserSidebarContainer = document.createXULElement("hbox"); browserSidebarContainer.className = "browserSidebarContainer"; diff --git a/browser/components/BrowserGlue.jsm b/browser/components/BrowserGlue.jsm index 7775f66a56b76..d727eefd18ac5 100644 --- a/browser/components/BrowserGlue.jsm +++ b/browser/components/BrowserGlue.jsm @@ -4130,50 +4130,6 @@ BrowserGlue.prototype = { lazy.UrlbarPrefs.migrateResultGroups(); } - if (currentUIVersion < 119 && AppConstants.NIGHTLY_BUILD) { - // Uninstall outdated monochromatic themes for the following UI versions: - // 118: Uninstall prototype monochromatic purple theme. - // 119 (bug 1732957): Uninstall themes with old IDs. - const themeIdsToMigrate = [ - "firefox-monochromatic-purple@mozilla.org", - "firefox-lush-soft@mozilla.org", - "firefox-lush-balanced@mozilla.org", - "firefox-lush-bold@mozilla.org", - "firefox-abstract-soft@mozilla.org", - "firefox-abstract-balanced@mozilla.org", - "firefox-abstract-bold@mozilla.org", - "firefox-elemental-soft@mozilla.org", - "firefox-elemental-balanced@mozilla.org", - "firefox-elemental-bold@mozilla.org", - "firefox-cheers-soft@mozilla.org", - "firefox-cheers-balanced@mozilla.org", - "firefox-cheers-bold@mozilla.org", - "firefox-graffiti-soft@mozilla.org", - "firefox-graffiti-balanced@mozilla.org", - "firefox-graffiti-bold@mozilla.org", - "firefox-foto-soft@mozilla.org", - "firefox-foto-balanced@mozilla.org", - "firefox-foto-bold@mozilla.org", - ]; - try { - for (let id of themeIdsToMigrate) { - lazy.AddonManager.getAddonByID(id).then(addon => { - if (!addon) { - // Either the addon wasn't installed, or the call to getAddonByID failed. - return; - } - addon.uninstall().catch(Cu.reportError); - }, Cu.reportError); - } - } catch (error) { - Cu.reportError( - "Could not access the AddonManager to upgrade the profile. This is most " + - "likely because the upgrader is being run from an xpcshell test where " + - "the AddonManager is not initialized." - ); - } - } - if (currentUIVersion < 120) { // Migrate old titlebar bool pref to new int-based one. const oldPref = "browser.tabs.drawInTitlebar"; diff --git a/browser/components/firefoxview/featureCallout.mjs b/browser/components/firefoxview/featureCallout.mjs index 274f650cda285..eaa8bab8af061 100644 --- a/browser/components/firefoxview/featureCallout.mjs +++ b/browser/components/firefoxview/featureCallout.mjs @@ -247,6 +247,12 @@ function _positionCallout() { function clearPosition() { positions.forEach(position => { container.style[position] = "unset"; + if (container.classList.contains(`arrow-${position}`)) { + container.classList.remove(`arrow-${position}`); + } + if (container.classList.contains(`arrow-inline-${position}`)) { + container.classList.remove(`arrow-inline-${position}`); + } }); } @@ -270,6 +276,7 @@ function _positionCallout() { containerTop )}px`; centerHorizontally(container, parentEl); + container.classList.add("arrow-top"); }, // Point to an element below the callout bottom() { @@ -277,6 +284,7 @@ function _positionCallout() { getOffset(parentEl).top - container.clientHeight + margin; container.style.top = `${Math.max(containerTop, 0)}px`; centerHorizontally(container, parentEl); + container.classList.add("arrow-bottom"); }, // Point to an element to the right of the callout left() { @@ -286,6 +294,7 @@ function _positionCallout() { containerLeft )}px`; container.style.top = `${getOffset(parentEl).top}px`; + container.classList.add("arrow-inline-start"); }, // Point to an element to the left of the callout right() { @@ -293,11 +302,16 @@ function _positionCallout() { getOffset(parentEl).left - container.offsetWidth + margin; container.style.left = `${Math.max(containerLeft, margin)}px`; container.style.top = `${getOffset(parentEl).top}px`; + container.classList.add("arrow-inline-end"); }, }; clearPosition(container); + if (!container.classList.contains("callout-arrow")) { + container.classList.add("callout-arrow"); + } + if (["start", "end"].includes(arrowPosition)) { if (RTL) { positioners[arrowPosition === "start" ? "right" : "left"](); diff --git a/browser/components/firefoxview/tests/browser/browser_feature_callout.js b/browser/components/firefoxview/tests/browser/browser_feature_callout.js index b9248cc0d602a..fa8ab12261b5e 100644 --- a/browser/components/firefoxview/tests/browser/browser_feature_callout.js +++ b/browser/components/firefoxview/tests/browser/browser_feature_callout.js @@ -415,3 +415,62 @@ add_task(async function feature_callout_only_highlights_existing_elements() { } ); }); + +add_task(async function feature_callout_arrow_class_exists() { + await SpecialPowers.pushPrefEnv({ + set: [ + ["browser.firefox-view.feature-tour", "{}"], + ["intl.l10n.pseudo", ""], + ], + }); + + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: "about:firefoxview", + }, + async browser => { + const { document } = browser.contentWindow; + + await waitForCalloutRender(document); + await waitForCalloutPositioned(document); + + const arrowParent = document.querySelector(".callout-arrow.arrow-top"); + ok(arrowParent, "Arrow class exists on parent container"); + } + ); +}); + +add_task(async function feature_callout_arrow_is_not_flipped_on_ltr() { + await SpecialPowers.pushPrefEnv({ + set: [ + ["browser.firefox-view.feature-tour", "{}"], + ["intl.l10n.pseudo", ""], + ], + }); + + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: "about:firefoxview", + }, + async browser => { + const { document } = browser.contentWindow; + + await waitForCalloutRender(document); + await waitForCalloutPositioned(document); + // Advance to third screen + clickPrimaryButton(document); + await waitForCalloutScreen(document, ".FEATURE_CALLOUT_2"); + clickPrimaryButton(document); + await waitForCalloutScreen(document, ".FEATURE_CALLOUT_3"); + let arrowParent = document.querySelector( + ".callout-arrow.arrow-inline-end" + ); + ok( + arrowParent, + "Feature Callout arrow parent has arrow-end class when arrow direction is set to 'end'" + ); + } + ); +}); diff --git a/browser/components/newtab/aboutwelcome/content/aboutwelcome.css b/browser/components/newtab/aboutwelcome/content/aboutwelcome.css index 8927b37378b5a..4c3a87fb9a985 100644 --- a/browser/components/newtab/aboutwelcome/content/aboutwelcome.css +++ b/browser/components/newtab/aboutwelcome/content/aboutwelcome.css @@ -37,6 +37,9 @@ input { .onboardingContainer.featureCallout, .onboardingContainer.featureCallout .outer-wrapper { height: auto; } +.onboardingContainer.featureCallout .screen:dir(rtl) { + transform: none; +} .onboardingContainer.featureCallout .screen[pos=callout] { z-index: 2147483646; height: fit-content; @@ -106,6 +109,57 @@ input { .onboardingContainer.featureCallout .screen[pos=callout] .action-buttons .secondary-cta { float: inline-end; } +.onboardingContainer.featureCallout.callout-arrow::before, .onboardingContainer.featureCallout.callout-arrow::after { + content: ""; + position: absolute; + width: 24px; + height: 24px; + transform: rotate(45deg); +} +.onboardingContainer.featureCallout.callout-arrow:dir(rtl)::before, .onboardingContainer.featureCallout.callout-arrow:dir(rtl)::after { + transform: rotate(315deg); +} +.onboardingContainer.featureCallout.callout-arrow::before { + background-color: var(--in-content-page-background); + z-index: 2147483647; +} +.onboardingContainer.featureCallout.callout-arrow::after { + background: transparent; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); + z-index: -1; +} +.onboardingContainer.featureCallout.arrow-top::before, .onboardingContainer.featureCallout.arrow-top::after { + top: -12px; + inset-inline-start: calc(50% - 12px); +} +.onboardingContainer.featureCallout.arrow-top::before { + border-top: 1px solid #CFCFD8; + border-inline-start: 1px solid #CFCFD8; +} +.onboardingContainer.featureCallout.arrow-bottom::before, .onboardingContainer.featureCallout.arrow-bottom::after { + top: calc(100% - 12px); + inset-inline-start: calc(50% - 12px); +} +.onboardingContainer.featureCallout.arrow-bottom::before { + border-inline-end: 1px solid #CFCFD8; + border-bottom: 1px solid #CFCFD8; +} +.onboardingContainer.featureCallout.arrow-inline-end::before, .onboardingContainer.featureCallout.arrow-inline-end::after { + top: calc(50% - 12px); + inset-inline-start: calc(100% - 12px); +} +.onboardingContainer.featureCallout.arrow-inline-end::before { + border-top: 1px solid #CFCFD8; + border-inline-end: 1px solid #CFCFD8; +} +.onboardingContainer.featureCallout.arrow-inline-start::before, .onboardingContainer.featureCallout.arrow-inline-start::after { + top: calc(50% - 12px); + inset-inline-start: -12px; +} +.onboardingContainer.featureCallout.arrow-inline-start::before { + border-bottom: 1px solid #CFCFD8; + border-inline-start: 1px solid #CFCFD8; +} html { height: 100%; diff --git a/browser/components/newtab/content-src/styles/_feature-callout.scss b/browser/components/newtab/content-src/styles/_feature-callout.scss index d391b4f453389..efad07a61f717 100644 --- a/browser/components/newtab/content-src/styles/_feature-callout.scss +++ b/browser/components/newtab/content-src/styles/_feature-callout.scss @@ -5,11 +5,17 @@ $max-z-index: 2147483647; &, & .outer-wrapper { + // auto height to allow for arrow positioning based on height height: auto; } // sass-lint:disable no-color-literals .screen { + // override transform in about:welcome + &:dir(rtl) { + transform: none; + } + &[pos='callout'] { // Max value for z-index z-index: $max-z-index - 1; @@ -98,4 +104,88 @@ $max-z-index: 2147483647; } } } + + $arrow-size: 24px; + $arrow-inset-size: math.div($arrow-size, 2); + $arrow-border: 1px solid #CFCFD8; + + // applied to all callout arrow foreground and background + &.callout-arrow::before, + &.callout-arrow::after { + content: ''; + position: absolute; + width: $arrow-size; + height: $arrow-size; + transform: rotate(45deg); + } + + &.callout-arrow:dir(rtl)::before, + &.callout-arrow:dir(rtl)::after { + transform: rotate(315deg); + } + + // color for all arrow foreground + &.callout-arrow::before { + background-color: var(--in-content-page-background); + z-index: $max-z-index; + } + + // styles for all arrow backgrounds + &.callout-arrow::after { + background: transparent; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); + z-index: -1; + } + + // up arrow positioning + &.arrow-top::before, + &.arrow-top::after { + top: -$arrow-inset-size; + inset-inline-start: calc(50% - $arrow-inset-size); + } + + // up arrow foreground + &.arrow-top::before { + border-top: $arrow-border; + border-inline-start: $arrow-border; + } + + // down arrow positioning + &.arrow-bottom::before, + &.arrow-bottom::after { + top: calc(100% - $arrow-inset-size); + inset-inline-start: calc(50% - $arrow-inset-size); + } + + // down arrow foreground + &.arrow-bottom::before { + border-inline-end: $arrow-border; + border-bottom: $arrow-border; + } + + // end arrow positioning + &.arrow-inline-end::before, + &.arrow-inline-end::after { + top: calc(50% - $arrow-inset-size); + inset-inline-start: calc(100% - $arrow-inset-size); + } + + // end arrow foreground + &.arrow-inline-end::before { + border-top: $arrow-border; + border-inline-end: $arrow-border; + } + + // start arrow positioning + &.arrow-inline-start::before, + &.arrow-inline-start::after { + top: calc(50% - $arrow-inset-size); + inset-inline-start: -$arrow-inset-size; + } + + // start arrow foreground + &.arrow-inline-start::before { + border-bottom: $arrow-border; + border-inline-start: $arrow-border; + } } diff --git a/browser/components/places/content/places.xhtml b/browser/components/places/content/places.xhtml index e19a580298283..bfcfa36243338 100644 --- a/browser/components/places/content/places.xhtml +++ b/browser/components/places/content/places.xhtml @@ -341,7 +341,7 @@ - + - - - - #include editBookmarkPanel.inc.xhtml diff --git a/browser/components/preferences/dialogs/blocklists.xhtml b/browser/components/preferences/dialogs/blocklists.xhtml index 06948335f4568..47d467c13e000 100644 --- a/browser/components/preferences/dialogs/blocklists.xhtml +++ b/browser/components/preferences/dialogs/blocklists.xhtml @@ -41,9 +41,9 @@ hidecolumnpicker="true" onselect="gBlocklistManager.onListSelected();"> - - diff --git a/browser/components/preferences/dialogs/permissions.js b/browser/components/preferences/dialogs/permissions.js index bbab64e570617..b4a1c5f58ca9e 100644 --- a/browser/components/preferences/dialogs/permissions.js +++ b/browser/components/preferences/dialogs/permissions.js @@ -354,7 +354,7 @@ var gPermissionManager = { let richlistitem = document.createXULElement("richlistitem"); richlistitem.setAttribute("origin", permission.origin); let row = document.createXULElement("hbox"); - row.setAttribute("flex", "1"); + row.setAttribute("style", "-moz-box-flex: 1"); let hbox = document.createXULElement("hbox"); let website = document.createXULElement("label"); @@ -363,7 +363,7 @@ var gPermissionManager = { website.setAttribute("value", permission.origin); hbox.setAttribute("width", "0"); hbox.setAttribute("class", "website-name"); - hbox.setAttribute("flex", "3"); + hbox.setAttribute("style", "-moz-box-flex: 3"); hbox.appendChild(website); row.appendChild(hbox); @@ -378,7 +378,7 @@ var gPermissionManager = { ); hbox.setAttribute("width", "0"); hbox.setAttribute("class", "website-name"); - hbox.setAttribute("flex", "1"); + hbox.setAttribute("style", "-moz-box-flex: 1"); hbox.appendChild(capability); row.appendChild(hbox); } diff --git a/browser/components/preferences/dialogs/permissions.xhtml b/browser/components/preferences/dialogs/permissions.xhtml index 34ee97300a3bd..1d51e6fe67f63 100644 --- a/browser/components/preferences/dialogs/permissions.xhtml +++ b/browser/components/preferences/dialogs/permissions.xhtml @@ -58,9 +58,9 @@ - - diff --git a/browser/components/preferences/dialogs/siteDataSettings.js b/browser/components/preferences/dialogs/siteDataSettings.js index 2b512156486c2..500001aa3abe3 100644 --- a/browser/components/preferences/dialogs/siteDataSettings.js +++ b/browser/components/preferences/dialogs/siteDataSettings.js @@ -41,7 +41,7 @@ let gSiteDataSettings = { function addColumnItem(l10n, flexWidth, tooltipText) { let box = document.createXULElement("hbox"); box.className = "item-box"; - box.setAttribute("flex", flexWidth); + box.setAttribute("style", `-moz-box-flex: ${flexWidth}`); let label = document.createXULElement("label"); label.setAttribute("crop", "end"); if (l10n) { diff --git a/browser/components/preferences/dialogs/siteDataSettings.xhtml b/browser/components/preferences/dialogs/siteDataSettings.xhtml index c20b76d5c090d..aeacde9009273 100644 --- a/browser/components/preferences/dialogs/siteDataSettings.xhtml +++ b/browser/components/preferences/dialogs/siteDataSettings.xhtml @@ -42,11 +42,11 @@ - - + + - - + + diff --git a/browser/components/preferences/dialogs/sitePermissions.js b/browser/components/preferences/dialogs/sitePermissions.js index 8c684f6f501ad..1d2c14fd4d751 100644 --- a/browser/components/preferences/dialogs/sitePermissions.js +++ b/browser/components/preferences/dialogs/sitePermissions.js @@ -351,18 +351,18 @@ var gSitePermissionsManager = { let richlistitem = document.createXULElement("richlistitem"); richlistitem.setAttribute("origin", permission.origin); let row = document.createXULElement("hbox"); - row.setAttribute("flex", "1"); + row.setAttribute("style", "-moz-box-flex: 1"); let hbox = document.createXULElement("hbox"); let website = document.createXULElement("label"); website.setAttribute("value", permission.origin); website.setAttribute("width", width); hbox.setAttribute("class", "website-name"); - hbox.setAttribute("flex", "3"); + hbox.setAttribute("style", "-moz-box-flex: 1"); hbox.appendChild(website); let menulist = document.createXULElement("menulist"); - menulist.setAttribute("flex", "1"); + menulist.setAttribute("style", "-moz-box-flex: 1"); menulist.setAttribute("width", width); menulist.setAttribute("class", "website-status"); let states = SitePermissions.getAvailableStates(permission.type); diff --git a/browser/components/preferences/dialogs/sitePermissions.xhtml b/browser/components/preferences/dialogs/sitePermissions.xhtml index e99758098cb9a..038b17eb9957e 100644 --- a/browser/components/preferences/dialogs/sitePermissions.xhtml +++ b/browser/components/preferences/dialogs/sitePermissions.xhtml @@ -49,9 +49,9 @@ - - diff --git a/browser/themes/shared/sidebar.css b/browser/themes/shared/sidebar.css index f8cfde28fd4e8..fb879bc73fced 100644 --- a/browser/themes/shared/sidebar.css +++ b/browser/themes/shared/sidebar.css @@ -18,6 +18,16 @@ border-bottom: 1px solid var(--sidebar-border-color); } +#sidebar-spacer { + /* To ensure the button doesn't expand unnecessarily for short labels, the + spacer should significantly out-flex the button. */ + -moz-box-flex: 1000; +} + +#sidebar { + -moz-box-flex: 1; +} + @media not (-moz-platform: linux) { /* We don't let the splitter overlap the sidebar on Linux since the sidebar's scrollbar is too narrow on Linux. */ @@ -55,6 +65,7 @@ margin: 0; padding: 0; padding-inline: 8px 4px; + -moz-box-flex: 1; } #sidebar-switcher-arrow { @@ -76,6 +87,7 @@ border-radius: var(--toolbarbutton-border-radius); border: 1px solid transparent; padding: 2px 4px; + -moz-box-flex: 1; } #sidebar-switcher-target:hover { diff --git a/browser/themes/shared/urlbar-searchbar.css b/browser/themes/shared/urlbar-searchbar.css index e406f8d26d2c3..dff34ccbacf89 100644 --- a/browser/themes/shared/urlbar-searchbar.css +++ b/browser/themes/shared/urlbar-searchbar.css @@ -265,6 +265,7 @@ #urlbar-container { -moz-box-align: center; + -moz-box-flex: 400; } #urlbar-search-splitter { @@ -638,6 +639,7 @@ #search-container { min-width: 125px; + -moz-box-flex: 175; } #search-container[cui-areatype="menu-panel"] > #searchbar:-moz-lwtheme { diff --git a/devtools/client/framework/test/browser_toolbox_screenshot_tool.js b/devtools/client/framework/test/browser_toolbox_screenshot_tool.js index 07c3b0b647987..62cf3e6f30b35 100644 --- a/devtools/client/framework/test/browser_toolbox_screenshot_tool.js +++ b/devtools/client/framework/test/browser_toolbox_screenshot_tool.js @@ -35,7 +35,7 @@ add_task(async function() { toolbox.doc.querySelector("#command-button-screenshot").click(); const filePath = await onScreenshotDownloaded; - ok(filePath, "The screenshot was taken"); + ok(!!filePath, "The screenshot was taken"); info("Create an image using the downloaded file as source"); const image = new Image(); @@ -78,7 +78,49 @@ add_task(async function() { `The warning message is rendered as expected (${message})` ); - //Remove the downloaded screenshot file + // Remove the downloaded screenshot file await IOUtils.remove(filePath); + + info( + "Check that taking a screenshot in a private window doesn't appear in the non-private window" + ); + const privateWindow = await BrowserTestUtils.openNewBrowserWindow({ + private: true, + }); + ok(PrivateBrowsingUtils.isWindowPrivate(privateWindow), "window is private"); + const privateBrowser = privateWindow.gBrowser; + privateBrowser.selectedTab = BrowserTestUtils.addTab( + privateBrowser, + TEST_URL + ); + + info("private tab opened"); + ok( + PrivateBrowsingUtils.isBrowserPrivate(privateBrowser.selectedBrowser), + "tab window is private" + ); + + const privateToolbox = await gDevTools.showToolboxForTab( + privateBrowser.selectedTab + ); + + const onPrivateScreenshotDownloaded = waitUntilScreenshot({ + isWindowPrivate: true, + }); + privateToolbox.doc.querySelector("#command-button-screenshot").click(); + const privateScreenshotFilePath = await onPrivateScreenshotDownloaded; + ok( + !!privateScreenshotFilePath, + "The screenshot was taken in the private window" + ); + + // Remove the downloaded screenshot file + await IOUtils.remove(privateScreenshotFilePath); + + // cleanup the downloads await resetDownloads(); + + const closePromise = BrowserTestUtils.windowClosed(privateWindow); + privateWindow.BrowserTryToCloseWindow(); + await closePromise; }); diff --git a/devtools/client/framework/toolbox-hosts.js b/devtools/client/framework/toolbox-hosts.js index b26253bde6f49..d0a31c5fbba23 100644 --- a/devtools/client/framework/toolbox-hosts.js +++ b/devtools/client/framework/toolbox-hosts.js @@ -420,7 +420,7 @@ function focusTab(tab) { function createDevToolsFrame(doc, className) { const frame = doc.createXULElement("browser"); frame.setAttribute("type", "content"); - frame.flex = 1; // Required to be able to shrink when the window shrinks + frame.setAttribute("flex", "1"); // Required to be able to shrink when the window shrinks frame.className = className; const inXULDocument = doc.documentElement.namespaceURI === XUL_NS; diff --git a/devtools/client/framework/toolbox.xhtml b/devtools/client/framework/toolbox.xhtml index 773221b76edf5..f5c83d05c0772 100644 --- a/devtools/client/framework/toolbox.xhtml +++ b/devtools/client/framework/toolbox.xhtml @@ -23,19 +23,15 @@ + + + diff --git a/toolkit/components/formautofill/FormAutofillPreferences.jsm b/toolkit/components/formautofill/FormAutofillPreferences.jsm index 12b57f731145f..1461b5ea5425d 100644 --- a/toolkit/components/formautofill/FormAutofillPreferences.jsm +++ b/toolkit/components/formautofill/FormAutofillPreferences.jsm @@ -160,7 +160,7 @@ FormAutofillPreferences.prototype = { } addressAutofillCheckboxGroup.setAttribute("align", "center"); - addressAutofillCheckboxGroup.flex = 1; + addressAutofillCheckboxGroup.setAttribute("flex", "1"); formAutofillGroup.appendChild(addressAutofill); addressAutofill.appendChild(addressAutofillCheckboxGroup); @@ -230,7 +230,7 @@ FormAutofillPreferences.prototype = { } creditCardAutofillCheckboxGroup.setAttribute("align", "center"); - creditCardAutofillCheckboxGroup.flex = 1; + creditCardAutofillCheckboxGroup.setAttribute("flex", "1"); formAutofillGroup.appendChild(creditCardAutofill); creditCardAutofill.appendChild(creditCardAutofillCheckboxGroup); @@ -288,7 +288,7 @@ FormAutofillPreferences.prototype = { } reauthCheckboxGroup.setAttribute("align", "center"); - reauthCheckboxGroup.flex = 1; + reauthCheckboxGroup.setAttribute("flex", "1"); formAutofillGroup.appendChild(reauth); reauth.appendChild(reauthCheckboxGroup); diff --git a/toolkit/components/printing/content/printUtils.js b/toolkit/components/printing/content/printUtils.js index a133332d406a4..9deb9c45598f7 100644 --- a/toolkit/components/printing/content/printUtils.js +++ b/toolkit/components/printing/content/printUtils.js @@ -62,8 +62,6 @@ ChromeUtils.defineModuleGetter( "resource://gre/modules/SharedPromptUtils.jsm" ); -const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm"); - var PrintUtils = { SAVE_TO_PDF_PRINTER: "Mozilla Save to PDF", @@ -321,11 +319,14 @@ var PrintUtils = { // (including using DownloadPaths.sanitize!). // For now, the following is for consistency with the behavior // prior to bug 1669149 part 3. - let dest = await OS.File.getCurrentDirectory(); + let dest = undefined; + try { + dest = Services.dirsvc.get("CurWorkD", Ci.nsIFile).path; + } catch (e) {} if (!dest) { - dest = OS.Constants.Path.homeDir; + dest = Services.dirsvc.get("Home", Ci.nsIFile).path; } - settings.toFileName = OS.Path.join(dest || "", "mozilla.pdf"); + settings.toFileName = PathUtils.join(dest, "mozilla.pdf"); } if (useSystemDialog) { diff --git a/toolkit/components/telemetry/Events.yaml b/toolkit/components/telemetry/Events.yaml index 1cb710c89553b..aabaca68a2884 100644 --- a/toolkit/components/telemetry/Events.yaml +++ b/toolkit/components/telemetry/Events.yaml @@ -217,13 +217,13 @@ addonsManager: - site_warning, site_blocked, install_disabled_warning - download_started, download_completed, download_failed notification_emails: ["addons-dev-internal@mozilla.com"] - expiry_version: "106" + expiry_version: "113" products: - "firefox" - "fennec" - "thunderbird" record_in_processes: ["main"] - bug_numbers: [1433335, 1515697, 1523641, 1549770, 1590736, 1630596, 1672570, 1714251, 1749878] + bug_numbers: [1433335, 1515697, 1523641, 1549770, 1590736, 1630596, 1672570, 1714251, 1749878, 1781974] release_channel_collection: opt-out install_stats: description: > @@ -272,13 +272,13 @@ addonsManager: e.g. install events with source "about:addons" may have "install-from-file" or "url" as method). num_strings: The number of permission description strings in the extension permission doorhanger notification_emails: ["addons-dev-internal@mozilla.com"] - expiry_version: "106" + expiry_version: "113" products: - "firefox" - "fennec" - "thunderbird" record_in_processes: ["main"] - bug_numbers: [1433335, 1515697, 1523641, 1549770, 1590736, 1630596, 1672570, 1714251, 1749878] + bug_numbers: [1433335, 1515697, 1523641, 1549770, 1590736, 1630596, 1672570, 1714251, 1749878, 1781974] release_channel_collection: opt-out link: description: > @@ -295,12 +295,12 @@ addonsManager: view: The view the user was on (discover, list, detail or updates). type: "For search: the type of page for this view (especially extension or theme list)." notification_emails: ["addons-dev-internal@mozilla.com"] - expiry_version: "106" + expiry_version: "113" products: - "firefox" - "fennec" record_in_processes: ["main"] - bug_numbers: [1500147, 1546248, 1590736, 1630596, 1672570, 1714251, 1749878] + bug_numbers: [1500147, 1546248, 1590736, 1630596, 1672570, 1714251, 1749878, 1781974] release_channel_collection: opt-out view: description: > @@ -322,12 +322,12 @@ addonsManager: TAAR based discovery was enabled, "0" if it was disabled and unset if not relevant for the particular view. notification_emails: ["addons-dev-internal@mozilla.com"] - expiry_version: "106" + expiry_version: "113" products: - "firefox" - "fennec" record_in_processes: ["main"] - bug_numbers: [1500147, 1590736, 1630596, 1672570, 1699225, 1714251, 1749878] + bug_numbers: [1500147, 1590736, 1630596, 1672570, 1699225, 1714251, 1749878, 1781974] release_channel_collection: opt-out action: description: > @@ -355,12 +355,12 @@ addonsManager: TAAR based recommendations, "0" for manually curated and unset if not relevant for the particular action. notification_emails: ["addons-dev-internal@mozilla.com"] - expiry_version: "106" + expiry_version: "113" products: - "firefox" - "fennec" record_in_processes: ["main"] - bug_numbers: [1500147, 1513344, 1546248, 1590736, 1630596, 1672570, 1699225, 1714251, 1749878, 1780746] + bug_numbers: [1500147, 1513344, 1546248, 1590736, 1630596, 1672570, 1699225, 1714251, 1749878, 1780746, 1781974] release_channel_collection: opt-out report: description: > @@ -381,13 +381,13 @@ addonsManager: ERROR_ABORTED_SUBMIT, ERROR_ADDON_NOT_FOUND, ERROR_CLIENT, ERROR_NETWORK, ERROR_UNKNOWN, ERROR_RECENT_SUBMIT, ERROR_SERVER, ERROR_AMODETAILS_NOTFOUND, ERROR_AMODETAILS_FAILURE. notification_emails: ["addons-dev-internal@mozilla.com"] - expiry_version: "106" + expiry_version: "113" products: - "firefox" - "fennec" - "thunderbird" record_in_processes: ["main"] - bug_numbers: [1544927, 1580561, 1590736, 1630596, 1672570, 1714251, 1749878, 1780746] + bug_numbers: [1544927, 1580561, 1590736, 1630596, 1672570, 1714251, 1749878, 1780746, 1781974] release_channel_collection: opt-out blocklist: @@ -609,9 +609,9 @@ creditcard: extensions.data: migrateResult: objects: ["storageLocal"] - bug_numbers: [1470213, 1553297, 1590736, 1630596, 1672570, 1714251, 1749878] + bug_numbers: [1470213, 1553297, 1590736, 1630596, 1672570, 1714251, 1749878, 1781974] notification_emails: ["addons-dev-internal@mozilla.com"] - expiry_version: "106" + expiry_version: "113" products: - "firefox" - "fennec" diff --git a/toolkit/components/telemetry/metrics.yaml b/toolkit/components/telemetry/metrics.yaml index 20f951f1ada13..4b92b6ff1738b 100644 --- a/toolkit/components/telemetry/metrics.yaml +++ b/toolkit/components/telemetry/metrics.yaml @@ -34,7 +34,10 @@ legacy.telemetry: - chutten@mozilla.com - glean-team@mozilla.com expires: never + no_lint: + - BASELINE_PING send_in_pings: - 'metrics' - 'events' - 'newtab' + - 'baseline' diff --git a/toolkit/content/minimal-xul.css b/toolkit/content/minimal-xul.css index 0bab06e226828..5b536e9e040da 100644 --- a/toolkit/content/minimal-xul.css +++ b/toolkit/content/minimal-xul.css @@ -48,6 +48,7 @@ -moz-control-character-visibility: initial; -moz-font-smoothing-background-color: initial; -moz-min-font-size-ratio: initial; + -moz-box-layout: initial; math-depth: initial; /* As long as inert implies pointer-events: none as it does now, we're * good. */ diff --git a/toolkit/content/tests/chrome/test_tree_hier.xhtml b/toolkit/content/tests/chrome/test_tree_hier.xhtml index 81d0567691b06..5c91d1bfb4ae0 100644 --- a/toolkit/content/tests/chrome/test_tree_hier.xhtml +++ b/toolkit/content/tests/chrome/test_tree_hier.xhtml @@ -16,7 +16,7 @@ - + diff --git a/toolkit/content/xul.css b/toolkit/content/xul.css index c9c88ffe2b1e3..44d7c63bab5dd 100644 --- a/toolkit/content/xul.css +++ b/toolkit/content/xul.css @@ -659,22 +659,5 @@ button, image { [pack="center"] { -moz-box-pack: center !important; } [pack="end"] { -moz-box-pack: end !important; } -@supports -moz-bool-pref("layout.css.emulate-moz-box-with-flex") { - /* This isn't a real solution for [flex] and [ordinal], but it covers enough - cases to render the browser chrome for us to test emulated flex mode without - mass-changing existing markup and CSS. - If we get attr() in Bug 435426 this could work for all cases. */ - [flex="1"] { -moz-box-flex: 1; } - [flex="2"] { -moz-box-flex: 2; } - [flex="3"] { -moz-box-flex: 3; } - [flex="4"] { -moz-box-flex: 4; } - [flex="5"] { -moz-box-flex: 5; } - [flex="6"] { -moz-box-flex: 6; } - [flex="7"] { -moz-box-flex: 7; } - [flex="8"] { -moz-box-flex: 8; } - [flex="9"] { -moz-box-flex: 9; } - [flex="100"] { -moz-box-flex: 100; } - [flex="400"] { -moz-box-flex: 400; } - [flex="1000"] { -moz-box-flex: 1000; } - [flex="10000"] { -moz-box-flex: 10000; } -} +[flex="0"] { -moz-box-flex: 0 !important; } +[flex="1"] { -moz-box-flex: 1 !important; } diff --git a/toolkit/mozapps/update/UpdateService.jsm b/toolkit/mozapps/update/UpdateService.jsm index 393ff53b8f69a..f499fb84ce2cf 100644 --- a/toolkit/mozapps/update/UpdateService.jsm +++ b/toolkit/mozapps/update/UpdateService.jsm @@ -5352,6 +5352,37 @@ Downloader.prototype = { let patchFile = updateDir.clone(); patchFile.append(FILE_UPDATE_MAR); + if (lazy.gIsBackgroundTaskMode) { + // We don't normally run a background update if we can't use BITS, but + // this branch is possible because we do fall back from BITS failures by + // attempting an internal download. + // If this happens, we are just going to need to wait for interactive + // Firefox to download the update. We don't, however, want to be in the + // "downloading" state when interactive Firefox runs because we want to + // download the newest update available which, at that point, may not be + // the one that we are currently trying to download. + // However, we can't just unconditionally clobber the current update + // because interactive Firefox might already be part way through an + // internal update download, and we definitely don't want to interrupt + // that. + let readyUpdateDir = getReadyUpdateDir(); + let status = readStatusFile(readyUpdateDir); + // nsIIncrementalDownload doesn't use an intermediate download location + // for partially downloaded files. If we have started an update + // download with it, it will be available at its ultimate location. + if (!(status == STATE_DOWNLOADING && patchFile.exists())) { + cleanupDownloadingUpdate(); + } + + // Tell any listeners that the download failed. In some cases, there + // won't actually have been a corresponding onStartRequest, but that + // shouldn't really hurt anything. + this.updateService.forEachDownloadListener(listener => { + listener.onStopRequest(null, Cr.NS_ERROR_FAILURE); + }); + return false; + } + // The interval is 0 since there is no need to throttle downloads. let interval = 0; diff --git a/toolkit/mozapps/update/tests/data/shared.js b/toolkit/mozapps/update/tests/data/shared.js index 70120d32c9ddf..b4769679dfa84 100644 --- a/toolkit/mozapps/update/tests/data/shared.js +++ b/toolkit/mozapps/update/tests/data/shared.js @@ -71,6 +71,7 @@ const DIR_TOBEDELETED = "tobedeleted"; const DIR_UPDATES = "updates"; const DIR_UPDATED = AppConstants.platform == "macosx" ? "Updated.app" : "updated"; +const DIR_DOWNLOADING = "downloading"; const FILE_ACTIVE_UPDATE_XML = "active-update.xml"; const FILE_ACTIVE_UPDATE_XML_TMP = "active-update.xml.tmp"; @@ -442,9 +443,17 @@ function getFileExtension(aFile) { * * @param aLogLeafName * The leafName of the file or directory to get. + * @param aWhichDir + * Since we started having a separate patch directory and downloading + * directory, there are now files with the same name that can be in + * either directory. This argument is optional and defaults to the + * patch directory for historical reasons. But if it is specified as + * DIR_DOWNLOADING, this function will provide the version of the file + * in the downloading directory. For files that aren't in the patch + * directory or the downloading directory, this value is ignored. * @return nsIFile for the file or directory. */ -function getUpdateDirFile(aLeafName) { +function getUpdateDirFile(aLeafName, aWhichDir = null) { let file = Services.dirsvc.get(XRE_UPDATE_ROOT_DIR, Ci.nsIFile); switch (aLeafName) { case undefined: @@ -460,6 +469,7 @@ function getUpdateDirFile(aLeafName) { file.append(aLeafName); return file; case DIR_PATCH: + case DIR_DOWNLOADING: case FILE_BACKUP_UPDATE_LOG: case FILE_LAST_UPDATE_LOG: file.append(DIR_UPDATES); @@ -472,7 +482,11 @@ function getUpdateDirFile(aLeafName) { case FILE_UPDATE_VERSION: case FILE_UPDATER_INI: file.append(DIR_UPDATES); - file.append(DIR_PATCH); + if (aWhichDir == DIR_DOWNLOADING) { + file.append(DIR_DOWNLOADING); + } else { + file.append(DIR_PATCH); + } file.append(aLeafName); return file; } @@ -530,25 +544,26 @@ function getStageDirFile(aRelPath) { */ function removeUpdateFiles(aRemoveLogFiles) { let files = [ - FILE_ACTIVE_UPDATE_XML, - FILE_UPDATES_XML, - FILE_BT_RESULT, - FILE_UPDATE_STATUS, - FILE_UPDATE_VERSION, - FILE_UPDATE_MAR, - FILE_UPDATER_INI, + [FILE_ACTIVE_UPDATE_XML], + [FILE_UPDATES_XML], + [FILE_BT_RESULT], + [FILE_UPDATE_STATUS], + [FILE_UPDATE_VERSION], + [FILE_UPDATE_MAR], + [FILE_UPDATE_MAR, DIR_DOWNLOADING], + [FILE_UPDATER_INI], ]; if (aRemoveLogFiles) { files = files.concat([ - FILE_BACKUP_UPDATE_LOG, - FILE_LAST_UPDATE_LOG, - FILE_UPDATE_LOG, + [FILE_BACKUP_UPDATE_LOG], + [FILE_LAST_UPDATE_LOG], + [FILE_UPDATE_LOG], ]); } for (let i = 0; i < files.length; i++) { - let file = getUpdateDirFile(files[i]); + let file = getUpdateDirFile.apply(null, files[i]); try { if (file.exists()) { file.remove(false); diff --git a/toolkit/mozapps/update/tests/unit_aus_update/backgroundUpdateTaskInternalUpdater.js b/toolkit/mozapps/update/tests/unit_aus_update/backgroundUpdateTaskInternalUpdater.js new file mode 100644 index 0000000000000..bb8c9c3f1f62f --- /dev/null +++ b/toolkit/mozapps/update/tests/unit_aus_update/backgroundUpdateTaskInternalUpdater.js @@ -0,0 +1,85 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +"use strict"; + +/** + * This test ensures that we don't resume an update download with the internal + * downloader when we are running background updates. Normally, the background + * update task won't even run if we can't use BITS. But it is possible for us to + * fall back from BITS to the internal downloader. Background update should + * prevent this fallback and just abort. + * + * But interactive Firefox allows that fallback. And once the internal + * download has started, the background update task must leave that download + * untouched and allow it to finish. + */ + +var TEST_MAR_CONTENTS = "Arbitrary MAR contents"; + +add_task(async function setup() { + setupTestCommon(); + start_httpserver(); + setUpdateURL(gURLData + gHTTPHandlerPath); + setUpdateChannel("test_channel"); + + // Pretend that this is a background task. + const bts = Cc["@mozilla.org/backgroundtasks;1"].getService( + Ci.nsIBackgroundTasks + ); + bts.overrideBackgroundTaskNameForTesting("test-task"); + + // No need for cleanup needed for changing update files. These will be cleaned + // up by removeUpdateFiles. + const downloadingMarFile = getUpdateDirFile(FILE_UPDATE_MAR, DIR_DOWNLOADING); + await IOUtils.writeUTF8(downloadingMarFile.path, TEST_MAR_CONTENTS); + + writeStatusFile(STATE_DOWNLOADING); + + let patchProps = { + state: STATE_DOWNLOADING, + bitsResult: Cr.NS_ERROR_FAILURE, + }; + let patches = getLocalPatchString(patchProps); + let updateProps = { appVersion: "1.0" }; + let updates = getLocalUpdateString(updateProps, patches); + writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true); +}); + +add_task(async function backgroundUpdate() { + let patches = getRemotePatchString({}); + let updateString = getRemoteUpdateString({}, patches); + gResponseBody = getRemoteUpdatesXMLString(updateString); + + let { updates } = await waitForUpdateCheck(true); + let bestUpdate = gAUS.selectUpdate(updates); + let success = gAUS.downloadUpdate(bestUpdate, false); + Assert.equal( + success, + false, + "We should not attempt to download an update in the background when an " + + "internal update download is already in progress." + ); + Assert.equal( + readStatusFile(), + STATE_DOWNLOADING, + "Background update during an internally downloading update should not " + + "change update status" + ); + const downloadingMarFile = getUpdateDirFile(FILE_UPDATE_MAR, DIR_DOWNLOADING); + Assert.ok( + await IOUtils.exists(downloadingMarFile.path), + "Downloading MAR should still exist" + ); + Assert.equal( + await IOUtils.readUTF8(downloadingMarFile.path), + TEST_MAR_CONTENTS, + "Downloading MAR should not have been modified" + ); +}); + +add_task(async function finish() { + stop_httpserver(doTestFinish); +}); diff --git a/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini b/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini index 6699f7861bfbf..4d700913cd6c6 100644 --- a/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini +++ b/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini @@ -71,3 +71,4 @@ reason = Feature is Firefox-specific and Windows-specific. [verifyChannelPrefsFile.js] run-if = appname == 'firefox' reason = File being verified is Firefox-specific. +[backgroundUpdateTaskInternalUpdater.js] diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 57245c933f0a4..bfb0d7d3205f7 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -161,7 +161,7 @@ typedef enum { GDK_TOUCHPAD_GESTURE_PHASE_CANCEL } GdkTouchpadGesturePhase; -GdkEventMask GDK_TOUCHPAD_GESTURE_MASK = static_cast(1 << 24); +gint GDK_TOUCHPAD_GESTURE_MASK = 1 << 24; GdkEventType GDK_TOUCHPAD_PINCH = static_cast(42); #endif diff --git a/widget/tests/moz.build b/widget/tests/moz.build index 1c4ff7ef8de4f..b50a2949f7bd0 100644 --- a/widget/tests/moz.build +++ b/widget/tests/moz.build @@ -97,9 +97,6 @@ with Files("*picker_no_crash*"): with Files("*platform_colors*"): BUG_COMPONENT = ("Core", "Widget: Cocoa") -with Files("*plugin*"): - BUG_COMPONENT = ("Core", "Plug-ins") - with Files("*position_on_resize*"): BUG_COMPONENT = ("Core", "Widget: Gtk") diff --git a/widget/tests/test_bug428405.xhtml b/widget/tests/test_bug428405.xhtml index d783f655e97b9..76903d86efd1a 100644 --- a/widget/tests/test_bug428405.xhtml +++ b/widget/tests/test_bug428405.xhtml @@ -11,14 +11,14 @@