Skip to content

Commit

Permalink
Merge pull request #1565 from Floorp-Projects/upstream-esr128-2025010…
Browse files Browse the repository at this point in the history
…7115437

Pull upstream
  • Loading branch information
surapunoyousei authored Jan 8, 2025
2 parents 2a4ee86 + 7f87430 commit 0e84375
Show file tree
Hide file tree
Showing 138 changed files with 5,299 additions and 4,905 deletions.
7 changes: 7 additions & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -5088,3 +5088,10 @@ e0c969a3bfc0a23219384269e5b36a589c8f6cc5 FIREFOX_128_3_1esr_RELEASE
c4a5d008ee64fab523384408fa2868e2d028025d FIREFOX_128_4_0esr_BUILD1
c4a5d008ee64fab523384408fa2868e2d028025d FIREFOX_128_4_0esr_RELEASE
68352da82b95d7114af99b268c179195fd2fead0 FIREFOX_128_5_0esr_BUILD1
68352da82b95d7114af99b268c179195fd2fead0 FIREFOX_128_5_0esr_RELEASE
a6cdcd2ed9ec3e256f358010672bafd1674b0b8b FIREFOX_128_5_1esr_BUILD1
a6cdcd2ed9ec3e256f358010672bafd1674b0b8b FIREFOX_128_5_1esr_RELEASE
f2cc51880bf4f49bfe087a2cc569388cab97242e FIREFOX_128_5_2esr_BUILD1
f2cc51880bf4f49bfe087a2cc569388cab97242e FIREFOX_128_5_2esr_RELEASE
4f008c71b12e001ae54b7fcd4787b266764c28bf FIREFOX_128_6_0esr_BUILD1
4f008c71b12e001ae54b7fcd4787b266764c28bf FIREFOX_128_6_0esr_RELEASE
2 changes: 1 addition & 1 deletion CLOBBER
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.

Merge day clobber 2024-10-28
Merge day clobber 2025-01-06
18 changes: 18 additions & 0 deletions accessible/windows/ia2/ia2Accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
#include "AccessibleStates.h"

#include "AccAttributes.h"
#include "ApplicationAccessible.h"
#include "Compatibility.h"
#include "ia2AccessibleRelation.h"
#include "IUnknownImpl.h"
#include "nsCoreUtils.h"
#include "nsIAccessibleTypes.h"
#include "mozilla/a11y/PDocAccessible.h"
#include "mozilla/StaticPrefs_accessibility.h"
#include "Relation.h"
#include "TextRange-inl.h"
#include "nsAccessibilityService.h"
Expand Down Expand Up @@ -352,6 +354,22 @@ ia2Accessible::get_windowHandle(HWND* aWindowHandle) {
if (!acc) return CO_E_OBJNOTCONNECTED;

*aWindowHandle = MsaaAccessible::GetHWNDFor(acc);
if (!*aWindowHandle && !StaticPrefs::accessibility_uia_enable()) {
// Bug 1890155: This can happen if a document is detached from its embedder.
// The document might be about to die or it might be moving to a different
// embedder; e.g. a tab in a different window. The IA2 -> UIA proxy may
// crash if we return a null HWND. For now, pick an arbitrary top level
// Gecko HWND. This might be wrong, but only briefly, since the document
// will either die or move very soon, at which point this method will
// return the correct answer.
// TODO This hack should be removed once we only use our native UIA
// implementation.
if (ApplicationAccessible* app = ApplicationAcc()) {
if (LocalAccessible* firstRoot = app->LocalFirstChild()) {
*aWindowHandle = MsaaAccessible::GetHWNDFor(firstRoot);
}
}
}
return S_OK;
}

Expand Down
10 changes: 0 additions & 10 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1194,15 +1194,9 @@ pref("network.manage-offline-status", true);

// We want to make sure mail URLs are handled externally...
pref("network.protocol-handler.external.mailto", true); // for mail
#ifdef XP_WIN
pref("network.protocol-handler.external.ms-windows-store", true);
#endif

// ...without warning dialogs
pref("network.protocol-handler.warn-external.mailto", false);
#ifdef XP_WIN
pref("network.protocol-handler.warn-external.ms-windows-store", false);
#endif

// By default, all protocol handlers are exposed. This means that
// the browser will respond to openURL commands for all URL types.
Expand Down Expand Up @@ -2427,10 +2421,6 @@ pref("signon.showAutoCompleteFooter", true);
pref("signon.showAutoCompleteImport", "import");
pref("signon.suggestImportCount", 3);

// Space separated list of URLS that are allowed to send objects (instead of
// only strings) through webchannels. Bug 1275612 tracks removing this pref and capability.
pref("webchannel.allowObject.urlWhitelist", "https://content.cdn.mozilla.net https://install.mozilla.org");

// Whether or not the browser should scan for unsubmitted
// crash reports, and then show a notification for submitting
// those reports.
Expand Down
14 changes: 0 additions & 14 deletions browser/base/content/test/general/browser_remoteTroubleshoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ const TEST_URL_TAIL =
"example.com/browser/browser/base/content/test/general/test_remoteTroubleshoot.html";
const TEST_URI_GOOD = Services.io.newURI("https://" + TEST_URL_TAIL);
const TEST_URI_BAD = Services.io.newURI("http://" + TEST_URL_TAIL);
const TEST_URI_GOOD_OBJECT = Services.io.newURI(
"https://" + TEST_URL_TAIL + "?object"
);

// Creates a one-shot web-channel for the test data to be sent back from the test page.
function promiseChannelResponse(channelID, originOrPermission) {
Expand Down Expand Up @@ -116,15 +113,4 @@ add_task(async function () {
got.message.errno === 2,
"should have failed with errno 2, no such channel"
);

// Check that the page can send an object as well if it's in the whitelist
let webchannelWhitelistPref = "webchannel.allowObject.urlWhitelist";
let origWhitelist = Services.prefs.getCharPref(webchannelWhitelistPref);
let newWhitelist = origWhitelist + " https://example.com";
Services.prefs.setCharPref(webchannelWhitelistPref, newWhitelist);
registerCleanupFunction(() => {
Services.prefs.clearUserPref(webchannelWhitelistPref);
});
got = await promiseNewChannelResponse(TEST_URI_GOOD_OBJECT);
Assert.ok(got.message, "should have gotten some data back");
});
13 changes: 2 additions & 11 deletions browser/base/content/test/general/test_remoteTroubleshoot.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
<!DOCTYPE HTML>
<html>
<script>
// This test is run multiple times, once with only strings allowed through the
// WebChannel, and once with objects allowed. This function allows us to handle
// both cases without too much pain.
function makeDetails(object) {
if (window.location.search.includes("object")) {
return object;
}
return JSON.stringify(object);
}
// Add a listener for responses to our remote requests.
window.addEventListener("WebChannelMessageToContent", function(event) {
if (event.detail.id == "remote-troubleshooting") {
// Send what we got back to the test.
var backEvent = new window.CustomEvent("WebChannelMessageToChrome", {
detail: makeDetails({
detail: JSON.stringify({
id: "test-remote-troubleshooting-backchannel",
message: {
message: event.detail.message,
Expand All @@ -32,7 +23,7 @@
// Make a request for the troubleshooting data as we load.
window.onload = function() {
var event = new window.CustomEvent("WebChannelMessageToChrome", {
detail: makeDetails({
detail: JSON.stringify({
id: "remote-troubleshooting",
message: {
command: "request",
Expand Down
1 change: 1 addition & 0 deletions browser/components/enterprisepolicies/Policies.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,7 @@ export var Policies = {
"general.smoothScroll",
"geo.",
"gfx.",
"identity.fxaccounts.toolbar.",
"intl.",
"keyword.enabled",
"layers.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,33 @@ add_task(async function () {
await PlacesUtils.bookmarks.eraseEverything();
});

if (AppConstants.platform === "win") {
if (Services.env.get("MOZ_AUTOMATION")) {
// When running in CI, pre-emptively kill Windows Explorer, using system
// from the standard library, since it sometimes holds the clipboard for
// long periods, thereby breaking the test (bug 1921759).
const { ctypes } = ChromeUtils.importESModule(
"resource://gre/modules/ctypes.sys.mjs"
);
let libc = ctypes.open("ucrtbase.dll");
let exec = libc.declare(
"system",
ctypes.default_abi,
ctypes.int,
ctypes.char.ptr
);
let rv = exec(
'"powershell -command "&{&Stop-Process -ProcessName explorer}"'
);
libc.close();
is(rv, 0, "Launched powershell to stop explorer.exe");
} else {
info(
"Skipping terminating Windows Explorer since we are not running in automation"
);
}
}

await withSidebarTree("bookmarks", async function (tree) {
const selectedNodeComparator = {
equalTitle: itemNode => {
Expand Down
4 changes: 1 addition & 3 deletions browser/components/shopping/tests/browser/browser.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ prefs = [
["browser_stale_product.js"]

["browser_ui_telemetry.js"]
skip-if = [
"os == 'linux' && os_version == '18.04'"
]
skip-if = ["true"]

["browser_unanalyzed_product.js"]

Expand Down
2 changes: 1 addition & 1 deletion browser/config/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
128.5.0
128.7.0
2 changes: 1 addition & 1 deletion browser/config/version_display.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.21.0
11.22.0
4 changes: 4 additions & 0 deletions build/moz.configure/bootstrap.configure
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def bootstrap_toolchain_tasks(host):
result = {
"index": t.optimization["index-search"],
"artifact": t.attributes["toolchain-artifact"],
"extract": t.attributes.get("toolchain-extract", True),
}
command = t.attributes.get("toolchain-command")
if command:
Expand Down Expand Up @@ -219,6 +220,9 @@ def bootstrap_path(path, **kwargs):
"--from-task",
f"{task_id}:{artifact}",
]
if not task["extract"]:
command.append("--no-unpack")

elif command:
# For private local toolchains, run the associated command.
command = (
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.
#--------------------------------------------------------

128.5.0
128.7.0
8 changes: 6 additions & 2 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6156,9 +6156,13 @@ nsresult nsDocShell::FilterStatusForErrorPage(
if (aStatus == NS_ERROR_UNKNOWN_PROTOCOL) {
// For unknown protocols we only display an error if the load is triggered
// by the browser itself. Showing the error for page-triggered navigations
// causes annoying behavior for users, see bug 1528305.
// causes annoying behavior for users when a page tries to open an external
// app which has not been installed, see bug 1528305. A missing WebExtension
// protocol handlers will however always load the error page, as it is not
// expected to be opened externally, see bug 1921426.
nsCOMPtr<nsILoadInfo> info = aChannel->LoadInfo();
if (!info->TriggeringPrincipal()->IsSystemPrincipal()) {
if (!info->TriggeringPrincipal()->IsSystemPrincipal() &&
!BasePrincipal::Cast(info->TriggeringPrincipal())->AddonPolicy()) {
if (aSkippedUnknownProtocolNavigation) {
*aSkippedUnknownProtocolNavigation = true;
}
Expand Down
12 changes: 6 additions & 6 deletions dom/base/StructuredCloneHolder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1369,14 +1369,14 @@ StructuredCloneHolder::CustomReadTransferHandler(
static_cast<OffscreenCanvasCloneData*>(aContent);
RefPtr<OffscreenCanvas> canvas =
OffscreenCanvas::CreateFromCloneData(mGlobal, data);
delete data;

JS::Rooted<JS::Value> value(aCx);
if (!GetOrCreateDOMReflector(aCx, canvas, &value)) {
JS_ClearPendingException(aCx);
return false;
}

delete data;
aReturnObject.set(&value.toObject());
return true;
}
Expand All @@ -1390,14 +1390,14 @@ StructuredCloneHolder::CustomReadTransferHandler(
ImageBitmapCloneData* data = static_cast<ImageBitmapCloneData*>(aContent);
RefPtr<ImageBitmap> bitmap =
ImageBitmap::CreateFromCloneData(mGlobal, data);
delete data;

JS::Rooted<JS::Value> value(aCx);
if (!GetOrCreateDOMReflector(aCx, bitmap, &value)) {
JS_ClearPendingException(aCx);
return false;
}

delete data;
aReturnObject.set(&value.toObject());
return true;
}
Expand Down Expand Up @@ -1466,14 +1466,14 @@ StructuredCloneHolder::CustomReadTransferHandler(
if (!frame) {
return false;
}
delete data;
aContent = nullptr;

JS::Rooted<JS::Value> value(aCx);
if (!GetOrCreateDOMReflector(aCx, frame, &value)) {
JS_ClearPendingException(aCx);
return false;
}
delete data;
aContent = nullptr;
aReturnObject.set(&value.toObject());
return true;
}
Expand All @@ -1499,14 +1499,14 @@ StructuredCloneHolder::CustomReadTransferHandler(
if (!audioData) {
return false;
}
delete data;
aContent = nullptr;

JS::Rooted<JS::Value> value(aCx);
if (!GetOrCreateDOMReflector(aCx, audioData, &value)) {
JS_ClearPendingException(aCx);
return false;
}
delete data;
aContent = nullptr;
aReturnObject.set(&value.toObject());
return true;
}
Expand Down
16 changes: 10 additions & 6 deletions dom/base/nsLineBreaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "mozilla/intl/LineBreaker.h" // for LineBreaker::ComputeBreakPositions
#include "mozilla/intl/Locale.h"
#include "mozilla/intl/UnicodeProperties.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/StaticPrefs_intl.h"

using mozilla::AutoRestore;
Expand Down Expand Up @@ -150,6 +151,15 @@ static void SetupCapitalization(const char16_t* aWord, uint32_t aLength,
}

nsresult nsLineBreaker::FlushCurrentWord() {
auto cleanup = mozilla::MakeScopeExit([&] {
mCurrentWord.Clear();
mTextItems.Clear();
mCurrentWordMightBeBreakable = false;
mCurrentWordContainsMixedLang = false;
mCurrentWordLanguage = nullptr;
mWordContinuation = false;
});

uint32_t length = mCurrentWord.Length();
AutoTArray<uint8_t, 4000> breakState;
if (!breakState.AppendElements(length, mozilla::fallible)) {
Expand Down Expand Up @@ -232,12 +242,6 @@ nsresult nsLineBreaker::FlushCurrentWord() {
offset += ti->mLength;
}

mCurrentWord.Clear();
mTextItems.Clear();
mCurrentWordMightBeBreakable = false;
mCurrentWordContainsMixedLang = false;
mCurrentWordLanguage = nullptr;
mWordContinuation = false;
return NS_OK;
}

Expand Down
7 changes: 6 additions & 1 deletion dom/canvas/DrawTargetWebgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3048,7 +3048,12 @@ static inline AAStroke::LineCap ToAAStrokeLineCap(CapStyle aCap) {
}

static inline Point WGRPointToPoint(const WGR::Point& aPoint) {
return Point(IntPoint(aPoint.x, aPoint.y)) * (1.0f / 16.0f);
// WGR points are 28.4 fixed-point where (0.0, 0.0) is assumed to be a pixel
// center, as opposed to (0.5, 0.5) in canvas device space. WGR thus shifts
// each point by (-0.5, -0.5). To undo this, transform from fixed-point back
// to floating-point, and reverse the pixel shift by adding back (0.5, 0.5).
return Point(IntPoint(aPoint.x, aPoint.y)) * (1.0f / 16.0f) +
Point(0.5f, 0.5f);
}

// Generates a vertex buffer for a stroked path using aa-stroke.
Expand Down
4 changes: 2 additions & 2 deletions dom/html/HTMLInputElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5717,7 +5717,7 @@ Nullable<uint32_t> HTMLInputElement::GetSelectionStart(ErrorResult& aRv) {
}

uint32_t HTMLInputElement::GetSelectionStartIgnoringType(ErrorResult& aRv) {
uint32_t selEnd, selStart;
uint32_t selEnd = 0, selStart = 0;
GetSelectionRange(&selStart, &selEnd, aRv);
return selStart;
}
Expand Down Expand Up @@ -5748,7 +5748,7 @@ Nullable<uint32_t> HTMLInputElement::GetSelectionEnd(ErrorResult& aRv) {
}

uint32_t HTMLInputElement::GetSelectionEndIgnoringType(ErrorResult& aRv) {
uint32_t selEnd, selStart;
uint32_t selEnd = 0, selStart = 0;
GetSelectionRange(&selStart, &selEnd, aRv);
return selEnd;
}
Expand Down
2 changes: 2 additions & 0 deletions dom/media/eme/mediafoundation/WMFCDMImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RefPtr<WMFCDMImpl::InitPromise> WMFCDMImpl::Init(
const WMFCDMImpl::InitParams& aParams) {
if (!mCDM) {
mCDM = MakeRefPtr<MFCDMChild>(mKeySystem);
mCDM->EnsureRemote();
}
RefPtr<WMFCDMImpl> self = this;
mCDM->Init(aParams.mOrigin, aParams.mInitDataTypes,
Expand Down Expand Up @@ -58,6 +59,7 @@ WMFCDMCapabilites::GetCapabilities(
nsTArray<RefPtr<CapabilitiesPromise>> promises;
for (const auto& request : aRequests) {
RefPtr<MFCDMChild> cdm = new MFCDMChild(request.mKeySystem);
cdm->EnsureRemote();
promises.AppendElement(cdm->GetCapabilities(MFCDMCapabilitiesRequest{
nsString{request.mKeySystem},
request.mDecryption == KeySystemConfig::DecryptionInfo::Hardware,
Expand Down
Loading

0 comments on commit 0e84375

Please sign in to comment.