diff --git a/browser/actors/RFPHelperParent.sys.mjs b/browser/actors/RFPHelperParent.sys.mjs
deleted file mode 100644
index 0e4e3e8be64..00000000000
--- a/browser/actors/RFPHelperParent.sys.mjs
+++ /dev/null
@@ -1,33 +0,0 @@
-1; /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
-
-const lazy = {};
-ChromeUtils.defineESModuleGetters(lazy, {
- RFPHelper: "resource://gre/modules/RFPHelper.sys.mjs",
-});
-
-const kPrefLetterboxing = "privacy.resistFingerprinting.letterboxing";
-
-XPCOMUtils.defineLazyPreferenceGetter(
- lazy,
- "isLetterboxingEnabled",
- kPrefLetterboxing,
- false
-);
-
-export class RFPHelperParent extends JSWindowActorParent {
- receiveMessage(aMessage) {
- if (
- lazy.isLetterboxingEnabled &&
- aMessage.name == "Letterboxing:ContentSizeUpdated"
- ) {
- let browser = this.browsingContext.top.embedderElement;
- let window = browser.ownerGlobal;
- lazy.RFPHelper.contentSizeUpdated(window);
- }
- }
-}
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index 48981f6d8b5..9e4caaee415 100644
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1945,7 +1945,7 @@ pref("browser.newtabpage.activity-stream.discoverystream.spocMessageVariant", ""
pref("browser.newtabpage.activity-stream.discoverystream.sendToPocket.enabled", true);
// Pref enabling content reporting
-pref("browser.newtabpage.activity-stream.discoverystream.reportContent.enabled", false);
+pref("browser.newtabpage.activity-stream.discoverystream.reportAds.enabled", false);
// List of regions that do not get stories, regardless of locale-list-config.
pref("browser.newtabpage.activity-stream.discoverystream.region-stories-block", "");
diff --git a/browser/components/asrouter/tests/browser/browser_asrouter_experimentsAPILoader.js b/browser/components/asrouter/tests/browser/browser_asrouter_experimentsAPILoader.js
index 5a053c1a6b6..374b21c2d80 100644
--- a/browser/components/asrouter/tests/browser/browser_asrouter_experimentsAPILoader.js
+++ b/browser/components/asrouter/tests/browser/browser_asrouter_experimentsAPILoader.js
@@ -297,7 +297,7 @@ add_task(async function test_forceEnrollUpdatesMessages() {
await assertMessageInState("xman_test_message");
- await ExperimentManager.unenroll(`optin-${experiment.slug}`, "cleanup");
+ await ExperimentManager.unenroll(`optin-${experiment.slug}`);
await SpecialPowers.popPrefEnv();
await cleanup();
});
diff --git a/browser/components/uitour/UITourChild.sys.mjs b/browser/components/uitour/UITourChild.sys.mjs
index 969b6923520..2df3b6e4c51 100644
--- a/browser/components/uitour/UITourChild.sys.mjs
+++ b/browser/components/uitour/UITourChild.sys.mjs
@@ -2,12 +2,11 @@
* 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/. */
-const PREF_TEST_ORIGINS = "browser.uitour.testingOrigins";
-const UITOUR_PERMISSION = "uitour";
+import { UITourUtils } from "moz-src:///browser/components/uitour/UITourUtils.sys.mjs";
export class UITourChild extends JSWindowActorChild {
handleEvent(event) {
- if (!this.ensureTrustedOrigin()) {
+ if (!UITourUtils.ensureTrustedOrigin(this.manager)) {
return;
}
@@ -18,62 +17,6 @@ export class UITourChild extends JSWindowActorChild {
});
}
- isTestingOrigin(aURI) {
- let testingOrigins = Services.prefs.getStringPref(PREF_TEST_ORIGINS, "");
- if (!testingOrigins) {
- return false;
- }
-
- // Allow any testing origins (comma-seperated).
- for (let origin of testingOrigins.split(/\s*,\s*/)) {
- try {
- let testingURI = Services.io.newURI(origin);
- if (aURI.prePath == testingURI.prePath) {
- return true;
- }
- } catch (ex) {
- console.error(ex);
- }
- }
- return false;
- }
-
- // This function is copied from UITour.sys.mjs.
- isSafeScheme(aURI) {
- let allowedSchemes = new Set(["https", "about"]);
- if (!allowedSchemes.has(aURI.scheme)) {
- return false;
- }
-
- return true;
- }
-
- ensureTrustedOrigin() {
- if (this.browsingContext.top != this.browsingContext) {
- return false;
- }
-
- let uri = this.document.documentURIObject;
-
- if (uri.schemeIs("chrome")) {
- return true;
- }
-
- if (!this.isSafeScheme(uri)) {
- return false;
- }
-
- let permission = Services.perms.testPermissionFromPrincipal(
- this.document.nodePrincipal,
- UITOUR_PERMISSION
- );
- if (permission == Services.perms.ALLOW_ACTION) {
- return true;
- }
-
- return this.isTestingOrigin(uri);
- }
-
receiveMessage(aMessage) {
switch (aMessage.name) {
case "UITour:SendPageCallback":
@@ -86,7 +29,7 @@ export class UITourChild extends JSWindowActorChild {
}
sendPageEvent(type, detail) {
- if (!this.ensureTrustedOrigin()) {
+ if (!UITourUtils.ensureTrustedOrigin(this.manager)) {
return;
}
diff --git a/browser/components/uitour/UITourParent.sys.mjs b/browser/components/uitour/UITourParent.sys.mjs
index 56222251074..61506d358db 100644
--- a/browser/components/uitour/UITourParent.sys.mjs
+++ b/browser/components/uitour/UITourParent.sys.mjs
@@ -3,9 +3,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { UITour } from "moz-src:///browser/components/uitour/UITour.sys.mjs";
+import { UITourUtils } from "moz-src:///browser/components/uitour/UITourUtils.sys.mjs";
export class UITourParent extends JSWindowActorParent {
receiveMessage(message) {
+ if (!UITourUtils.ensureTrustedOrigin(this.manager)) {
+ return;
+ }
switch (message.name) {
case "UITour:onPageEvent":
if (this.manager.rootFrameLoader) {
diff --git a/browser/components/uitour/UITourUtils.sys.mjs b/browser/components/uitour/UITourUtils.sys.mjs
new file mode 100644
index 00000000000..b390b2b53dc
--- /dev/null
+++ b/browser/components/uitour/UITourUtils.sys.mjs
@@ -0,0 +1,84 @@
+/* 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/. */
+
+const PREF_TEST_ORIGINS = "browser.uitour.testingOrigins";
+const UITOUR_PERMISSION = "uitour";
+
+export let UITourUtils = {
+ /**
+ * Check if we've got a testing origin.
+ *
+ * @param {nsIURI} uri
+ * The URI to check
+ * @returns {boolean}
+ * Whether or not it's a testing origin.
+ */
+ isTestingOrigin(uri) {
+ let testingOrigins = Services.prefs.getStringPref(PREF_TEST_ORIGINS, "");
+ if (!testingOrigins) {
+ return false;
+ }
+
+ // Allow any testing origins (comma-seperated).
+ for (let origin of testingOrigins.split(/\s*,\s*/)) {
+ try {
+ let testingURI = Services.io.newURI(origin);
+ if (uri.prePath == testingURI.prePath) {
+ return true;
+ }
+ } catch (ex) {
+ console.error(ex);
+ }
+ }
+ return false;
+ },
+
+ /**
+ *
+ * @param {WindowGlobalChild|WindowGlobalParent} windowGlobal
+ * The parent/child representation of a window global to check if we can
+ * use UITour.
+ * @returns {boolean}
+ * Whether or not we can use UITour here.
+ */
+ ensureTrustedOrigin(windowGlobal) {
+ // If we're not top-most or no longer current, bail out immediately.
+ if (windowGlobal.browsingContext.parent || !windowGlobal.isCurrentGlobal) {
+ return false;
+ }
+
+ let principal, uri;
+ // We can get either a WindowGlobalParent or WindowGlobalChild, depending on
+ // what process we're called in, and determining the secure context-ness and
+ // principal + URI needs different approaches based on this.
+ if (WindowGlobalParent.isInstance(windowGlobal)) {
+ if (!windowGlobal.browsingContext.secureBrowserUI?.isSecureContext) {
+ return false;
+ }
+ principal = windowGlobal.documentPrincipal;
+ uri = windowGlobal.documentURI;
+ } else {
+ if (!windowGlobal.contentWindow?.isSecureContext) {
+ return false;
+ }
+ let document = windowGlobal.contentWindow.document;
+ principal = document?.nodePrincipal;
+ uri = document?.documentURIObject;
+ }
+
+ if (!principal) {
+ return false;
+ }
+
+ let permission = Services.perms.testPermissionFromPrincipal(
+ principal,
+ UITOUR_PERMISSION
+ );
+ if (permission == Services.perms.ALLOW_ACTION) {
+ return true;
+ }
+
+ return uri && this.isTestingOrigin(uri);
+ },
+};
diff --git a/browser/components/uitour/moz.build b/browser/components/uitour/moz.build
index 3a891ae10a0..e679af7e23e 100644
--- a/browser/components/uitour/moz.build
+++ b/browser/components/uitour/moz.build
@@ -2,7 +2,12 @@
# 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/.
-MOZ_SRC_FILES += ["UITour.sys.mjs", "UITourChild.sys.mjs", "UITourParent.sys.mjs"]
+MOZ_SRC_FILES += [
+ "UITour.sys.mjs",
+ "UITourChild.sys.mjs",
+ "UITourParent.sys.mjs",
+ "UITourUtils.sys.mjs",
+]
BROWSER_CHROME_MANIFESTS += [
"test/browser.toml",
diff --git a/browser/components/uitour/test/browser_UITour_private_browsing.js b/browser/components/uitour/test/browser_UITour_private_browsing.js
index 0c5a52f6674..d69bb30fbb9 100644
--- a/browser/components/uitour/test/browser_UITour_private_browsing.js
+++ b/browser/components/uitour/test/browser_UITour_private_browsing.js
@@ -16,6 +16,10 @@ add_task(async function test_privatebrowsing_window() {
const ABOUT_ORIGIN_WITH_UITOUR_DEFAULT = "about:newtab";
const HTTPS_ORIGIN_WITH_UITOUR_DEFAULT = "https://www.mozilla.org";
+ let { UITourUtils } = ChromeUtils.importESModule(
+ "moz-src:///browser/components/uitour/UITourUtils.sys.mjs"
+ );
+
let win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
let browser = win.gBrowser.selectedBrowser;
@@ -26,10 +30,21 @@ add_task(async function test_privatebrowsing_window() {
BrowserTestUtils.startLoadingURIString(browser, uri);
await BrowserTestUtils.browserLoaded(browser);
+ Assert.ok(
+ UITourUtils.ensureTrustedOrigin(
+ browser.browsingContext.currentWindowGlobal
+ ),
+ "Page should be considered trusted for UITour in the parent."
+ );
+
await SpecialPowers.spawn(browser, [], async () => {
let actor = content.windowGlobalChild.getActor("UITour");
+ // eslint-disable-next-line no-shadow
+ let { UITourUtils } = ChromeUtils.importESModule(
+ "moz-src:///browser/components/uitour/UITourUtils.sys.mjs"
+ );
Assert.ok(
- actor.ensureTrustedOrigin(),
+ UITourUtils.ensureTrustedOrigin(actor.manager),
"Page should be considered trusted for UITour."
);
});
diff --git a/browser/components/urlbar/docs/firefox-suggest-telemetry.rst b/browser/components/urlbar/docs/firefox-suggest-telemetry.rst
index 964d9165b29..83c37123d81 100644
--- a/browser/components/urlbar/docs/firefox-suggest-telemetry.rst
+++ b/browser/components/urlbar/docs/firefox-suggest-telemetry.rst
@@ -158,11 +158,16 @@ The following scalars are recorded for Firefox Suggest. For general information
on scalar telemetry in Firefox, see the
:doc:`/toolkit/components/telemetry/collection/scalars` document.
-browser.ui.interaction.preferences_panePrivacy
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+browser.ui.interaction.preferences_paneSearch
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This keyed scalar is incremented each time the user clicks a Firefox Suggest
-checkbox or toggle switch in the preferences UI. Keys are the following:
+checkbox or toggle switch in the preferences UI.
+
+Note: These are also recorded in different forms under the
+``contextual.services.quicksuggest.*`` telemetry described below.
+
+Keys are the following:
:firefoxSuggestBestMatch:
This key is incremented when the "Top pick" checkbox is clicked. In 120 this
@@ -173,10 +178,10 @@ checkbox or toggle switch in the preferences UI. Keys are the following:
:firefoxSuggestDataCollectionToggle:
This key is incremented when the toggle switch for data collection
is clicked.
-:firefoxSuggestNonsponsoredToggle:
+:firefoxSuggestNonsponsored:
This key is incremented when the toggle switch for non-sponsored suggestions
is clicked.
-:firefoxSuggestSponsoredToggle:
+:firefoxSuggestSponsored:
This key is incremented when the toggle switch for sponsored suggestions
is clicked.
@@ -194,10 +199,18 @@ Changelog
Removed ``firefoxSuggestBestMatch`` and
``firefoxSuggestBestMatchLearnMore``. [Bug 1857391_]
+ Firefox 123.0
+ Recording moved from ``browser.ui.interaction.preferences_panePrivacy`` to
+ ``browser.ui.interaction.preferences_paneSearch``. [Bug 1852048_]
+ ``firefoxSuggestNonsponsoredToggle`` was renamed to ``firefoxSuggestNonsponsored``
+ ``firefoxSuggestSponsoredToggle`` was renamed to ``firefoxSuggestSponsored``
+ ``
+
.. _1735976: https://bugzilla.mozilla.org/show_bug.cgi?id=1735976
.. _1755100: https://bugzilla.mozilla.org/show_bug.cgi?id=1755100
.. _1756917: https://bugzilla.mozilla.org/show_bug.cgi?id=1756917
.. _1857391: https://bugzilla.mozilla.org/show_bug.cgi?id=1857391
+.. _1852048: https://bugzilla.mozilla.org/show_bug.cgi?id=1852048
contextual.services.quicksuggest.block_dynamic_wikipedia
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/browser/components/urlbar/docs/telemetry.rst b/browser/components/urlbar/docs/telemetry.rst
index 90f0836cb7e..486cf9e6877 100644
--- a/browser/components/urlbar/docs/telemetry.rst
+++ b/browser/components/urlbar/docs/telemetry.rst
@@ -291,6 +291,10 @@ urlbar.searchmode.*
Used when the user selects a keyword offer result.
- ``oneoff``
Used when the user selects a one-off engine in the Urlbar.
+ - ``searchbutton``
+ Used when the user entered search mode via the unified search button.
+ Added in Firefox 133, but the unified search button was not enabled in
+ release until 136.
- ``shortcut``
Used when the user enters search mode with a keyboard shortcut or menu bar
item (e.g. ``Accel+K``).
@@ -365,6 +369,14 @@ urlbar.searchmode.*
Please note that symbols cannot trigger the ``urlbar.searchmode.keywordoffer``
telemetry, as symbols are only valid for typed. [Bug `1919180`_]
+ Firefox 133
+ Added ``urlbar.searchmode.searchbutton``:
+ - This new probe is for accesses to search mode from the unified search
+ button. The button was released in Firefox 136 and replaced the previous
+ one-off buttons (``urlbar.searchmode.oneoff``).
+
+ Added Glean equivalents of the probes as labeled counters.
+
urlbar.picked.*
~~~~~~~~~~~~~~~
diff --git a/browser/extensions/newtab/content-src/components/DiscoveryStreamBase/DiscoveryStreamBase.jsx b/browser/extensions/newtab/content-src/components/DiscoveryStreamBase/DiscoveryStreamBase.jsx
index cfea19640b1..526d84051d5 100644
--- a/browser/extensions/newtab/content-src/components/DiscoveryStreamBase/DiscoveryStreamBase.jsx
+++ b/browser/extensions/newtab/content-src/components/DiscoveryStreamBase/DiscoveryStreamBase.jsx
@@ -253,8 +253,9 @@ export class _DiscoveryStreamBase extends React.PureComponent {
const { config } = this.props.DiscoveryStream;
const topicSelectionEnabled =
this.props.Prefs.values["discoverystream.topicSelection.enabled"];
- const reportContentEnabled =
- this.props.Prefs.values["discoverystream.reportContent.enabled"];
+ const reportAdsEnabled =
+ this.props.Prefs.values["discoverystream.reportAds.enabled"];
+ const spocsEnabled = this.props.Prefs.values["unifiedAds.spocs.enabled"];
// Allow rendering without extracting special components
if (!config.collapsible) {
@@ -319,16 +320,19 @@ export class _DiscoveryStreamBase extends React.PureComponent {
}
}
- // Render a DS-style TopSites then the rest if any in a collapsible section
const { DiscoveryStream } = this.props;
+
return (
{this.props.DiscoveryStream.isPrivacyInfoModalVisible && (
)}
- {reportContentEnabled && (
+
+ {/* Reporting stories/articles will only be available in sections, not the default card grid */}
+ {((reportAdsEnabled && spocsEnabled) || sectionsEnabled) && (
)}
+
{topSites &&
this.renderLayout([
{
diff --git a/browser/extensions/newtab/content-src/components/DiscoveryStreamComponents/AdBanner/AdBanner.jsx b/browser/extensions/newtab/content-src/components/DiscoveryStreamComponents/AdBanner/AdBanner.jsx
index fd38ededfe2..d503f8b32a8 100644
--- a/browser/extensions/newtab/content-src/components/DiscoveryStreamComponents/AdBanner/AdBanner.jsx
+++ b/browser/extensions/newtab/content-src/components/DiscoveryStreamComponents/AdBanner/AdBanner.jsx
@@ -49,6 +49,7 @@ export const AdBanner = ({
};
const sectionsEnabled = prefs["discoverystream.sections.enabled"];
+ const showAdReporting = prefs["discoverystream.reportAds.enabled"];
const { width: imgWidth, height: imgHeight } = getDimensions(spoc.format);
@@ -89,7 +90,7 @@ export const AdBanner = ({
spoc={spoc}
position={row}
type={type}
- prefs={prefs}
+ showAdReporting={showAdReporting}
/>
({
id: "newtab-menu-manage-sponsored-content",
action: ac.OnlyToMain({ type: at.SETTINGS_OPEN }),
+ userEvent: "OPEN_NEWTAB_PREFS",
}),
OurSponsorsAndYourPrivacy: () => ({
id: "newtab-menu-our-sponsors-and-your-privacy",
@@ -524,6 +525,7 @@ export const LinkMenuOptions = {
url: "https://support.mozilla.org/kb/pocket-sponsored-stories-new-tabs",
},
}),
+ userEvent: "CLICK_PRIVACY_INFO",
}),
ReportAd: site => {
return {
diff --git a/browser/extensions/newtab/data/content/activity-stream.bundle.js b/browser/extensions/newtab/data/content/activity-stream.bundle.js
index 98876b69db2..db5e7b1feb2 100644
--- a/browser/extensions/newtab/data/content/activity-stream.bundle.js
+++ b/browser/extensions/newtab/data/content/activity-stream.bundle.js
@@ -2202,6 +2202,7 @@ const LinkMenuOptions = {
ManageSponsoredContent: () => ({
id: "newtab-menu-manage-sponsored-content",
action: actionCreators.OnlyToMain({ type: actionTypes.SETTINGS_OPEN }),
+ userEvent: "OPEN_NEWTAB_PREFS",
}),
OurSponsorsAndYourPrivacy: () => ({
id: "newtab-menu-our-sponsors-and-your-privacy",
@@ -2211,6 +2212,7 @@ const LinkMenuOptions = {
url: "https://support.mozilla.org/kb/pocket-sponsored-stories-new-tabs",
},
}),
+ userEvent: "CLICK_PRIVACY_INFO",
}),
ReportAd: site => {
return {
@@ -2437,19 +2439,16 @@ class _DSLinkMenu extends (external_React_default()).PureComponent {
dispatch
} = this.props;
let TOP_STORIES_CONTEXT_MENU_OPTIONS;
- const PREF_REPORT_CONTENT_ENABLED = "discoverystream.reportContent.enabled";
+ const PREF_REPORT_ADS_ENABLED = "discoverystream.reportAds.enabled";
const prefs = this.props.Prefs.values;
- const showReporting = prefs[PREF_REPORT_CONTENT_ENABLED];
+ const showAdsReporting = prefs[PREF_REPORT_ADS_ENABLED];
const isSpoc = this.props.card_type === "spoc";
if (isSpoc) {
- TOP_STORIES_CONTEXT_MENU_OPTIONS = ["BlockUrl", ...(showReporting ? ["ReportAd"] : []), "ManageSponsoredContent", "OurSponsorsAndYourPrivacy"];
+ TOP_STORIES_CONTEXT_MENU_OPTIONS = ["BlockUrl", ...(showAdsReporting ? ["ReportAd"] : []), "ManageSponsoredContent", "OurSponsorsAndYourPrivacy"];
} else {
const saveToPocketOptions = this.props.pocket_button_enabled ? ["CheckArchiveFromPocket", "CheckSavedToPocket"] : [];
- TOP_STORIES_CONTEXT_MENU_OPTIONS = ["CheckBookmark", ...(showReporting && this.props.section ? ["ReportContent"] : []), ...saveToPocketOptions, "Separator", "OpenInNewWindow", "OpenInPrivateWindow", "Separator", "BlockUrl"];
+ TOP_STORIES_CONTEXT_MENU_OPTIONS = ["CheckBookmark", ...(this.props.section ? ["ReportContent"] : []), ...saveToPocketOptions, "Separator", "OpenInNewWindow", "OpenInPrivateWindow", "Separator", "BlockUrl"];
}
-
- // eslint-disable-next-line no-console
- console.log("dslinkmenu prop", this.props);
const type = this.props.type || "DISCOVERY_STREAM";
const title = this.props.title || this.props.source;
return /*#__PURE__*/external_React_default().createElement("div", {
@@ -4521,6 +4520,7 @@ function ListFeed({
* @param spoc
* @param position
* @param type
+ * @param showAdReporting
* @returns {Element}
* @constructor
*/
@@ -4529,11 +4529,9 @@ function AdBannerContextMenu({
spoc,
position,
type,
- prefs
+ showAdReporting
}) {
- const PREF_REPORT_CONTENT_ENABLED = "discoverystream.reportContent.enabled";
- const showReporting = prefs[PREF_REPORT_CONTENT_ENABLED];
- const ADBANNER_CONTEXT_MENU_OPTIONS = ["BlockAdUrl", ...(showReporting ? ["ReportAd"] : []), "ManageSponsoredContent", "OurSponsorsAndYourPrivacy"];
+ const ADBANNER_CONTEXT_MENU_OPTIONS = ["BlockAdUrl", ...(showAdReporting ? ["ReportAd"] : []), "ManageSponsoredContent", "OurSponsorsAndYourPrivacy"];
const [showContextMenu, setShowContextMenu] = (0,external_React_namespaceObject.useState)(false);
const onClick = e => {
e.preventDefault();
@@ -4633,6 +4631,7 @@ const AdBanner = ({
};
};
const sectionsEnabled = prefs["discoverystream.sections.enabled"];
+ const showAdReporting = prefs["discoverystream.reportAds.enabled"];
const {
width: imgWidth,
height: imgHeight
@@ -4675,7 +4674,7 @@ const AdBanner = ({
spoc: spoc,
position: row,
type: type,
- prefs: prefs
+ showAdReporting: showAdReporting
}), /*#__PURE__*/external_React_default().createElement(SafeAnchor, {
className: "ad-banner-link",
url: spoc.url,
@@ -11412,7 +11411,8 @@ class _DiscoveryStreamBase extends (external_React_default()).PureComponent {
config
} = this.props.DiscoveryStream;
const topicSelectionEnabled = this.props.Prefs.values["discoverystream.topicSelection.enabled"];
- const reportContentEnabled = this.props.Prefs.values["discoverystream.reportContent.enabled"];
+ const reportAdsEnabled = this.props.Prefs.values["discoverystream.reportAds.enabled"];
+ const spocsEnabled = this.props.Prefs.values["unifiedAds.spocs.enabled"];
// Allow rendering without extracting special components
if (!config.collapsible) {
@@ -11474,14 +11474,12 @@ class _DiscoveryStreamBase extends (external_React_default()).PureComponent {
sectionTitle = "Editor’s Picks";
}
}
-
- // Render a DS-style TopSites then the rest if any in a collapsible section
const {
DiscoveryStream
} = this.props;
return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, this.props.DiscoveryStream.isPrivacyInfoModalVisible && /*#__PURE__*/external_React_default().createElement(DSPrivacyModal, {
dispatch: this.props.dispatch
- }), reportContentEnabled && /*#__PURE__*/external_React_default().createElement(ReportContent, {
+ }), (reportAdsEnabled && spocsEnabled || sectionsEnabled) && /*#__PURE__*/external_React_default().createElement(ReportContent, {
spocs: DiscoveryStream.spocs
}), topSites && this.renderLayout([{
width: 12,
diff --git a/browser/extensions/newtab/lib/ActivityStream.sys.mjs b/browser/extensions/newtab/lib/ActivityStream.sys.mjs
index 1c54cb46629..63a33eda837 100644
--- a/browser/extensions/newtab/lib/ActivityStream.sys.mjs
+++ b/browser/extensions/newtab/lib/ActivityStream.sys.mjs
@@ -610,10 +610,9 @@ export const PREFS_CONFIG = new Map([
},
],
[
- "discoverystream.reportContent.enabled",
+ "discoverystream.reportAds.enabled",
{
- title:
- "Boolean flag to enable reporting content and ads from the context menu",
+ title: "Boolean flag to enable reporting ads from the context menu",
value: false,
},
],
diff --git a/browser/extensions/newtab/test/unit/content-src/components/DiscoveryStreamComponents/AdBannerContextMenu.test.jsx b/browser/extensions/newtab/test/unit/content-src/components/DiscoveryStreamComponents/AdBannerContextMenu.test.jsx
index af53ed513d5..7ca3d134359 100644
--- a/browser/extensions/newtab/test/unit/content-src/components/DiscoveryStreamComponents/AdBannerContextMenu.test.jsx
+++ b/browser/extensions/newtab/test/unit/content-src/components/DiscoveryStreamComponents/AdBannerContextMenu.test.jsx
@@ -11,9 +11,7 @@ describe("", () => {
spoc: { url: "https://www.test.com/", shim: "aaabbbcccddd" },
position: 1,
type: "billboard",
- prefs: {
- "discoverystream.reportContent.enabled": true,
- },
+ prefs: {},
};
beforeEach(() => {
@@ -53,8 +51,34 @@ describe("", () => {
].forEach(prop => assert.property(linkMenuProps, prop));
});
- it("should pass through the correct menu options to LinkMenu for ad banners", () => {
- const reportPref = props.prefs["discoverystream.reportContent.enabled"];
+ it("should pass through the correct menu options to LinkMenu for ad banners with reporting INCLUDED", () => {
+ const propsWithReporting = {
+ ...props,
+ showAdReporting: true,
+ };
+ wrapper = shallow();
+ wrapper.find("moz-button").simulate("click", {
+ preventDefault: () => {},
+ });
+ const linkMenuProps = wrapper.find(LinkMenu).props();
+
+ const linkMenuOptions = [
+ "BlockAdUrl",
+ "ReportAd",
+ "ManageSponsoredContent",
+ "OurSponsorsAndYourPrivacy",
+ ];
+
+ assert.deepEqual(linkMenuProps.options, linkMenuOptions);
+ });
+
+ it("should pass through correct menu options to LinkMenu for ad banner with reporting EXCLUDED", () => {
+ const propsWithoutReporting = {
+ ...props,
+ showAdReporting: false,
+ };
+
+ wrapper = shallow();
wrapper.find("moz-button").simulate("click", {
preventDefault: () => {},
});
@@ -66,18 +90,7 @@ describe("", () => {
"OurSponsorsAndYourPrivacy",
];
- const optionsWithReporting = [
- "BlockAdUrl",
- "ReportAd",
- "ManageSponsoredContent",
- "OurSponsorsAndYourPrivacy",
- ];
-
- const expectedOptions = reportPref
- ? optionsWithReporting
- : linkMenuOptions;
-
- assert.deepEqual(linkMenuProps.options, expectedOptions);
+ assert.deepEqual(linkMenuProps.options, linkMenuOptions);
});
});
});
diff --git a/browser/locales/l10n-changesets.json b/browser/locales/l10n-changesets.json
index 4727347b2a6..567d2e10eb7 100644
--- a/browser/locales/l10n-changesets.json
+++ b/browser/locales/l10n-changesets.json
@@ -17,7 +17,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"af": {
"pin": false,
@@ -37,7 +37,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"an": {
"pin": false,
@@ -57,7 +57,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ar": {
"pin": false,
@@ -77,7 +77,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ast": {
"pin": false,
@@ -97,7 +97,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"az": {
"pin": false,
@@ -117,7 +117,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"be": {
"pin": false,
@@ -137,7 +137,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"bg": {
"pin": false,
@@ -157,7 +157,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"bn": {
"pin": false,
@@ -177,7 +177,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"bo": {
"pin": false,
@@ -197,7 +197,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"br": {
"pin": false,
@@ -217,7 +217,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"brx": {
"pin": false,
@@ -237,7 +237,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"bs": {
"pin": false,
@@ -257,7 +257,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ca": {
"pin": false,
@@ -277,7 +277,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ca-valencia": {
"pin": false,
@@ -297,7 +297,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"cak": {
"pin": false,
@@ -317,7 +317,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ckb": {
"pin": false,
@@ -337,7 +337,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"cs": {
"pin": false,
@@ -357,7 +357,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"cy": {
"pin": false,
@@ -377,7 +377,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"da": {
"pin": false,
@@ -397,7 +397,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"de": {
"pin": false,
@@ -417,7 +417,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"dsb": {
"pin": false,
@@ -437,7 +437,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"el": {
"pin": false,
@@ -457,7 +457,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"en-CA": {
"pin": false,
@@ -477,7 +477,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"en-GB": {
"pin": false,
@@ -497,7 +497,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"eo": {
"pin": false,
@@ -517,7 +517,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"es-AR": {
"pin": false,
@@ -537,7 +537,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"es-CL": {
"pin": false,
@@ -557,7 +557,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"es-ES": {
"pin": false,
@@ -577,7 +577,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"es-MX": {
"pin": false,
@@ -597,7 +597,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"et": {
"pin": false,
@@ -617,7 +617,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"eu": {
"pin": false,
@@ -637,7 +637,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"fa": {
"pin": false,
@@ -657,7 +657,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ff": {
"pin": false,
@@ -677,7 +677,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"fi": {
"pin": false,
@@ -697,7 +697,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"fr": {
"pin": false,
@@ -717,7 +717,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"fur": {
"pin": false,
@@ -737,7 +737,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"fy-NL": {
"pin": false,
@@ -757,7 +757,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ga-IE": {
"pin": false,
@@ -777,7 +777,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"gd": {
"pin": false,
@@ -797,7 +797,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"gl": {
"pin": false,
@@ -817,7 +817,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"gn": {
"pin": false,
@@ -837,7 +837,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"gu-IN": {
"pin": false,
@@ -857,7 +857,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"he": {
"pin": false,
@@ -877,7 +877,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"hi-IN": {
"pin": false,
@@ -897,7 +897,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"hr": {
"pin": false,
@@ -917,7 +917,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"hsb": {
"pin": false,
@@ -937,7 +937,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"hu": {
"pin": false,
@@ -957,7 +957,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"hy-AM": {
"pin": false,
@@ -977,7 +977,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"hye": {
"pin": false,
@@ -997,7 +997,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ia": {
"pin": false,
@@ -1017,7 +1017,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"id": {
"pin": false,
@@ -1037,7 +1037,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"is": {
"pin": false,
@@ -1057,7 +1057,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"it": {
"pin": false,
@@ -1077,7 +1077,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ja": {
"pin": false,
@@ -1095,7 +1095,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ja-JP-mac": {
"pin": false,
@@ -1103,7 +1103,7 @@
"macosx64",
"macosx64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ka": {
"pin": false,
@@ -1123,7 +1123,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"kab": {
"pin": false,
@@ -1143,7 +1143,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"kk": {
"pin": false,
@@ -1163,7 +1163,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"km": {
"pin": false,
@@ -1183,7 +1183,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"kn": {
"pin": false,
@@ -1203,7 +1203,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ko": {
"pin": false,
@@ -1223,7 +1223,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"lij": {
"pin": false,
@@ -1243,7 +1243,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"lo": {
"pin": false,
@@ -1263,7 +1263,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"lt": {
"pin": false,
@@ -1283,7 +1283,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ltg": {
"pin": false,
@@ -1303,7 +1303,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"lv": {
"pin": false,
@@ -1323,7 +1323,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"meh": {
"pin": false,
@@ -1343,7 +1343,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"mk": {
"pin": false,
@@ -1363,7 +1363,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ml": {
"pin": false,
@@ -1383,7 +1383,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"mr": {
"pin": false,
@@ -1403,7 +1403,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ms": {
"pin": false,
@@ -1423,7 +1423,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"my": {
"pin": false,
@@ -1443,7 +1443,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"nb-NO": {
"pin": false,
@@ -1463,7 +1463,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ne-NP": {
"pin": false,
@@ -1483,7 +1483,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"nl": {
"pin": false,
@@ -1503,7 +1503,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"nn-NO": {
"pin": false,
@@ -1523,7 +1523,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"oc": {
"pin": false,
@@ -1543,7 +1543,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"pa-IN": {
"pin": false,
@@ -1563,7 +1563,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"pl": {
"pin": false,
@@ -1583,7 +1583,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"pt-BR": {
"pin": false,
@@ -1603,7 +1603,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"pt-PT": {
"pin": false,
@@ -1623,7 +1623,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"rm": {
"pin": false,
@@ -1643,7 +1643,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ro": {
"pin": false,
@@ -1663,7 +1663,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ru": {
"pin": false,
@@ -1683,7 +1683,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"sat": {
"pin": false,
@@ -1703,7 +1703,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"sc": {
"pin": false,
@@ -1723,7 +1723,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"scn": {
"pin": false,
@@ -1743,7 +1743,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"sco": {
"pin": false,
@@ -1763,7 +1763,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"si": {
"pin": false,
@@ -1783,7 +1783,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"sk": {
"pin": false,
@@ -1803,7 +1803,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"skr": {
"pin": false,
@@ -1823,7 +1823,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"sl": {
"pin": false,
@@ -1843,7 +1843,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"son": {
"pin": false,
@@ -1863,7 +1863,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"sq": {
"pin": false,
@@ -1883,7 +1883,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"sr": {
"pin": false,
@@ -1903,7 +1903,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"sv-SE": {
"pin": false,
@@ -1923,7 +1923,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"szl": {
"pin": false,
@@ -1943,7 +1943,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ta": {
"pin": false,
@@ -1963,7 +1963,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"te": {
"pin": false,
@@ -1983,7 +1983,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"tg": {
"pin": false,
@@ -2003,7 +2003,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"th": {
"pin": false,
@@ -2023,7 +2023,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"tl": {
"pin": false,
@@ -2043,7 +2043,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"tr": {
"pin": false,
@@ -2063,7 +2063,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"trs": {
"pin": false,
@@ -2083,7 +2083,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"uk": {
"pin": false,
@@ -2103,7 +2103,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"ur": {
"pin": false,
@@ -2123,7 +2123,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"uz": {
"pin": false,
@@ -2143,7 +2143,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"vi": {
"pin": false,
@@ -2163,7 +2163,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"wo": {
"pin": false,
@@ -2183,7 +2183,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"xh": {
"pin": false,
@@ -2203,7 +2203,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"zh-CN": {
"pin": false,
@@ -2223,7 +2223,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
},
"zh-TW": {
"pin": false,
@@ -2243,6 +2243,6 @@
"win64-aarch64-devedition",
"win64-devedition"
],
- "revision": "22ddd09d5b7bf939862d445984bc2c3095dc2503"
+ "revision": "467538f140e3a848feafd5eba60654350dcce57f"
}
}
\ No newline at end of file
diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp
index 7b5f63b61c5..05cdc124858 100644
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -2849,7 +2849,7 @@ void nsPIDOMWindowInner::TryToCacheTopInnerWindow() {
}
}
-void nsPIDOMWindowInner::UpdateActiveIndexedDBDatabaseCount(int32_t aDelta) {
+void nsGlobalWindowInner::UpdateActiveIndexedDBDatabaseCount(int32_t aDelta) {
MOZ_ASSERT(NS_IsMainThread());
if (aDelta == 0) {
@@ -2865,7 +2865,7 @@ void nsPIDOMWindowInner::UpdateActiveIndexedDBDatabaseCount(int32_t aDelta) {
counter += aDelta;
}
-bool nsGlobalWindowInner::HasActiveIndexedDBDatabases() {
+bool nsGlobalWindowInner::HasActiveIndexedDBDatabases() const {
MOZ_ASSERT(NS_IsMainThread());
return mTopInnerWindow ? mTopInnerWindow->mNumOfIndexedDBDatabases > 0
diff --git a/dom/base/nsGlobalWindowInner.h b/dom/base/nsGlobalWindowInner.h
index effa95d67df..9e6ae30c93e 100644
--- a/dom/base/nsGlobalWindowInner.h
+++ b/dom/base/nsGlobalWindowInner.h
@@ -335,12 +335,15 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
void Freeze(bool aIncludeSubWindows = true);
void Thaw(bool aIncludeSubWindows = true);
virtual bool IsFrozen() const override;
- virtual bool HasActiveIndexedDBDatabases() override;
+ virtual bool HasActiveIndexedDBDatabases() const override;
virtual bool HasActivePeerConnections() override;
virtual bool HasOpenWebSockets() const override;
virtual bool HasScheduledNormalOrHighPriorityWebTasks() const override;
void SyncStateFromParentWindow();
virtual void UpdateWebSocketCount(int32_t aDelta) override;
+ // Increase/Decrease the number of active IndexedDB databases for the
+ // decision making of timeout-throttling.
+ virtual void UpdateActiveIndexedDBDatabaseCount(int32_t aDelta) override;
// Called on the current inner window of a browsing context when its
// background state changes according to selected tab or visibility of the
diff --git a/dom/base/nsIGlobalObject.h b/dom/base/nsIGlobalObject.h
index 281e41fe1c2..33419699591 100644
--- a/dom/base/nsIGlobalObject.h
+++ b/dom/base/nsIGlobalObject.h
@@ -336,7 +336,7 @@ class nsIGlobalObject : public nsISupports {
}
// Return true if there is any active IndexedDB databases which could block
// timeout-throttling.
- virtual bool HasActiveIndexedDBDatabases() { return false; }
+ virtual bool HasActiveIndexedDBDatabases() const { return false; }
/**
* Check whether the active peer connection count is non-zero.
*/
@@ -352,6 +352,9 @@ class nsIGlobalObject : public nsISupports {
}
virtual void UpdateWebSocketCount(int32_t aDelta) {};
+ // Increase/Decrease the number of active IndexedDB databases for the
+ // decision making of timeout-throttling.
+ virtual void UpdateActiveIndexedDBDatabaseCount(int32_t aDelta) {}
/**
* Report a localized error message to the error console. Currently this
diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h
index b8e612086ad..53c53254799 100644
--- a/dom/base/nsPIDOMWindow.h
+++ b/dom/base/nsPIDOMWindow.h
@@ -340,10 +340,6 @@ class nsPIDOMWindowInner : public mozIDOMWindow {
// indexedDB counters.
void TryToCacheTopInnerWindow();
- // Increase/Decrease the number of active IndexedDB databases for the
- // decision making of timeout-throttling.
- void UpdateActiveIndexedDBDatabaseCount(int32_t aDelta);
-
mozilla::Maybe GetClientInfo() const;
mozilla::Maybe GetClientState() const;
mozilla::Maybe GetController() const;
diff --git a/dom/chrome-webidl/WindowGlobalActors.webidl b/dom/chrome-webidl/WindowGlobalActors.webidl
index ead070a2fec..54b47719782 100644
--- a/dom/chrome-webidl/WindowGlobalActors.webidl
+++ b/dom/chrome-webidl/WindowGlobalActors.webidl
@@ -178,6 +178,7 @@ interface WindowGlobalChild {
readonly attribute boolean isInProcess;
readonly attribute BrowsingContext browsingContext;
readonly attribute WindowContext windowContext;
+ readonly attribute WindowProxy? contentWindow;
readonly attribute boolean isCurrentGlobal;
diff --git a/dom/indexedDB/IDBFactory.cpp b/dom/indexedDB/IDBFactory.cpp
index 860b14e5720..a17d45fdac2 100644
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -404,8 +404,8 @@ void IDBFactory::UpdateActiveDatabaseCount(int32_t aDelta) {
(mActiveDatabaseCount + aDelta) < mActiveDatabaseCount);
mActiveDatabaseCount += aDelta;
- if (nsGlobalWindowInner* win = GetOwnerWindow()) {
- win->UpdateActiveIndexedDBDatabaseCount(aDelta);
+ if (nsIGlobalObject* global = GetOwnerGlobal()) {
+ global->UpdateActiveIndexedDBDatabaseCount(aDelta);
}
}
diff --git a/dom/ipc/WindowGlobalChild.cpp b/dom/ipc/WindowGlobalChild.cpp
index 356f12605e1..de149d7126c 100644
--- a/dom/ipc/WindowGlobalChild.cpp
+++ b/dom/ipc/WindowGlobalChild.cpp
@@ -258,6 +258,13 @@ dom::BrowsingContext* WindowGlobalChild::BrowsingContext() {
return mWindowContext->GetBrowsingContext();
}
+Nullable WindowGlobalChild::GetContentWindow() {
+ if (IsCurrentGlobal()) {
+ return WindowProxyHolder(BrowsingContext());
+ }
+ return nullptr;
+}
+
uint64_t WindowGlobalChild::InnerWindowId() {
return mWindowContext->InnerWindowId();
}
diff --git a/dom/ipc/WindowGlobalChild.h b/dom/ipc/WindowGlobalChild.h
index b90f692ddcd..b5f207a5b9c 100644
--- a/dom/ipc/WindowGlobalChild.h
+++ b/dom/ipc/WindowGlobalChild.h
@@ -14,6 +14,7 @@
#include "nsWrapperCache.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/WindowGlobalActor.h"
+#include "mozilla/dom/WindowProxyHolder.h"
class nsGlobalWindowInner;
class nsDocShell;
@@ -53,6 +54,8 @@ class WindowGlobalChild final : public WindowGlobalActor,
dom::WindowContext* WindowContext() const { return mWindowContext; }
nsGlobalWindowInner* GetWindowGlobal() const { return mWindowGlobal; }
+ Nullable GetContentWindow();
+
// Has this actor been shut down
bool IsClosed() { return !CanSend(); }
void Destroy();
diff --git a/dom/quota/ActorsParent.cpp b/dom/quota/ActorsParent.cpp
index 28d0936938d..7422444b83f 100644
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -2699,12 +2699,7 @@ void QuotaManager::UpdateOriginAccessTime(
MutexAutoUnlock autoUnlock(mQuotaMutex);
- auto op = CreateSaveOriginAccessTimeOp(WrapMovingNotNullUnchecked(this),
- aOriginMetadata, timestamp);
-
- RegisterNormalOriginOp(*op);
-
- op->RunImmediately();
+ SaveOriginAccessTime(aOriginMetadata, timestamp);
}
}
@@ -6589,6 +6584,21 @@ RefPtr QuotaManager::InitializeAllTemporaryOrigins() {
return promise;
}
+RefPtr QuotaManager::SaveOriginAccessTime(
+ const OriginMetadata& aOriginMetadata, int64_t aTimestamp) {
+ AssertIsOnOwningThread();
+ MOZ_ASSERT(aOriginMetadata.mPersistenceType != PERSISTENCE_TYPE_PERSISTENT);
+
+ auto saveOriginAccessTimeOp = CreateSaveOriginAccessTimeOp(
+ WrapMovingNotNullUnchecked(this), aOriginMetadata, aTimestamp);
+
+ RegisterNormalOriginOp(*saveOriginAccessTimeOp);
+
+ saveOriginAccessTimeOp->RunImmediately();
+
+ return saveOriginAccessTimeOp->OnResults();
+}
+
RefPtr QuotaManager::GetUsage(
bool aGetAll, RefPtr aOnCancelPromise) {
AssertIsOnOwningThread();
diff --git a/dom/quota/OriginOperations.cpp b/dom/quota/OriginOperations.cpp
index 6c997a13ce2..ffdd087aa7a 100644
--- a/dom/quota/OriginOperations.cpp
+++ b/dom/quota/OriginOperations.cpp
@@ -114,7 +114,7 @@ class FinalizeOriginEvictionOp : public OriginOperationBase {
};
class SaveOriginAccessTimeOp
- : public OpenStorageDirectoryHelper {
+ : public OpenStorageDirectoryHelper> {
const OriginMetadata mOriginMetadata;
int64_t mTimestamp;
@@ -129,8 +129,6 @@ class SaveOriginAccessTimeOp
AssertIsOnOwningThread();
}
- NS_INLINE_DECL_REFCOUNTING(SaveOriginAccessTimeOp, override)
-
private:
~SaveOriginAccessTimeOp() = default;
@@ -138,7 +136,7 @@ class SaveOriginAccessTimeOp
virtual nsresult DoDirectoryWork(QuotaManager& aQuotaManager) override;
- virtual void SendResults() override;
+ bool UnwrapResolveValue() override { return true; }
void CloseDirectory() override;
};
@@ -1006,7 +1004,7 @@ RefPtr CreateFinalizeOriginEvictionOp(
std::move(aLocks));
}
-RefPtr CreateSaveOriginAccessTimeOp(
+RefPtr> CreateSaveOriginAccessTimeOp(
MovingNotNull> aQuotaManager,
const OriginMetadata& aOriginMetadata, int64_t aTimestamp) {
return MakeRefPtr(std::move(aQuotaManager),
@@ -1331,8 +1329,6 @@ nsresult SaveOriginAccessTimeOp::DoDirectoryWork(QuotaManager& aQuotaManager) {
return NS_OK;
}
-void SaveOriginAccessTimeOp::SendResults() {}
-
void SaveOriginAccessTimeOp::CloseDirectory() {
AssertIsOnOwningThread();
diff --git a/dom/quota/OriginOperations.h b/dom/quota/OriginOperations.h
index dd3d1c54a44..50fdcd169e6 100644
--- a/dom/quota/OriginOperations.h
+++ b/dom/quota/OriginOperations.h
@@ -45,7 +45,7 @@ RefPtr CreateFinalizeOriginEvictionOp(
MovingNotNull> aQuotaManager,
nsTArray>&& aLocks);
-RefPtr CreateSaveOriginAccessTimeOp(
+RefPtr> CreateSaveOriginAccessTimeOp(
MovingNotNull> aQuotaManager,
const OriginMetadata& aOriginMetadata, int64_t aTimestamp);
diff --git a/dom/quota/QuotaManager.h b/dom/quota/QuotaManager.h
index 365b42ca20c..1d6beca4071 100644
--- a/dom/quota/QuotaManager.h
+++ b/dom/quota/QuotaManager.h
@@ -510,6 +510,9 @@ class QuotaManager final : public BackgroundThreadObject {
public:
RefPtr InitializeAllTemporaryOrigins();
+ RefPtr SaveOriginAccessTime(
+ const OriginMetadata& aOriginMetadata, int64_t aTimestamp);
+
RefPtr GetUsage(
bool aGetAll, RefPtr aOnCancelPromise = nullptr);
diff --git a/dom/quota/test/gtest/TestQuotaManager.cpp b/dom/quota/test/gtest/TestQuotaManager.cpp
index 16dacfa0b4e..a11af94c847 100644
--- a/dom/quota/test/gtest/TestQuotaManager.cpp
+++ b/dom/quota/test/gtest/TestQuotaManager.cpp
@@ -17,6 +17,7 @@
#include "mozilla/dom/quota/UniversalDirectoryLock.h"
#include "mozilla/gtest/MozAssertions.h"
#include "nsFmtString.h"
+#include "prtime.h"
#include "QuotaManagerDependencyFixture.h"
#include "QuotaManagerTestHelpers.h"
@@ -1989,6 +1990,39 @@ TEST_F(TestQuotaManager,
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
}
+// Tests the availability of SaveOriginAccessTime and verifies that calling it
+// does not trigger temporary storage or origin initialization.
+TEST_F(TestQuotaManager, SaveOriginAccessTime_Simple) {
+ auto testOriginMetadata = GetTestOriginMetadata();
+
+ ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
+
+ ASSERT_NO_FATAL_FAILURE(AssertStorageNotInitialized());
+ ASSERT_NO_FATAL_FAILURE(AssertTemporaryStorageNotInitialized());
+ ASSERT_NO_FATAL_FAILURE(
+ AssertTemporaryOriginNotInitialized(testOriginMetadata));
+
+ PerformOnBackgroundThread([testOriginMetadata]() {
+ QuotaManager* quotaManager = QuotaManager::Get();
+ ASSERT_TRUE(quotaManager);
+
+ {
+ int64_t timestamp = PR_Now();
+
+ auto value = Await(
+ quotaManager->SaveOriginAccessTime(testOriginMetadata, timestamp));
+ ASSERT_TRUE(value.IsResolve());
+ }
+ });
+
+ ASSERT_NO_FATAL_FAILURE(AssertStorageInitialized());
+ ASSERT_NO_FATAL_FAILURE(AssertTemporaryStorageNotInitialized());
+ ASSERT_NO_FATAL_FAILURE(
+ AssertTemporaryOriginNotInitialized(testOriginMetadata));
+
+ ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
+}
+
// Test simple ClearStoragesForOrigin.
TEST_F(TestQuotaManager, ClearStoragesForOrigin_Simple) {
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
diff --git a/dom/security/nsContentSecurityUtils.cpp b/dom/security/nsContentSecurityUtils.cpp
index 13f24b160fd..be117589712 100644
--- a/dom/security/nsContentSecurityUtils.cpp
+++ b/dom/security/nsContentSecurityUtils.cpp
@@ -1959,7 +1959,6 @@ void nsContentSecurityUtils::AssertChromePageHasCSP(Document* aDocument) {
"chrome://global/content/appPicker.xhtml"_ns,
"chrome://global/content/backgroundPageThumbs.xhtml"_ns,
"chrome://global/content/megalist/megalist.html"_ns,
- "chrome://global/content/selectDialog.xhtml"_ns,
// Test files
"chrome://mochikit/"_ns,
"chrome://mochitests/"_ns,
diff --git a/dom/webgpu/ExternalTexture.cpp b/dom/webgpu/ExternalTexture.cpp
index d972097e3a5..491548ff941 100644
--- a/dom/webgpu/ExternalTexture.cpp
+++ b/dom/webgpu/ExternalTexture.cpp
@@ -37,7 +37,8 @@ UniquePtr ExternalTexture::Create(
UniquePtr texture;
#ifdef XP_WIN
- texture = ExternalTextureD3D11::Create(aWidth, aHeight, aFormat, aUsage);
+ texture = ExternalTextureD3D11::Create(aParent, aDeviceId, aWidth, aHeight,
+ aFormat, aUsage);
#elif defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID)
texture = ExternalTextureDMABuf::Create(aParent, aDeviceId, aWidth, aHeight,
aFormat, aUsage);
diff --git a/dom/webgpu/ExternalTexture.h b/dom/webgpu/ExternalTexture.h
index c84ba30844f..5653f3e5944 100644
--- a/dom/webgpu/ExternalTexture.h
+++ b/dom/webgpu/ExternalTexture.h
@@ -43,6 +43,7 @@ class ExtTex : public ObjectBase {
void Cleanup() {}
};
+class ExternalTextureD3D11;
class ExternalTextureDMABuf;
class ExternalTextureMacIOSurface;
class WebGPUParent;
@@ -62,10 +63,7 @@ class ExternalTexture {
const ffi::WGPUTextureUsages aUsage);
virtual ~ExternalTexture();
- virtual void* GetExternalTextureHandle() { return nullptr; }
-
- virtual Maybe ToSurfaceDescriptor(
- Maybe& aFenceInfo) = 0;
+ virtual Maybe ToSurfaceDescriptor() = 0;
virtual void GetSnapshot(const ipc::Shmem& aDestShmem,
const gfx::IntSize& aSize) {}
@@ -76,6 +74,8 @@ class ExternalTexture {
return nullptr;
}
+ virtual ExternalTextureD3D11* AsExternalTextureD3D11() { return nullptr; }
+
gfx::IntSize GetSize() { return gfx::IntSize(mWidth, mHeight); }
void SetSubmissionIndex(uint64_t aSubmissionIndex);
@@ -114,8 +114,7 @@ class ExternalTextureReadBackPresent final : public ExternalTexture {
const ffi::WGPUTextureUsages aUsage);
virtual ~ExternalTextureReadBackPresent();
- Maybe ToSurfaceDescriptor(
- Maybe& aFenceInfo) override {
+ Maybe ToSurfaceDescriptor() override {
return Nothing();
}
};
diff --git a/dom/webgpu/ExternalTextureD3D11.cpp b/dom/webgpu/ExternalTextureD3D11.cpp
index 09830abc027..e5be9c0f9a4 100644
--- a/dom/webgpu/ExternalTextureD3D11.cpp
+++ b/dom/webgpu/ExternalTextureD3D11.cpp
@@ -9,15 +9,40 @@
#include "mozilla/gfx/DeviceManagerDx.h"
#include "mozilla/gfx/Logging.h"
+#include "mozilla/layers/FenceD3D11.h"
+#include "mozilla/layers/GpuProcessD3D11FencesHolderMap.h"
#include "mozilla/layers/ImageDataSerializer.h"
+#include "mozilla/webgpu/WebGPUParent.h"
namespace mozilla::webgpu {
// static
UniquePtr ExternalTextureD3D11::Create(
+ WebGPUParent* aParent, const ffi::WGPUDeviceId aDeviceId,
const uint32_t aWidth, const uint32_t aHeight,
const struct ffi::WGPUTextureFormat aFormat,
const ffi::WGPUTextureUsages aUsage) {
+ auto* fencesHolderMap = layers::GpuProcessD3D11FencesHolderMap::Get();
+ if (!fencesHolderMap) {
+ MOZ_ASSERT_UNREACHABLE("unexpected to be called");
+ gfxCriticalNoteOnce << "Failed to get FencesHolderMap";
+ return nullptr;
+ }
+
+ RefPtr fenceHandle =
+ aParent->GetDeviceFenceHandle(aDeviceId);
+ if (!fenceHandle) {
+ gfxCriticalNoteOnce << "Failed to get fenceHandle";
+ return nullptr;
+ }
+
+ RefPtr fence =
+ layers::FenceD3D11::CreateFromHandle(fenceHandle);
+ if (!fence) {
+ gfxCriticalNoteOnce << "Failed create FenceD3D11";
+ return nullptr;
+ }
+
const RefPtr d3d11Device =
gfx::DeviceManagerDx::Get()->GetCompositorDevice();
if (!d3d11Device) {
@@ -53,55 +78,74 @@ UniquePtr ExternalTextureD3D11::Create(
texture->QueryInterface((IDXGIResource1**)getter_AddRefs(resource));
if (!resource) {
gfxCriticalNoteOnce << "Failed to get IDXGIResource";
- return 0;
+ return nullptr;
}
HANDLE sharedHandle;
hr = resource->CreateSharedHandle(
nullptr, DXGI_SHARED_RESOURCE_READ | DXGI_SHARED_RESOURCE_WRITE, nullptr,
&sharedHandle);
- if (FAILED(hr)) {
+ if (FAILED(hr) || !sharedHandle) {
gfxCriticalNoteOnce << "GetSharedHandle failed: " << gfx::hexa(hr);
- return 0;
+ return nullptr;
}
RefPtr handle =
new gfx::FileHandleWrapper(UniqueFileHandle(sharedHandle));
+ auto fencesHolderId = layers::GpuProcessFencesHolderId::GetNext();
+ fencesHolderMap->Register(fencesHolderId);
+
return MakeUnique(aWidth, aHeight, aFormat, aUsage,
- texture, std::move(handle));
+ texture, std::move(handle),
+ fencesHolderId, std::move(fence));
}
ExternalTextureD3D11::ExternalTextureD3D11(
const uint32_t aWidth, const uint32_t aHeight,
const struct ffi::WGPUTextureFormat aFormat,
const ffi::WGPUTextureUsages aUsage, const RefPtr aTexture,
- RefPtr&& aSharedHandle)
+ RefPtr&& aSharedHandle,
+ const layers::GpuProcessFencesHolderId aFencesHolderId,
+ RefPtr&& aWriteFence)
: ExternalTexture(aWidth, aHeight, aFormat, aUsage),
mTexture(aTexture),
- mSharedHandle(std::move(aSharedHandle)) {
+ mSharedHandle(std::move(aSharedHandle)),
+ mFencesHolderId(aFencesHolderId),
+ mWriteFence(std::move(aWriteFence)) {
MOZ_ASSERT(mTexture);
}
ExternalTextureD3D11::~ExternalTextureD3D11() {}
void* ExternalTextureD3D11::GetExternalTextureHandle() {
- if (!mSharedHandle) {
- return nullptr;
- }
+ RefPtr device;
+ mTexture->GetDevice(getter_AddRefs(device));
+ auto* fencesHolderMap = layers::GpuProcessD3D11FencesHolderMap::Get();
+ MOZ_ASSERT(fencesHolderMap);
+
+ // XXX deliver fences to wgpu
+ fencesHolderMap->WaitAllFencesAndForget(mFencesHolderId, device);
return mSharedHandle->GetHandle();
}
-Maybe ExternalTextureD3D11::ToSurfaceDescriptor(
- Maybe& aFenceInfo) {
+Maybe ExternalTextureD3D11::ToSurfaceDescriptor() {
+ MOZ_ASSERT(mSubmissionIndex > 0);
+
+ mWriteFence->Update(mSubmissionIndex);
+
+ auto* fencesHolderMap = layers::GpuProcessD3D11FencesHolderMap::Get();
+ MOZ_ASSERT(fencesHolderMap);
+ fencesHolderMap->SetWriteFence(mFencesHolderId, mWriteFence);
+
const auto format = gfx::SurfaceFormat::B8G8R8A8;
return Some(layers::SurfaceDescriptorD3D10(
mSharedHandle,
/* gpuProcessTextureId */ Nothing(),
/* arrayIndex */ 0, format, gfx::IntSize(mWidth, mHeight),
gfx::ColorSpace2::SRGB, gfx::ColorRange::FULL,
- /* hasKeyedMutex */ false, aFenceInfo));
+ /* hasKeyedMutex */ false, Some(mFencesHolderId)));
}
void ExternalTextureD3D11::GetSnapshot(const ipc::Shmem& aDestShmem,
diff --git a/dom/webgpu/ExternalTextureD3D11.h b/dom/webgpu/ExternalTextureD3D11.h
index 74f4cbdc863..0ffe8c3dc30 100644
--- a/dom/webgpu/ExternalTextureD3D11.h
+++ b/dom/webgpu/ExternalTextureD3D11.h
@@ -13,11 +13,16 @@ struct ID3D11Texture2D;
namespace mozilla {
+namespace layers {
+class FenceD3D11;
+} // namespace layers
+
namespace webgpu {
class ExternalTextureD3D11 final : public ExternalTexture {
public:
static UniquePtr Create(
+ WebGPUParent* aParent, const ffi::WGPUDeviceId aDeviceId,
const uint32_t aWidth, const uint32_t aHeight,
const struct ffi::WGPUTextureFormat aFormat,
const ffi::WGPUTextureUsages aUsage);
@@ -26,20 +31,25 @@ class ExternalTextureD3D11 final : public ExternalTexture {
const struct ffi::WGPUTextureFormat aFormat,
const ffi::WGPUTextureUsages aUsage,
const RefPtr aTexture,
- RefPtr&& aSharedHandle);
+ RefPtr&& aSharedHandle,
+ const layers::GpuProcessFencesHolderId aFencesHolderId,
+ RefPtr&& aWriteFence);
virtual ~ExternalTextureD3D11();
- void* GetExternalTextureHandle() override;
+ void* GetExternalTextureHandle();
- Maybe ToSurfaceDescriptor(
- Maybe& aFenceInfo) override;
+ Maybe ToSurfaceDescriptor() override;
void GetSnapshot(const ipc::Shmem& aDestShmem,
const gfx::IntSize& aSize) override;
+ ExternalTextureD3D11* AsExternalTextureD3D11() override { return this; }
+
protected:
const RefPtr mTexture;
const RefPtr mSharedHandle;
+ const layers::GpuProcessFencesHolderId mFencesHolderId;
+ const RefPtr mWriteFence;
};
} // namespace webgpu
diff --git a/dom/webgpu/ExternalTextureDMABuf.cpp b/dom/webgpu/ExternalTextureDMABuf.cpp
index 7eda87479be..c375968ee15 100644
--- a/dom/webgpu/ExternalTextureDMABuf.cpp
+++ b/dom/webgpu/ExternalTextureDMABuf.cpp
@@ -97,10 +97,7 @@ ExternalTextureDMABuf::ExternalTextureDMABuf(
ExternalTextureDMABuf::~ExternalTextureDMABuf() {}
-void* ExternalTextureDMABuf::GetExternalTextureHandle() { return nullptr; }
-
-Maybe ExternalTextureDMABuf::ToSurfaceDescriptor(
- Maybe& aFenceInfo) {
+Maybe ExternalTextureDMABuf::ToSurfaceDescriptor() {
layers::SurfaceDescriptor sd;
if (!mSurface->Serialize(sd)) {
return Nothing();
diff --git a/dom/webgpu/ExternalTextureDMABuf.h b/dom/webgpu/ExternalTextureDMABuf.h
index 374b4c1fbfc..b65cc00db40 100644
--- a/dom/webgpu/ExternalTextureDMABuf.h
+++ b/dom/webgpu/ExternalTextureDMABuf.h
@@ -35,10 +35,7 @@ class ExternalTextureDMABuf final : public ExternalTexture {
const layers::SurfaceDescriptorDMABuf& aSurfaceDescriptor);
virtual ~ExternalTextureDMABuf();
- void* GetExternalTextureHandle() override;
-
- Maybe ToSurfaceDescriptor(
- Maybe& aFenceInfo) override;
+ Maybe ToSurfaceDescriptor() override;
void GetSnapshot(const ipc::Shmem& aDestShmem,
const gfx::IntSize& aSize) override;
diff --git a/dom/webgpu/ExternalTextureMacIOSurface.cpp b/dom/webgpu/ExternalTextureMacIOSurface.cpp
index 3f6c863959d..6324b85fecf 100644
--- a/dom/webgpu/ExternalTextureMacIOSurface.cpp
+++ b/dom/webgpu/ExternalTextureMacIOSurface.cpp
@@ -55,17 +55,12 @@ ExternalTextureMacIOSurface::ExternalTextureMacIOSurface(
ExternalTextureMacIOSurface::~ExternalTextureMacIOSurface() {}
-void* ExternalTextureMacIOSurface::GetExternalTextureHandle() {
- return nullptr;
-}
-
uint32_t ExternalTextureMacIOSurface::GetIOSurfaceId() {
return mSurface->GetIOSurfaceID();
}
Maybe
-ExternalTextureMacIOSurface::ToSurfaceDescriptor(
- Maybe& aFenceInfo) {
+ExternalTextureMacIOSurface::ToSurfaceDescriptor() {
MOZ_ASSERT(mSubmissionIndex > 0);
RefPtr gpuFence;
diff --git a/dom/webgpu/ExternalTextureMacIOSurface.h b/dom/webgpu/ExternalTextureMacIOSurface.h
index 031e9193759..0f6b1023274 100644
--- a/dom/webgpu/ExternalTextureMacIOSurface.h
+++ b/dom/webgpu/ExternalTextureMacIOSurface.h
@@ -32,10 +32,7 @@ class ExternalTextureMacIOSurface final : public ExternalTexture {
RefPtr&& aSurface);
virtual ~ExternalTextureMacIOSurface();
- void* GetExternalTextureHandle() override;
-
- Maybe ToSurfaceDescriptor(
- Maybe& aFenceInfo) override;
+ Maybe ToSurfaceDescriptor() override;
void GetSnapshot(const ipc::Shmem& aDestShmem,
const gfx::IntSize& aSize) override;
diff --git a/dom/webgpu/ipc/WebGPUParent.cpp b/dom/webgpu/ipc/WebGPUParent.cpp
index 61e36037c3a..033355e7b72 100644
--- a/dom/webgpu/ipc/WebGPUParent.cpp
+++ b/dom/webgpu/ipc/WebGPUParent.cpp
@@ -22,6 +22,7 @@
#if defined(XP_WIN)
# include "mozilla/gfx/DeviceManagerDx.h"
+# include "mozilla/webgpu/ExternalTextureD3D11.h"
#endif
#if defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID)
@@ -86,7 +87,12 @@ extern void* wgpu_server_get_external_texture_handle(void* aParam,
void* sharedHandle = nullptr;
#ifdef XP_WIN
- sharedHandle = texture->GetExternalTextureHandle();
+ auto* textureD3D11 = texture->AsExternalTextureD3D11();
+ if (!textureD3D11) {
+ MOZ_ASSERT_UNREACHABLE("unexpected to be called");
+ return nullptr;
+ }
+ sharedHandle = textureD3D11->GetExternalTextureHandle();
if (!sharedHandle) {
MOZ_ASSERT_UNREACHABLE("unexpected to be called");
gfxCriticalNoteOnce << "Failed to get shared handle";
@@ -1428,19 +1434,11 @@ void WebGPUParent::PostExternalTexture(
const auto surfaceFormat = gfx::SurfaceFormat::B8G8R8A8;
const auto size = aExternalTexture->GetSize();
- const auto index = aExternalTexture->GetSubmissionIndex();
- MOZ_ASSERT(index != 0);
RefPtr data = lookup->second.get();
- Maybe fenceInfo;
- auto it = mDeviceFenceHandles.find(data->mDeviceId);
- if (it != mDeviceFenceHandles.end()) {
- fenceInfo = Some(gfx::FenceInfo(it->second, index));
- }
-
Maybe desc =
- aExternalTexture->ToSurfaceDescriptor(fenceInfo);
+ aExternalTexture->ToSurfaceDescriptor();
if (!desc) {
MOZ_ASSERT_UNREACHABLE("unexpected to be called");
return;
@@ -1456,6 +1454,15 @@ void WebGPUParent::PostExternalTexture(
}
}
+RefPtr WebGPUParent::GetDeviceFenceHandle(
+ const RawId aDeviceId) {
+ auto it = mDeviceFenceHandles.find(aDeviceId);
+ if (it == mDeviceFenceHandles.end()) {
+ return nullptr;
+ }
+ return it->second;
+}
+
ipc::IPCResult WebGPUParent::RecvSwapChainPresent(
RawId aTextureId, RawId aCommandEncoderId,
const layers::RemoteTextureId& aRemoteTextureId,
diff --git a/dom/webgpu/ipc/WebGPUParent.h b/dom/webgpu/ipc/WebGPUParent.h
index fe7162ec4f4..ff6d749e09c 100644
--- a/dom/webgpu/ipc/WebGPUParent.h
+++ b/dom/webgpu/ipc/WebGPUParent.h
@@ -190,6 +190,8 @@ class WebGPUParent final : public PWebGPUParent, public SupportsWeakPtr {
return mActiveDeviceIds.Contains(aDeviceId);
}
+ RefPtr GetDeviceFenceHandle(const RawId aDeviceId);
+
private:
static void MapCallback(uint8_t* aUserData,
ffi::WGPUBufferMapAsyncStatus aStatus);
diff --git a/dom/workers/WorkerScope.h b/dom/workers/WorkerScope.h
index a663e9897be..cbe7c1fc6db 100644
--- a/dom/workers/WorkerScope.h
+++ b/dom/workers/WorkerScope.h
@@ -218,8 +218,20 @@ class WorkerGlobalScopeBase : public DOMEventTargetHelper,
mNumOfOpenWebSockets += aDelta;
}
+ // Increase/Decrease the number of active IndexedDB databases for the
+ // decision making of timeout-throttling.
+ void UpdateActiveIndexedDBDatabaseCount(int32_t aDelta) override {
+ AssertIsOnWorkerThread();
+ mNumOfIndexedDBDatabases += aDelta;
+ }
+
bool HasOpenWebSockets() const override { return mNumOfOpenWebSockets; }
+ bool HasActiveIndexedDBDatabases() const override {
+ AssertIsOnWorkerThread();
+ return mNumOfIndexedDBDatabases;
+ }
+
void TriggerUpdateCCFlag() override {
mWorkerPrivate->UpdateCCFlag(WorkerPrivate::CCFlag::EligibleForTimeout);
}
@@ -247,6 +259,7 @@ class WorkerGlobalScopeBase : public DOMEventTargetHelper,
#endif
mozilla::UniquePtr mTimeoutManager;
uint32_t mNumOfOpenWebSockets{};
+ uint32_t mNumOfIndexedDBDatabases{};
};
namespace workerinternals {
diff --git a/editor/libeditor/tests/mochitest.toml b/editor/libeditor/tests/mochitest.toml
index e8ab9288b2f..3b6f6191f08 100644
--- a/editor/libeditor/tests/mochitest.toml
+++ b/editor/libeditor/tests/mochitest.toml
@@ -444,6 +444,7 @@ skip-if = ["os == 'android'"] # Needs interaction with the scrollbar
["test_editing_UI_in_plaintext-only.html"]
["test_execCommandPaste_noTarget.html"]
+skip-if = ["display == 'wayland'"] # Bug 1935188
["test_focus_caret_navigation_between_nested_editors.html"]
diff --git a/editor/libeditor/tests/test_bug578771.html b/editor/libeditor/tests/test_bug578771.html
index 5cf7b23e525..1a2414fb5d3 100644
--- a/editor/libeditor/tests/test_bug578771.html
+++ b/editor/libeditor/tests/test_bug578771.html
@@ -31,13 +31,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=578771
ce.focus();
synthesizeMouse(elem, 5, 5, {clickCount: 2 });
- ok(elem.selectionStart == 0 && elem.selectionEnd == 7,
- " Double-clicking on another " + elemTag + " works correctly");
+ is(elem.selectionStart, 0, `${elemTag} selectionStart after double-click`);
+ is(elem.selectionEnd, 7, `${elemTag} selectionEnd after double-click`);
ce.focus();
synthesizeMouse(elem, 5, 5, {clickCount: 3 });
- ok(elem.selectionStart == 0 && elem.selectionEnd == 14,
- "Triple-clicking on another " + elemTag + " works correctly");
+ is(elem.selectionStart, 0, `${elemTag} selectionStart after triple-click`);
+ is(elem.selectionEnd, 14, `${elemTag} selectionEnd after triple-click`);
}
// Avoid platform selection differences
SimpleTest.waitForFocus(function() {
diff --git a/gfx/gl/SharedSurfaceANGLE.cpp b/gfx/gl/SharedSurfaceANGLE.cpp
index 54200bb5c33..e61ba5fdbaf 100644
--- a/gfx/gl/SharedSurfaceANGLE.cpp
+++ b/gfx/gl/SharedSurfaceANGLE.cpp
@@ -177,7 +177,7 @@ SharedSurface_ANGLEShareHandle::ToSurfaceDescriptor() {
mSharedHandle, /* gpuProcessTextureId */ Nothing(),
/* arrayIndex */ 0, format, mDesc.size, mDesc.colorSpace,
gfx::ColorRange::FULL, /* hasKeyedMutex */ true,
- /* fenceInfo */ Nothing()));
+ /* fencesHolderId */ Nothing()));
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/gfx/gl/SharedSurfaceD3D11Interop.cpp b/gfx/gl/SharedSurfaceD3D11Interop.cpp
index c39cd0d4699..b6c86afd73e 100644
--- a/gfx/gl/SharedSurfaceD3D11Interop.cpp
+++ b/gfx/gl/SharedSurfaceD3D11Interop.cpp
@@ -452,7 +452,7 @@ SharedSurface_D3D11Interop::ToSurfaceDescriptor() {
mData.dxgiHandle, /* gpuProcessTextureId */ Nothing(),
/* arrayIndex */ 0, format, mDesc.size, mDesc.colorSpace,
gfx::ColorRange::FULL, /* hasKeyedMutex */ true,
- /* fenceInfo */ Nothing()));
+ /* fencesHolderId */ Nothing()));
}
//////////////////////////////////////////////////////////////////////////////////////////
diff --git a/gfx/ipc/FileHandleWrapper.h b/gfx/ipc/FileHandleWrapper.h
index 6ca905bd617..b507b5d1a16 100644
--- a/gfx/ipc/FileHandleWrapper.h
+++ b/gfx/ipc/FileHandleWrapper.h
@@ -43,20 +43,6 @@ class FileHandleWrapper {
const mozilla::UniqueFileHandle mHandle;
};
-struct FenceInfo {
- FenceInfo() = default;
- FenceInfo(FileHandleWrapper* aFenceHandle, uint64_t aFenceValue)
- : mFenceHandle(aFenceHandle), mFenceValue(aFenceValue) {}
-
- bool operator==(const FenceInfo& aOther) const {
- return mFenceHandle == aOther.mFenceHandle &&
- mFenceValue == aOther.mFenceValue;
- }
-
- RefPtr mFenceHandle;
- uint64_t mFenceValue = 0;
-};
-
} // namespace gfx
} // namespace mozilla
diff --git a/gfx/ipc/GfxMessageUtils.h b/gfx/ipc/GfxMessageUtils.h
index 5ebd5b2c025..484be9d6804 100644
--- a/gfx/ipc/GfxMessageUtils.h
+++ b/gfx/ipc/GfxMessageUtils.h
@@ -1203,24 +1203,6 @@ struct ParamTraits {
}
};
-template <>
-struct ParamTraits {
- typedef mozilla::gfx::FenceInfo paramType;
-
- static void Write(MessageWriter* aWriter, const paramType& aParam) {
- WriteParam(aWriter, aParam.mFenceHandle);
- WriteParam(aWriter, aParam.mFenceValue);
- }
-
- static bool Read(MessageReader* aReader, paramType* aResult) {
- if (!ReadParam(aReader, &aResult->mFenceHandle) ||
- !ReadParam(aReader, &aResult->mFenceValue)) {
- return false;
- }
- return true;
- }
-};
-
} // namespace IPC
namespace mozilla {
diff --git a/gfx/layers/d3d11/FenceD3D11.cpp b/gfx/layers/d3d11/FenceD3D11.cpp
index 0486872b5ee..01230865ca2 100644
--- a/gfx/layers/d3d11/FenceD3D11.cpp
+++ b/gfx/layers/d3d11/FenceD3D11.cpp
@@ -63,6 +63,11 @@ RefPtr FenceD3D11::Create(ID3D11Device* aDevice) {
/* static */
RefPtr FenceD3D11::CreateFromHandle(
RefPtr aHandle) {
+ MOZ_ASSERT(aHandle);
+
+ if (!aHandle) {
+ return nullptr;
+ }
// Opening shared handle is deferred.
return new FenceD3D11(aHandle);
}
@@ -125,10 +130,6 @@ RefPtr FenceD3D11::CloneFromHandle() {
return fence;
}
-gfx::FenceInfo FenceD3D11::GetFenceInfo() const {
- return gfx::FenceInfo(mHandle, mFenceValue);
-}
-
bool FenceD3D11::IncrementAndSignal() {
MOZ_ASSERT(mDevice);
MOZ_ASSERT(mSignalFence);
diff --git a/gfx/layers/d3d11/FenceD3D11.h b/gfx/layers/d3d11/FenceD3D11.h
index 54c191a0ca2..69919a782d6 100644
--- a/gfx/layers/d3d11/FenceD3D11.h
+++ b/gfx/layers/d3d11/FenceD3D11.h
@@ -62,8 +62,6 @@ class FenceD3D11 final : public Fence {
uint64_t GetFenceValue() const { return mFenceValue; }
- gfx::FenceInfo GetFenceInfo() const;
-
const RefPtr mHandle;
protected:
diff --git a/gfx/layers/d3d11/GpuProcessD3D11FencesHolderMap.cpp b/gfx/layers/d3d11/GpuProcessD3D11FencesHolderMap.cpp
index 55ab2924520..94bfd145f3c 100644
--- a/gfx/layers/d3d11/GpuProcessD3D11FencesHolderMap.cpp
+++ b/gfx/layers/d3d11/GpuProcessD3D11FencesHolderMap.cpp
@@ -17,13 +17,13 @@ StaticAutoPtr
/* static */
void GpuProcessD3D11FencesHolderMap::Init() {
- MOZ_ASSERT(XRE_IsGPUProcess());
+ MOZ_ASSERT(XRE_IsGPUProcess() || XRE_IsParentProcess());
sInstance = new GpuProcessD3D11FencesHolderMap();
}
/* static */
void GpuProcessD3D11FencesHolderMap::Shutdown() {
- MOZ_ASSERT(XRE_IsGPUProcess());
+ MOZ_ASSERT(XRE_IsGPUProcess() || XRE_IsParentProcess());
sInstance = nullptr;
}
diff --git a/gfx/layers/d3d11/TextureD3D11.cpp b/gfx/layers/d3d11/TextureD3D11.cpp
index 3d5a8020ab7..7528ea471f0 100644
--- a/gfx/layers/d3d11/TextureD3D11.cpp
+++ b/gfx/layers/d3d11/TextureD3D11.cpp
@@ -425,7 +425,7 @@ bool D3D11TextureData::SerializeSpecific(
*aOutDesc = SurfaceDescriptorD3D10(
mSharedHandle, mGpuProcessTextureId, mArrayIndex, mFormat, mSize,
mColorSpace, mColorRange, /* hasKeyedMutex */ mHasKeyedMutex,
- /* fenceInfo */ Nothing());
+ /* fencesHolderId */ Nothing());
return true;
}
@@ -921,9 +921,7 @@ DXGITextureHostD3D11::DXGITextureHostD3D11(
mSize(aDescriptor.size()),
mFormat(aDescriptor.format()),
mHasKeyedMutex(aDescriptor.hasKeyedMutex()),
- mAcquireFenceInfo(aDescriptor.fenceInfo().isSome()
- ? aDescriptor.fenceInfo().ref()
- : gfx::FenceInfo()),
+ mFencesHolderId(aDescriptor.fencesHolderId()),
mColorSpace(aDescriptor.colorSpace()),
mColorRange(aDescriptor.colorRange()) {}
@@ -1182,7 +1180,7 @@ void DXGITextureHostD3D11::CreateRenderTexture(
RefPtr texture = new wr::RenderDXGITextureHost(
mHandle, mGpuProcessTextureId, mArrayIndex, mFormat, mColorSpace,
- mColorRange, mSize, mHasKeyedMutex, mAcquireFenceInfo);
+ mColorRange, mSize, mHasKeyedMutex, mFencesHolderId);
if (mFlags & TextureFlags::SOFTWARE_DECODED_VIDEO) {
texture->SetIsSoftwareDecodedVideo();
}
diff --git a/gfx/layers/d3d11/TextureD3D11.h b/gfx/layers/d3d11/TextureD3D11.h
index 86debb7b62a..f49bfa97e51 100644
--- a/gfx/layers/d3d11/TextureD3D11.h
+++ b/gfx/layers/d3d11/TextureD3D11.h
@@ -26,7 +26,6 @@ namespace mozilla {
namespace gfx {
class FileHandleWrapper;
-struct FenceInfo;
} // namespace gfx
namespace gl {
@@ -398,7 +397,7 @@ class DXGITextureHostD3D11 : public TextureHost {
const gfx::IntSize mSize;
const gfx::SurfaceFormat mFormat;
const bool mHasKeyedMutex;
- const gfx::FenceInfo mAcquireFenceInfo;
+ const Maybe mFencesHolderId;
const gfx::ColorSpace2 mColorSpace;
const gfx::ColorRange mColorRange;
};
diff --git a/gfx/layers/d3d11/TextureHostWrapperD3D11.cpp b/gfx/layers/d3d11/TextureHostWrapperD3D11.cpp
index efcb75776dc..a6900e0faf2 100644
--- a/gfx/layers/d3d11/TextureHostWrapperD3D11.cpp
+++ b/gfx/layers/d3d11/TextureHostWrapperD3D11.cpp
@@ -257,7 +257,7 @@ RefPtr TextureHostWrapperD3D11::CreateFromBufferTexture(
auto descD3D10 = SurfaceDescriptorD3D10(
nullptr, Some(id),
/* arrayIndex */ 0, gfx::SurfaceFormat::NV12, size, colorSpace,
- colorRange, /* hasKeyedMutex */ false, /* fenceInfo */ Nothing());
+ colorRange, /* hasKeyedMutex */ false, /* fencesHolderId */ Nothing());
RefPtr textureHostD3D11 =
new DXGITextureHostD3D11(flags, descD3D10);
diff --git a/gfx/layers/ipc/LayersSurfaces.ipdlh b/gfx/layers/ipc/LayersSurfaces.ipdlh
index e5b279306a8..5e24ddeab4c 100644
--- a/gfx/layers/ipc/LayersSurfaces.ipdlh
+++ b/gfx/layers/ipc/LayersSurfaces.ipdlh
@@ -22,7 +22,6 @@ using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
using mozilla::gfx::IntRect from "mozilla/gfx/Rect.h";
using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
using mozilla::gfx::Matrix4x4 from "mozilla/gfx/Matrix.h";
-using mozilla::gfx::FenceInfo from "mozilla/gfx/FileHandleWrapper.h";
[RefCounted] using mozilla::gfx::FileHandleWrapper from "mozilla/gfx/FileHandleWrapper.h";
using gfxImageFormat from "gfxTypes.h";
using mozilla::layers::MaybeVideoBridgeSource from "mozilla/layers/VideoBridgeUtils.h";
@@ -48,7 +47,7 @@ namespace layers {
ColorSpace2 colorSpace;
ColorRange colorRange;
bool hasKeyedMutex;
- FenceInfo? fenceInfo;
+ GpuProcessFencesHolderId? fencesHolderId;
};
[Comparable] struct SurfaceDescriptorDXGIYCbCr {
diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
index 39c76fab144..38e847aa2a0 100644
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -77,6 +77,7 @@
#if defined(XP_WIN)
# include "gfxWindowsPlatform.h"
+# include "mozilla/layers/GpuProcessD3D11FencesHolderMap.h"
# include "mozilla/widget/WinWindowOcclusionTracker.h"
#elif defined(XP_DARWIN)
# include "gfxPlatformMac.h"
@@ -1336,6 +1337,9 @@ void gfxPlatform::InitLayersIPC() {
}
#endif
if (!gfxConfig::IsEnabled(Feature::GPU_PROCESS)) {
+#if defined(XP_WIN)
+ GpuProcessD3D11FencesHolderMap::Init();
+#endif
RemoteTextureMap::Init();
wr::RenderThread::Start(GPUProcessManager::Get()->AllocateNamespace());
image::ImageMemoryReporter::InitForWebRender();
@@ -1391,6 +1395,7 @@ void gfxPlatform::ShutdownLayersIPC() {
StaticPrefs::GetPrefName_gfx_webrender_blob_tile_size()));
}
#if defined(XP_WIN)
+ GpuProcessD3D11FencesHolderMap::Shutdown();
widget::WinWindowOcclusionTracker::ShutDown();
#endif
} else {
@@ -3974,6 +3979,9 @@ void gfxPlatform::DisableGPUProcess() {
"FEATURE_FAILURE_DISABLED_BY_GPU_PROCESS_DISABLED"_ns);
}
+#if defined(XP_WIN)
+ GpuProcessD3D11FencesHolderMap::Init();
+#endif
RemoteTextureMap::Init();
// We need to initialize the parent process to prepare for WebRender if we
// did not end up disabling it, despite losing the GPU process.
diff --git a/gfx/webrender_bindings/RenderD3D11TextureHost.cpp b/gfx/webrender_bindings/RenderD3D11TextureHost.cpp
index 928b9499b94..a6a55a139b4 100644
--- a/gfx/webrender_bindings/RenderD3D11TextureHost.cpp
+++ b/gfx/webrender_bindings/RenderD3D11TextureHost.cpp
@@ -30,7 +30,7 @@ RenderDXGITextureHost::RenderDXGITextureHost(
const uint32_t aArrayIndex, const gfx::SurfaceFormat aFormat,
const gfx::ColorSpace2 aColorSpace, const gfx::ColorRange aColorRange,
const gfx::IntSize aSize, bool aHasKeyedMutex,
- const gfx::FenceInfo& aAcquireFenceInfo)
+ const Maybe& aFencesHolderId)
: mHandle(aHandle),
mGpuProcessTextureId(aGpuProcessTextureId),
mArrayIndex(aArrayIndex),
@@ -42,7 +42,7 @@ RenderDXGITextureHost::RenderDXGITextureHost(
mColorRange(aColorRange),
mSize(aSize),
mHasKeyedMutex(aHasKeyedMutex),
- mAcquireFenceInfo(aAcquireFenceInfo),
+ mFencesHolderId(aFencesHolderId),
mLocked(false) {
MOZ_COUNT_CTOR_INHERITED(RenderDXGITextureHost, RenderTextureHost);
MOZ_ASSERT((mFormat != gfx::SurfaceFormat::NV12 &&
@@ -367,19 +367,20 @@ wr::WrExternalImage RenderDXGITextureHost::Lock(uint8_t aChannelIndex,
}
bool RenderDXGITextureHost::LockInternal() {
- if (!mLocked) {
- if (mAcquireFenceInfo.mFenceHandle) {
- if (!mAcquireFence) {
- mAcquireFence = layers::FenceD3D11::CreateFromHandle(
- mAcquireFenceInfo.mFenceHandle);
- }
- if (mAcquireFence) {
- MOZ_ASSERT(mAcquireFenceInfo.mFenceHandle == mAcquireFence->mHandle);
+ MOZ_ASSERT(mTexture);
- mAcquireFence->Update(mAcquireFenceInfo.mFenceValue);
- RefPtr d3d11Device =
- gfx::DeviceManagerDx::Get()->GetCompositorDevice();
- mAcquireFence->Wait(d3d11Device);
+ if (!mLocked) {
+ if (mFencesHolderId.isSome()) {
+ auto* fencesHolderMap = layers::GpuProcessD3D11FencesHolderMap::Get();
+ if (!fencesHolderMap) {
+ MOZ_ASSERT_UNREACHABLE("unexpected to be called");
+ return false;
+ }
+ RefPtr device;
+ mTexture->GetDevice(getter_AddRefs(device));
+
+ if (!fencesHolderMap->WaitWriteFence(mFencesHolderId.ref(), device)) {
+ return false;
}
}
if (mKeyedMutex) {
@@ -468,7 +469,7 @@ gfx::IntSize RenderDXGITextureHost::GetSize(uint8_t aChannelIndex) const {
bool RenderDXGITextureHost::SyncObjectNeeded() {
return mGpuProcessTextureId.isNothing() && !mHasKeyedMutex &&
- !mAcquireFenceInfo.mFenceHandle;
+ mFencesHolderId.isNothing();
}
RenderDXGIYCbCrTextureHost::RenderDXGIYCbCrTextureHost(
@@ -641,12 +642,12 @@ bool RenderDXGIYCbCrTextureHost::EnsureD3D11Texture2D(ID3D11Device* aDevice) {
bool RenderDXGIYCbCrTextureHost::LockInternal() {
if (!mLocked) {
- auto* fenceHolderMap = layers::GpuProcessD3D11FencesHolderMap::Get();
- if (!fenceHolderMap) {
+ auto* fencesHolderMap = layers::GpuProcessD3D11FencesHolderMap::Get();
+ if (!fencesHolderMap) {
MOZ_ASSERT_UNREACHABLE("unexpected to be called");
return false;
}
- if (!fenceHolderMap->WaitWriteFence(mFencesHolderId, mDevice)) {
+ if (!fencesHolderMap->WaitWriteFence(mFencesHolderId, mDevice)) {
return false;
}
mLocked = true;
diff --git a/gfx/webrender_bindings/RenderD3D11TextureHost.h b/gfx/webrender_bindings/RenderD3D11TextureHost.h
index fc6d55cc9b7..061571d5237 100644
--- a/gfx/webrender_bindings/RenderD3D11TextureHost.h
+++ b/gfx/webrender_bindings/RenderD3D11TextureHost.h
@@ -32,7 +32,7 @@ class RenderDXGITextureHost final : public RenderTextureHostSWGL {
const uint32_t aArrayIndex, const gfx::SurfaceFormat aFormat,
const gfx::ColorSpace2 aColorSpace, const gfx::ColorRange aColorRange,
const gfx::IntSize aSize, const bool aHasKeyedMutex,
- const gfx::FenceInfo& aAcquireFenceInfo);
+ const Maybe& aFencesHolderId);
wr::WrExternalImage Lock(uint8_t aChannelIndex, gl::GLContext* aGL) override;
void Unlock() override;
@@ -121,15 +121,13 @@ class RenderDXGITextureHost final : public RenderTextureHostSWGL {
bool mIsSoftwareDecodedVideo = false;
- RefPtr mAcquireFence;
-
public:
const gfx::SurfaceFormat mFormat;
const gfx::ColorSpace2 mColorSpace;
const gfx::ColorRange mColorRange;
const gfx::IntSize mSize;
const bool mHasKeyedMutex;
- const gfx::FenceInfo mAcquireFenceInfo;
+ const Maybe mFencesHolderId;
private:
bool mLocked;
diff --git a/gfx/wr/webrender/src/scene_building.rs b/gfx/wr/webrender/src/scene_building.rs
index 22ac36f751f..d45e514422c 100644
--- a/gfx/wr/webrender/src/scene_building.rs
+++ b/gfx/wr/webrender/src/scene_building.rs
@@ -393,10 +393,15 @@ impl PictureChainBuilder {
// If no picture was created for this stacking context, create a
// pass-through wrapper now. This is only needed in 1-2 edge cases
// now, and will be removed as a follow up.
+
+ // If the picture is snapshotted, it needs to have a surface rather
+ // than being pass-through.
+ let composite_mode = snapshot.map(|_| PictureCompositeMode::Blit(BlitReason::SNAPSHOT));
+
let pic_index = PictureIndex(prim_store.pictures
.alloc()
.init(PicturePrimitive::new_image(
- None,
+ composite_mode,
Picture3DContext::Out,
self.flags,
prim_list,
@@ -644,6 +649,10 @@ impl<'a> SceneBuilder<'a> {
&builder.interners,
);
+ for pic_index in &builder.snapshot_pictures {
+ builder.picture_graph.add_root(*pic_index);
+ }
+
// Add all the tile cache pictures as roots of the picture graph
for pic_index in &tile_cache_pictures {
builder.picture_graph.add_root(*pic_index);
@@ -2618,7 +2627,10 @@ impl<'a> SceneBuilder<'a> {
// 3d render context.
for child_pic_index in &prim_list.child_pictures {
let child_pic = &mut self.prim_store.pictures[child_pic_index.0];
- child_pic.composite_mode = None;
+ let needs_surface = child_pic.snapshot.is_some();
+ if !needs_surface {
+ child_pic.composite_mode = None;
+ }
child_pic.context_3d = Picture3DContext::Out;
}
diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp
index 1b052da2d9a..a58efeabe0c 100644
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -839,11 +839,17 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer {
sMostRecentHighRate = rate;
}
+#ifdef DEBUG
// On 32-bit Windows we sometimes get times where TimeStamp::Now() is not
// monotonic because the underlying system apis produce non-monontonic
- // results. (bug 1306896)
-#if !defined(_WIN32)
+ // results; see bug 1306896.
+ // On Wayland, vsync timestamp might not precisely match system time; see
+ // bug 1958043.
+# if defined(_WIN32) || defined(MOZ_WAYLAND)
+ Unused << NS_WARN_IF(aVsyncTimestamp > tickStart);
+# else
MOZ_ASSERT(aVsyncTimestamp <= tickStart);
+# endif
#endif
bool shouldGiveNonVSyncTasksMoreTime = ShouldGiveNonVsyncTasksMoreTime();
diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp
index 09c9dd43e52..8b190c2bb55 100644
--- a/layout/generic/nsIFrame.cpp
+++ b/layout/generic/nsIFrame.cpp
@@ -4615,6 +4615,10 @@ nsresult nsIFrame::GetDataForTableSelection(
}
static bool IsEditingHost(const nsIFrame* aFrame) {
+ if (aFrame->Style()->GetPseudoType() ==
+ PseudoStyleType::mozTextControlEditingRoot) {
+ return true;
+ }
nsIContent* content = aFrame->GetContent();
return content && content->IsEditingHost();
}
@@ -4666,8 +4670,6 @@ bool nsIFrame::ShouldHaveLineIfEmpty() const {
break;
case PseudoStyleType::scrolledContent:
return GetParent()->ShouldHaveLineIfEmpty();
- case PseudoStyleType::mozTextControlEditingRoot:
- return true;
case PseudoStyleType::buttonContent:
// HTML quirk.
return GetContent()->IsHTMLElement(nsGkAtoms::input);
@@ -5460,6 +5462,23 @@ struct MOZ_STACK_CLASS FrameContentRange {
int32_t end;
};
+static bool IsRelevantBlockFrame(const nsIFrame* aFrame) {
+ if (!aFrame->IsBlockOutside()) {
+ return false;
+ }
+ if (aFrame->GetContent()->IsInNativeAnonymousSubtree()) {
+ // This helps skipping things like scrollbar parts.
+ return false;
+ }
+ auto pseudoType = aFrame->Style()->GetPseudoType();
+ if (PseudoStyle::IsAnonBox(pseudoType)) {
+ // Table cell contents should be considered block boundaries for this
+ // purpose.
+ return pseudoType == PseudoStyleType::cellContent;
+ }
+ return true;
+}
+
// Retrieve the content offsets of a frame
static FrameContentRange GetRangeForFrame(const nsIFrame* aFrame) {
nsIContent* content = aFrame->GetContent();
@@ -5486,7 +5505,7 @@ static FrameContentRange GetRangeForFrame(const nsIFrame* aFrame) {
MOZ_ASSERT(!content->IsBeingRemoved());
nsIContent* parent = content->GetParent();
- if (aFrame->IsBlockOutside() || !parent) {
+ if (IsRelevantBlockFrame(aFrame) || !parent) {
return FrameContentRange(content, 0, content->GetChildCount());
}
@@ -9385,7 +9404,7 @@ static nsContentAndOffset FindLineBreakingFrame(nsIFrame* aFrame,
// the content of the inline frames they were created from. The
// first/last child of such frames is the real block frame we're
// looking for.
- if ((aFrame->IsBlockOutside() &&
+ if ((IsRelevantBlockFrame(aFrame) &&
!aFrame->HasAnyStateBits(NS_FRAME_PART_OF_IBSPLIT)) ||
aFrame->IsBrFrame()) {
nsIContent* content = aFrame->GetContent();
@@ -9427,7 +9446,7 @@ nsresult nsIFrame::PeekOffsetForParagraph(PeekOffsetStruct* aPos) {
nsIFrame* frame = this;
nsContentAndOffset blockFrameOrBR;
blockFrameOrBR.mContent = nullptr;
- bool reachedLimit = frame->IsBlockOutside() || IsEditingHost(frame);
+ bool reachedLimit = IsRelevantBlockFrame(frame) || IsEditingHost(frame);
auto traverse = [&aPos](nsIFrame* current) {
return aPos->mDirection == eDirPrevious ? current->GetPrevSibling()
@@ -9463,7 +9482,8 @@ nsresult nsIFrame::PeekOffsetForParagraph(PeekOffsetStruct* aPos) {
break;
}
frame = parent;
- reachedLimit = frame && (frame->IsBlockOutside() || IsEditingHost(frame));
+ reachedLimit =
+ frame && (IsRelevantBlockFrame(frame) || IsEditingHost(frame));
}
if (reachedLimit) { // no "stop frame" found
diff --git a/layout/generic/test/test_selection_tripleclick.html b/layout/generic/test/test_selection_tripleclick.html
index a912eb46863..62ad6b94843 100644
--- a/layout/generic/test/test_selection_tripleclick.html
+++ b/layout/generic/test/test_selection_tripleclick.html
@@ -5,6 +5,7 @@
Some code
with text with code
in it
@@ -15,6 +16,8 @@ some more code with pre-formatted
whitespace that should be selected
line by line
+Some code
with text with code
in it
+
-
-
-
diff --git a/testing/web-platform/tests/IndexedDB/key_invalid.any.js b/testing/web-platform/tests/IndexedDB/key_invalid.any.js
new file mode 100644
index 00000000000..2d673ed5e91
--- /dev/null
+++ b/testing/web-platform/tests/IndexedDB/key_invalid.any.js
@@ -0,0 +1,134 @@
+// META: global=window,worker
+// META: title=Invalid key
+// META: script=resources/support.js
+
+// Spec: https://w3c.github.io/IndexedDB/#key-construct
+
+'use strict';
+
+const invalid_key = (desc, key) => {
+ async_test(t => {
+ const db = createdb_for_multiple_tests();
+ let objStore = null;
+ let objStore2 = null;
+
+ const is_cloneable = o => {
+ try {
+ self.postMessage(o, '*');
+ return true;
+ } catch (ex) {
+ return false;
+ }
+ };
+
+ db.setTest(t).onupgradeneeded = t.step_func(e => {
+ objStore = objStore || e.target.result.createObjectStore('store');
+ assert_throws_dom('DataError', () => {
+ objStore.add('value', key);
+ });
+
+ if (is_cloneable(key)) {
+ objStore2 = objStore2 || e.target.result.createObjectStore('store2', {
+ keyPath: ['x', 'keypath'],
+ });
+ assert_throws_dom('DataError', () => {
+ objStore.add('value', key);
+ });
+ }
+ t.done();
+ });
+ }, 'Invalid key - ' + desc);
+};
+
+const fake_array = {
+ length: 0,
+ constructor: Array,
+};
+
+const ArrayClone = function() {};
+ArrayClone.prototype = Array;
+const ArrayClone_instance = new ArrayClone();
+
+// booleans
+invalid_key('true', true);
+invalid_key('false', false);
+
+// null/NaN/undefined
+invalid_key('null', null);
+invalid_key('NaN', NaN);
+invalid_key('undefined', undefined);
+invalid_key('undefined2');
+
+// functions
+invalid_key('function() {}', function() {});
+
+// objects
+invalid_key('{}', {});
+invalid_key('{ obj: 1 }', {obj: 1});
+invalid_key('Math', Math);
+invalid_key('self', self);
+invalid_key('{length:0,constructor:Array}', fake_array);
+invalid_key('Array clone’s instance', ArrayClone_instance);
+invalid_key('Array (object)', Array);
+invalid_key('String (object)', String);
+invalid_key('new String()', new String());
+invalid_key('new Number()', new Number());
+invalid_key('new Boolean()', new Boolean());
+
+// arrays
+invalid_key('[{}]', [{}]);
+invalid_key('[[], [], [], [[ Date ]]]', [[], [], [], [[Date]]]);
+invalid_key('[undefined]', [undefined]);
+invalid_key('[,1]', [, 1]);
+
+if (typeof document !== 'undefined') {
+ invalid_key(
+ 'document.getElementsByTagName("script")',
+ document.getElementsByTagName('script'));
+}
+
+// dates
+invalid_key('new Date(NaN)', new Date(NaN));
+invalid_key('new Date(Infinity)', new Date(Infinity));
+
+// regexes
+invalid_key('/foo/', /foo/);
+invalid_key('new RegExp()', new RegExp());
+
+const sparse = [];
+sparse[10] = 'hei';
+invalid_key('sparse array', sparse);
+
+const sparse2 = [];
+sparse2[0] = 1;
+sparse2[''] = 2;
+sparse2[2] = 3;
+invalid_key('sparse array 2', sparse2);
+
+invalid_key('[[1], [3], [7], [[ sparse array ]]]', [
+ [1],
+ [3],
+ [7],
+ [[sparse2]],
+]);
+
+// sparse3
+invalid_key('[1,2,3,,]', [
+ 1,
+ 2,
+ 3,
+ ,
+]);
+
+const recursive = [];
+recursive.push(recursive);
+invalid_key('array directly contains self', recursive);
+
+const recursive2 = [];
+recursive2.push([recursive2]);
+invalid_key('array indirectly contains self', recursive2);
+
+const recursive3 = [recursive];
+invalid_key('array member contains self', recursive3);
+
+invalid_key('proxy of an array', new Proxy([1, 2, 3], {}));
diff --git a/testing/web-platform/tests/IndexedDB/key_invalid.htm b/testing/web-platform/tests/IndexedDB/key_invalid.htm
deleted file mode 100644
index cf649b07d05..00000000000
--- a/testing/web-platform/tests/IndexedDB/key_invalid.htm
+++ /dev/null
@@ -1,131 +0,0 @@
-
-
-
-Invalid key
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/IndexedDB/key_valid.any.js b/testing/web-platform/tests/IndexedDB/key_valid.any.js
new file mode 100644
index 00000000000..8c015d331ba
--- /dev/null
+++ b/testing/web-platform/tests/IndexedDB/key_valid.any.js
@@ -0,0 +1,68 @@
+// META: global=window,worker
+// META: title=Valid key
+// META: script=resources/support.js
+
+// Spec: https://w3c.github.io/IndexedDB/#key-construct
+
+'use strict';
+
+const valid_key = (desc, key) => {
+ async_test(t => {
+ let db;
+ const open_rq = createdb(t);
+ open_rq.onupgradeneeded = t.step_func(e => {
+ db = e.target.result;
+ const store = db.createObjectStore('store');
+ assert_true(store.add('value', key) instanceof IDBRequest);
+
+ const store2 = db.createObjectStore('store2', {
+ keyPath: ['x', 'keypath'],
+ });
+ assert_true(store2.add({x: 'v', keypath: key}) instanceof IDBRequest);
+ });
+
+ open_rq.onsuccess = t.step_func(e => {
+ const rq =
+ db.transaction('store', 'readonly').objectStore('store').get(key);
+ rq.onsuccess = t.step_func(e => {
+ assert_equals(e.target.result, 'value');
+ const rq2 =
+ db.transaction('store2', 'readonly').objectStore('store2').get([
+ 'v', key
+ ]);
+ rq2.onsuccess = t.step_func(e => {
+ assert_equals(e.target.result.x, 'v');
+ assert_key_equals(e.target.result.keypath, key);
+ t.done();
+ });
+ });
+ });
+ }, 'Valid key - ' + desc);
+};
+
+// Date
+valid_key('new Date()', new Date());
+valid_key('new Date(0)', new Date(0));
+
+// Array
+valid_key('[]', []);
+valid_key('new Array()', new Array());
+
+valid_key('["undefined"]', ['undefined']);
+
+// Float
+valid_key('Infinity', Infinity);
+valid_key('-Infinity', -Infinity);
+valid_key('0', 0);
+valid_key('1.5', 1.5);
+valid_key('3e38', 3e38);
+valid_key('3e-38', 3e38);
+
+// String
+valid_key('"foo"', 'foo');
+valid_key('"\\n"', '\n');
+valid_key('""', '');
+valid_key('"\\""', '"');
+valid_key('"\\u1234"', '\u1234');
+valid_key('"\\u0000"', '\u0000');
+valid_key('"NaN"', 'NaN');
diff --git a/testing/web-platform/tests/IndexedDB/key_valid.html b/testing/web-platform/tests/IndexedDB/key_valid.html
deleted file mode 100644
index 0cca54cdbb3..00000000000
--- a/testing/web-platform/tests/IndexedDB/key_valid.html
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-Valid key
-
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/IndexedDB/keyorder.any.js b/testing/web-platform/tests/IndexedDB/keyorder.any.js
new file mode 100644
index 00000000000..fe3eb11fa92
--- /dev/null
+++ b/testing/web-platform/tests/IndexedDB/keyorder.any.js
@@ -0,0 +1,169 @@
+// META: global=window,worker
+// META: title=Key sort order
+// META: script=resources/support.js
+
+// Spec: https://w3c.github.io/IndexedDB/#key-construct
+
+'use strict';
+
+const global_db = createdb_for_multiple_tests();
+
+const keysort = (desc, unsorted, expected) => {
+ async_test(t => {
+ const store_name = 'store-' + Date.now() + Math.random();
+
+ // The database test
+ const open_rq = global_db.setTest(t);
+ open_rq.onupgradeneeded = t.step_func(e => {
+ const db = e.target.result;
+ const objStore = db.createObjectStore(store_name);
+
+ for (let i = 0; i < unsorted.length; i++)
+ objStore.add('value', unsorted[i]);
+ });
+
+ open_rq.onsuccess = t.step_func(e => {
+ const db = e.target.result;
+ const actual_keys = [];
+ const rq =
+ db.transaction(store_name).objectStore(store_name).openCursor();
+
+ rq.onsuccess = t.step_func(e => {
+ const cursor = e.target.result;
+
+ if (cursor) {
+ actual_keys.push(cursor.key);
+ cursor.continue();
+ } else {
+ assert_key_equals(actual_keys, expected, 'keyorder array');
+ assert_equals(actual_keys.length, expected.length, 'array length');
+
+ t.done();
+ }
+ });
+ });
+ }, `Database readback sort - ${desc}`);
+
+ // The IDBKey.cmp test
+ test(() => {
+ const sorted = unsorted.slice(0).sort((a, b) => indexedDB.cmp(a, b));
+ assert_key_equals(sorted, expected, 'sorted array');
+ }, `IDBKey.cmp sort - ${desc}`);
+};
+
+const now = new Date();
+const one_sec_ago = new Date(now - 1000);
+const one_min_future = new Date(now.getTime() + 1000 * 60);
+
+keysort('String < Array', [[0], 'yo', '', []], ['', 'yo', [], [0]]);
+
+keysort(
+ 'float < String', [Infinity, 'yo', 0, '', 100],
+ [0, 100, Infinity, '', 'yo']);
+
+keysort(
+ 'float < Date', [now, 0, 9999999999999, -0.22],
+ [-0.22, 0, 9999999999999, now]);
+
+keysort(
+ 'float < Date < String < Array', [[], '', now, [0], '-1', 0, 9999999999999],
+ [0, 9999999999999, now, '', '-1', [], [0]]);
+
+keysort(
+ 'Date(1 sec ago) < Date(now) < Date(1 minute in future)',
+ [now, one_sec_ago, one_min_future], [one_sec_ago, now, one_min_future]);
+
+keysort(
+ '-1.1 < 1 < 1.01337 < 1.013373 < 2', [1.013373, 2, 1.01337, -1.1, 1],
+ [-1.1, 1, 1.01337, 1.013373, 2]);
+
+keysort(
+ '-Infinity < -0.01 < 0 < Infinity', [0, -0.01, -Infinity, Infinity],
+ [-Infinity, -0.01, 0, Infinity]);
+
+keysort(
+ '"" < "a" < "ab" < "b" < "ba"', ['a', 'ba', '', 'b', 'ab'],
+ ['', 'a', 'ab', 'b', 'ba']);
+
+keysort(
+ 'Arrays', [[[0]], [0], [], [0, 0], [0, [0]]],
+ [[], [0], [0, 0], [0, [0]], [[0]]]);
+
+const big_array = [];
+const bigger_array = [];
+for (let i = 0; i < 10000; i++) {
+ big_array.push(i);
+ bigger_array.push(i);
+}
+bigger_array.push(0);
+
+keysort(
+ 'Array.length: 10,000 < Array.length: 10,001',
+ [bigger_array, [0, 2, 3], [0], [9], big_array],
+ [[0], big_array, bigger_array, [0, 2, 3], [9]]);
+
+keysort(
+ 'Infinity inside arrays',
+ [
+ [Infinity, 1],
+ [Infinity, Infinity],
+ [1, 1],
+ [1, Infinity],
+ [1, -Infinity],
+ [-Infinity, Infinity],
+ ],
+ [
+ [-Infinity, Infinity],
+ [1, -Infinity],
+ [1, 1],
+ [1, Infinity],
+ [Infinity, 1],
+ [Infinity, Infinity],
+ ]);
+
+keysort(
+ 'Test different stuff at once',
+ [
+ now,
+ [0, []],
+ 'test',
+ 1,
+ ['a', [1, [-1]]],
+ ['b', 'a'],
+ [0, 2, 'c'],
+ ['a', [1, 2]],
+ [],
+ [0, [], 3],
+ ['a', 'b'],
+ [1, 2],
+ ['a', 'b', 'c'],
+ one_sec_ago,
+ [0, 'b', 'c'],
+ Infinity,
+ -Infinity,
+ 2.55,
+ [0, now],
+ [1],
+ ],
+ [
+ -Infinity,
+ 1,
+ 2.55,
+ Infinity,
+ one_sec_ago,
+ now,
+ 'test',
+ [],
+ [0, 2, 'c'],
+ [0, now],
+ [0, 'b', 'c'],
+ [0, []],
+ [0, [], 3],
+ [1],
+ [1, 2],
+ ['a', 'b'],
+ ['a', 'b', 'c'],
+ ['a', [1, 2]],
+ ['a', [1, [-1]]],
+ ['b', 'a'],
+ ]);
diff --git a/testing/web-platform/tests/IndexedDB/keyorder.htm b/testing/web-platform/tests/IndexedDB/keyorder.htm
deleted file mode 100644
index 7e8b3d41264..00000000000
--- a/testing/web-platform/tests/IndexedDB/keyorder.htm
+++ /dev/null
@@ -1,175 +0,0 @@
-
-
-
-Key sort order
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/ai/language_detection/detector.https.tentative.any.js b/testing/web-platform/tests/ai/language_detection/detector.https.tentative.any.js
index 8c02df18cbe..8e4bedd05bb 100644
--- a/testing/web-platform/tests/ai/language_detection/detector.https.tentative.any.js
+++ b/testing/web-platform/tests/ai/language_detection/detector.https.tentative.any.js
@@ -22,6 +22,10 @@ promise_test(async t => {
}
}, 'Simple LanguageDetector.detect() call');
+promise_test(async t => {
+ testMonitor(LanguageDetector.create);
+}, 'LanguageDetector.create() notifies its monitor on downloadprogress');
+
promise_test(async t => {
const controller = new AbortController();
controller.abort();
@@ -82,19 +86,18 @@ promise_test(async t => {
detector.measureInputUsage('hello', {signal: controller.signal});
await promise_rejects_dom(t, 'AbortError', measureInputUsagePromise);
-}, 'Translator.measureInputUsage() call with an aborted signal.');
+}, 'LanguageDetector.measureInputUsage() call with an aborted signal.');
promise_test(async t => {
const detector = await LanguageDetector.create();
await testAbortPromise(t, signal => {
return detector.measureInputUsage('hello', {signal});
});
-}, 'Aborting Translator.measureInputUsage().');
+}, 'Aborting LanguageDetector.measureInputUsage().');
promise_test(async () => {
- const expected_languages = ['en', 'es'];
- const detector = await languageDetector.create({
- expectedInputLanguages: expected_languages
- });
- assert_array_equals(detector.expectedInputLanguages(), expected_languages);
+ const expectedLanguages = ['en', 'es'];
+ const detector = await LanguageDetector.create(
+ {expectedInputLanguages: expectedLanguages});
+ assert_array_equals(detector.expectedInputLanguages, expectedLanguages);
}, 'Creating LanguageDetector with expectedInputLanguages');
diff --git a/testing/web-platform/tests/ai/resources/util.js b/testing/web-platform/tests/ai/resources/util.js
index 49d677edae2..6433404580b 100644
--- a/testing/web-platform/tests/ai/resources/util.js
+++ b/testing/web-platform/tests/ai/resources/util.js
@@ -25,3 +25,33 @@ const testAbortPromise = async (t, method) => {
await promise_rejects_exactly(t, err, anotherPromise);
}
};
+
+async function testMonitor(createFunc, options = {}) {
+ let created = false;
+ const progressEvents = [];
+ function monitor(m) {
+ m.addEventListener('downloadprogress', e => {
+ // No progress events should be fired after `createFunc` resolves.
+ assert_false(created);
+
+ progressEvents.push(e);
+ });
+ }
+
+ await createFunc({...options, monitor});
+ created = true;
+
+ assert_greater_than_equal(progressEvents.length, 2);
+ assert_equals(progressEvents.at(0).loaded, 0);
+ assert_equals(progressEvents.at(-1).loaded, 1);
+
+ let lastProgressEventLoaded = -1;
+ for (const progressEvent of progressEvents) {
+ assert_equals(progressEvent.total, 1);
+ assert_less_than_equal(progressEvent.loaded, progressEvent.total);
+
+ // Progress events should have monotonically increasing `loaded` values.
+ assert_greater_than(progressEvent.loaded, lastProgressEventLoaded);
+ lastProgressEventLoaded = progressEvent.loaded;
+ }
+}
diff --git a/testing/web-platform/tests/ai/translator/translator_translate.tentative.https.any.js b/testing/web-platform/tests/ai/translator/translator_translate.tentative.https.any.js
index 5a800c00c69..a8aad5e03e1 100644
--- a/testing/web-platform/tests/ai/translator/translator_translate.tentative.https.any.js
+++ b/testing/web-platform/tests/ai/translator/translator_translate.tentative.https.any.js
@@ -108,39 +108,9 @@ promise_test(async t => {
}, 'Aborting Translator.translate().');
promise_test(async t => {
- let monitorCalled = false;
- let createdTranslator = false;
- const progressEvents = [];
- function monitor(m) {
- monitorCalled = true;
-
- m.addEventListener('downloadprogress', e => {
- // No progress events should have been fired after we've created the
- // translator.
- assert_false(createdTranslator);
-
- progressEvents.push(e);
- });
- }
-
- await createTranslator({sourceLanguage: 'en', targetLanguage: 'ja', monitor});
- createdTranslator = true;
-
- // Monitor callback must be called.
- assert_true(monitorCalled);
-
- // Must have at least 2 progress events, one for 0 and one for 1.
- assert_greater_than_equal(progressEvents.length, 2);
-
- // 0 should be the first event and 1 should be the last event.
- assert_equals(progressEvents.at(0).loaded, 0);
- assert_equals(progressEvents.at(-1).loaded, 1);
-
- // All progress events must have a total of 1.
- for (const progressEvent of progressEvents) {
- assert_equals(progressEvent.total, 1);
- }
-}, 'Translator.create() monitor option is called correctly.');
+ await testMonitor(
+ createTranslator, {sourceLanguage: 'en', targetLanguage: 'ja'});
+}, 'Translator.create() notifies its monitor on downloadprogress');
promise_test(async t => {
const translator =
diff --git a/testing/web-platform/tests/clear-site-data/clear-cache-bfcache.sub.https.html b/testing/web-platform/tests/clear-site-data/clear-cache-bfcache.sub.https.html
new file mode 100644
index 00000000000..61d810f453b
--- /dev/null
+++ b/testing/web-platform/tests/clear-site-data/clear-cache-bfcache.sub.https.html
@@ -0,0 +1,115 @@
+
+
+
+Clear-Site-Data: cache for bfcache
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/clear-site-data/support/clear-cache-helper.sub.js b/testing/web-platform/tests/clear-site-data/support/clear-cache-helper.sub.js
index 2b2d35abfc5..5db0caf834c 100644
--- a/testing/web-platform/tests/clear-site-data/support/clear-cache-helper.sub.js
+++ b/testing/web-platform/tests/clear-site-data/support/clear-cache-helper.sub.js
@@ -39,7 +39,7 @@ function getUrl(cacheHelper, {
} else { // !second_origin && !subdomain
url += "{{hosts[][]}}";
}
- url += ":{{ports[https][1]}}";
+ url += ":{{ports[https][0]}}";
url += "/clear-site-data/support/clear-site-data-cache.py";
url = new URL(url);
let params = new URLSearchParams();
@@ -130,4 +130,3 @@ function testCacheClear(test, params, assert) {
openTestPageHelper(test, null, testUrls, 0, assert, resolve)
});
}
-
diff --git a/testing/web-platform/tests/cookies/partitioned-cookies/partitioned-cookies-parallel-iframes.embed.tentative.https.html b/testing/web-platform/tests/cookies/partitioned-cookies/partitioned-cookies-parallel-iframes.embed.tentative.https.html
index 68de567afee..e92a15bcc29 100644
--- a/testing/web-platform/tests/cookies/partitioned-cookies/partitioned-cookies-parallel-iframes.embed.tentative.https.html
+++ b/testing/web-platform/tests/cookies/partitioned-cookies/partitioned-cookies-parallel-iframes.embed.tentative.https.html
@@ -102,6 +102,9 @@ promise_test( async() => {
assert_false(iframe2.contentWindow.document.cookie.includes(partitionedCookie),
iframe2.contentWindow.document.cookie);
+ erase_cookie_from_js("partitionedCookie", "Secure; Path=/; SameSite=None; Partitioned");
+ erase_cookie_from_js("second", "Secure; Path=/; SameSite=None; Partitioned");
+
}, "Partitioned cookies set in same-site contexts are available in other same-site documents.");
+
+
+
+