Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/release' into iceweasel_release
Browse files Browse the repository at this point in the history
  • Loading branch information
adonais committed May 14, 2022
2 parents 39ad219 + e99d465 commit ad2a6c5
Show file tree
Hide file tree
Showing 45 changed files with 1,440 additions and 923 deletions.
2 changes: 2 additions & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -3602,3 +3602,5 @@ b7eb8312a3a0c4ce7f3939ec3a3d81007fc13db7 FIREFOX_100_0b8_RELEASE
bc1aed5ba113eff5be89837fa44a8a3978772978 FIREFOX_RELEASE_99_END
bcf19cbec5bbd223a8798fcd387d3407cc9f0be8 FIREFOX_100_0_BUILD1
1c7f7adc90e2b4c8d64548938bb1499033c5be8f FIREFOX_100_0_BUILD2
1c7f7adc90e2b4c8d64548938bb1499033c5be8f FIREFOX_100_0_RELEASE
b1c0f261443931d2a01f2fdc7016db5424cb471d FIREFOX_100_0_1_BUILD1
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,7 @@ const COOKIE_BEHAVIOR_PREF = "network.cookie.cookieBehavior";
const defaultPrefs = Services.prefs.getDefaultBranch("");
const previousDefaultCB = defaultPrefs.getIntPref(COOKIE_BEHAVIOR_PREF);

const SEARCH_PREFS_OPT_IN = [
["browser.search.param.google_channel_us", "tus7"],
["browser.search.param.google_channel_row", "trow7"],
["browser.search.param.bing_ptag", "MOZZ0000000031"],
];

const SEARCH_PREFS_OPT_OUT = [
["browser.search.param.google_channel_us", "tus7"],
["browser.search.param.google_channel_row", "trow7"],
["browser.search.param.bing_ptag", "MOZZ0000000031"],
];

function cleanup() {
[...SEARCH_PREFS_OPT_IN, ...SEARCH_PREFS_OPT_OUT].forEach(([key]) =>
Services.prefs.clearUserPref(key)
);

[COOKIE_BEHAVIOR_PREF, PREF_DFPI_ENABLED_BY_DEFAULT].forEach(
Services.prefs.clearUserPref
);
Expand All @@ -47,22 +31,6 @@ function cleanup() {
Services.telemetry.scalarSet("privacy.dfpi_rollout_enabledByDefault", 2);
}

function testSearchPrefState(optIn) {
let expectedPrefs = optIn ? SEARCH_PREFS_OPT_IN : SEARCH_PREFS_OPT_OUT;

expectedPrefs.forEach(([key, value]) => {
ok(
Services.prefs.prefHasUserValue(key),
`Pref '${key}' should have user value.'`
);
is(
Services.prefs.getStringPref(key),
value,
`Pref '${key}' should have correct value.`
);
});
}

function testTelemetryState(optIn) {
let expectedValue;
if (optIn == null) {
Expand Down Expand Up @@ -100,31 +68,27 @@ add_task(async function testdFPIRolloutPref() {
defaultPrefs.getIntPref(COOKIE_BEHAVIOR_PREF),
Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER
);
testSearchPrefState(false);
testTelemetryState(false);

Services.prefs.setBoolPref(PREF_DFPI_ENABLED_BY_DEFAULT, true);
is(
defaultPrefs.getIntPref(COOKIE_BEHAVIOR_PREF),
Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN
);
testSearchPrefState(true);
testTelemetryState(true);

Services.prefs.setBoolPref(PREF_DFPI_ENABLED_BY_DEFAULT, false);
is(
defaultPrefs.getIntPref(COOKIE_BEHAVIOR_PREF),
Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER
);
testSearchPrefState(false);
testTelemetryState(false);

Services.prefs.setBoolPref(PREF_DFPI_ENABLED_BY_DEFAULT, true);
is(
defaultPrefs.getIntPref(COOKIE_BEHAVIOR_PREF),
Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN
);
testSearchPrefState(true);
testTelemetryState(true);

cleanup();
Expand Down
28 changes: 0 additions & 28 deletions browser/components/BrowserGlue.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -1773,34 +1773,6 @@ BrowserGlue.prototype = {
"privacy.dfpi_rollout_enabledByDefault",
dFPIEnabled ? 1 : 0
);

if (dFPIEnabled) {
Services.prefs.setStringPref(
"browser.search.param.google_channel_us",
"tus7"
);
Services.prefs.setStringPref(
"browser.search.param.google_channel_row",
"trow7"
);
Services.prefs.setStringPref(
"browser.search.param.bing_ptag",
"MOZZ0000000031"
);
} else {
Services.prefs.setStringPref(
"browser.search.param.google_channel_us",
"tus7"
);
Services.prefs.setStringPref(
"browser.search.param.google_channel_row",
"trow7"
);
Services.prefs.setStringPref(
"browser.search.param.bing_ptag",
"MOZZ0000000031"
);
}
},

_setPrefExpectations() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
}
}
},
"additionalProperties": false,
"additionalProperties": true,
"required": [
"layout",
"category",
Expand Down Expand Up @@ -427,5 +427,6 @@
"required": ["id"]
}
},
"additionalProperties": true,
"required": ["id", "groups", "content", "targeting", "template", "trigger"]
}
36 changes: 36 additions & 0 deletions browser/components/newtab/test/xpcshell/test_PanelTestProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const { validate } = ChromeUtils.import(

Cu.importGlobalProperties(["fetch"]);

let CFR_SCHEMA;
let UPDATE_ACTION_SCHEMA;
let WHATS_NEW_SCHEMA;
let SPOTLIGHT_SCHEMA;
Expand All @@ -20,6 +21,9 @@ add_setup(async function setup() {
return fetch(uri, { credentials: "omit" }).then(rsp => rsp.json());
}

CFR_SCHEMA = await fetchSchema(
"resource://activity-stream/schemas/CFR/ExtensionDoorhanger.schema.json"
);
UPDATE_ACTION_SCHEMA = await fetchSchema(
"resource://activity-stream/schemas/OnboardingMessage/UpdateAction.schema.json"
);
Expand Down Expand Up @@ -99,3 +103,35 @@ add_task(async function test_PanelTestProvider() {
"There is one pb_newtab message"
);
});

add_task(async function test_SpotlightAsCFR() {
let message = await PanelTestProvider.getMessages().then(msgs =>
msgs.find(msg => msg.id === "TCP_SPOTLIGHT_MESSAGE_95")
);

message = {
...message,
content: {
...message.content,
category: "",
layout: "icon_and_message",
bucket_id: "",
notification_text: "",
heading_text: "",
text: "",
buttons: {},
},
};

assertSchema(
message,
CFR_SCHEMA,
"Munged spotlight message validates with CFR ExtensionDoorhanger schema"
);

assertSchema(
message,
SPOTLIGHT_SCHEMA,
"Munged Spotlight message validates with Spotlight schema"
);
});
10 changes: 10 additions & 0 deletions browser/components/uitour/test/browser_UITour_colorway.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ add_UITour_task(async function test_setColorway_unknown() {

add_UITour_task(async function test_setColorway() {
const id = COLORWAY_IDS.at(0);
if (!id) {
info("No colorways to test");
return;
}

await gContentAPI.setConfiguration("colorway", id);

ok(
Expand All @@ -50,6 +55,11 @@ add_UITour_task(async function test_setColorway() {

add_UITour_task(async function test_anotherColorway() {
const id = COLORWAY_IDS.at(-1);
if (!id) {
info("No colorways to test");
return;
}

await gContentAPI.setConfiguration("colorway", id);

ok(
Expand Down
2 changes: 1 addition & 1 deletion browser/config/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
100.0
100.0.1
2 changes: 1 addition & 1 deletion browser/config/version_display.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
100.0
100.0.1
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ let AVAILABLE_PIP_OVERRIDES;
// See PictureInPictureControls.jsm for these values.
// eslint-disable-next-line no-unused-vars
const TOGGLE_POLICIES = browser.pictureInPictureChild.getPolicies();
const KEYBOARD_CONTROLS = browser.pictureInPictureChild.getKeyboardControls();

AVAILABLE_PIP_OVERRIDES = {
// The keys of this object are match patterns for URLs, as documented in
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns
//
// Example:
// const KEYBOARD_CONTROLS = browser.pictureInPictureChild.getKeyboardControls();
//
//
// "https://*.youtube.com/*": {
// policy: TOGGLE_POLICIES.THREE_QUARTERS,
Expand Down Expand Up @@ -46,7 +47,6 @@ let AVAILABLE_PIP_OVERRIDES;

netflix: {
"https://*.netflix.com/*": {
keyboardControls: ~KEYBOARD_CONTROLS.SEEK,
videoWrapperScriptPath: "video-wrappers/netflix.js",
},
"https://*.netflix.com/browse*": { policy: TOGGLE_POLICIES.HIDDEN },
Expand Down
52 changes: 40 additions & 12 deletions browser/extensions/pictureinpicture/video-wrappers/netflix.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,21 @@ class PictureInPictureVideoWrapper {
constructor() {
let netflixPlayerAPI = window.wrappedJSObject.netflix.appContext.state.playerApp.getAPI()
.videoPlayer;
let sessionId = netflixPlayerAPI.getAllPlayerSessionIds()[0];
let sessionId = null;
for (let id of netflixPlayerAPI.getAllPlayerSessionIds()) {
if (id.startsWith("watch-")) {
sessionId = id;
break;
}
}
this.player = netflixPlayerAPI.getVideoPlayerBySessionId(sessionId);
}
getCurrentTime(video) {
return this.player.getCurrentTime();
}
getDuration(video) {
return this.player.getDuration();
}
play() {
this.player.play();
}
Expand All @@ -24,17 +36,8 @@ class PictureInPictureVideoWrapper {
if (container) {
updateCaptionsFunction("");
const callback = function(mutationsList, observer) {
let textNodeList = container
.querySelector(".player-timedtext")
?.querySelectorAll("span");
if (!textNodeList || textNodeList.length < 1) {
updateCaptionsFunction("");
return;
}

updateCaptionsFunction(
Array.from(textNodeList, x => x.textContent).join("\n")
);
let text = container.querySelector(".player-timedtext").innerText;
updateCaptionsFunction(text);
};

// immediately invoke the callback function to add subtitles to the PiP window
Expand All @@ -49,6 +52,31 @@ class PictureInPictureVideoWrapper {
});
}
}

setCurrentTime(video, position) {
let oldTime = this.player.getCurrentTime();
let duration = this.player.getDuration();
let isHome = position == 0;
let isEnd = position >= duration;
// Read pipChild's expected seek result to determine if we want
// to move forward/backwards, or go to the start/end
let seekDirection = position - oldTime;
// But ignore pipChild's proposed seek forward/backward time for a better viewing
// experience. 10 seconds (10000ms) seems to be the best value for compatibility.
// The new currentTime will not always be 10 seconds forward/backward though, since Netflix
// adjusts the new currentTime when seek() is called, according to the current timestamp.
let seekTimeMS = 10000;
let newTime = 0;

if (isHome || isEnd) {
newTime = position;
} else if (seekDirection < 0) {
newTime = Math.max(oldTime - seekTimeMS, 0);
} else if (seekDirection > 0) {
newTime = Math.min(oldTime + seekTimeMS, duration);
}
this.player.seek(newTime);
}
}

this.PictureInPictureVideoWrapper = PictureInPictureVideoWrapper;
5 changes: 4 additions & 1 deletion browser/extensions/webcompat/data/ua_overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,11 +714,14 @@ const AVAILABLE_UA_OVERRIDES = [
bug: "1743429",
config: {
matches: [
"*://*.commerzbank.de/*", // Bug 1767630
"*://*.edf.com/*", // Bug 1764786
"*://*.wordpress.org/*", // Bug 1743431
"*://bethesda.net/*", // #94607
"*://cdn-vzn.yottaa.net/*", // Bug 1764795
"*://citoyens.telerecours.fr/*", // #101066
"*://www.connexus.com/*", // Bug 1765925
"*://dsae.co.za/*", // Bug 1765925
"*://genehmigung.ahs-vwa.at/*", // #100063
"*://moje.pzu.pl/*", // #99772
"*://mon.allianzbanque.fr/*", // #101074
Expand Down Expand Up @@ -809,9 +812,9 @@ const AVAILABLE_UA_OVERRIDES = [
"*://www.southportvisiter.co.uk/*", // Bug 1762928 (Reach Plc)
"*://www.staffordshire-live.co.uk/*", // Bug 1762928 (Reach Plc)
"*://www.stokesentinel.co.uk/*", // Bug 1762928 (Reach Plc)
"*://survey.sogosurvey.com/*", // Bug 1765925
"*://www.sussexlive.co.uk/*", // Bug 1762928 (Reach Plc)
"*://www.tm-awx.com/*", // Bug 1762928 (Reach Plc)
"*://www.twitch.tv/*", // Bug 1764591
"*://www.walesonline.co.uk/*", // Bug 1762928 (Reach Plc)
"*://www.wharf.co.uk/*", // Bug 1762928 (Reach Plc)
],
Expand Down
2 changes: 1 addition & 1 deletion browser/extensions/webcompat/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Web Compatibility Interventions",
"description": "Urgent post-release fixes for web compatibility.",
"version": "100.2.0",
"version": "100.2.1",
"applications": {
"gecko": {
"id": "webcompat@mozilla.org",
Expand Down
5 changes: 3 additions & 2 deletions browser/themes/shared/spotlight.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
* scrollbar. This should be okay as we wrap content for this fixed width
* dialog unless the window is actually narrow and really does need
* horizontal scrollbars. */
@media (min-width: 604px) {
@media (min-width: 544px) {
body {
overflow-x: hidden;
}
}

body {
padding: 20px 40px;
width: 465px;
/* Keep as multiple of 4px. Match min-width media query above + padding. */
width: 464px;
}

#dialog-content {
Expand Down
2 changes: 1 addition & 1 deletion config/milestone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
# hardcoded milestones in the tree from these two files.
#--------------------------------------------------------

100.0
100.0.1
3 changes: 3 additions & 0 deletions dom/media/MediaData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ PlanarYCbCrData ConstructPlanarYCbCrData(const VideoInfo& aInfo,
data.mStereoMode = aInfo.mStereoMode;
data.mYUVColorSpace = aBuffer.mYUVColorSpace;
data.mColorDepth = aBuffer.mColorDepth;
if (aInfo.mTransferFunction) {
data.mTransferFunction = *aInfo.mTransferFunction;
}
data.mColorRange = aBuffer.mColorRange;
data.mChromaSubsampling = aBuffer.mChromaSubsampling;
return data;
Expand Down
Loading

0 comments on commit ad2a6c5

Please sign in to comment.