summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2024-08-07 10:45:26 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2024-11-24 22:58:39 -0600
commit1a7b7d68a2413c63cf01088c2c18b773c747efb7 (patch)
treed688b826537cb72f19a250cd96cdb1db5c5cd9ad
parent8b431243b55de98fd1b9686e52e9565375e7cfcf (diff)
downloadpackages-1a7b7d68a2413c63cf01088c2c18b773c747efb7.tar.gz
packages-1a7b7d68a2413c63cf01088c2c18b773c747efb7.tar.bz2
packages-1a7b7d68a2413c63cf01088c2c18b773c747efb7.tar.xz
packages-1a7b7d68a2413c63cf01088c2c18b773c747efb7.zip
user/firefox-esr: Update to 128.4.0esr
Also, include a patch that makes it almost work in PPC64.
-rw-r--r--user/firefox-esr/APKBUILD62
-rw-r--r--user/firefox-esr/BTS-1074.patch62
-rw-r--r--user/firefox-esr/bad-google-code.patch4
-rw-r--r--user/firefox-esr/disable-arm-flac.patch15
-rw-r--r--user/firefox-esr/fix-mutex-build.patch8
-rw-r--r--user/firefox-esr/fix-seccomp-bpf.patch6
-rw-r--r--user/firefox-esr/gcc13.patch10
-rw-r--r--user/firefox-esr/gcc89074.patch24
-rw-r--r--user/firefox-esr/icu-75.patch41
-rw-r--r--user/firefox-esr/jpeg-link.patch2
-rw-r--r--user/firefox-esr/js-endian.patch33
-rw-r--r--user/firefox-esr/mozconfig1
-rw-r--r--user/firefox-esr/mozilla-build-arm.patch4
-rw-r--r--user/firefox-esr/newer-cbindgen.patch17
-rw-r--r--user/firefox-esr/pmmx-double-format.patch2
-rw-r--r--user/firefox-esr/python3.11-open-U.patch102
-rw-r--r--user/firefox-esr/python3.11-regex-inline-flags.patch27
-rw-r--r--user/firefox-esr/rust-32bit.patch32
-rw-r--r--user/firefox-esr/shut-up-warning.patch2
-rw-r--r--user/firefox-esr/skia-endian.patch112
-rw-r--r--user/firefox-esr/skia-unified.patch833
-rw-r--r--user/firefox-esr/stackwalk-x86-ppc.patch12
-rw-r--r--user/firefox-esr/triplet-vendor-support.patch316
-rw-r--r--user/firefox-esr/webrender.patch32
-rw-r--r--user/firefox-esr/without-jit.patch28
25 files changed, 1056 insertions, 731 deletions
diff --git a/user/firefox-esr/APKBUILD b/user/firefox-esr/APKBUILD
index 82c29ffd7..7e57092b8 100644
--- a/user/firefox-esr/APKBUILD
+++ b/user/firefox-esr/APKBUILD
@@ -1,9 +1,9 @@
# Contributor: Molly Miller <adelie@m-squa.red>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=firefox-esr
-pkgver=91.13.0
-_llvmver=14
-pkgrel=4
+pkgver=128.4.0
+_llvmver=18
+pkgrel=0
pkgdesc="Firefox web browser (extended support release)"
url="https://www.mozilla.org/firefox/"
arch="all !ppc" # #837
@@ -33,25 +33,21 @@ source="https://ftp.mozilla.org/pub/firefox/releases/$_ffxver/source/firefox-$_f
mozconfig
bad-google-code.patch
- BTS-1074.patch
- disable-arm-flac.patch
fix-mutex-build.patch
fix-seccomp-bpf.patch
- gcc89074.patch
+ icu-75.patch
jpeg-link.patch
+ js-endian.patch
mozilla-build-arm.patch
- newer-cbindgen.patch
pmmx-double-format.patch
ppc32-fix.patch
- python3.11-open-U.patch
- python3.11-regex-inline-flags.patch
rust-32bit.patch
shut-up-warning.patch
+ skia-endian.patch
skia-unified.patch
stackwalk-x86-ppc.patch
- triplet-vendor-support.patch
webrender.patch
- gcc13.patch
+ without-jit.patch
firefox.desktop
firefox-safe.desktop
@@ -97,12 +93,14 @@ prepare() {
}
build() {
+ export CFLAGS="$CFLAGS -Wno-dangling-pointer -Wno-array-bounds -Wno-comment -Wno-maybe-uninitialized -Wno-misleading-indentation"
+ export CXXFLAGS="$CFLAGS -Wno-class-memaccess -Wno-changes-meaning"
export PATH="/usr/lib/llvm${_llvmver}/bin:${PATH}" #1230
export SHELL=/bin/sh
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
export USE_SHORT_LIBNAME=1
- export MACH_USE_SYSTEM_PYTHON=1
+ export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
# set rpath so linker finds the libs
export LDFLAGS="$LDFLAGS -Wl,-rpath,${_mozappdir}"
@@ -121,7 +119,7 @@ run() {
}
package() {
- export MACH_USE_SYSTEM_PYTHON=1
+ export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
DESTDIR="$pkgdir" ./mach install
install -m755 -d ${pkgdir}/usr/share/applications
@@ -157,27 +155,23 @@ package() {
EOF
}
-sha512sums="38b4cc52de21e76d6061e6ba175e1cbfd888a16070aa951f5a44283f2db9d7e94f2504621f0da78feac6e71491a6d0e7038f63dd0ae112dcad700eb02e9aa516 firefox-91.13.0esr.source.tar.xz
-86168a5e5b8aa3ea7cc0d40174baa97595c82b8e599937155fbd7761e7df7220980c74f75e96c34e5f660423e42ad67761f57b2923389be363253868bac033a9 mozconfig
-ace7492f4fb0523c7340fdc09c831906f74fddad93822aff367135538dacd3f56288b907f5a04f53f94c76e722ba0bab73e28d83ec12d3e672554712e6b08613 bad-google-code.patch
-57410e4b9199f3c7db1cd4a0cf3e67cd962b585730c073edb1cadc3bcac5b0aec4e6f7efe24f3eadd1020aefef475e08e97f13dc6b6534e639f33cc6fb1abe04 BTS-1074.patch
-33c6c9d845981137e41e396463c09a55c4effe56628f9f7a4e13b7328e4591b97bc607df484393994a9da07d701f2eaee4e30b463284159e4206e1c42a1a4cdc disable-arm-flac.patch
-c0b2bf43206c2a5154e560ef30189a1062ae856861b39f52ce69002390ff9972d43e387bfd2bf8d2ab3cac621987bc042c8c0a8b4cf90ae05717ca7705271880 fix-mutex-build.patch
-70863b985427b9653ce5e28d6064f078fb6d4ccf43dd1b68e72f97f44868fc0ce063161c39a4e77a0a1a207b7365d5dc7a7ca5e68c726825eba814f2b93e2f5d fix-seccomp-bpf.patch
-6eb7fb134760f5d232710c56f18f14de4f533e41e269531edd01f5650f6d641513e34a8d2294af5ad6fd184736f674c734efb4cc003636a75e14a8fdba2fe3b0 gcc89074.patch
-240d6c9290a20e2c9ccfa2d15c9a636fc1b09b62f09285eb688974d888390da2a84271f14c397570b58ccdcf29b99370f7183cc0dbbbe581bf6e7d7ee8dcabd2 jpeg-link.patch
-e61664bc93eadce5016a06a4d0684b34a05074f1815e88ef2613380d7b369c6fd305fb34f83b5eb18b9e3138273ea8ddcfdcb1084fdcaa922a1e5b30146a3b18 mozilla-build-arm.patch
-eb158bf2e4b9d513ae36f3c977a3b110ea8c4801c3c94841bc3ad4cdca3bdfc96d4a662e5a2e662fe7a01b0f1af097280097b16f5d0e83d29b4a7e6cbb8c7396 newer-cbindgen.patch
-573b90c73512d2b9971e466b138ffeea94b28f9a20e11e75ee1121e3f6a14fb4bf1a30622da6d48f67e5ea0bc58b200ba5fc3e930bae52f83b2f25f6c10806dd pmmx-double-format.patch
+sha512sums="e720b1f993926d73f5a5727648f753176ac2fd093fb0b71393946bbc5919ce5fc7b88b82960bd1aa427b5663c7f659828dc6702485fc0c1e7a6961571c67faa3 firefox-128.4.0esr.source.tar.xz
+aaeec88eda3ca5ef00503f2e1656f8a143017d5ff60bd289ce7a49b7f8352ce5b61556c732e5eb3b6859e1c30551219eb5bbb954e9b88eca8d3f44683bdd747d mozconfig
+1fff71be77aa34791ef8aa972b5dc5f131d79f4b895ebbfb59bc223078764d6f79c82a3a4e4c717a3893ecbe4907d556f27e97d2692e41f02365f06da759a71a bad-google-code.patch
+5e6c3fa027052cc43ba161cf5c12016b07723e7c0b002a42431bbd5d716d512d5245ab6befbb56c37c7d244441533f810f4e7b583f83bbe965981931f1435a94 fix-mutex-build.patch
+9f2892eff9d09f3eed1f9a9ee98ba9c6a6826c30ccdeabfefb8733abc98e7b612418827262423568e830c6354a2b8242f471bc200b7079f21862bb00947da716 fix-seccomp-bpf.patch
+0a84e8cb6604fdb7601745b60c04ee74733632ada32bfd85eb32db8fee095cfb79c82033e5e3cf3bbc7b7f4df753e86ffe18e26e63a6603a93c3bb5a459aabd3 icu-75.patch
+a2400c8df888637d9ebe33d82dc2fb95792685c9938b5486230a5c15bc819cbb850a2bdcb54a775516652fc8ffd6b40f8c591ab7941211f9516064101380ebbf jpeg-link.patch
+d40e6c1a6e62d5e1dc350dc0bbaf2b8488b19ea0911532784f1df1199a7a5af0aae81b0b0d77c4398a2d903d86b5560f4442386eb446d9af8d58e73eea475e4f js-endian.patch
+9f5730ee3a29b86786089abcfffab32bf2210f1a1ec43260ae824a08acda687dbfa37306b82a4978dd022bcf747eab155f7f3c5f73a1375f1c3c4fcd106dae3e mozilla-build-arm.patch
+1864c6c63c647f3ed1b3ca4df7f52a2c7ec4c65f2e067a9842d24a242f01e047d59ffbf88ad3740d830df1eb0bade929e245e640db135fe14f4c0d879269cb7e pmmx-double-format.patch
06a3f4ee6d3726adf3460952fcbaaf24bb15ef8d15b3357fdd1766c7a62b00bd53a1e943b5df7f4e1a69f4fae0d44b64fae1e027d7812499c77894975969ea10 ppc32-fix.patch
-07c311921e50fdb86c587000418306292548117f32a69b78db9d8ebd3a1b08196774a3d284b7e2898a2f1fbb9987b2367092f33957824514fd3d7c7b618a83e2 python3.11-open-U.patch
-c9c5610b99e73a1eedd3510e73921cba84f8c6d0c58fc7fe5b4a7ec261bd5fe530560856fba46d6b37f84c6e467d5b43946968dc8230b5491bba976b0b5ae33c python3.11-regex-inline-flags.patch
-153f955169e1489d49867be90f68e8a4722cad8edb3a9d1ddb6161e34399e1b4e9e82dc8d72aaba1d5f585bca7c4852433e8ecb068be1583df7155c7cce0223b rust-32bit.patch
-39ddb15d1453a8412275c36fc8db3befc69dffd4a362e932d280fb7fd1190db595a2af9b468ee49e0714f5e9df6e48eb5794122a64fa9f30d689de8693acbb15 shut-up-warning.patch
-961fa1c856e97e4d08da4682f520ecf23075571a532a781c5e14dbec4915130b02a8199caf6602013ea904d347c4f06d086b0fe84a3850dd6910d351232da599 skia-unified.patch
-452b47b825294779f98ed46bc1065dad76b79ff453521ef049934a120f349c84a1c863b16af1828fe053059823da9690ec917c055ae02dcc5c80c54cad732448 stackwalk-x86-ppc.patch
-60ffc4b95ba72aa19fb4f4aaf91393e8c730dae536a19248e2dd21c38cc32891bff69a6b51ea903f185ecc680dae4b21ec11d8cac67b3b038b3f0e757639ad94 triplet-vendor-support.patch
-b7c1ac21cd03b7cdc887e005ed970cf13ff95643c7651decf1e6d42094cda6a0464dc2ba3cded3827f6d0f3682c2c9b081a7667f386133aa6e3072d0464e72e8 webrender.patch
-bb57b3ed998543f9a2edcc379a0c5e2d7e855a0d6f538547f18cdfce56f6c91a3c26a8b1505824628fdd394f0f75a8e98c7fb559ef79eac803d4028e5e9827e5 gcc13.patch
+e1c8a85c46a9cc804eb6b5946d35b63fa2cfc7ad8b4f250c5eaf1b590b139a66d9a833246bc26ae2e340fffb81b6761cf51c600181895bd49feb9a3b8fbfe331 rust-32bit.patch
+c2248297df00633771da7e6b9f2caba3dd5108d93617f652fa8b2fb4e6975821e5fee866c00713f8fce08e760fa456e2dd19a8ef7370e5a2c65dc09614526be9 shut-up-warning.patch
+11f7ce86376b54281082fa5b9d3fefee8046eabe38a0ec17266764b4f62cb90f4744245c1ca93d73ed74cf81c066dab7ddcb3fe9704be8f91e0a2a4f664b203a skia-endian.patch
+8e155e5a883e26c9bc67b7d45ca7d36813b07723e0eff9d7bc5b696b6412354906bd645cd890b54de2af19c1f205ea7991bd32cde1a669224beedf539b93bd56 skia-unified.patch
+9df89366bd51670f534591e4c169186703ad3166a493f522e58f129fb79af375d71baaf0f6b238126792118a2d3ed0f011b010e39497ab5901ee5bea63a84fa2 stackwalk-x86-ppc.patch
+e1d9e30a1c8d1c6bdd3530183400d7d245e437ce18bb5b262bec1d01932b02b8eaededd892efcdd277eaccb357aede4537972382be9f00eedf1785acebbd1ca6 webrender.patch
+ed78e15030d79b10026ebae26e44a68d16c2a8567082072b5099b0dde4f79ae217a21737e0d9c7ec6a3cc99de3ab3c9083cca7d82889d559bb18cc15fa7e6f2a without-jit.patch
f3b7c3e804ce04731012a46cb9e9a6b0769e3772aef9c0a4a8c7520b030fdf6cd703d5e9ff49275f14b7d738fe82a0a4fde3bc3219dff7225d5db0e274987454 firefox.desktop
5dcb6288d0444a8a471d669bbaf61cdb1433663eff38b72ee5e980843f5fc07d0d60c91627a2c1159215d0ad77ae3f115dcc5fdfe87e64ca704b641aceaa44ed firefox-safe.desktop"
diff --git a/user/firefox-esr/BTS-1074.patch b/user/firefox-esr/BTS-1074.patch
deleted file mode 100644
index fdc5478b4..000000000
--- a/user/firefox-esr/BTS-1074.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-gas(1) under binutils-2.41 no longer allows invalid negative shifts.
-
-This patch fixes the bundled FFmpeg in Firefox to not use them.
-
---- a/media/ffvpx/libavcodec/x86/mathops.h.old 2023-10-03 22:15:24.440738743 -0500
-+++ b/media/ffvpx/libavcodec/x86/mathops.h 2023-10-03 22:15:41.458911245 -0500
-@@ -35,12 +35,20 @@
- static av_always_inline av_const int MULL(int a, int b, unsigned shift)
- {
- int rt, dummy;
-+ if (__builtin_constant_p(shift))
- __asm__ (
- "imull %3 \n\t"
- "shrdl %4, %%edx, %%eax \n\t"
- :"=a"(rt), "=d"(dummy)
-- :"a"(a), "rm"(b), "ci"((uint8_t)shift)
-+ :"a"(a), "rm"(b), "i"(shift & 0x1F)
- );
-+ else
-+ __asm__ (
-+ "imull %3 \n\t"
-+ "shrdl %4, %%edx, %%eax \n\t"
-+ :"=a"(rt), "=d"(dummy)
-+ :"a"(a), "rm"(b), "c"((uint8_t)shift)
-+ );
- return rt;
- }
-
-@@ -113,19 +121,31 @@
- // avoid +32 for shift optimization (gcc should do that ...)
- #define NEG_SSR32 NEG_SSR32
- static inline int32_t NEG_SSR32( int32_t a, int8_t s){
-+ if (__builtin_constant_p(s))
- __asm__ ("sarl %1, %0\n\t"
- : "+r" (a)
-- : "ic" ((uint8_t)(-s))
-+ : "i" (-s & 0x1F)
- );
-+ else
-+ __asm__ ("sarl %1, %0\n\t"
-+ : "+r" (a)
-+ : "c" ((uint8_t)(-s))
-+ );
- return a;
- }
-
- #define NEG_USR32 NEG_USR32
- static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
-+ if (__builtin_constant_p(s))
- __asm__ ("shrl %1, %0\n\t"
- : "+r" (a)
-- : "ic" ((uint8_t)(-s))
-+ : "i" (-s & 0x1F)
- );
-+ else
-+ __asm__ ("shrl %1, %0\n\t"
-+ : "+r" (a)
-+ : "c" ((uint8_t)(-s))
-+ );
- return a;
- }
-
diff --git a/user/firefox-esr/bad-google-code.patch b/user/firefox-esr/bad-google-code.patch
index e214af432..31659370d 100644
--- a/user/firefox-esr/bad-google-code.patch
+++ b/user/firefox-esr/bad-google-code.patch
@@ -1,6 +1,6 @@
--- firefox-esr-60.2.1/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
+++ firefox-esr-60.2.1/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
-@@ -45,6 +45,7 @@
+@@ -47,6 +47,7 @@
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -34,7 +34,7 @@
--- firefox-esr-60.2.1/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+++ firefox-esr-60.2.1/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
-@@ -1134,6 +1134,12 @@ struct kernel_statfs {
+@@ -1246,6 +1246,12 @@ struct kernel_statfs {
#ifndef __NR_fallocate
#define __NR_fallocate 285
#endif
diff --git a/user/firefox-esr/disable-arm-flac.patch b/user/firefox-esr/disable-arm-flac.patch
deleted file mode 100644
index fa1ba8753..000000000
--- a/user/firefox-esr/disable-arm-flac.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-32-bit ARM assembler is mostly for Android32 accel anyway.
-
-It doesn't link properly on musl (TEXTRELs).
-
---- firefox-91.13.0/toolkit/moz.configure.old 2023-10-09 10:40:18.231733637 +0000
-+++ firefox-91.13.0/toolkit/moz.configure 2023-10-10 02:22:34.743712070 +0000
-@@ -1894,7 +1894,7 @@
- flac_only = True
- elif target.cpu == "x86_64":
- flags = ["-D__x86_64__", "-DPIC", "-DELF", "-Pconfig_unix64.asm"]
-- elif target.cpu in ("x86", "arm", "aarch64"):
-+ elif target.cpu in ("x86", "aarch64"):
- flac_only = True
- else:
- enable = False
diff --git a/user/firefox-esr/fix-mutex-build.patch b/user/firefox-esr/fix-mutex-build.patch
index a569e5aa7..1d1d0772b 100644
--- a/user/firefox-esr/fix-mutex-build.patch
+++ b/user/firefox-esr/fix-mutex-build.patch
@@ -1,18 +1,18 @@
--- firefox-60.3.0/memory/build/Mutex.h.old 2018-10-17 20:39:32.000000000 +0000
+++ firefox-60.3.0/memory/build/Mutex.h 2018-10-26 05:22:54.980000000 +0000
-@@ -39,7 +39,7 @@
+@@ -57,7 +57,7 @@
}
#elif defined(XP_DARWIN)
- mMutex = OS_SPINLOCK_INIT;
+ mMutex = OS_UNFAIR_LOCK_INIT;
-#elif defined(XP_LINUX) && !defined(ANDROID)
+#elif defined(XP_LINUX) && defined(__GLIBC__)
pthread_mutexattr_t attr;
if (pthread_mutexattr_init(&attr) != 0) {
return false;
-@@ -107,7 +107,7 @@
+@@ -142,7 +142,7 @@
# if defined(XP_DARWIN)
- # define STATIC_MUTEX_INIT OS_SPINLOCK_INIT
+ # define STATIC_MUTEX_INIT OS_UNFAIR_LOCK_INIT
-# elif defined(XP_LINUX) && !defined(ANDROID)
+# elif defined(XP_LINUX) && defined(__GLIBC__)
# define STATIC_MUTEX_INIT PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
diff --git a/user/firefox-esr/fix-seccomp-bpf.patch b/user/firefox-esr/fix-seccomp-bpf.patch
index 47cde56c7..08068b5f5 100644
--- a/user/firefox-esr/fix-seccomp-bpf.patch
+++ b/user/firefox-esr/fix-seccomp-bpf.patch
@@ -1,8 +1,8 @@
--- a/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc.orig 2015-09-23 09:10:08.812740571 +0200
+++ b/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc 2015-09-23 09:11:38.404746155 +0200
-@@ -23,6 +23,11 @@
- #include "sandbox/linux/services/android_ucontext.h"
- #endif
+@@ -25,6 +25,11 @@
+ #include "sandbox/linux/system_headers/linux_seccomp.h"
+ #include "sandbox/linux/system_headers/linux_signal.h"
+// musl libc defines siginfo_t __si_fields instead of _sifields
+#if defined(OS_LINUX) && !defined(__GLIBC__)
diff --git a/user/firefox-esr/gcc13.patch b/user/firefox-esr/gcc13.patch
deleted file mode 100644
index 1c4f085e0..000000000
--- a/user/firefox-esr/gcc13.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- firefox-91.13.0/gfx/2d/Rect.h.old 2022-08-15 13:04:38.000000000 -0500
-+++ firefox-91.13.0/gfx/2d/Rect.h 2024-05-28 20:50:50.230975904 -0500
-@@ -15,6 +15,7 @@
- #include "mozilla/Maybe.h"
-
- #include <cmath>
-+#include <cstdint>
-
- namespace mozilla {
-
diff --git a/user/firefox-esr/gcc89074.patch b/user/firefox-esr/gcc89074.patch
deleted file mode 100644
index e9713193c..000000000
--- a/user/firefox-esr/gcc89074.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Upstream-URL: https://bugzilla.mozilla.org/show_bug.cgi?id=1688122
-Upstream-URL: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89074
-
-Valid code, but only used for debugging. GCC 12 fixed this.
-Moz upstream not interested.
-
---- firefox-91.13.0/dom/base/nsTreeSanitizer.cpp.old 2022-08-15 13:04:32.000000000 -0500
-+++ firefox-91.13.0/dom/base/nsTreeSanitizer.cpp 2022-11-19 00:42:15.892580023 -0600
-@@ -632,15 +632,6 @@
- constexpr const nsStaticAtom* const kURLAttributesSVG[] = {nsGkAtoms::href,
- nullptr};
-
--static_assert(AllOf(std::begin(kURLAttributesSVG), std::end(kURLAttributesSVG),
-- [](auto aURLAttributeSVG) {
-- return AnyOf(std::begin(kAttributesSVG),
-- std::end(kAttributesSVG),
-- [&](auto aAttributeSVG) {
-- return aAttributeSVG == aURLAttributeSVG;
-- });
-- }));
--
- const nsStaticAtom* const kElementsMathML[] = {
- nsGkAtoms::abs_, // abs
- nsGkAtoms::_and, // and
diff --git a/user/firefox-esr/icu-75.patch b/user/firefox-esr/icu-75.patch
new file mode 100644
index 000000000..617dd76a9
--- /dev/null
+++ b/user/firefox-esr/icu-75.patch
@@ -0,0 +1,41 @@
+https://bugs.gentoo.org/917599
+https://bugzilla.mozilla.org/show_bug.cgi?id=1862601
+https://hg.mozilla.org/try/rev/d5f3b0c4f08a426ce00a153c04e177eecb6820e2
+
+# HG changeset patch
+# User André Bargull <andre.bargull@gmail.com>
+# Date 1697435923 -7200
+# Node ID d5f3b0c4f08a426ce00a153c04e177eecb6820e2
+# Parent c63994f8259efdf6e745c960aa9e1409d5477049
+Bug xxx - Part 12: Add new line break classes. r?
+
+diff --git a/intl/lwbrk/LineBreaker.cpp b/intl/lwbrk/LineBreaker.cpp
+--- a/intl/lwbrk/LineBreaker.cpp
++++ b/intl/lwbrk/LineBreaker.cpp
+@@ -443,17 +443,23 @@ static int8_t GetClass(uint32_t u, LineB
+ /* JT = 34, [JT] */ CLASS_CHARACTER,
+ /* JV = 35, [JV] */ CLASS_CHARACTER,
+ /* CLOSE_PARENTHESIS = 36, [CP] */ CLASS_CLOSE_LIKE_CHARACTER,
+ /* CONDITIONAL_JAPANESE_STARTER = 37, [CJ] */ CLASS_CLOSE,
+ /* HEBREW_LETTER = 38, [HL] */ CLASS_CHARACTER,
+ /* REGIONAL_INDICATOR = 39, [RI] */ CLASS_CHARACTER,
+ /* E_BASE = 40, [EB] */ CLASS_BREAKABLE,
+ /* E_MODIFIER = 41, [EM] */ CLASS_CHARACTER,
+- /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER};
++ /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER,
++ /* AKSARA = 43, [AK] */ CLASS_CHARACTER,
++ /* AKSARA_PREBASE = 44, [AP] */ CLASS_CHARACTER,
++ /* AKSARA_START = 45, [AS] */ CLASS_CHARACTER,
++ /* VIRAMA_FINAL = 46, [VF] */ CLASS_CHARACTER,
++ /* VIRAMA = 47, [VI] */ CLASS_CHARACTER,
++ };
+
+ static_assert(U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass),
+ "Gecko vs ICU LineBreak class mismatch");
+
+ auto cls = GetLineBreakClass(u);
+ MOZ_ASSERT(cls < mozilla::ArrayLength(sUnicodeLineBreakToClass));
+
+ // Overrides based on rules for the different line-break values given in
+
+
diff --git a/user/firefox-esr/jpeg-link.patch b/user/firefox-esr/jpeg-link.patch
index a04d924d4..724bc76fb 100644
--- a/user/firefox-esr/jpeg-link.patch
+++ b/user/firefox-esr/jpeg-link.patch
@@ -1,6 +1,6 @@
--- firefox-91.13.0/toolkit/moz.configure.old 2022-08-15 13:05:59.000000000 -0500
+++ firefox-91.13.0/toolkit/moz.configure 2022-11-15 01:26:57.874201494 -0600
-@@ -1758,14 +1758,14 @@
+@@ -2274,14 +2274,14 @@
)
with only_when("--with-system-jpeg"):
diff --git a/user/firefox-esr/js-endian.patch b/user/firefox-esr/js-endian.patch
new file mode 100644
index 000000000..44f21d2d1
--- /dev/null
+++ b/user/firefox-esr/js-endian.patch
@@ -0,0 +1,33 @@
+# HG changeset patch
+# User A. Wilcox <AWilcox@Wilcox-Tech.com>
+# Date 1729710191 18000
+# Wed Oct 23 14:03:11 2024 -0500
+# Node ID 6102585e0d752de1729135d4c7d917e751b268c5
+# Parent 61f7d9c0998e2ce8008cd15b187f86dfdba21a26
+Bug 1926667 - Ensure JSStructuredCloneReader::readTransferMap respects endianness r?sfink
+
+Differential Revision: https://phabricator.services.mozilla.com/D226707
+
+diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
+--- a/js/src/vm/StructuredClone.cpp
++++ b/js/src/vm/StructuredClone.cpp
+@@ -3387,7 +3387,8 @@ bool JSStructuredCloneReader::readTransf
+ }
+
+ headerPos.write(
+- PairToUInt64(SCTAG_TRANSFER_MAP_HEADER, SCTAG_TM_TRANSFERRING));
++ NativeEndian::swapToLittleEndian(
++ PairToUInt64(SCTAG_TRANSFER_MAP_HEADER, SCTAG_TM_TRANSFERRING)));
+
+ uint64_t numTransferables;
+ MOZ_ALWAYS_TRUE(in.readPair(&tag, &data));
+@@ -3512,7 +3513,8 @@ bool JSStructuredCloneReader::readTransf
+ MOZ_ASSERT(TransferableMapHeader(data) == SCTAG_TM_TRANSFERRING);
+ #endif
+ headerPos.write(
+- PairToUInt64(SCTAG_TRANSFER_MAP_HEADER, SCTAG_TM_TRANSFERRED));
++ NativeEndian::swapToLittleEndian(
++ PairToUInt64(SCTAG_TRANSFER_MAP_HEADER, SCTAG_TM_TRANSFERRED)));
+
+ return true;
+ }
diff --git a/user/firefox-esr/mozconfig b/user/firefox-esr/mozconfig
index ed1f42dbb..b49d3be3f 100644
--- a/user/firefox-esr/mozconfig
+++ b/user/firefox-esr/mozconfig
@@ -23,3 +23,4 @@ ac_add_options --with-system-nss
ac_add_options --with-system-pixman
ac_add_options --with-system-png
ac_add_options --with-system-zlib
+ac_add_options --without-wasm-sandboxed-libraries
diff --git a/user/firefox-esr/mozilla-build-arm.patch b/user/firefox-esr/mozilla-build-arm.patch
index dcf2f6d8a..17c95d01d 100644
--- a/user/firefox-esr/mozilla-build-arm.patch
+++ b/user/firefox-esr/mozilla-build-arm.patch
@@ -1,10 +1,10 @@
--- ./gfx/ycbcr/moz.build.orig 2014-04-03 13:50:38.990296661 +0000
+++ ./gfx/ycbcr/moz.build 2014-04-03 13:52:26.878268547 +0000
-@@ -59,7 +59,7 @@
+@@ -53,7 +53,7 @@
'yuv_row_other.cpp',
]
--if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['HAVE_ARM_NEON']:
+-if CONFIG['TARGET_CPU'] == 'arm' and CONFIG['HAVE_ARM_NEON']:
+if CONFIG['HAVE_ARM_NEON']:
SOURCES += [
'yuv_row_arm.s',
diff --git a/user/firefox-esr/newer-cbindgen.patch b/user/firefox-esr/newer-cbindgen.patch
deleted file mode 100644
index 9829237ee..000000000
--- a/user/firefox-esr/newer-cbindgen.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Description: Remove an extra constant definition that is now being
- generated by newer versions of cbindgen (0.24), and causing
- build failures because it is defined in several places.
-Author: Olivier Tilloy <olivier.tilloy@canonical.com>
-Upstream-URL: https://bugzilla.mozilla.org/show_bug.cgi?id=1773259
-
---- a/gfx/webrender_bindings/webrender_ffi.h
-+++ b/gfx/webrender_bindings/webrender_ffi.h
-@@ -77,8 +77,6 @@ struct WrPipelineInfo;
- struct WrPipelineIdAndEpoch;
- using WrPipelineIdEpochs = nsTArray<WrPipelineIdAndEpoch>;
-
--const uint64_t ROOT_CLIP_CHAIN = ~0;
--
- } // namespace wr
- } // namespace mozilla
-
diff --git a/user/firefox-esr/pmmx-double-format.patch b/user/firefox-esr/pmmx-double-format.patch
index 4b2289fab..e520987b3 100644
--- a/user/firefox-esr/pmmx-double-format.patch
+++ b/user/firefox-esr/pmmx-double-format.patch
@@ -12,5 +12,5 @@ index 51d79f9c2ec59..fafd7d6fc1e0d 100644
typedef double __double_t;
+#endif
typedef __double_t double_t;
+ typedef float __float_t;
- /*
diff --git a/user/firefox-esr/python3.11-open-U.patch b/user/firefox-esr/python3.11-open-U.patch
deleted file mode 100644
index 8cbab9c0a..000000000
--- a/user/firefox-esr/python3.11-open-U.patch
+++ /dev/null
@@ -1,102 +0,0 @@
---- thunderbird-91.11.0/dom/base/usecounters.py.python-open-U 2022-06-28 04:37:00.000000000 +0200
-+++ thunderbird-91.11.0/dom/base/usecounters.py 2022-07-11 19:17:46.266517761 +0200
-@@ -8,7 +8,7 @@ import re
-
- def read_conf(conf_filename):
- # Can't read/write from a single StringIO, so make a new one for reading.
-- stream = open(conf_filename, "rU")
-+ stream = open(conf_filename, "r")
-
- def parse_counters(stream):
- for line_num, line in enumerate(stream):
---- thunderbird-91.11.0/python/mozbuild/mozbuild/action/process_define_files.py.python-open-U 2022-06-28 04:37:39.000000000 +0200
-+++ thunderbird-91.11.0/python/mozbuild/mozbuild/action/process_define_files.py 2022-07-11 19:18:24.056417112 +0200
-@@ -36,7 +36,7 @@ def process_define_file(output, input):
- ) and not config.substs.get("JS_STANDALONE"):
- config = PartialConfigEnvironment(mozpath.join(topobjdir, "js", "src"))
-
-- with open(path, "rU") as input:
-+ with open(path, "r") as input:
- r = re.compile(
- "^\s*#\s*(?P<cmd>[a-z]+)(?:\s+(?P<name>\S+)(?:\s+(?P<value>\S+))?)?", re.U
- )
---- thunderbird-91.11.0/python/mozbuild/mozbuild/backend/base.py.python-open-U 2022-06-28 04:37:39.000000000 +0200
-+++ thunderbird-91.11.0/python/mozbuild/mozbuild/backend/base.py 2022-07-11 19:18:34.165390187 +0200
-@@ -272,7 +272,7 @@ class BuildBackend(LoggingMixin):
- return status
-
- @contextmanager
-- def _write_file(self, path=None, fh=None, readmode="rU"):
-+ def _write_file(self, path=None, fh=None, readmode="r"):
- """Context manager to write a file.
-
- This is a glorified wrapper around FileAvoidWrite with integration to
---- thunderbird-91.11.0/python/mozbuild/mozbuild/preprocessor.py.python-open-U 2022-06-28 04:37:20.000000000 +0200
-+++ thunderbird-91.11.0/python/mozbuild/mozbuild/preprocessor.py 2022-07-11 19:19:30.677239685 +0200
-@@ -531,7 +531,7 @@ class Preprocessor:
-
- if args:
- for f in args:
-- with io.open(f, "rU", encoding="utf-8") as input:
-+ with io.open(f, "r", encoding="utf-8") as input:
- self.processFile(input=input, output=out)
- if depfile:
- mk = Makefile()
-@@ -860,7 +860,7 @@ class Preprocessor:
- args = self.applyFilters(args)
- if not os.path.isabs(args):
- args = os.path.join(self.curdir, args)
-- args = io.open(args, "rU", encoding="utf-8")
-+ args = io.open(args, "r", encoding="utf-8")
- except Preprocessor.Error:
- raise
- except Exception:
-@@ -914,7 +914,7 @@ class Preprocessor:
- def preprocess(includes=[sys.stdin], defines={}, output=sys.stdout, marker="#"):
- pp = Preprocessor(defines=defines, marker=marker)
- for f in includes:
-- with io.open(f, "rU", encoding="utf-8") as input:
-+ with io.open(f, "r", encoding="utf-8") as input:
- pp.processFile(input=input, output=output)
- return pp.includes
-
---- thunderbird-91.11.0/python/mozbuild/mozbuild/util.py.python-open-U 2022-06-28 04:37:40.000000000 +0200
-+++ thunderbird-91.11.0/python/mozbuild/mozbuild/util.py 2022-07-11 19:19:19.903268374 +0200
-@@ -225,7 +225,7 @@ class FileAvoidWrite(BytesIO):
- still occur, as well as diff capture if requested.
- """
-
-- def __init__(self, filename, capture_diff=False, dry_run=False, readmode="rU"):
-+ def __init__(self, filename, capture_diff=False, dry_run=False, readmode="r"):
- BytesIO.__init__(self)
- self.name = filename
- assert type(capture_diff) == bool
-@@ -1447,7 +1447,7 @@ def patch_main():
-
- def my_get_command_line():
- with open(
-- os.path.join(os.path.dirname(__file__), "fork_interpose.py"), "rU"
-+ os.path.join(os.path.dirname(__file__), "fork_interpose.py"), "r"
- ) as fork_file:
- fork_code = fork_file.read()
- # Add our relevant globals.
---- thunderbird-91.11.0/python/mozbuild/mozpack/files.py.python-open-U 2022-06-28 04:37:40.000000000 +0200
-+++ thunderbird-91.11.0/python/mozbuild/mozpack/files.py 2022-07-11 19:19:40.372213866 +0200
-@@ -574,7 +574,7 @@ class PreprocessedFile(BaseFile):
- pp = Preprocessor(defines=self.defines, marker=self.marker)
- pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
-
-- with _open(self.path, "rU") as input:
-+ with _open(self.path, "r") as input:
- with _open(os.devnull, "w") as output:
- pp.processFile(input=input, output=output)
-
-@@ -631,7 +631,7 @@ class PreprocessedFile(BaseFile):
- pp = Preprocessor(defines=self.defines, marker=self.marker)
- pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
-
-- with _open(self.path, "rU") as input:
-+ with _open(self.path, "r") as input:
- pp.processFile(input=input, output=dest, depfile=deps_out)
-
- dest.close()
diff --git a/user/firefox-esr/python3.11-regex-inline-flags.patch b/user/firefox-esr/python3.11-regex-inline-flags.patch
deleted file mode 100644
index 39481ec01..000000000
--- a/user/firefox-esr/python3.11-regex-inline-flags.patch
+++ /dev/null
@@ -1,27 +0,0 @@
---- thunderbird-91.11.0/xpcom/idl-parser/xpidl/xpidl.py.python-inline-flags 2022-06-28 04:39:56.000000000 +0200
-+++ thunderbird-91.11.0/xpcom/idl-parser/xpidl/xpidl.py 2022-07-11 21:55:05.287553042 +0200
-@@ -1563,13 +1563,13 @@ class IDLParser(object):
- t_ignore = " \t"
-
- def t_multilinecomment(self, t):
-- r"/\*(?s).*?\*/"
-+ r"/\*(?s:.*?)\*/"
- t.lexer.lineno += t.value.count("\n")
- if t.value.startswith("/**"):
- self._doccomments.append(t.value)
-
- def t_singlelinecomment(self, t):
-- r"(?m)//.*?$"
-+ r"(?m://.*?$)"
-
- def t_IID(self, t):
- return t
-@@ -1582,7 +1582,7 @@ class IDLParser(object):
- return t
-
- def t_LCDATA(self, t):
-- r"(?s)%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?"
-+ r"(?s:%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?)"
- t.type = "CDATA"
- t.value = t.lexer.lexmatch.group("cdata")
- t.lexer.lineno += t.value.count("\n")
diff --git a/user/firefox-esr/rust-32bit.patch b/user/firefox-esr/rust-32bit.patch
index cff36e90b..4829e44bf 100644
--- a/user/firefox-esr/rust-32bit.patch
+++ b/user/firefox-esr/rust-32bit.patch
@@ -1,32 +1,30 @@
---- firefox-91.13.0/config/makefiles/rust.mk.old 2022-08-15 13:04:32.000000000 -0500
-+++ firefox-91.13.0/config/makefiles/rust.mk 2022-11-15 01:35:10.150096648 -0600
-@@ -64,19 +64,19 @@
+LTO kills the build on 32-bit architectures.
+
+--- firefox-128.0/config/makefiles/rust.mk.old 2024-07-04 11:20:25.000000000 -0500
++++ firefox-128.0/config/makefiles/rust.mk 2024-08-04 03:20:25.375459833 -0500
+@@ -82,25 +82,6 @@
# These flags are passed via `cargo rustc` and only apply to the final rustc
# invocation (i.e., only the top-level crate, not its dependencies).
cargo_rustc_flags = $(CARGO_RUSTCFLAGS)
-ifndef DEVELOPER_OPTIONS
-ifndef MOZ_DEBUG_RUST
-+#ifndef DEVELOPER_OPTIONS
-+#ifndef MOZ_DEBUG_RUST
- # Enable link-time optimization for release builds, but not when linking
- # gkrust_gtest. And not when doing cross-language LTO.
+-# Enable link-time optimization for release builds, but not when linking
+-# gkrust_gtest. And not when doing cross-language LTO.
-ifndef MOZ_LTO_RUST_CROSS
+-# Never enable when sancov is enabled to work around https://github.com/rust-lang/rust/issues/90300.
+-ifndef rustflags_sancov
+-# Never enable when coverage is enabled to work around https://github.com/rust-lang/rust/issues/90045.
+-ifndef MOZ_CODE_COVERAGE
-ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
--cargo_rustc_flags += -Clto
+-cargo_rustc_flags += -Clto$(if $(filter full,$(MOZ_LTO_RUST_CROSS)),=fat)
-endif
-+#ifndef MOZ_LTO_RUST_CROSS
-+#ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
-+#cargo_rustc_flags += -Clto
-+#endif
- # We need -Cembed-bitcode=yes for all crates when using -Clto.
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
-RUSTFLAGS += -Cembed-bitcode=yes
-endif
-endif
-endif
-+#RUSTFLAGS += -Cembed-bitcode=yes
-+#endif
-+#endif
-+#endif
+-endif
+-endif
ifdef CARGO_INCREMENTAL
export CARGO_INCREMENTAL
diff --git a/user/firefox-esr/shut-up-warning.patch b/user/firefox-esr/shut-up-warning.patch
index 8df045af1..bc90b6e2b 100644
--- a/user/firefox-esr/shut-up-warning.patch
+++ b/user/firefox-esr/shut-up-warning.patch
@@ -1,6 +1,6 @@
--- firefox-68.0.1/gfx/2d/HelpersCairo.h.old 2019-07-17 20:51:26.000000000 +0000
+++ firefox-68.0.1/gfx/2d/HelpersCairo.h 2019-08-10 11:38:36.047380153 +0000
-@@ -147,7 +147,7 @@
+@@ -149,7 +149,7 @@
case SurfaceFormat::R5G6B5_UINT16:
return CAIRO_FORMAT_RGB16_565;
default:
diff --git a/user/firefox-esr/skia-endian.patch b/user/firefox-esr/skia-endian.patch
new file mode 100644
index 000000000..7a88b0869
--- /dev/null
+++ b/user/firefox-esr/skia-endian.patch
@@ -0,0 +1,112 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=1888396
+
+--- firefox-128.0/gfx/skia/skia/include/private/SkColorData.h
++++ firefox-128.0/gfx/skia/skia/include/private/SkColorData.h
+@@ -12,6 +12,13 @@ #include "include/core/SkColor.h"
+ #include "include/core/SkColorPriv.h"
+ #include "include/private/base/SkTo.h"
+
++/* Macro to covert between big endian and little endian memory order. */
++#ifdef SK_CPU_BENDIAN
++#define BE_CONVERT(c) ((((c) & 0xff)<<24) | (((c) & 0xff00)<<8) | (((c) & 0xff0000)>>8) | (((c) & 0xff000000)>>24))
++#else
++#define BE_CONVERT(c) c
++#endif
++
+ ////////////////////////////////////////////////////////////////////////////////////////////
+ // Convert a 16bit pixel to a 32bit pixel
+
+--- firefox-128.0/gfx/skia/skia/src/core/SkBlitRow_D32.cpp
++++ firefox-128.0/gfx/skia/skia/src/core/SkBlitRow_D32.cpp
+@@ -555,7 +555,7 @@ }
+ void SkBlitRow::Color32(SkPMColor dst[], int count, SkPMColor color) {
+ switch (SkGetPackedA32(color)) {
+ case 0: /* Nothing to do */ return;
+- case 255: SkOpts::memset32(dst, color, count); return;
++ case 255: SkOpts::memset32(dst, BE_CONVERT(color), count); return;
+ }
+- return SkOpts::blit_row_color32(dst, count, color);
++ return SkOpts::blit_row_color32(dst, count, BE_CONVERT(color));
+ }
+--- firefox-128.0/gfx/skia/skia/src/core/SkBlitter_ARGB32.cpp
++++ firefox-128.0/gfx/skia/skia/src/core/SkBlitter_ARGB32.cpp
+@@ -1487,7 +1487,7 @@ }
+ unsigned aa = antialias[0];
+ if (aa) {
+ if ((opaqueMask & aa) == 255) {
+- SkOpts::memset32(device, color, count);
++ SkOpts::memset32(device, BE_CONVERT(color), count);
+ } else {
+ uint32_t sc = SkAlphaMulQ(color, SkAlpha255To256(aa));
+ SkBlitRow::Color32(device, count, sc);
+@@ -1503,17 +1503,17 @@ void SkARGB32_Blitter::blitAntiH2(int x,
+ uint32_t* device = fDevice.writable_addr32(x, y);
+ SkDEBUGCODE((void)fDevice.writable_addr32(x + 1, y);)
+
+- device[0] = SkBlendARGB32(fPMColor, device[0], a0);
+- device[1] = SkBlendARGB32(fPMColor, device[1], a1);
++ device[0] = BE_CONVERT(SkBlendARGB32(fPMColor, BE_CONVERT(device[0]), a0));
++ device[1] = BE_CONVERT(SkBlendARGB32(fPMColor, BE_CONVERT(device[1]), a1));
+ }
+
+ void SkARGB32_Blitter::blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) {
+ uint32_t* device = fDevice.writable_addr32(x, y);
+ SkDEBUGCODE((void)fDevice.writable_addr32(x, y + 1);)
+
+- device[0] = SkBlendARGB32(fPMColor, device[0], a0);
++ device[0] = BE_CONVERT(SkBlendARGB32(fPMColor, BE_CONVERT(device[0]), a0));
+ device = (uint32_t*)((char*)device + fDevice.rowBytes());
+- device[0] = SkBlendARGB32(fPMColor, device[0], a1);
++ device[0] = BE_CONVERT(SkBlendARGB32(fPMColor, BE_CONVERT(device[0]), a1));
+ }
+
+ //////////////////////////////////////////////////////////////////////////////////////
+@@ -1604,17 +1604,17 @@ void SkARGB32_Opaque_Blitter::blitAntiH2
+ uint32_t* device = fDevice.writable_addr32(x, y);
+ SkDEBUGCODE((void)fDevice.writable_addr32(x + 1, y);)
+
+- device[0] = SkFastFourByteInterp(fPMColor, device[0], a0);
+- device[1] = SkFastFourByteInterp(fPMColor, device[1], a1);
++ device[0] = BE_CONVERT(SkFastFourByteInterp(fPMColor, BE_CONVERT(device[0]), a0));
++ device[1] = BE_CONVERT(SkFastFourByteInterp(fPMColor, BE_CONVERT(device[1]), a1));
+ }
+
+ void SkARGB32_Opaque_Blitter::blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) {
+ uint32_t* device = fDevice.writable_addr32(x, y);
+ SkDEBUGCODE((void)fDevice.writable_addr32(x, y + 1);)
+
+- device[0] = SkFastFourByteInterp(fPMColor, device[0], a0);
++ device[0] = BE_CONVERT(SkFastFourByteInterp(fPMColor, BE_CONVERT(device[0]), a0));
+ device = (uint32_t*)((char*)device + fDevice.rowBytes());
+- device[0] = SkFastFourByteInterp(fPMColor, device[0], a1);
++ device[0] = BE_CONVERT(SkFastFourByteInterp(fPMColor, BE_CONVERT(device[0]), a1));
+ }
+
+ ///////////////////////////////////////////////////////////////////////////////
+@@ -1634,7 +1634,7 @@ }
+ unsigned dst_scale = SkAlpha255To256(255 - SkGetPackedA32(color));
+ size_t rowBytes = fDevice.rowBytes();
+ while (--height >= 0) {
+- device[0] = color + SkAlphaMulQ(device[0], dst_scale);
++ device[0] = BE_CONVERT(color + SkAlphaMulQ(BE_CONVERT(device[0]), dst_scale));
+ device = (uint32_t*)((char*)device + rowBytes);
+ }
+ }
+@@ -1651,7 +1651,7 @@ uint32_t color = fPMColor;
+ size_t rowBytes = fDevice.rowBytes();
+
+ if (SkGetPackedA32(fPMColor) == 0xFF) {
+- SkOpts::rect_memset32(device, color, width, rowBytes, height);
++ SkOpts::rect_memset32(device, BE_CONVERT(color), width, rowBytes, height);
+ } else {
+ while (height --> 0) {
+ SkBlitRow::Color32(device, width, color);
+@@ -1680,7 +1680,7 @@ }
+ unsigned aa = antialias[0];
+ if (aa) {
+ if (aa == 255) {
+- SkOpts::memset32(device, black, count);
++ SkOpts::memset32(device, BE_CONVERT(black), count);
+ } else {
+ SkPMColor src = aa << SK_A32_SHIFT;
+ unsigned dst_scale = 256 - aa;
diff --git a/user/firefox-esr/skia-unified.patch b/user/firefox-esr/skia-unified.patch
index 77bc56299..cf74c1dcd 100644
--- a/user/firefox-esr/skia-unified.patch
+++ b/user/firefox-esr/skia-unified.patch
@@ -1,69 +1,786 @@
-https://bugzilla.mozilla.org/show_bug.cgi?id=1344659
+This patch is not complete.
---- firefox-102.1.0/gfx/2d/Types.h
-+++ firefox-102.1.0/gfx/2d/Types.h
-@@ -91,15 +91,8 @@ UNKNOWN,
- // The following values are endian-independent synonyms. The _UINT32 suffix
- // indicates that the name reflects the layout when viewed as a uint32_t
- // value.
--#if MOZ_LITTLE_ENDIAN()
- A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB
- X8R8G8B8_UINT32 = B8G8R8X8, // 0x00RRGGBB
--#elif MOZ_BIG_ENDIAN()
-- A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB
-- X8R8G8B8_UINT32 = X8R8G8B8, // 0x00RRGGBB
--#else
--# error "bad endianness"
--#endif
+It attempts to completely remove endian-specific surface formats from the
+entire tree, then replace it with a single swizzle in Skia.
- // The following values are OS and endian-independent synonyms.
- //
+Most things are working, including most Web sites and graphics. However,
+notably, native widgets (like menus, or 'Remember password?' popups) cause
+an assertion failure.
+We need to ship beta6 and this gets people a browser with many unfortunate
+caveats, which is better than no browser at all.
-https://bugzilla.mozilla.org/show_bug.cgi?id=1325259
+I intend to remain working with upstream on finding a way forward with the
+overall idea of this patch and hope to land something eventually.
---- firefox-102.1.0/gfx/2d/DrawTargetSkia.cpp
-+++ firefox-102.1.0/gfx/2d/DrawTargetSkia.cpp
-@@ -154,8 +154,12 @@ }
- return surfaceBounds.Intersect(bounds);
+diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp
+--- a/dom/canvas/CanvasRenderingContext2D.cpp
++++ b/dom/canvas/CanvasRenderingContext2D.cpp
+@@ -383,7 +383,7 @@ class AdjustedTargetForFilter {
+ }
+
+ if (!mFinalTarget->CanCreateSimilarDrawTarget(mSourceGraphicRect.Size(),
+- SurfaceFormat::B8G8R8A8)) {
++ SurfaceFormat::OS_RGBA)) {
+ mTarget = mFinalTarget;
+ mCtx = nullptr;
+ mFinalTarget = nullptr;
+@@ -391,7 +391,7 @@ class AdjustedTargetForFilter {
+ }
+
+ mTarget = mFinalTarget->CreateSimilarDrawTarget(mSourceGraphicRect.Size(),
+- SurfaceFormat::B8G8R8A8);
++ SurfaceFormat::OS_RGBA);
+
+ if (mTarget) {
+ // See bug 1524554.
+@@ -419,7 +419,7 @@ class AdjustedTargetForFilter {
+ }
+
+ RefPtr<DrawTarget> dt = mFinalTarget->CreateSimilarDrawTarget(
+- aRect.Size(), SurfaceFormat::B8G8R8A8);
++ aRect.Size(), SurfaceFormat::OS_RGBA);
+
+ if (dt) {
+ // See bug 1524554.
+@@ -516,7 +516,7 @@ class AdjustedTargetForShadow {
+ bounds.RoundOut();
+ if (!bounds.ToIntRect(&mTempRect) ||
+ !mFinalTarget->CanCreateSimilarDrawTarget(mTempRect.Size(),
+- SurfaceFormat::B8G8R8A8)) {
++ SurfaceFormat::OS_RGBA)) {
+ mTarget = mFinalTarget;
+ mCtx = nullptr;
+ mFinalTarget = nullptr;
+@@ -524,7 +524,7 @@ class AdjustedTargetForShadow {
+ }
+
+ mTarget = mFinalTarget->CreateShadowDrawTarget(
+- mTempRect.Size(), SurfaceFormat::B8G8R8A8, mSigma);
++ mTempRect.Size(), SurfaceFormat::OS_RGBA, mSigma);
+
+ if (mTarget) {
+ // See bug 1524554.
+@@ -2117,7 +2117,7 @@ CanvasRenderingContext2D::GetOptimizedSn
+ }
+
+ SurfaceFormat CanvasRenderingContext2D::GetSurfaceFormat() const {
+- return mOpaque ? SurfaceFormat::B8G8R8X8 : SurfaceFormat::B8G8R8A8;
++ return mOpaque ? SurfaceFormat::OS_RGBX : SurfaceFormat::OS_RGBA;
}
-+#if __sparc
-+static const int kARGBAlphaOffset = 0;
-+#else
- static const int kARGBAlphaOffset =
- SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0;
+ //
+@@ -5295,7 +5295,7 @@ static already_AddRefed<SourceSurface> E
+ }
+
+ RefPtr<DrawTarget> subrectDT = aTargetDT->CreateSimilarDrawTarget(
+- roundedOutSourceRectInt.Size(), SurfaceFormat::B8G8R8A8);
++ roundedOutSourceRectInt.Size(), SurfaceFormat::OS_RGBA);
+
+ if (subrectDT) {
+ // See bug 1524554.
+@@ -6061,7 +6061,7 @@ void CanvasRenderingContext2D::DrawWindo
+ }
+ }
+ drawDT = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
+- dtSize, SurfaceFormat::B8G8R8A8);
++ dtSize, SurfaceFormat::OS_RGBA);
+ if (!drawDT || !drawDT->IsValid()) {
+ aError.Throw(NS_ERROR_FAILURE);
+ return;
+@@ -6315,7 +6315,7 @@ void CanvasRenderingContext2D::EnsureErr
+
+ RefPtr<DrawTarget> errorTarget =
+ gfxPlatform::GetPlatform()->CreateOffscreenCanvasDrawTarget(
+- IntSize(1, 1), SurfaceFormat::B8G8R8A8);
++ IntSize(1, 1), SurfaceFormat::OS_RGBA);
+ MOZ_ASSERT(errorTarget, "Failed to allocate the error target!");
+
+ sErrorTarget.set(errorTarget.forget().take());
+@@ -6437,7 +6437,7 @@ void CanvasRenderingContext2D::PutImageD
+ dstData = lockedBits + dirtyRect.y * dstStride + dirtyRect.x * 4;
+ } else {
+ sourceSurface = Factory::CreateDataSourceSurface(
+- dirtyRect.Size(), SurfaceFormat::B8G8R8A8, false);
++ dirtyRect.Size(), SurfaceFormat::OS_RGBA, false);
+
+ // In certain scenarios, requesting larger than 8k image fails. Bug
+ // 803568 covers the details of how to run into it, but the full
+diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp
+--- a/dom/canvas/ImageBitmap.cpp
++++ b/dom/canvas/ImageBitmap.cpp
+@@ -227,7 +227,7 @@ static already_AddRefed<DataSourceSurfac
+ // this rectangle are outside the area where the input bitmap was placed, then
+ // they will be transparent black in output."
+ // So, instead, we force the output format to be SurfaceFormat::B8G8R8A8.
+- const SurfaceFormat format = SurfaceFormat::B8G8R8A8;
++ const SurfaceFormat format = SurfaceFormat::OS_RGBA;
+ const int bytesPerPixel = BytesPerPixel(format);
+ const IntSize dstSize =
+ IntSize(positiveCropRect.width, positiveCropRect.height);
+@@ -500,6 +500,11 @@ static already_AddRefed<layers::Image> C
+
+ // Convert RGBA to BGRA
+ RefPtr<DataSourceSurface> rgbaDataSurface = rgbaSurface->GetDataSurface();
++
++ if (SurfaceFormat::OS_RGBA == SurfaceFormat::R8G8B8A8) {
++ return CreateImageFromSurface(rgbaDataSurface);
++ }
++
+ DataSourceSurface::ScopedMap rgbaMap(rgbaDataSurface,
+ DataSourceSurface::READ);
+ if (NS_WARN_IF(!rgbaMap.IsMapped())) {
+@@ -724,7 +729,7 @@ SurfaceFromElementResult ImageBitmap::Su
+ bool requiresCrop = !allowUncropped && hasCropRect;
+ if (wantExactSize || requiresPremult || requiresCrop || mSurface) {
+ RefPtr<DrawTarget> dt = Factory::CreateDrawTarget(
+- BackendType::SKIA, IntSize(1, 1), SurfaceFormat::B8G8R8A8);
++ BackendType::SKIA, IntSize(1, 1), SurfaceFormat::OS_RGBA);
+ sfer.mSourceSurface = PrepareForDrawTarget(dt);
+
+ if (!sfer.mSourceSurface) {
+@@ -831,7 +836,7 @@ already_AddRefed<SourceSurface> ImageBit
+ // black, even if the surface is opaque, so force to an alpha format in
+ // that case.
+ if (!surfPortion.IsEqualEdges(mPictureRect) && isOpaque) {
+- format = SurfaceFormat::B8G8R8A8;
++ format = SurfaceFormat::OS_RGBA;
+ }
+
+ // If we need to pre-multiply the alpha, then we need to be able to
+diff --git a/dom/canvas/OffscreenCanvasDisplayHelper.cpp b/dom/canvas/OffscreenCanvasDisplayHelper.cpp
+--- a/dom/canvas/OffscreenCanvasDisplayHelper.cpp
++++ b/dom/canvas/OffscreenCanvasDisplayHelper.cpp
+@@ -181,7 +181,7 @@ bool OffscreenCanvasDisplayHelper::Commi
+
+ MutexAutoLock lock(mMutex);
+
+- gfx::SurfaceFormat format = gfx::SurfaceFormat::B8G8R8A8;
++ gfx::SurfaceFormat format = gfx::SurfaceFormat::OS_RGBA;
+ layers::TextureFlags flags = layers::TextureFlags::IMMUTABLE;
+
+ if (!mCanvasElement) {
+@@ -207,7 +207,7 @@ bool OffscreenCanvasDisplayHelper::Commi
+
+ if (mData.mIsOpaque) {
+ flags |= layers::TextureFlags::IS_OPAQUE;
+- format = gfx::SurfaceFormat::B8G8R8X8;
++ format = gfx::SurfaceFormat::OS_RGBX;
+ } else if (!mData.mIsAlphaPremult) {
+ flags |= layers::TextureFlags::NON_PREMULTIPLIED;
+ }
+diff --git a/gfx/2d/HelpersSkia.h b/gfx/2d/HelpersSkia.h
+--- a/gfx/2d/HelpersSkia.h
++++ b/gfx/2d/HelpersSkia.h
+@@ -26,6 +26,9 @@ namespace gfx {
+ static inline SkColorType GfxFormatToSkiaColorType(SurfaceFormat format) {
+ switch (format) {
+ case SurfaceFormat::B8G8R8A8:
++#if MOZ_BIG_ENDIAN()
++ //MOZ_DIAGNOSTIC_ASSERT(false, "wrong way unsupported by Skia");
++#endif
+ return kBGRA_8888_SkColorType;
+ case SurfaceFormat::B8G8R8X8:
+ // We probably need to do something here.
+@@ -37,7 +40,9 @@ static inline SkColorType GfxFormatToSki
+ case SurfaceFormat::R8G8B8A8:
+ return kRGBA_8888_SkColorType;
+ case SurfaceFormat::A8R8G8B8:
++#if MOZ_LITTLE_ENDIAN()
+ MOZ_DIAGNOSTIC_ASSERT(false, "A8R8G8B8 unsupported by Skia");
+#endif
+ return kRGBA_8888_SkColorType;
+ default:
+ MOZ_DIAGNOSTIC_ASSERT(false, "Unknown surface format");
+@@ -49,20 +54,20 @@ static inline SurfaceFormat SkiaColorTyp
+ SkColorType aColorType, SkAlphaType aAlphaType = kPremul_SkAlphaType) {
+ switch (aColorType) {
+ case kBGRA_8888_SkColorType:
+- return aAlphaType == kOpaque_SkAlphaType ? SurfaceFormat::B8G8R8X8
+- : SurfaceFormat::B8G8R8A8;
++ return aAlphaType == kOpaque_SkAlphaType ? SurfaceFormat::OS_RGBX
++ : SurfaceFormat::OS_RGBA;
+ case kRGB_565_SkColorType:
+ return SurfaceFormat::R5G6B5_UINT16;
+ case kAlpha_8_SkColorType:
+ return SurfaceFormat::A8;
+ default:
+- return SurfaceFormat::B8G8R8A8;
++ return SurfaceFormat::OS_RGBA;
+ }
+ }
- static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize,
- const int32_t aStride, SurfaceFormat aFormat) {
-# HG changeset patch
-# Parent 46ea866ca3acb8bb5e1709ceb799b9c94f591dec
-Problem description: Tab-titles that are too long to fit into a tab get faded out.
- On big endian this is broken and instead of fading out, the
- tab gets white and the font transparent, leading to an unreadable
- tab-title
-Solution: This is not a real solution, but a hack. The real solution would have been
- to byte-swap the correct buffer, but I could not find it.
- So the next best thing is to deactivate the fading-effect. Now all tab-titles
- are readable, albeit not as pretty to look at as they could be.
-Side-effects: I have not yet found an unwanted side-effect.
-
-diff -r 46ea866ca3ac -r 6ef20eee3f8f gfx/2d/DrawTargetSkia.cpp
---- a/gfx/2d/DrawTargetSkia.cpp Tue Oct 22 12:27:22 2019 +0200
-+++ b/gfx/2d/DrawTargetSkia.cpp Thu Oct 31 09:11:56 2019 +0100
-@@ -1861,6 +1861,14 @@
- SkCanvas::kPreserveLCDText_SaveLayerFlag |
- (aCopyBackground ? SkCanvas::kInitWithPrevious_SaveLayerFlag : 0));
-
-+#if MOZ_BIG_ENDIAN
-+ // Pushing a layer where an aMask is defined produces wrong output.
-+ // We _should_ endian swap the data, but I couldn't find a workable way to do so
-+ // Therefore I deactivate those layers in the meantime.
-+ // The result is: Tab-titles that are longer than the available space should be faded out.
-+ // The fading doesn't work, so we deactivate the fading-effect here.
-+ if (!aMask)
+ static inline SkAlphaType GfxFormatToSkiaAlphaType(SurfaceFormat format) {
+ switch (format) {
+- case SurfaceFormat::B8G8R8X8:
++ case SurfaceFormat::OS_RGBX:
+ case SurfaceFormat::R5G6B5_UINT16:
+ return kOpaque_SkAlphaType;
+ default:
+diff --git a/gfx/ipc/CrossProcessPaint.cpp b/gfx/ipc/CrossProcessPaint.cpp
+--- a/gfx/ipc/CrossProcessPaint.cpp
++++ b/gfx/ipc/CrossProcessPaint.cpp
+@@ -107,7 +107,7 @@ PaintFragment PaintFragment::Record(dom:
+ nsContentUtils::FlushLayoutForTree(ds->GetWindow());
+
+ // Initialize the recorder
+- SurfaceFormat format = SurfaceFormat::B8G8R8A8;
++ SurfaceFormat format = SurfaceFormat::OS_RGBA;
+ RefPtr<DrawTarget> referenceDt = Factory::CreateDrawTarget(
+ gfxPlatform::GetPlatform()->GetSoftwareBackend(), IntSize(1, 1), format);
+
+@@ -254,7 +254,7 @@ bool CrossProcessPaint::Start(dom::Windo
+ // Create the destination draw target
+ RefPtr<DrawTarget> drawTarget =
+ gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
+- root->mSize, SurfaceFormat::B8G8R8A8);
++ root->mSize, SurfaceFormat::OS_RGBA);
+ if (!drawTarget || !drawTarget->IsValid()) {
+ CPP_LOG("Couldn't create (%d x %d) surface for fragment %" PRIu64
+ ".\n",
+diff --git a/gfx/ipc/GfxMessageUtils.h b/gfx/ipc/GfxMessageUtils.h
+--- a/gfx/ipc/GfxMessageUtils.h
++++ b/gfx/ipc/GfxMessageUtils.h
+@@ -677,7 +677,7 @@ struct ParamTraits<GeckoProcessType>
+ template <>
+ struct ParamTraits<mozilla::gfx::SurfaceFormat>
+ : public ContiguousEnumSerializer<mozilla::gfx::SurfaceFormat,
+- mozilla::gfx::SurfaceFormat::B8G8R8A8,
++ mozilla::gfx::SurfaceFormat::OS_RGBA,
+ mozilla::gfx::SurfaceFormat::UNKNOWN> {};
+
+ template <>
+diff --git a/gfx/layers/Compositor.cpp b/gfx/layers/Compositor.cpp
+--- a/gfx/layers/Compositor.cpp
++++ b/gfx/layers/Compositor.cpp
+@@ -36,7 +36,7 @@ class CompositorRecordedFrame final : pu
+ gfx::IntSize size = mBuffer->GetSize();
+
+ mSurface = gfx::Factory::CreateDataSourceSurface(
+- size, gfx::SurfaceFormat::B8G8R8A8,
++ size, gfx::SurfaceFormat::OS_RGBA,
+ /* aZero = */ false);
+
+ if (!mBuffer->MapAndCopyInto(mSurface, size)) {
+diff --git a/gfx/layers/ImageDataSerializer.cpp b/gfx/layers/ImageDataSerializer.cpp
+--- a/gfx/layers/ImageDataSerializer.cpp
++++ b/gfx/layers/ImageDataSerializer.cpp
+@@ -288,16 +288,16 @@ already_AddRefed<DataSourceSurface> Data
+ RefPtr<DataSourceSurface> result;
+ if (aSurface) {
+ MOZ_ASSERT(aSurface->GetSize() == size);
+- MOZ_ASSERT(aSurface->GetFormat() == gfx::SurfaceFormat::B8G8R8X8);
++ MOZ_ASSERT(aSurface->GetFormat() == gfx::SurfaceFormat::OS_RGBX);
+ if (aSurface->GetSize() == size &&
+- aSurface->GetFormat() == gfx::SurfaceFormat::B8G8R8X8) {
++ aSurface->GetFormat() == gfx::SurfaceFormat::OS_RGBX) {
+ result = aSurface;
+ }
+ }
+
+ if (!result) {
+ result =
+- Factory::CreateDataSourceSurface(size, gfx::SurfaceFormat::B8G8R8X8);
++ Factory::CreateDataSourceSurface(size, gfx::SurfaceFormat::OS_RGBX);
+ }
+ if (NS_WARN_IF(!result)) {
+ return nullptr;
+@@ -320,7 +320,7 @@ already_AddRefed<DataSourceSurface> Data
+ ycbcrData.mChromaSubsampling = aDescriptor.chromaSubsampling();
+
+- gfx::ConvertYCbCrToRGB(ycbcrData, gfx::SurfaceFormat::B8G8R8X8, size,
++ gfx::ConvertYCbCrToRGB(ycbcrData, gfx::SurfaceFormat::OS_RGBX, size,
+ map.mData, map.mStride);
+
+ result->Unmap();
+ return result.forget();
+diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp
+--- a/gfx/layers/composite/TextureHost.cpp
++++ b/gfx/layers/composite/TextureHost.cpp
+@@ -182,7 +182,7 @@ already_AddRefed<TextureHost> CreateDumm
+ aFlags &= ~TextureFlags::DEALLOCATE_CLIENT;
+ aFlags |= TextureFlags::DUMMY_TEXTURE;
+ UniquePtr<TextureData> textureData(BufferTextureData::Create(
+- gfx::IntSize(1, 1), gfx::SurfaceFormat::B8G8R8A8, gfx::BackendType::SKIA,
++ gfx::IntSize(1, 1), gfx::SurfaceFormat::OS_RGBA, gfx::BackendType::SKIA,
+ aBackend, aFlags, TextureAllocationFlags::ALLOC_DEFAULT, nullptr));
+ SurfaceDescriptor surfDesc;
+ textureData->Serialize(surfDesc);
+diff --git a/gfx/layers/ipc/SharedSurfacesChild.cpp b/gfx/layers/ipc/SharedSurfacesChild.cpp
+--- a/gfx/layers/ipc/SharedSurfacesChild.cpp
++++ b/gfx/layers/ipc/SharedSurfacesChild.cpp
+@@ -241,7 +241,7 @@ nsresult SharedSurfacesChild::ShareInter
+
+ SurfaceFormat format = aSurface->GetFormat();
+ MOZ_RELEASE_ASSERT(
+- format == SurfaceFormat::B8G8R8X8 || format == SurfaceFormat::B8G8R8A8,
++ format == SurfaceFormat::OS_RGBX || format == SurfaceFormat::OS_RGBA,
+ "bad format");
+
+ data->MarkShared(manager->GetNextExternalImageId());
+diff --git a/gfx/layers/wr/WebRenderLayerManager.cpp b/gfx/layers/wr/WebRenderLayerManager.cpp
+--- a/gfx/layers/wr/WebRenderLayerManager.cpp
++++ b/gfx/layers/wr/WebRenderLayerManager.cpp
+@@ -512,7 +512,7 @@ void WebRenderLayerManager::MakeSnapshot
+ #ifdef MOZ_WIDGET_ANDROID
+ SurfaceFormat::R8G8B8A8;
+ #else
+- SurfaceFormat::B8G8R8A8;
++ SurfaceFormat::OS_RGBA;
+ #endif
+ RefPtr<TextureClient> texture = TextureClient::CreateForRawBufferAccess(
+ WrBridge(), format, aSize.ToUnknownSize(), BackendType::SKIA,
+diff --git a/gfx/layers/wr/WebRenderTextureHost.cpp b/gfx/layers/wr/WebRenderTextureHost.cpp
+--- a/gfx/layers/wr/WebRenderTextureHost.cpp
++++ b/gfx/layers/wr/WebRenderTextureHost.cpp
+@@ -159,7 +159,7 @@ int32_t WebRenderTextureHost::GetRGBStri
+ // XXX this stride is used until yuv image rendering by webrender is used.
+ // Software converted RGB buffers strides are aliened to 16
+ return gfx::GetAlignedStride<16>(
+- GetSize().width, BytesPerPixel(gfx::SurfaceFormat::B8G8R8A8));
++ GetSize().width, BytesPerPixel(gfx::SurfaceFormat::OS_RGBA));
+ }
+ return ImageDataSerializer::ComputeRGBStride(format, GetSize().width);
+ }
+diff --git a/gfx/thebes/gfx2DGlue.h b/gfx/thebes/gfx2DGlue.h
+--- a/gfx/thebes/gfx2DGlue.h
++++ b/gfx/thebes/gfx2DGlue.h
+@@ -68,9 +68,9 @@ inline gfxRect ThebesRect(const RectDoub
+
+ inline gfxImageFormat SurfaceFormatToImageFormat(SurfaceFormat aFormat) {
+ switch (aFormat) {
+- case SurfaceFormat::B8G8R8A8:
++ case SurfaceFormat::OS_RGBA:
+ return SurfaceFormat::A8R8G8B8_UINT32;
+- case SurfaceFormat::B8G8R8X8:
++ case SurfaceFormat::OS_RGBX:
+ return SurfaceFormat::X8R8G8B8_UINT32;
+ case SurfaceFormat::R5G6B5_UINT16:
+ return SurfaceFormat::R5G6B5_UINT16;
+@@ -84,16 +84,16 @@ inline gfxImageFormat SurfaceFormatToIma
+ inline SurfaceFormat ImageFormatToSurfaceFormat(gfxImageFormat aFormat) {
+ switch (aFormat) {
+ case SurfaceFormat::A8R8G8B8_UINT32:
+- return SurfaceFormat::B8G8R8A8;
++ return SurfaceFormat::OS_RGBA;
+ case SurfaceFormat::X8R8G8B8_UINT32:
+- return SurfaceFormat::B8G8R8X8;
++ return SurfaceFormat::OS_RGBX;
+ case SurfaceFormat::R5G6B5_UINT16:
+ return SurfaceFormat::R5G6B5_UINT16;
+ case SurfaceFormat::A8:
+ return SurfaceFormat::A8;
+ default:
+ case SurfaceFormat::UNKNOWN:
+- return SurfaceFormat::B8G8R8A8;
++ return SurfaceFormat::OS_RGBA;
+ }
+ }
+
+@@ -102,9 +102,11 @@ inline gfxContentType ContentForFormat(c
+ case SurfaceFormat::R5G6B5_UINT16:
+ case SurfaceFormat::B8G8R8X8:
+ case SurfaceFormat::R8G8B8X8:
++ case SurfaceFormat::OS_RGBX:
+ return gfxContentType::COLOR;
+ case SurfaceFormat::A8:
+ return gfxContentType::ALPHA;
++ case SurfaceFormat::OS_RGBA:
+ case SurfaceFormat::B8G8R8A8:
+ case SurfaceFormat::R8G8B8A8:
+ default:
+diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
+--- a/gfx/thebes/gfxPlatform.cpp
++++ b/gfx/thebes/gfxPlatform.cpp
+@@ -987,7 +987,7 @@ void gfxPlatform::Init() {
+
+ gPlatform->mScreenReferenceDrawTarget =
+ gPlatform->CreateOffscreenContentDrawTarget(IntSize(1, 1),
+- SurfaceFormat::B8G8R8A8);
++ SurfaceFormat::OS_RGBA);
+ if (!gPlatform->mScreenReferenceDrawTarget ||
+ !gPlatform->mScreenReferenceDrawTarget->IsValid()) {
+ // If TDR is detected, create a draw target with software backend
+diff --git a/gfx/thebes/gfxPlatformWorker.cpp b/gfx/thebes/gfxPlatformWorker.cpp
+--- a/gfx/thebes/gfxPlatformWorker.cpp
++++ b/gfx/thebes/gfxPlatformWorker.cpp
+@@ -64,7 +64,7 @@ RefPtr<mozilla::gfx::DrawTarget>
+ gfxPlatformWorker::ScreenReferenceDrawTarget() {
+ if (!mScreenReferenceDrawTarget) {
+ mScreenReferenceDrawTarget = Factory::CreateDrawTarget(
+- BackendType::SKIA, IntSize(1, 1), SurfaceFormat::B8G8R8A8);
++ BackendType::SKIA, IntSize(1, 1), SurfaceFormat::OS_RGBA);
+ }
+ return mScreenReferenceDrawTarget;
+ }
+diff --git a/gfx/thebes/gfxUtils.cpp b/gfx/thebes/gfxUtils.cpp
+--- a/gfx/thebes/gfxUtils.cpp
++++ b/gfx/thebes/gfxUtils.cpp
+@@ -1082,10 +1082,10 @@ nsresult gfxUtils::EncodeSourceSurfaceAs
+ }
+
+ RefPtr<DataSourceSurface> dataSurface;
+- if (aSurface->GetFormat() != SurfaceFormat::B8G8R8A8) {
++ if (aSurface->GetFormat() != SurfaceFormat::OS_RGBA) {
+ // FIXME bug 995807 (B8G8R8X8), bug 831898 (R5G6B5)
+ dataSurface = gfxUtils::CopySurfaceToDataSourceSurfaceWithFormat(
+- aSurface, SurfaceFormat::B8G8R8A8);
++ aSurface, SurfaceFormat::OS_RGBA);
+ } else {
+ dataSurface = aSurface->GetDataSurface();
+ }
+diff --git a/gfx/webrender_bindings/RenderCompositorSWGL.cpp b/gfx/webrender_bindings/RenderCompositorSWGL.cpp
+--- a/gfx/webrender_bindings/RenderCompositorSWGL.cpp
++++ b/gfx/webrender_bindings/RenderCompositorSWGL.cpp
+@@ -7,6 +7,7 @@
+ #include "RenderCompositorSWGL.h"
+
+ #include "mozilla/gfx/Logging.h"
++#include "mozilla/gfx/Swizzle.h"
+ #include "mozilla/widget/CompositorWidget.h"
+
+ #ifdef MOZ_WIDGET_GTK
+@@ -92,8 +93,8 @@ bool RenderCompositorSWGL::AllocateMappe
+ gfx::SurfaceFormat format = gfx::SurfaceFormat::UNKNOWN;
+ if (bufferMode != layers::BufferMode::BUFFERED && !mSurface &&
+ mDT->LockBits(&data, &size, &stride, &format) &&
+- (format != gfx::SurfaceFormat::B8G8R8A8 &&
+- format != gfx::SurfaceFormat::B8G8R8X8)) {
++ (format != gfx::SurfaceFormat::OS_RGBA &&
++ format != gfx::SurfaceFormat::OS_RGBX)) {
+ // We tried to lock the DT and it succeeded, but the size or format
+ // of the data is not compatible, so just release it and fall back below...
+ mDT->ReleaseBits(data);
+@@ -127,7 +128,7 @@ bool RenderCompositorSWGL::AllocateMappe
+ size = bounds.Size().ToUnknownSize();
+ if (!mSurface || mSurface->GetSize() != size) {
+ mSurface = gfx::Factory::CreateDataSourceSurface(
+- size, gfx::SurfaceFormat::B8G8R8A8);
++ size, gfx::SurfaceFormat::OS_RGBA);
+ }
+ gfx::DataSourceSurface::MappedSurface map = {nullptr, 0};
+ if (!mSurface || !mSurface->Map(gfx::DataSourceSurface::READ_WRITE, &map)) {
+@@ -242,6 +243,12 @@ void RenderCompositorSWGL::CommitMappedB
+ }
+ mDT->Flush();
+
++#if MOZ_BIG_ENDIAN()
++ gfx::SwizzleData(mMappedData, mMappedStride, gfx::SurfaceFormat::B8G8R8A8,
++ mMappedData, mMappedStride, gfx::SurfaceFormat::A8R8G8B8,
++ mDT->GetSize());
+#endif
- mCanvas->saveLayer(saveRec);
++
+ // Done with the DT. Hand it back to the widget and clear out any trace of it.
+ mWidget->EndRemoteDrawingInRegion(mDT, mDirtyRegion);
+ mDirtyRegion.SetEmpty();
+diff --git a/gfx/webrender_bindings/RenderTextureHostSWGL.cpp b/gfx/webrender_bindings/RenderTextureHostSWGL.cpp
+--- a/gfx/webrender_bindings/RenderTextureHostSWGL.cpp
++++ b/gfx/webrender_bindings/RenderTextureHostSWGL.cpp
+@@ -36,8 +36,8 @@ bool RenderTextureHostSWGL::UpdatePlanes
+ }
+ GLenum internalFormat = 0;
+ switch (format) {
+- case gfx::SurfaceFormat::B8G8R8A8:
+- case gfx::SurfaceFormat::B8G8R8X8:
++ case gfx::SurfaceFormat::OS_RGBA:
++ case gfx::SurfaceFormat::OS_RGBX:
+ MOZ_ASSERT(colorDepth == gfx::ColorDepth::COLOR_8);
+ internalFormat = LOCAL_GL_RGBA8;
+ break;
+diff --git a/gfx/webrender_bindings/WebRenderTypes.h b/gfx/webrender_bindings/WebRenderTypes.h
+--- a/gfx/webrender_bindings/WebRenderTypes.h
++++ b/gfx/webrender_bindings/WebRenderTypes.h
+@@ -105,7 +105,7 @@ inline Maybe<wr::ImageFormat> SurfaceFor
+ inline gfx::SurfaceFormat ImageFormatToSurfaceFormat(ImageFormat aFormat) {
+ switch (aFormat) {
+ case ImageFormat::BGRA8:
+- return gfx::SurfaceFormat::B8G8R8A8;
++ return gfx::SurfaceFormat::OS_RGBA;
+ case ImageFormat::R8:
+ return gfx::SurfaceFormat::A8;
+ case ImageFormat::R16:
+diff --git a/image/imgTools.cpp b/image/imgTools.cpp
+--- a/image/imgTools.cpp
++++ b/image/imgTools.cpp
+@@ -425,8 +425,8 @@ static nsresult EncodeImageData(DataSour
+ const nsACString& aMimeType,
+ const nsAString& aOutputOptions,
+ nsIInputStream** aStream) {
+- MOZ_ASSERT(aDataSurface->GetFormat() == SurfaceFormat::B8G8R8A8 ||
+- aDataSurface->GetFormat() == SurfaceFormat::B8G8R8X8,
++ MOZ_ASSERT(aDataSurface->GetFormat() == SurfaceFormat::OS_RGBA ||
++ aDataSurface->GetFormat() == SurfaceFormat::OS_RGBX,
+ "We're assuming B8G8R8A8/X8");
+
+ // Get an image encoder for the media type
+@@ -474,13 +474,13 @@ imgTools::EncodeImage(imgIContainer* aCo
+
+ RefPtr<DataSourceSurface> dataSurface;
+
+- if (frame->GetFormat() == SurfaceFormat::B8G8R8A8 ||
+- frame->GetFormat() == SurfaceFormat::B8G8R8X8) {
++ if (frame->GetFormat() == SurfaceFormat::OS_RGBA ||
++ frame->GetFormat() == SurfaceFormat::OS_RGBX) {
+ dataSurface = frame->GetDataSurface();
+ } else {
+ // Convert format to SurfaceFormat::B8G8R8A8
+ dataSurface = gfxUtils::CopySurfaceToDataSourceSurfaceWithFormat(
+- frame, SurfaceFormat::B8G8R8A8);
++ frame, SurfaceFormat::OS_RGBA);
+ }
+
+ NS_ENSURE_TRUE(dataSurface, NS_ERROR_FAILURE);
+@@ -522,8 +522,8 @@ imgTools::EncodeScaledImage(imgIContaine
+
+ // If the given surface is the right size/format, we can encode it directly.
+ if (scaledSize == frame->GetSize() &&
+- (frame->GetFormat() == SurfaceFormat::B8G8R8A8 ||
+- frame->GetFormat() == SurfaceFormat::B8G8R8X8)) {
++ (frame->GetFormat() == SurfaceFormat::OS_RGBA ||
++ frame->GetFormat() == SurfaceFormat::OS_RGBX)) {
+ RefPtr<DataSourceSurface> dataSurface = frame->GetDataSurface();
+ if (dataSurface) {
+ return EncodeImageData(dataSurface, aMimeType, aOutputOptions, aStream);
+@@ -533,7 +533,7 @@ imgTools::EncodeScaledImage(imgIContaine
+ // Otherwise we need to scale it using a draw target.
+ // Ensure the surface is initialized to clear in case we need to blend to it.
+ RefPtr<DataSourceSurface> dataSurface = Factory::CreateDataSourceSurface(
+- scaledSize, SurfaceFormat::B8G8R8A8, true);
++ scaledSize, SurfaceFormat::OS_RGBA, true);
+ if (NS_WARN_IF(!dataSurface)) {
+ return NS_ERROR_FAILURE;
+ }
+@@ -545,7 +545,7 @@ imgTools::EncodeScaledImage(imgIContaine
+
+ RefPtr<DrawTarget> dt = Factory::CreateDrawTargetForData(
+ BackendType::SKIA, map.GetData(), dataSurface->GetSize(), map.GetStride(),
+- SurfaceFormat::B8G8R8A8);
++ SurfaceFormat::OS_RGBA);
+ if (!dt) {
+ gfxWarning() << "imgTools::EncodeImage failed in CreateDrawTargetForData";
+ return NS_ERROR_OUT_OF_MEMORY;
+@@ -603,7 +603,7 @@ imgTools::EncodeCroppedImage(imgIContain
+ frameHeight >= aOffsetY + aHeight);
+
+ RefPtr<DataSourceSurface> dataSurface = Factory::CreateDataSourceSurface(
+- IntSize(aWidth, aHeight), SurfaceFormat::B8G8R8A8,
++ IntSize(aWidth, aHeight), SurfaceFormat::OS_RGBA,
+ /* aZero = */ true);
+ if (NS_WARN_IF(!dataSurface)) {
+ return NS_ERROR_FAILURE;
+@@ -616,7 +616,7 @@ imgTools::EncodeCroppedImage(imgIContain
+
+ RefPtr<DrawTarget> dt = Factory::CreateDrawTargetForData(
+ BackendType::SKIA, map.GetData(), dataSurface->GetSize(), map.GetStride(),
+- SurfaceFormat::B8G8R8A8);
++ SurfaceFormat::OS_RGBA);
+ if (!dt) {
+ gfxWarning()
+ << "imgTools::EncodeCroppedImage failed in CreateDrawTargetForData";
+diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp
+--- a/layout/base/PresShell.cpp
++++ b/layout/base/PresShell.cpp
+@@ -5124,7 +5124,7 @@ already_AddRefed<SourceSurface> PresShel
+
+ RefPtr<DrawTarget> dt =
+ gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
+- IntSize(pixelArea.width, pixelArea.height), SurfaceFormat::B8G8R8A8);
++ IntSize(pixelArea.width, pixelArea.height), SurfaceFormat::OS_RGBA);
+ if (!dt || !dt->IsValid()) {
+ return nullptr;
+ }
+diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp
+--- a/layout/base/nsLayoutUtils.cpp
++++ b/layout/base/nsLayoutUtils.cpp
+@@ -7022,9 +7022,9 @@ SurfaceFromElementResult nsLayoutUtils::
+ result.mAlphaType = gfxAlphaType::Opaque;
+ RefPtr<DrawTarget> ref =
+ aTarget ? aTarget : gfxPlatform::ThreadLocalScreenReferenceDrawTarget();
+- if (ref->CanCreateSimilarDrawTarget(size, SurfaceFormat::B8G8R8A8)) {
++ if (ref->CanCreateSimilarDrawTarget(size, SurfaceFormat::OS_RGBA)) {
+ RefPtr<DrawTarget> dt =
+- ref->CreateSimilarDrawTarget(size, SurfaceFormat::B8G8R8A8);
++ ref->CreateSimilarDrawTarget(size, SurfaceFormat::OS_RGBA);
+ if (dt) {
+ result.mSourceSurface = dt->Snapshot();
+ }
+@@ -7102,12 +7102,12 @@ SurfaceFromElementResult nsLayoutUtils::
+ : gfxPlatform::GetPlatform()
+ ->ThreadLocalScreenReferenceDrawTarget();
+ if (!ref->CanCreateSimilarDrawTarget(displaySize,
+- SurfaceFormat::B8G8R8A8)) {
++ SurfaceFormat::OS_RGBA)) {
+ return result;
+ }
+
+ RefPtr<DrawTarget> dt =
+- ref->CreateSimilarDrawTarget(displaySize, SurfaceFormat::B8G8R8A8);
++ ref->CreateSimilarDrawTarget(displaySize, SurfaceFormat::OS_RGBA);
+ if (!dt) {
+ return result;
+ }
+@@ -7380,9 +7380,9 @@ SurfaceFromElementResult nsLayoutUtils::
+ RefPtr<DrawTarget> ref =
+ aTarget ? aTarget
+ : gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget();
+- if (ref->CanCreateSimilarDrawTarget(size, SurfaceFormat::B8G8R8A8)) {
++ if (ref->CanCreateSimilarDrawTarget(size, SurfaceFormat::OS_RGBA)) {
+ RefPtr<DrawTarget> dt =
+- ref->CreateSimilarDrawTarget(size, SurfaceFormat::B8G8R8A8);
++ ref->CreateSimilarDrawTarget(size, SurfaceFormat::OS_RGBA);
+ if (dt) {
+ result.mSourceSurface = dt->Snapshot();
+ }
+diff --git a/layout/painting/nsCSSRenderingGradients.cpp b/layout/painting/nsCSSRenderingGradients.cpp
+--- a/layout/painting/nsCSSRenderingGradients.cpp
++++ b/layout/painting/nsCSSRenderingGradients.cpp
+@@ -1160,7 +1160,7 @@ bool nsCSSGradientRenderer::TryPaintTile
+ {
+ RefPtr<gfx::DrawTarget> tileTarget =
+ aContext.GetDrawTarget()->CreateSimilarDrawTarget(
+- tileSize, gfx::SurfaceFormat::B8G8R8A8);
++ tileSize, gfx::SurfaceFormat::OS_RGBA);
+ if (!tileTarget || !tileTarget->IsValid()) {
+ return false;
+ }
+diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp
+--- a/layout/painting/nsDisplayList.cpp
++++ b/layout/painting/nsDisplayList.cpp
+@@ -5043,7 +5043,7 @@ void nsDisplayBlendMode::Paint(nsDisplay
+ // we're going to draw to. This will include the same transform as
+ // is currently on |dt|.
+ RefPtr<DrawTarget> temp =
+- dt->CreateClippedDrawTarget(rect, SurfaceFormat::B8G8R8A8);
++ dt->CreateClippedDrawTarget(rect, SurfaceFormat::OS_RGBA);
+ if (!temp) {
+ return;
+ }
+@@ -6870,7 +6870,7 @@ void nsDisplayTransform::Paint(nsDisplay
+ RefPtr<DrawTarget> untransformedDT =
+ gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
+ IntSize(pixelBounds.Width(), pixelBounds.Height()),
+- SurfaceFormat::B8G8R8A8, true);
++ SurfaceFormat::OS_RGBA, true);
+ if (!untransformedDT || !untransformedDT->IsValid()) {
+ return;
+ }
+diff --git a/layout/painting/nsImageRenderer.cpp b/layout/painting/nsImageRenderer.cpp
+--- a/layout/painting/nsImageRenderer.cpp
++++ b/layout/painting/nsImageRenderer.cpp
+@@ -469,7 +469,7 @@ ImgDrawResult nsImageRenderer::Draw(nsPr
+ return ImgDrawResult::SUCCESS;
+ }
+ RefPtr<DrawTarget> tempDT = ctx->GetDrawTarget()->CreateSimilarDrawTarget(
+- tmpDTRect.Size(), SurfaceFormat::B8G8R8A8);
++ tmpDTRect.Size(), SurfaceFormat::OS_RGBA);
+ if (!tempDT || !tempDT->IsValid()) {
+ gfxDevCrash(LogReason::InvalidContext)
+ << "ImageRenderer::Draw problem " << gfx::hexa(tempDT);
+diff --git a/layout/svg/FilterInstance.cpp b/layout/svg/FilterInstance.cpp
+--- a/layout/svg/FilterInstance.cpp
++++ b/layout/svg/FilterInstance.cpp
+@@ -666,7 +666,7 @@ void FilterInstance::BuildSourcePaint(So
+
+ RefPtr<DrawTarget> offscreenDT =
+ gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
+- neededRect.Size(), SurfaceFormat::B8G8R8A8);
++ neededRect.Size(), SurfaceFormat::OS_RGBA);
+ if (!offscreenDT || !offscreenDT->IsValid()) {
+ return;
+ }
+@@ -714,7 +714,7 @@ void FilterInstance::BuildSourceImage(Dr
+ }
+
+ RefPtr<DrawTarget> offscreenDT;
+- SurfaceFormat format = SurfaceFormat::B8G8R8A8;
++ SurfaceFormat format = SurfaceFormat::OS_RGBA;
+ if (aDest->CanCreateSimilarDrawTarget(neededRect.Size(), format)) {
+ offscreenDT = aDest->CreateSimilarDrawTargetForFilter(
+ neededRect.Size(), format, aFilter, aSource, aSourceRect, Point(0, 0));
+diff --git a/layout/svg/SVGMaskFrame.cpp b/layout/svg/SVGMaskFrame.cpp
+--- a/layout/svg/SVGMaskFrame.cpp
++++ b/layout/svg/SVGMaskFrame.cpp
+@@ -68,7 +68,7 @@ already_AddRefed<SourceSurface> SVGMaskF
+ RefPtr<DrawTarget> maskDT;
+ if (maskType == StyleMaskType::Luminance) {
+ maskDT = aParams.dt->CreateClippedDrawTarget(maskSurfaceRect,
+- SurfaceFormat::B8G8R8A8);
++ SurfaceFormat::OS_RGBA);
+ } else {
+ maskDT =
+ aParams.dt->CreateClippedDrawTarget(maskSurfaceRect, SurfaceFormat::A8);
+diff --git a/layout/svg/SVGPatternFrame.cpp b/layout/svg/SVGPatternFrame.cpp
+--- a/layout/svg/SVGPatternFrame.cpp
++++ b/layout/svg/SVGPatternFrame.cpp
+@@ -370,7 +370,7 @@ already_AddRefed<SourceSurface> SVGPatte
+ }
+
+ RefPtr<DrawTarget> dt = aDrawTarget->CreateSimilarDrawTargetWithBacking(
+- surfaceSize, SurfaceFormat::B8G8R8A8);
++ surfaceSize, SurfaceFormat::OS_RGBA);
+ if (!dt || !dt->IsValid()) {
+ return nullptr;
+ }
+diff --git a/layout/svg/SVGUtils.cpp b/layout/svg/SVGUtils.cpp
+--- a/layout/svg/SVGUtils.cpp
++++ b/layout/svg/SVGUtils.cpp
+@@ -488,7 +488,7 @@ class MixModeBlender {
+
+ RefPtr<DrawTarget> targetDT =
+ mSourceCtx->GetDrawTarget()->CreateSimilarDrawTarget(
+- drawRect.Size(), SurfaceFormat::B8G8R8A8);
++ drawRect.Size(), SurfaceFormat::OS_RGBA);
+ if (!targetDT || !targetDT->IsValid()) {
+ return nullptr;
+ }
+diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp
+--- a/widget/gtk/DMABufSurface.cpp
++++ b/widget/gtk/DMABufSurface.cpp
+@@ -948,8 +948,8 @@ bool DMABufSurfaceRGBA::HasAlpha() {
+ }
+
+ gfx::SurfaceFormat DMABufSurfaceRGBA::GetFormat() {
+- return HasAlpha() ? gfx::SurfaceFormat::B8G8R8A8
+- : gfx::SurfaceFormat::B8G8R8X8;
++ return HasAlpha() ? gfx::SurfaceFormat::OS_RGBA
++ : gfx::SurfaceFormat::OS_RGBX;
+ }
+
+ // GL uses swapped R and B components so report accordingly.
+@@ -1662,7 +1662,7 @@ DMABufSurfaceYUV::GetAsSourceSurface() {
+ LOGDMABUF(("DMABufSurfaceYUV::GetAsSourceSurface UID %d", mUID));
+
+ gfx::IntSize size(GetWidth(), GetHeight());
+- const auto format = gfx::SurfaceFormat::B8G8R8A8;
++ const auto format = gfx::SurfaceFormat::OS_RGBA;
+ RefPtr<gfx::DataSourceSurface> source =
+ gfx::Factory::CreateDataSourceSurface(size, format);
+ if (NS_WARN_IF(!source)) {
+@@ -1692,7 +1692,7 @@ nsresult DMABufSurfaceYUV::BuildSurfaceD
+ LOGDMABUF(("DMABufSurfaceYUV::BuildSurfaceDescriptorBuffer UID %d", mUID));
+
+ gfx::IntSize size(GetWidth(), GetHeight());
+- const auto format = gfx::SurfaceFormat::B8G8R8A8;
++ const auto format = gfx::SurfaceFormat::OS_RGBA;
- SetPermitSubpixelAA(aOpaque);
+ uint8_t* buffer = nullptr;
+ int32_t stride = 0;
+diff --git a/widget/gtk/WindowSurfaceX11.cpp b/widget/gtk/WindowSurfaceX11.cpp
+--- a/widget/gtk/WindowSurfaceX11.cpp
++++ b/widget/gtk/WindowSurfaceX11.cpp
+@@ -24,13 +24,13 @@ gfx::SurfaceFormat WindowSurfaceX11::Get
+ case 32:
+ if (aVisual->red_mask == 0xff0000 && aVisual->green_mask == 0xff00 &&
+ aVisual->blue_mask == 0xff) {
+- return gfx::SurfaceFormat::B8G8R8A8;
++ return gfx::SurfaceFormat::OS_RGBA;
+ }
+ break;
+ case 24:
+ if (aVisual->red_mask == 0xff0000 && aVisual->green_mask == 0xff00 &&
+ aVisual->blue_mask == 0xff) {
+- return gfx::SurfaceFormat::B8G8R8X8;
++ return gfx::SurfaceFormat::OS_RGBX;
+ }
+ break;
+ case 16:
diff --git a/user/firefox-esr/stackwalk-x86-ppc.patch b/user/firefox-esr/stackwalk-x86-ppc.patch
index eed7a0956..df9ebfd94 100644
--- a/user/firefox-esr/stackwalk-x86-ppc.patch
+++ b/user/firefox-esr/stackwalk-x86-ppc.patch
@@ -1,16 +1,16 @@
--- thunderbird-52.6.0/mozglue/misc/StackWalk.cpp
+++ thunderbird-52.6.0/mozglue/misc/StackWalk.cpp
-@@ -41,13 +41,7 @@ static CriticalAddress gCriticalAddress;
- #define MOZ_STACKWALK_SUPPORTS_MACOSX 0
+@@ -50,13 +50,6 @@ static CriticalAddress gCriticalAddress;
+ # define HAVE___LIBC_STACK_END 0
#endif
-#if (defined(linux) && \
- ((defined(__GNUC__) && (defined(__i386) || defined(PPC))) || \
-- defined(HAVE__UNWIND_BACKTRACE)))
+- defined(HAVE__UNWIND_BACKTRACE)) && \
+- (HAVE___LIBC_STACK_END || ANDROID))
-# define MOZ_STACKWALK_SUPPORTS_LINUX 1
-#else
# define MOZ_STACKWALK_SUPPORTS_LINUX 0
-#endif
-
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
- #define HAVE___LIBC_STACK_END 1
+
+ #if HAVE___LIBC_STACK_END
diff --git a/user/firefox-esr/triplet-vendor-support.patch b/user/firefox-esr/triplet-vendor-support.patch
deleted file mode 100644
index d0ca17e81..000000000
--- a/user/firefox-esr/triplet-vendor-support.patch
+++ /dev/null
@@ -1,316 +0,0 @@
-Squashed version of https://github.com/bytecodealliance/target-lexicon/pull/35
-
-diff -Naur firefox-91.13.0/third_party/rust/target-lexicon-0.9.0_orig/build.rs firefox-91.13.0/third_party/rust/target-lexicon-0.9.0/build.rs
---- firefox-91.13.0/third_party/rust/target-lexicon-0.9.0_orig/build.rs 2022-08-15 13:05:59.000000000 -0500
-+++ firefox-91.13.0/third_party/rust/target-lexicon-0.9.0/build.rs 2022-11-23 00:35:04.697192794 -0600
-@@ -32,6 +32,7 @@
- }
- }
-
-+use self::targets::Vendor;
- use self::triple::Triple;
-
- fn main() {
-@@ -52,6 +53,8 @@
- writeln!(out, "use crate::Aarch64Architecture::*;")?;
- writeln!(out, "#[allow(unused_imports)]")?;
- writeln!(out, "use crate::ArmArchitecture::*;")?;
-+ writeln!(out, "#[allow(unused_imports)]")?;
-+ writeln!(out, "use crate::CustomVendor;")?;
- writeln!(out)?;
- writeln!(out, "/// The `Triple` of the current host.")?;
- writeln!(out, "pub const HOST: Triple = Triple {{")?;
-@@ -60,7 +63,7 @@
- " architecture: Architecture::{:?},",
- triple.architecture
- )?;
-- writeln!(out, " vendor: Vendor::{:?},", triple.vendor)?;
-+ writeln!(out, " vendor: {},", vendor_display(&triple.vendor))?;
- writeln!(
- out,
- " operating_system: OperatingSystem::{:?},",
-@@ -90,7 +93,7 @@
- writeln!(out, "impl Vendor {{")?;
- writeln!(out, " /// Return the vendor for the current host.")?;
- writeln!(out, " pub const fn host() -> Self {{")?;
-- writeln!(out, " Vendor::{:?}", triple.vendor)?;
-+ writeln!(out, " {}", vendor_display(&triple.vendor))?;
- writeln!(out, " }}")?;
- writeln!(out, "}}")?;
- writeln!(out)?;
-@@ -138,7 +141,11 @@
- " architecture: Architecture::{:?},",
- triple.architecture
- )?;
-- writeln!(out, " vendor: Vendor::{:?},", triple.vendor)?;
-+ writeln!(
-+ out,
-+ " vendor: {},",
-+ vendor_display(&triple.vendor)
-+ )?;
- writeln!(
- out,
- " operating_system: OperatingSystem::{:?},",
-@@ -160,3 +167,13 @@
-
- Ok(())
- }
-+
-+fn vendor_display(vendor: &Vendor) -> String {
-+ match vendor {
-+ Vendor::Custom(custom) => format!(
-+ "Vendor::Custom(CustomVendor::Static({:?}))",
-+ custom.as_str()
-+ ),
-+ known => format!("Vendor::{:?}", known),
-+ }
-+}
-diff -Naur firefox-91.13.0/third_party/rust/target-lexicon-0.9.0_orig/src/lib.rs firefox-91.13.0/third_party/rust/target-lexicon-0.9.0/src/lib.rs
---- firefox-91.13.0/third_party/rust/target-lexicon-0.9.0_orig/src/lib.rs 2022-08-15 13:05:37.000000000 -0500
-+++ firefox-91.13.0/third_party/rust/target-lexicon-0.9.0/src/lib.rs 2022-11-23 00:35:04.697192794 -0600
-@@ -28,7 +28,7 @@
- pub use self::host::HOST;
- pub use self::parse_error::ParseError;
- pub use self::targets::{
-- Aarch64Architecture, Architecture, ArmArchitecture, BinaryFormat, Environment, OperatingSystem,
-- Vendor,
-+ Aarch64Architecture, Architecture, ArmArchitecture, BinaryFormat, CustomVendor, Environment,
-+ OperatingSystem, Vendor,
- };
- pub use self::triple::{CallingConvention, Endianness, PointerWidth, Triple};
-diff -Naur firefox-91.13.0/third_party/rust/target-lexicon-0.9.0_orig/src/targets.rs firefox-91.13.0/third_party/rust/target-lexicon-0.9.0/src/targets.rs
---- firefox-91.13.0/third_party/rust/target-lexicon-0.9.0_orig/src/targets.rs 2022-08-15 13:05:42.000000000 -0500
-+++ firefox-91.13.0/third_party/rust/target-lexicon-0.9.0/src/targets.rs 2022-11-23 00:35:04.697192794 -0600
-@@ -1,7 +1,10 @@
- // This file defines all the identifier enums and target-aware logic.
-
- use crate::triple::{Endianness, PointerWidth, Triple};
-+use alloc::boxed::Box;
-+use alloc::string::String;
- use core::fmt;
-+use core::hash::{Hash, Hasher};
- use core::str::FromStr;
-
- /// The "architecture" field, which in some cases also specifies a specific
-@@ -290,9 +293,42 @@
- }
- }
-
-+/// A string for a `Vendor::Custom` that can either be used in `const`
-+/// contexts or hold dynamic strings.
-+#[derive(Clone, Debug, Eq)]
-+pub enum CustomVendor {
-+ /// An owned `String`. This supports the general case.
-+ Owned(Box<String>),
-+ /// A static `str`, so that `CustomVendor` can be constructed in `const`
-+ /// contexts.
-+ Static(&'static str),
-+}
-+
-+impl CustomVendor {
-+ /// Extracts a string slice.
-+ pub fn as_str(&self) -> &str {
-+ match self {
-+ CustomVendor::Owned(s) => s,
-+ CustomVendor::Static(s) => s,
-+ }
-+ }
-+}
-+
-+impl PartialEq for CustomVendor {
-+ fn eq(&self, other: &Self) -> bool {
-+ self.as_str() == other.as_str()
-+ }
-+}
-+
-+impl Hash for CustomVendor {
-+ fn hash<H: Hasher>(&self, state: &mut H) {
-+ self.as_str().hash(state)
-+ }
-+}
-+
- /// The "vendor" field, which in practice is little more than an arbitrary
- /// modifier.
--#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
-+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
- #[allow(missing_docs)]
- pub enum Vendor {
- Unknown,
-@@ -306,6 +342,15 @@
- Sun,
- Uwp,
- Wrs,
-+
-+ /// A custom vendor. "Custom" in this context means that the vendor is
-+ /// not specifically recognized by upstream Autotools, LLVM, Rust, or other
-+ /// relevant authorities on triple naming. It's useful for people building
-+ /// and using locally patched toolchains.
-+ ///
-+ /// Outside of such patched environments, users of `target-lexicon` should
-+ /// treat `Custom` the same as `Unknown` and ignore the string.
-+ Custom(CustomVendor),
- }
-
- /// The "operating system" field, which sometimes implies an environment, and
-@@ -717,6 +762,7 @@
- Vendor::Sun => "sun",
- Vendor::Uwp => "uwp",
- Vendor::Wrs => "wrs",
-+ Vendor::Custom(ref name) => name.as_str(),
- };
- f.write_str(s)
- }
-@@ -738,7 +784,43 @@
- "sun" => Vendor::Sun,
- "uwp" => Vendor::Uwp,
- "wrs" => Vendor::Wrs,
-- _ => return Err(()),
-+ custom => {
-+ use alloc::borrow::ToOwned;
-+
-+ // A custom vendor. Since triple syntax is so loosely defined,
-+ // be as conservative as we can to avoid potential ambiguities.
-+ // We err on the side of being too strict here, as we can
-+ // always relax it if needed.
-+
-+ // Don't allow empty string names.
-+ if custom.is_empty() {
-+ return Err(());
-+ }
-+
-+ // Don't allow any other recognized name as a custom vendor,
-+ // since vendors can be omitted in some contexts.
-+ if Architecture::from_str(custom).is_ok()
-+ || OperatingSystem::from_str(custom).is_ok()
-+ || Environment::from_str(custom).is_ok()
-+ || BinaryFormat::from_str(custom).is_ok()
-+ {
-+ return Err(());
-+ }
-+
-+ // Require the first character to be an ascii lowercase.
-+ if !custom.chars().nth(0).unwrap().is_ascii_lowercase() {
-+ return Err(());
-+ }
-+
-+ // Restrict the set of characters permitted in a custom vendor.
-+ if custom.chars().any(|c: char| {
-+ !(c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_' || c == '.')
-+ }) {
-+ return Err(());
-+ }
-+
-+ Vendor::Custom(CustomVendor::Owned(Box::new(custom.to_owned())))
-+ }
- })
- }
- }
-@@ -1120,4 +1202,87 @@
- assert_eq!(t.environment, Environment::Eabihf);
- assert_eq!(t.binary_format, BinaryFormat::Elf);
- }
-+
-+ #[test]
-+ fn custom_vendors() {
-+ // Test various invalid cases.
-+ assert!(Triple::from_str("x86_64--linux").is_err());
-+ assert!(Triple::from_str("x86_64-42-linux").is_err());
-+ assert!(Triple::from_str("x86_64-__customvendor__-linux").is_err());
-+ assert!(Triple::from_str("x86_64-^-linux").is_err());
-+ assert!(Triple::from_str("x86_64- -linux").is_err());
-+ assert!(Triple::from_str("x86_64-CustomVendor-linux").is_err());
-+ assert!(Triple::from_str("x86_64-linux-linux").is_err());
-+ assert!(Triple::from_str("x86_64-x86_64-linux").is_err());
-+ assert!(Triple::from_str("x86_64-elf-linux").is_err());
-+ assert!(Triple::from_str("x86_64-gnu-linux").is_err());
-+ assert!(Triple::from_str("x86_64-linux-customvendor").is_err());
-+ assert!(Triple::from_str("customvendor").is_err());
-+ assert!(Triple::from_str("customvendor-x86_64").is_err());
-+ assert!(Triple::from_str("x86_64-").is_err());
-+ assert!(Triple::from_str("x86_64--").is_err());
-+
-+ // Test various Unicode things.
-+ assert!(
-+ Triple::from_str("x86_64-𝓬𝓾𝓼𝓽𝓸𝓶𝓿𝓮𝓷𝓭𝓸𝓻-linux").is_err(),
-+ "unicode font hazard"
-+ );
-+ assert!(
-+ Triple::from_str("x86_64-ćúśtőḿvéńdőŕ-linux").is_err(),
-+ "diacritical mark stripping hazard"
-+ );
-+ assert!(
-+ Triple::from_str("x86_64-customvendοr-linux").is_err(),
-+ "homoglyph hazard"
-+ );
-+ assert!(Triple::from_str("x86_64-customvendor-linux").is_ok());
-+ assert!(
-+ Triple::from_str("x86_64-ffi-linux").is_err(),
-+ "normalization hazard"
-+ );
-+ assert!(Triple::from_str("x86_64-ffi-linux").is_ok());
-+ assert!(
-+ Triple::from_str("x86_64-custom‍vendor-linux").is_err(),
-+ "zero-width character hazard"
-+ );
-+ assert!(
-+ Triple::from_str("x86_64-customvendor-linux").is_err(),
-+ "BOM hazard"
-+ );
-+
-+ // Test some valid cases.
-+ let t = Triple::from_str("x86_64-customvendor-linux")
-+ .expect("can't parse target with custom vendor");
-+ assert_eq!(t.architecture, Architecture::X86_64);
-+ assert_eq!(
-+ t.vendor,
-+ Vendor::Custom(CustomVendor::Static("customvendor"))
-+ );
-+ assert_eq!(t.operating_system, OperatingSystem::Linux);
-+ assert_eq!(t.environment, Environment::Unknown);
-+ assert_eq!(t.binary_format, BinaryFormat::Elf);
-+ assert_eq!(t.to_string(), "x86_64-customvendor-linux");
-+
-+ let t =
-+ Triple::from_str("x86_64-customvendor").expect("can't parse target with custom vendor");
-+ assert_eq!(t.architecture, Architecture::X86_64);
-+ assert_eq!(
-+ t.vendor,
-+ Vendor::Custom(CustomVendor::Static("customvendor"))
-+ );
-+ assert_eq!(t.operating_system, OperatingSystem::Unknown);
-+ assert_eq!(t.environment, Environment::Unknown);
-+ assert_eq!(t.binary_format, BinaryFormat::Unknown);
-+
-+ assert_eq!(
-+ Triple::from_str("unknown-foo"),
-+ Ok(Triple {
-+ architecture: Architecture::Unknown,
-+ vendor: Vendor::Custom(CustomVendor::Static("foo")),
-+ operating_system: OperatingSystem::Unknown,
-+ environment: Environment::Unknown,
-+ binary_format: BinaryFormat::Unknown,
-+ })
-+ );
-+ }
- }
-diff -Naur firefox-91.13.0/third_party/rust/target-lexicon-0.9.0_orig/src/triple.rs firefox-91.13.0/third_party/rust/target-lexicon-0.9.0/src/triple.rs
---- firefox-91.13.0/third_party/rust/target-lexicon-0.9.0_orig/src/triple.rs 2022-08-15 13:05:59.000000000 -0500
-+++ firefox-91.13.0/third_party/rust/target-lexicon-0.9.0/src/triple.rs 2022-11-23 00:35:04.697192794 -0600
-@@ -323,10 +323,6 @@
- Err(ParseError::UnrecognizedArchitecture("foo".to_owned()))
- );
- assert_eq!(
-- Triple::from_str("unknown-foo"),
-- Err(ParseError::UnrecognizedVendor("foo".to_owned()))
-- );
-- assert_eq!(
- Triple::from_str("unknown-unknown-foo"),
- Err(ParseError::UnrecognizedOperatingSystem("foo".to_owned()))
- );
-diff -Naur firefox-91.13.0/third_party/rust/target-lexicon-0.9.0_orig/.cargo-checksum.json firefox-91.13.0/third_party/rust/target-lexicon-0.9.0/.cargo-checksum.json
---- firefox-91.13.0/third_party/rust/target-lexicon-0.9.0_orig/.cargo-checksum.json 2022-08-15 13:05:38.000000000 -0500
-+++ firefox-91.13.0/third_party/rust/target-lexicon-0.9.0/.cargo-checksum.json 2022-11-23 01:16:14.304912521 -0600
-@@ -1 +1 @@
--{"files":{"Cargo.lock":"a1a162e6ce8fc2234a6ddf7090410006a1920ace8738772e32a5b50e4780c19d","Cargo.toml":"f3b545fa0f184fd0d3624e6e5c205fcbdf1ad0934a2e08406549ad53c2a62ac3","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"c3467056d91be3f59562158ee9604c729b5b5f473efbefb036032803eb76809e","build.rs":"723100e9cdc30cd8c48407233c2cffa10f5b10703a0a11bac1230d8b86e49ccf","examples/host.rs":"503bafddfb372123fe4dc0e7b8037808beb5bfe6df60c00d3315922bd3792c6c","examples/misc.rs":"49a579845450b7b020ed5c97dca142fc548725893cbc82f6f750ee0caab2beca","newlist":"89564342916321c5bc35e772d374a7f0af22cc9ae6dcc0027eca48d2269f18cb","src/host.rs":"fb543df4f362e9119a58523563e453110f4e3a426f0995911d0ca386657cf1d9","src/lib.rs":"4414353c30f25d44df6cc14f7f9eea9991222289c6aa662b74406f6923235970","src/parse_error.rs":"b3735eabc0fd0a9dfdd6375662f20ec96a79852a00a05a98fb2e421545285e53","src/targets.rs":"9ccc0849cff06d8906dacbdc15136cc47fab85ccd795033ddfdde1397dfcfe32","src/triple.rs":"949bd83b043b53b18f643ebc3fbebbfe02a13998b787fda432a5d36aa27d20bd","test.sh":"22e3c630a6c84e90d5c70c367a6712be8eeca1e7682c00d1f65bf53e330e9191"},"package":"6f4c118a7a38378f305a9e111fcb2f7f838c0be324bfb31a77ea04f7f6e684b4"}
-\ No newline at end of file
-+{"files":{"Cargo.lock":"a1a162e6ce8fc2234a6ddf7090410006a1920ace8738772e32a5b50e4780c19d","Cargo.toml":"f3b545fa0f184fd0d3624e6e5c205fcbdf1ad0934a2e08406549ad53c2a62ac3","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"c3467056d91be3f59562158ee9604c729b5b5f473efbefb036032803eb76809e","build.rs":"85d6a1b6392b56946f48c0ff1526736a37fe012951bf3855709da1d6cfb4baa0","examples/host.rs":"503bafddfb372123fe4dc0e7b8037808beb5bfe6df60c00d3315922bd3792c6c","examples/misc.rs":"49a579845450b7b020ed5c97dca142fc548725893cbc82f6f750ee0caab2beca","newlist":"89564342916321c5bc35e772d374a7f0af22cc9ae6dcc0027eca48d2269f18cb","src/host.rs":"fb543df4f362e9119a58523563e453110f4e3a426f0995911d0ca386657cf1d9","src/lib.rs":"89986c98b9a04e0f1e957e0127e23a53048a1f0d597493723c4bba031c2ca32d","src/parse_error.rs":"b3735eabc0fd0a9dfdd6375662f20ec96a79852a00a05a98fb2e421545285e53","src/targets.rs":"f2048f06e3e2151a8181d8c92651fa45e64b8bfdfd18ead4b6c18ee7c9fb9003","src/triple.rs":"4704266fec8763bc70d230aad3608bdb790b51e41149056daa2ce0d5fdaef5a3","test.sh":"22e3c630a6c84e90d5c70c367a6712be8eeca1e7682c00d1f65bf53e330e9191"},"package":"6f4c118a7a38378f305a9e111fcb2f7f838c0be324bfb31a77ea04f7f6e684b4"}
diff --git a/user/firefox-esr/webrender.patch b/user/firefox-esr/webrender.patch
index a2457e576..e6b145956 100644
--- a/user/firefox-esr/webrender.patch
+++ b/user/firefox-esr/webrender.patch
@@ -6,35 +6,9 @@
# Parent 20d81e68da033746bf81acbb08490f16679853da
Bug 1716707 [s390x] Software WebRender does not support big endian
-diff -r 20d81e68da03 -r 903e5f164c0e gfx/webrender_bindings/RenderCompositorSWGL.cpp
---- a/gfx/webrender_bindings/RenderCompositorSWGL.cpp Thu Mar 24 06:57:58 2022 +0000
-+++ b/gfx/webrender_bindings/RenderCompositorSWGL.cpp Thu Mar 24 02:36:16 2022 -0700
-@@ -7,6 +7,7 @@
- #include "RenderCompositorSWGL.h"
-
- #include "mozilla/gfx/Logging.h"
-+#include "mozilla/gfx/Swizzle.h"
- #include "mozilla/widget/CompositorWidget.h"
-
- #ifdef MOZ_WIDGET_GTK
-@@ -235,6 +237,13 @@
- }
- mDT->Flush();
-
-+#if MOZ_BIG_ENDIAN()
-+ // One swizzle to rule them all.
-+ gfx::SwizzleData(mMappedData, mMappedStride, gfx::SurfaceFormat::B8G8R8A8,
-+ mMappedData, mMappedStride, gfx::SurfaceFormat::A8R8G8B8,
-+ mDT->GetSize());
-+#endif
-+
- // Done with the DT. Hand it back to the widget and clear out any trace of it.
- mWidget->EndRemoteDrawingInRegion(mDT, mDirtyRegion);
- mDirtyRegion.SetEmpty();
-diff -r 20d81e68da03 -r 903e5f164c0e image/imgFrame.cpp
---- a/image/imgFrame.cpp Thu Mar 24 06:57:58 2022 +0000
-+++ b/image/imgFrame.cpp Thu Mar 24 02:36:16 2022 -0700
-@@ -372,6 +372,17 @@
+--- firefox-128.0/image/imgFrame.cpp
++++ firefox-128.0/image/imgFrame.cpp
+@@ -372,6 +372,17 @@ mAborted = true;
return NS_ERROR_OUT_OF_MEMORY;
}
diff --git a/user/firefox-esr/without-jit.patch b/user/firefox-esr/without-jit.patch
new file mode 100644
index 000000000..dff372ec0
--- /dev/null
+++ b/user/firefox-esr/without-jit.patch
@@ -0,0 +1,28 @@
+diff -r 81fc811c3c39 toolkit/components/translations/actors/TranslationsParent.sys.mjs
+--- a/toolkit/components/translations/actors/TranslationsParent.sys.mjs Thu Aug 08 21:26:29 2024 -0700
++++ b/toolkit/components/translations/actors/TranslationsParent.sys.mjs Sat Aug 10 16:45:13 2024 -0700
+@@ -618,16 +618,25 @@
+ * Detect if Wasm SIMD is supported, and cache the value. It's better to check
+ * for support before downloading large binary blobs to a user who can't even
+ * use the feature. This function also respects mocks and simulating unsupported
+ * engines.
+ *
+ * @type {boolean}
+ */
+ static getIsTranslationsEngineSupported() {
++ try {
++ // Ensure WebAssembly is supported and enabled (may not be on tier-3).
++ if (!WebAssembly) {
++ return false;
++ }
++ } catch(e) {
++ return false;
++ }
++
+ if (lazy.simulateUnsupportedEnginePref) {
+ // Use the non-lazy console.log so that the user is always informed as to why
+ // the translations engine is not working.
+ console.log(
+ "Translations: The translations engine is disabled through the pref " +
+ '"browser.translations.simulateUnsupportedEngine".'
+ );