Skip to content

Commit

Permalink
124.0b2
Browse files Browse the repository at this point in the history
  • Loading branch information
bot committed Feb 22, 2024
1 parent a780d26 commit c14fec6
Show file tree
Hide file tree
Showing 621 changed files with 35,031 additions and 27,493 deletions.
15 changes: 15 additions & 0 deletions firefox-src-part/accessible/interfaces/nsIAccessibleRole.idl
Original file line number Diff line number Diff line change
Expand Up @@ -784,4 +784,19 @@ interface nsIAccessibleRole : nsISupports
*/
const unsigned long ROLE_SUPERSCRIPT = 134;

/**
* Represents one or more emphasized characters. Use this role to stress or
* emphasize content.
*/
const unsigned long ROLE_EMPHASIS = 135;

/**
* Represents content that is important, serious, or urgent.
*/
const unsigned long ROLE_STRONG = 136;

/**
* Represents a specific point in time.
*/
const unsigned long ROLE_TIME = 137;
};
2 changes: 1 addition & 1 deletion firefox-src-part/browser/actors/AboutNewTabChild.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class AboutNewTabChild extends RemotePageChild {
) {
this.sendAsyncMessage("AboutNewTabVisible");

// Note: newtab feature info is currently being loaded in PrefsFeed.jsm,
// Note: newtab feature info is currently being loaded in PrefsFeed.sys.mjs,
// But we're recording exposure events here.
lazy.NimbusFeatures.newtab.recordExposureEvent({ once: true });
}
Expand Down
7 changes: 1 addition & 6 deletions firefox-src-part/browser/actors/AboutNewTabParent.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +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/. */

import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";

const lazy = {};

ChromeUtils.defineESModuleGetters(lazy, {
AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs",
});

XPCOMUtils.defineLazyModuleGetters(lazy, {
ASRouter: "resource://activity-stream/lib/ASRouter.jsm",
ASRouter: "resource:///modules/asrouter/ASRouter.sys.mjs",
});

// A mapping of loaded new tab pages, where the mapping is:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
* 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 { ASRouter } = ChromeUtils.import(
"resource://activity-stream/lib/ASRouter.jsm"
);
import { ASRouter } from "resource:///modules/asrouter/ASRouter.sys.mjs";
import { BrowserUtils } from "resource://gre/modules/BrowserUtils.sys.mjs";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";

Expand Down
109 changes: 96 additions & 13 deletions firefox-src-part/browser/actors/SearchSERPTelemetryChild.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ XPCOMUtils.defineLazyPreferenceGetter(
const SEARCH_TELEMETRY_SHARED = {
PROVIDER_INFO: "SearchTelemetry:ProviderInfo",
LOAD_TIMEOUT: "SearchTelemetry:LoadTimeout",
SPA_LOAD_TIMEOUT: "SearchTelemetry:SPALoadTimeout",
};

/**
Expand Down Expand Up @@ -828,8 +829,13 @@ class SearchAdImpression {
let url = document.documentURI;
let callback = documentToEventCallbackMap.get(document);

let removeListenerCallbacks = [];

for (let element of elements) {
let clickCallback = () => {
if (clickAction == "submitted") {
documentToSubmitMap.set(document, true);
}
callback({
type,
url,
Expand All @@ -840,6 +846,9 @@ class SearchAdImpression {

let keydownCallback = event => {
if (event.key == "Enter") {
if (keydownEnterAction == "submitted") {
documentToSubmitMap.set(document, true);
}
callback({
type,
url,
Expand All @@ -849,15 +858,34 @@ class SearchAdImpression {
};
element.addEventListener("keydown", keydownCallback);

document.ownerGlobal.addEventListener(
"pagehide",
() => {
element.removeEventListener("click", clickCallback);
element.removeEventListener("keydown", keydownCallback);
},
{ once: true }
);
removeListenerCallbacks.push(() => {
element.removeEventListener("click", clickCallback);
element.removeEventListener("keydown", keydownCallback);
});
}

document.ownerGlobal.addEventListener(
"pagehide",
() => {
let callbacks = documentToRemoveEventListenersMap.get(document);
if (callbacks) {
for (let removeEventListenerCallback of callbacks) {
removeEventListenerCallback();
}
documentToRemoveEventListenersMap.delete(document);
}
},
{ once: true }
);

// The map might have entries from previous callers, so we must ensure
// we don't discard existing event listener callbacks.
if (documentToRemoveEventListenersMap.has(document)) {
let callbacks = documentToRemoveEventListenersMap.get(document);
removeListenerCallbacks = removeListenerCallbacks.concat(callbacks);
}

documentToRemoveEventListenersMap.set(document, removeListenerCallbacks);
}
}

Expand All @@ -878,6 +906,8 @@ class SearchAdImpression {
* The key name of the data attribute to lookup.
* @property {string | null} options.queryParamKey
* The key name of the query param value to lookup.
* @property {boolean | null} options.queryParamValueIsHref
* Whether the query param value is expected to contain an href.
*/

/**
Expand Down Expand Up @@ -919,7 +949,8 @@ class DomainExtractor {
elements,
origin,
extractedDomains,
extractorInfo.options?.queryParamKey
extractorInfo.options?.queryParamKey,
extractorInfo.options?.queryParamValueIsHref
);
break;
}
Expand Down Expand Up @@ -952,12 +983,15 @@ class DomainExtractor {
* The result set of domains extracted from the page.
* @param {string | null} queryParam
* An optional query param to search for in an element's href attribute.
* @param {boolean | null} queryParamValueIsHref
* Whether the query param value is expected to contain an href.
*/
#fromElementsConvertHrefsIntoDomains(
elements,
origin,
extractedDomains,
queryParam
queryParam,
queryParamValueIsHref
) {
for (let element of elements) {
let href = element.getAttribute("href");
Expand All @@ -974,9 +1008,20 @@ class DomainExtractor {
continue;
}

let domain = queryParam ? url.searchParams.get(queryParam) : url.hostname;
if (domain && !extractedDomains.has(domain)) {
extractedDomains.add(domain);
if (queryParam) {
let paramValue = url.searchParams.get(queryParam);
if (queryParamValueIsHref) {
try {
paramValue = new URL(paramValue).hostname;
} catch (e) {
continue;
}
}
if (paramValue && !extractedDomains.has(paramValue)) {
extractedDomains.add(paramValue);
}
} else if (url.hostname && !extractedDomains.has(url.hostname)) {
extractedDomains.add(url.hostname);
}
}
}
Expand Down Expand Up @@ -1013,6 +1058,8 @@ const searchProviders = new SearchProviders();
const searchAdImpression = new SearchAdImpression();

const documentToEventCallbackMap = new WeakMap();
const documentToRemoveEventListenersMap = new WeakMap();
const documentToSubmitMap = new WeakMap();

/**
* SearchTelemetryChild monitors for pages that are partner searches, and
Expand Down Expand Up @@ -1190,6 +1237,16 @@ export class SearchSERPTelemetryChild extends JSWindowActorChild {
}
}

#removeEventListeners() {
let callbacks = documentToRemoveEventListenersMap.get(this.document);
if (callbacks) {
for (let callback of callbacks) {
callback();
}
documentToRemoveEventListenersMap.delete(this.document);
}
}

/**
* Handles events received from the actor child notifications.
*
Expand Down Expand Up @@ -1236,6 +1293,32 @@ export class SearchSERPTelemetryChild extends JSWindowActorChild {
}
}

async receiveMessage(message) {
switch (message.name) {
case "SearchSERPTelemetry:WaitForSPAPageLoad":
lazy.setTimeout(() => {
this.#checkForPageImpressionComponents();
this._checkForAdLink("load");
}, Services.cpmm.sharedData.get(SEARCH_TELEMETRY_SHARED.SPA_LOAD_TIMEOUT));
break;
case "SearchSERPTelemetry:StopTrackingDocument":
this.#removeDocumentFromSubmitMap();
this.#removeEventListeners();
break;
case "SearchSERPTelemetry:DidSubmit":
return this.#didSubmit();
}
return null;
}

#didSubmit() {
return documentToSubmitMap.get(this.document);
}

#removeDocumentFromSubmitMap() {
documentToSubmitMap.delete(this.document);
}

#urlIsSERP(url) {
let provider = this._getProviderInfoForUrl(this.document.documentURI);
if (provider) {
Expand Down
19 changes: 13 additions & 6 deletions firefox-src-part/browser/actors/WebRTCParent.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -571,11 +571,18 @@ function prompt(aActor, aBrowser, aRequest) {
reqAudioOutput,
!!aRequest.secondOrigin
);
const message = localization.formatValueSync(stringId, {
origin: "<>",
thirdParty: "{}",
});

let message;
let originToShow;
if (principal.schemeIs("file")) {
message = localization.formatValueSync(stringId + "-with-file");
originToShow = null;
} else {
message = localization.formatValueSync(stringId, {
origin: "<>",
thirdParty: "{}",
});
originToShow = lazy.webrtcUI.getHostOrExtensionName(principal.URI);
}
let notification; // Used by action callbacks.
const actionL10nIds = [{ id: "webrtc-action-allow" }];

Expand Down Expand Up @@ -714,7 +721,7 @@ function prompt(aActor, aBrowser, aRequest) {
}

let options = {
name: lazy.webrtcUI.getHostOrExtensionName(principal.URI),
name: originToShow,
persistent: true,
hideClose: true,
eventCallback(aTopic, aNewBrowser, isCancel) {
Expand Down
Loading

0 comments on commit c14fec6

Please sign in to comment.