summaryrefslogtreecommitdiff
path: root/user/firefox-esr
diff options
context:
space:
mode:
Diffstat (limited to 'user/firefox-esr')
-rw-r--r--user/firefox-esr/APKBUILD157
-rw-r--r--user/firefox-esr/bad-google-code.patch4
-rw-r--r--user/firefox-esr/disable-gecko-profiler.patch14
-rw-r--r--user/firefox-esr/fix-bug-1261392.patch25
-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/icu-75.patch41
-rw-r--r--user/firefox-esr/jpeg-link.patch25
-rw-r--r--user/firefox-esr/js-endian.patch33
-rw-r--r--user/firefox-esr/mozconfig6
-rw-r--r--user/firefox-esr/mozilla-build-arm.patch4
-rw-r--r--user/firefox-esr/pmmx-double-format.patch16
-rw-r--r--user/firefox-esr/ppc32-fix.patch43
-rw-r--r--user/firefox-esr/rust-32bit.patch30
-rw-r--r--user/firefox-esr/rust-config.patch20
-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.patch786
-rw-r--r--user/firefox-esr/stackwalk-x86-ppc.patch12
-rw-r--r--user/firefox-esr/webrender.patch28
-rw-r--r--user/firefox-esr/webrtc-broken.patch30
-rw-r--r--user/firefox-esr/without-jit.patch28
-rw-r--r--user/firefox-esr/yuv-be.patch48
23 files changed, 1227 insertions, 251 deletions
diff --git a/user/firefox-esr/APKBUILD b/user/firefox-esr/APKBUILD
index ebaf536bf..66803e8b4 100644
--- a/user/firefox-esr/APKBUILD
+++ b/user/firefox-esr/APKBUILD
@@ -1,11 +1,12 @@
# Contributor: Molly Miller <adelie@m-squa.red>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=firefox-esr
-pkgver=68.1.0
+pkgver=128.10.1
+_llvmver=18
pkgrel=0
pkgdesc="Firefox web browser (extended support release)"
url="https://www.mozilla.org/firefox/"
-arch="all"
+arch="all !ppc" # #837
options="!check" # Tests disabled
license="MPL-2.0"
depends=""
@@ -14,154 +15,119 @@ depends=""
# system-libs
# actual deps
makedepends="
- autoconf2.13 cargo cbindgen clang llvm8-dev node ncurses-dev
- perl rust rust-stdlib cmd:which
+ autoconf2.13 cargo cbindgen clang llvm${_llvmver}-dev node ncurses-dev
+ perl python3 rust rust-std cmd:which
ncurses-dev openssl-dev
alsa-lib-dev bzip2-dev icu-dev libevent-dev libffi-dev libpng-dev
- libjpeg-turbo-dev nspr-dev nss-dev pulseaudio-dev zlib-dev
+ libjpeg-turbo-dev nspr-dev nss-dev pcre-dev pulseaudio-dev zlib-dev
dbus-glib-dev fts-dev gconf-dev gtk+3.0-dev hunspell-dev
libnotify-dev libsm-dev libxcomposite-dev libxdamage-dev
libxrender-dev libxt-dev nasm nss-static sqlite-dev
startup-notification-dev unzip yasm zip gtk+2.0-dev
"
-_py2ver="2.7.16"
_ffxver="$pkgver"'esr'
source="https://ftp.mozilla.org/pub/firefox/releases/$_ffxver/source/firefox-$_ffxver.source.tar.xz
- https://www.python.org/ftp/python/$_py2ver/Python-$_py2ver.tar.xz
mozconfig
bad-google-code.patch
- disable-gecko-profiler.patch
fix-mutex-build.patch
fix-seccomp-bpf.patch
+ icu-75.patch
+ jpeg-link.patch
+ js-endian.patch
mozilla-build-arm.patch
- rust-config.patch
+ pmmx-double-format.patch
+ ppc32-fix.patch
+ rust-32bit.patch
shut-up-warning.patch
+ skia-endian.patch
+ skia-unified.patch
stackwalk-x86-ppc.patch
- webrtc-broken.patch
- yuv-be.patch
+ webrender.patch
+ without-jit.patch
firefox.desktop
firefox-safe.desktop
"
builddir="$srcdir/firefox-$pkgver"
_mozappdir=/usr/lib/firefox
+somask="libgkcodecs.so libipcclientcerts.so liblgpllibs.so libmozavcodec.so
+ libmozavutil.so libmozgtk.so libmozsandbox.so libmozsqlite3.so
+ libmozwayland.so libxul.so"
ldpath="$_mozappdir"
-# secfixes: firefox
+# secfixes: firefox-esr
# 68.0.2-r0:
# - CVE-2019-11733
-# 68.1.0-r0:
-# - CVE-2019-9812
-# - CVE-2019-11735
-# - CVE-2019-11736
-# - CVE-2019-11738
-# - CVE-2019-11740
-# - CVE-2019-11742
-# - CVE-2019-11743
-# - CVE-2019-11744
-# - CVE-2019-11746
-# - CVE-2019-11747
-# - CVE-2019-11748
-# - CVE-2019-11749
-# - CVE-2019-11750
-# - CVE-2019-11751
-# - CVE-2019-11752
-# - CVE-2019-11753
-
-
-unpack() {
- default_unpack
- [ -z $SKIP_PYTHON ] || return 0
-
- msg "Killing all remaining hope for humanity and building Python 2..."
- cd "$srcdir/Python-$_py2ver"
- [ -d ../python ] && rm -r ../python
-
- # 19:39 <+solar> just make the firefox build process build its own py2 copy
- # 20:03 <calvin> TheWilfox: there's always violence
-
- sed -e 's/é/e/g' /etc/os-release > "$srcdir"/os-release
- export UNIXCONFDIR="$srcdir"
-
- ./configure --prefix="$srcdir/python" --with-ensurepip=install
- make -j $JOBS
- # 6 tests failed:
- # test__locale test_os test_posix test_re test_strptime test_time
- # make test
- make -j $JOBS install
-
- # firefox's bundled pipenv and pip aren't new enough to support
- # configurable UNIXCONFDIR
- export PATH="$srcdir/python/bin:$PATH"
- pip2 install virtualenv pipenv
-}
prepare() {
- cd "$builddir"
default_prepare
cp "$srcdir"/mozconfig "$builddir"/mozconfig
- echo "ac_add_options --enable-optimize=\"$CFLAGS\"" >> "$builddir"/mozconfig
echo "ac_add_options --host=\"$CHOST\"" >> "$builddir"/mozconfig
echo "ac_add_options --target=\"$CTARGET\"" >> "$builddir"/mozconfig
- # too much memory
- if [ -z "$JOBS" ] || [ $JOBS -ge 16 ]; then
- JOBS=16
- fi
echo "mk_add_options MOZ_MAKE_FLAGS=\"-j$JOBS\"" >> "$builddir"/mozconfig
+ # arch-specific configuration
case "$CARCH" in
- pmmx|x86*)
+ pmmx|x86*|arm*|aarch64)
echo "ac_add_options --disable-elf-hack" >> "$builddir"/mozconfig
;;
+ ppc)
+ export LDFLAGS="$LDFLAGS -latomic"
+ ;;
+ s390x)
+ echo "ac_add_options --disable-startupcache" >> "$builddir"/mozconfig
+ ;;
esac
- rm "$builddir"/third_party/python/virtualenv/virtualenv_support/pip*.whl
- rm "$builddir"/third_party/python/virtualenv/virtualenv_support/setuptools*.whl
- cp "$srcdir/Python-$_py2ver"/Lib/ensurepip/_bundled/*.whl \
- "$builddir/third_party/python/virtualenv/virtualenv_support"
+ # 32-bit memory ceiling, #1012, #1057
+ case "${CARCH}" in
+ pmmx|x86|ppc|i528|m68k|mips32*|arm*)
+ echo "ac_add_options --disable-debug-symbols" >> "$builddir"/mozconfig
+ echo "ac_add_options --enable-strip" >> "$builddir"/mozconfig
+ CFLAGS="${CFLAGS} -g0";
+ ;;
+ esac
+
+ echo "ac_add_options --enable-optimize=\"$CFLAGS\"" >> "$builddir"/mozconfig
}
build() {
- cd "$builddir"
-
+ 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
- # gcc 6
- export CXXFLAGS="-fno-delete-null-pointer-checks -fno-schedule-insns2"
+ export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
# set rpath so linker finds the libs
export LDFLAGS="$LDFLAGS -Wl,-rpath,${_mozappdir}"
export UNIXCONFDIR="$srcdir"
- local extra_flags=""
- [ "$CARCH" = "s390x" ] && extra_flags="--disable-startupcache"
-
- export PATH="$srcdir/python/bin:$PATH"
./mach build
}
run() {
cd "$builddir"/obj-$CHOST/dist/bin
export LD_LIBRARY_PATH=.
- ./firefox -no-remote -profile "$builddir"/obj-$CHOST/tmp/profile-default
+ export PROFILE_DIR="$builddir"/obj-$CHOST/tmp/profile-default
+ [ -d $PROFILE_DIR ] || ./firefox -no-remote -CreateProfile "Test $PROFILE_DIR"
+ ./firefox -no-remote -profile "$PROFILE_DIR" about:buildconfig
}
package() {
- cd "$builddir"
- export PATH="$srcdir/python/bin:$PATH"
+ export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
DESTDIR="$pkgdir" ./mach install
install -m755 -d ${pkgdir}/usr/share/applications
install -m755 -d ${pkgdir}/usr/share/pixmaps
- local png
for png in browser/branding/official/default*.png; do
local i="${_png%.png}"
i=${i##*/default}
@@ -192,18 +158,23 @@ package() {
EOF
}
-sha512sums="a53b04b6a4fc98065596117b6bc0aee40c36f74bca02dc7486fda7e9556ad6f221f5ead94db1dc5db572f277556a21b22a0395dae107b67336ca91e33df9882c firefox-68.1.0esr.source.tar.xz
-16e814e8dcffc707b595ca2919bd2fa3db0d15794c63d977364652c4a5b92e90e72b8c9e1cc83b5020398bd90a1b397dbdd7cb931c49f1aa4af6ef95414b43e0 Python-2.7.16.tar.xz
-1b84e737ce9931872e0eba11d2dd1c9e66ee28f03a4d881ab8df2f7c41b6bcfc74d3dfc7dd03c0b000718ecd71492392538b8615a773e9aca62d52ceff756cbc mozconfig
-ace7492f4fb0523c7340fdc09c831906f74fddad93822aff367135538dacd3f56288b907f5a04f53f94c76e722ba0bab73e28d83ec12d3e672554712e6b08613 bad-google-code.patch
-9c14041f0295682b8dbeb6d5b58a2f9dc0a2dc8bef995a0f7e30fa0b17c51aa0f6748f80fb8584169db7687e2eeb404dff68a09158ae56a5f24eef30685dd2b3 disable-gecko-profiler.patch
-c0b2bf43206c2a5154e560ef30189a1062ae856861b39f52ce69002390ff9972d43e387bfd2bf8d2ab3cac621987bc042c8c0a8b4cf90ae05717ca7705271880 fix-mutex-build.patch
-70863b985427b9653ce5e28d6064f078fb6d4ccf43dd1b68e72f97f44868fc0ce063161c39a4e77a0a1a207b7365d5dc7a7ca5e68c726825eba814f2b93e2f5d fix-seccomp-bpf.patch
-e61664bc93eadce5016a06a4d0684b34a05074f1815e88ef2613380d7b369c6fd305fb34f83b5eb18b9e3138273ea8ddcfdcb1084fdcaa922a1e5b30146a3b18 mozilla-build-arm.patch
-45613d476e85fe333ef8091acce4806803953c1a99de4f03ff577cf20c5a1a3d635d0589e1490da104ef80721f4f1b1d35045af3c6892c1a468fa84095f27ad8 rust-config.patch
-39ddb15d1453a8412275c36fc8db3befc69dffd4a362e932d280fb7fd1190db595a2af9b468ee49e0714f5e9df6e48eb5794122a64fa9f30d689de8693acbb15 shut-up-warning.patch
-452b47b825294779f98ed46bc1065dad76b79ff453521ef049934a120f349c84a1c863b16af1828fe053059823da9690ec917c055ae02dcc5c80c54cad732448 stackwalk-x86-ppc.patch
-be68f1387aa6677875a67106e2d6a9db470c934c943056d3b53391a63034235108e41945c53957db427d9cdc59f0aa2f9e6f2f8cd862e090e512a3ab9cbcc9a8 webrtc-broken.patch
-2dfb986089c9afcd6a895302c8a5a1d299cffa4cc3c73fce784c29d348f362c1e7570109c4f09d328275d8549a96531736dd976411c15956b385d7fb211b8af2 yuv-be.patch
+sha512sums="6e7363d8cbecda1cedaf534ac10dc046b5f515399ec754492357e8a558c61ee3389f7bb90aa929dbcb4d6eba041ae1e778a0a8f90aa1e1f939eea517333b6c45 firefox-128.10.1esr.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
+e1c8a85c46a9cc804eb6b5946d35b63fa2cfc7ad8b4f250c5eaf1b590b139a66d9a833246bc26ae2e340fffb81b6761cf51c600181895bd49feb9a3b8fbfe331 rust-32bit.patch
+c2248297df00633771da7e6b9f2caba3dd5108d93617f652fa8b2fb4e6975821e5fee866c00713f8fce08e760fa456e2dd19a8ef7370e5a2c65dc09614526be9 shut-up-warning.patch
+11f7ce86376b54281082fa5b9d3fefee8046eabe38a0ec17266764b4f62cb90f4744245c1ca93d73ed74cf81c066dab7ddcb3fe9704be8f91e0a2a4f664b203a skia-endian.patch
+a6a14104ee6985867efb1937a262aba1538ed4b069bba56e400d75f51d84d29363d8bbb2183ee27785758ad3a8b8ae4350e23dc854d50c92cb2147eddf83b9bb skia-unified.patch
+9df89366bd51670f534591e4c169186703ad3166a493f522e58f129fb79af375d71baaf0f6b238126792118a2d3ed0f011b010e39497ab5901ee5bea63a84fa2 stackwalk-x86-ppc.patch
+7d6c5f3cafd29eae4e7c5433b14f49cc679eebdcb4e602af18819f685500747a6daa8d38fbb0f91878331b14ce299ca8b731f62ab013b69e579fc450b29fe743 webrender.patch
+ed78e15030d79b10026ebae26e44a68d16c2a8567082072b5099b0dde4f79ae217a21737e0d9c7ec6a3cc99de3ab3c9083cca7d82889d559bb18cc15fa7e6f2a without-jit.patch
f3b7c3e804ce04731012a46cb9e9a6b0769e3772aef9c0a4a8c7520b030fdf6cd703d5e9ff49275f14b7d738fe82a0a4fde3bc3219dff7225d5db0e274987454 firefox.desktop
5dcb6288d0444a8a471d669bbaf61cdb1433663eff38b72ee5e980843f5fc07d0d60c91627a2c1159215d0ad77ae3f115dcc5fdfe87e64ca704b641aceaa44ed firefox-safe.desktop"
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-gecko-profiler.patch b/user/firefox-esr/disable-gecko-profiler.patch
deleted file mode 100644
index 160ac6097..000000000
--- a/user/firefox-esr/disable-gecko-profiler.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -uwr firefox-67.0-old/toolkit/moz.configure firefox-67.0/toolkit/moz.configure
---- firefox-67.0-old/toolkit/moz.configure 2019-05-22 10:35:06.170036401 +0000
-+++ firefox-67.0/toolkit/moz.configure 2019-05-22 10:36:21.680036609 +0000
-@@ -70,10 +70,6 @@
- if value:
- return True
-
--set_config('MOZ_GECKO_PROFILER', gecko_profiler_define)
--set_define('MOZ_GECKO_PROFILER', gecko_profiler_define)
--
--
- # Whether code to parse ELF binaries should be compiled for the Gecko profiler
- # (for symbol table dumping).
- @depends(gecko_profiler, target)
diff --git a/user/firefox-esr/fix-bug-1261392.patch b/user/firefox-esr/fix-bug-1261392.patch
deleted file mode 100644
index fa40914d6..000000000
--- a/user/firefox-esr/fix-bug-1261392.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- a/tools/profiler/core/platform.h 2017-05-27 11:44:06.733119794 +0000
-+++ b/tools/profiler/core/platform.h 2017-05-27 11:46:16.004253520 +0000
-@@ -54,10 +54,11 @@
- #include <vector>
- #include "StackTop.h"
-
--// We need a definition of gettid(), but old glibc versions don't provide a
--// wrapper for it.
--#if defined(__GLIBC__)
-+// We need a definition of gettid(), but Linux libc implementations don't
-+// provide a wrapper for it (except for Bionic)
-+#if defined(__linux__)
- # include <unistd.h>
-+#if !defined(__BIONIC__)
- # include <sys/syscall.h>
- # define gettid() static_cast<pid_t>(syscall(SYS_gettid))
-+#endif
-@@ -71,6 +72,7 @@
- return (pid_t) syscall(SYS_thread_selfid);
- }
- #endif
-+#endif
-
- #ifdef XP_WIN
- #include <windows.h>
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/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
new file mode 100644
index 000000000..724bc76fb
--- /dev/null
+++ b/user/firefox-esr/jpeg-link.patch
@@ -0,0 +1,25 @@
+--- 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
+@@ -2274,14 +2274,14 @@
+ )
+
+ with only_when("--with-system-jpeg"):
+- check_symbol(
+- "jpeg_destroy_compress",
+- flags=jpeg_flags.ldflags,
+- onerror=lambda: die(
+- "--with-system-jpeg requested but symbol "
+- "jpeg_destroy_compress not found."
+- ),
+- )
++ #check_symbol(
++ # "jpeg_destroy_compress",
++ # flags=jpeg_flags.ldflags,
++ # onerror=lambda: die(
++ # "--with-system-jpeg requested but symbol "
++ # "jpeg_destroy_compress not found."
++ # ),
++ #)
+
+ c_compiler.try_compile(
+ includes=[
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 0ce38dcf6..b49d3be3f 100644
--- a/user/firefox-esr/mozconfig
+++ b/user/firefox-esr/mozconfig
@@ -7,20 +7,20 @@ ac_add_options --disable-profiling
ac_add_options --disable-strip
ac_add_options --disable-tests
ac_add_options --disable-updater
+ac_add_options --disable-webrtc
ac_add_options --enable-alsa
ac_add_options --enable-application=browser
ac_add_options --enable-dbus
ac_add_options --enable-default-toolkit=cairo-gtk3
ac_add_options --enable-official-branding
ac_add_options --enable-pulseaudio
-ac_add_options --enable-startup-notification
ac_add_options --enable-system-ffi
-ac_add_options --with-system-bz2
ac_add_options --with-system-icu
-#ac_add_options --with-system-jpeg
+ac_add_options --with-system-jpeg
ac_add_options --with-system-libevent
ac_add_options --with-system-nspr
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/pmmx-double-format.patch b/user/firefox-esr/pmmx-double-format.patch
new file mode 100644
index 000000000..e520987b3
--- /dev/null
+++ b/user/firefox-esr/pmmx-double-format.patch
@@ -0,0 +1,16 @@
+diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h
+index 51d79f9c2ec59..fafd7d6fc1e0d 100644
+--- a/modules/fdlibm/src/math_private.h
++++ b/modules/fdlibm/src/math_private.h
+@@ -30,7 +30,11 @@
+ * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
+ */
+
++#if defined __FLT_EVAL_METHOD__ && (__FLT_EVAL_METHOD__ == 2)
++typedef long double __double_t;
++#else
+ typedef double __double_t;
++#endif
+ typedef __double_t double_t;
+ typedef float __float_t;
+
diff --git a/user/firefox-esr/ppc32-fix.patch b/user/firefox-esr/ppc32-fix.patch
new file mode 100644
index 000000000..b4103c65f
--- /dev/null
+++ b/user/firefox-esr/ppc32-fix.patch
@@ -0,0 +1,43 @@
+--- firefox-68.1.0/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_linux.cpp
++++ firefox-68.1.0/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_linux.cpp
+@@ -45,11 +45,8 @@ invoke_copy_to_stack(uint32_t* d,
+ uint64_t tempu64;
+
+ for(uint32_t i = 0; i < paramCount; i++, s++) {
+- if(s->IsPtrData()) {
+- if(s->type == nsXPTType::T_JSVAL)
+- tempu32 = (uint32_t) &s->ptr;
+- else
+- tempu32 = (uint32_t) s->ptr;
++ if(s->IsIndirect()) {
++ tempu32 = (uint32_t) &s->val;
+ }
+ else {
+ switch(s->type) {
+@@ -70,7 +67,7 @@ invoke_copy_to_stack(uint32_t* d,
+ }
+ }
+
+- if (!s->IsPtrData() && s->type == nsXPTType::T_DOUBLE) {
++ if (!s->IsIndirect() && s->type == nsXPTType::T_DOUBLE) {
+ #ifndef __NO_FPRS__
+ if (fpr < FPR_COUNT)
+ fpregs[fpr++] = s->val.d;
+@@ -88,7 +85,7 @@ invoke_copy_to_stack(uint32_t* d,
+ d += 2;
+ }
+ }
+- else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) {
++ else if (!s->IsIndirect() && s->type == nsXPTType::T_FLOAT) {
+ #ifndef __NO_FPRS__
+ if (fpr < FPR_COUNT)
+ fpregs[fpr++] = s->val.f; // if passed in registers, floats are promoted to doubles
+@@ -99,7 +96,7 @@ invoke_copy_to_stack(uint32_t* d,
+ else
+ *((float*) d++) = s->val.f;
+ }
+- else if (!s->IsPtrData() && (s->type == nsXPTType::T_I64
++ else if (!s->IsIndirect() && (s->type == nsXPTType::T_I64
+ || s->type == nsXPTType::T_U64)) {
+ if (gpr & 1) gpr++; // longlongs are aligned in odd/even register pairs, eg. r5/r6
+ if ((gpr + 1) < GPR_COUNT) {
diff --git a/user/firefox-esr/rust-32bit.patch b/user/firefox-esr/rust-32bit.patch
new file mode 100644
index 000000000..4829e44bf
--- /dev/null
+++ b/user/firefox-esr/rust-32bit.patch
@@ -0,0 +1,30 @@
+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
+-# 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$(if $(filter full,$(MOZ_LTO_RUST_CROSS)),=fat)
+-endif
+-# We need -Cembed-bitcode=yes for all crates when using -Clto.
+-RUSTFLAGS += -Cembed-bitcode=yes
+-endif
+-endif
+-endif
+-endif
+-endif
+
+ ifdef CARGO_INCREMENTAL
+ export CARGO_INCREMENTAL
diff --git a/user/firefox-esr/rust-config.patch b/user/firefox-esr/rust-config.patch
deleted file mode 100644
index eab72a0e4..000000000
--- a/user/firefox-esr/rust-config.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -urw firefox-68.0-old/build/moz.configure/rust.configure firefox-68.0/build/moz.configure/rust.configure
---- firefox-68.0-old/build/moz.configure/rust.configure 2019-07-07 15:56:29.345963800 +0000
-+++ firefox-68.0/build/moz.configure/rust.configure 2019-07-07 16:19:25.990645334 +0000
-@@ -193,12 +193,16 @@
- ambiguous = set()
- per_raw_os = {}
- for t in out:
-+ if 'fuchsia' in t: continue
- t = split_triplet(t, allow_unknown=True)
- endianness = t.endianness
- if t.cpu.startswith('thumb') and endianness not in ('big', 'little'):
- endianness = 'little'
- key = (t.cpu, endianness, t.os)
- if key in per_os:
-+ # hax to allow Adélie toolchains to work
-+ if 'foxkit' in per_os[key].alias:
-+ continue
- previous = per_os[key]
- per_raw_os[(previous.cpu, previous.endianness,
- previous.raw_os)] = previous
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
new file mode 100644
index 000000000..cacfe3451
--- /dev/null
+++ b/user/firefox-esr/skia-unified.patch
@@ -0,0 +1,786 @@
+This patch is not complete.
+
+It attempts to completely remove endian-specific surface formats from the
+entire tree, then replace it with a single swizzle in Skia.
+
+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.
+
+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.
+
+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;
+ }
+
+ //
+@@ -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 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::X8R8G8B8:
+ return gfxContentType::COLOR;
+ case SurfaceFormat::A8:
+ return gfxContentType::ALPHA;
++ case SurfaceFormat::A8R8G8B8:
+ 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
++
+ // 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;
+
+ 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/webrender.patch b/user/firefox-esr/webrender.patch
new file mode 100644
index 000000000..cfc920cfd
--- /dev/null
+++ b/user/firefox-esr/webrender.patch
@@ -0,0 +1,28 @@
+# HG changeset patch
+# User Petr Sumbera <petr.sumbera@oracle.com>
+# Date 1648114576 25200
+# Thu Mar 24 02:36:16 2022 -0700
+# Node ID 903e5f164c0ed424492eec6f388c03cbbcf99913
+# Parent 20d81e68da033746bf81acbb08490f16679853da
+Bug 1716707 [s390x] Software WebRender does not support big endian
+
+--- firefox-128.0/image/imgFrame.cpp
++++ firefox-128.0/image/imgFrame.cpp
+@@ -382,6 +382,17 @@ mAborted = true;
+ return NS_ERROR_OUT_OF_MEMORY;
+ }
+
++#if MOZ_BIG_ENDIAN()
++ if (aBackend == gfx::BackendType::SKIA && canUseDataSurface) {
++ // SKIA is lying about what format it returns on big endian
++ for (int ii=0; ii < mRawSurface->GetSize().Height()*mRawSurface->Stride() / 4; ++ii) {
++ uint32_t *vals = (uint32_t*)(mRawSurface->GetData());
++ uint32_t val = ((vals[ii] << 8) & 0xFF00FF00 ) | ((vals[ii] >> 8) & 0xFF00FF );
++ vals[ii] = (val << 16) | (val >> 16);
++ }
++ }
++#endif
++
+ if (!canUseDataSurface) {
+ // We used an offscreen surface, which is an "optimized" surface from
+ // imgFrame's perspective.
diff --git a/user/firefox-esr/webrtc-broken.patch b/user/firefox-esr/webrtc-broken.patch
deleted file mode 100644
index 85b1b1209..000000000
--- a/user/firefox-esr/webrtc-broken.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -Naur firefox-60.0.orig/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features_linux.c firefox-60.0/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features_linux.c
---- firefox-60.0.orig/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features_linux.c 2018-05-13 17:33:55.266855917 -0700
-+++ firefox-60.0/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features_linux.c 2018-05-13 20:21:08.158464933 -0700
-@@ -11,7 +11,7 @@
- #ifndef __GLIBC_PREREQ
- #define __GLIBC_PREREQ(a, b) 0
- #endif
--#if __GLIBC_PREREQ(2, 16)
-+#if __linux__
- #include <sys/auxv.h>
- #else
- #include <fcntl.h>
-@@ -29,7 +29,7 @@
- int architecture = 0;
- unsigned long hwcap = 0;
- const char* platform = NULL;
--#if __GLIBC_PREREQ(2, 16)
-+#if __linux__
- hwcap = getauxval(AT_HWCAP);
- platform = (const char*)getauxval(AT_PLATFORM);
- #else
-@@ -53,7 +53,7 @@
- }
- close(fd);
- }
--#endif // __GLIBC_PREREQ(2,16)
-+#endif // __linux__
- #if defined(__aarch64__)
- architecture = 8;
- if ((hwcap & HWCAP_FP) != 0)
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".'
+ );
diff --git a/user/firefox-esr/yuv-be.patch b/user/firefox-esr/yuv-be.patch
deleted file mode 100644
index ccb0c2fd8..000000000
--- a/user/firefox-esr/yuv-be.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-# HG changeset patch
-# User A. Wilcox <AWilcox@Wilcox-Tech.com>
-# Date 1543674229 0
-# Sat Dec 01 14:23:49 2018 +0000
-# Node ID 0309ff19e46b126c527e633518d7de8570442114
-# Parent 53107afbc21ec78e7ac46d37af212505f2032d5d
-Bug 1511604 - Swizzle YCbCr->RGB data on big-endian machines
-
-diff -r 53107afbc21e -r 0309ff19e46b gfx/ycbcr/YCbCrUtils.cpp
---- a/gfx/ycbcr/YCbCrUtils.cpp Wed Nov 07 04:50:21 2018 +0000
-+++ b/gfx/ycbcr/YCbCrUtils.cpp Sat Dec 01 14:23:49 2018 +0000
-@@ -3,7 +3,9 @@
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-+#include "mozilla/EndianUtils.h"
- #include "gfx2DGlue.h"
-+#include "mozilla/gfx/Swizzle.h"
-
- #include "YCbCrUtils.h"
- #include "yuv_convert.h"
-@@ -236,6 +238,13 @@
- yuvtype,
- srcData.mYUVColorSpace);
- }
-+#if MOZ_BIG_ENDIAN
-+ // libyuv makes endian-correct result, which needs to be swapped to BGRX
-+ if (aDestFormat != SurfaceFormat::R5G6B5_UINT16)
-+ gfx::SwizzleData(aDestBuffer, aStride, gfx::SurfaceFormat::X8R8G8B8,
-+ aDestBuffer, aStride, gfx::SurfaceFormat::B8G8R8X8,
-+ srcData.mPicSize);
-+#endif
- }
-
- void
-@@ -257,6 +266,12 @@
- aSrcStrideYA,
- aSrcStrideUV,
- aDstStrideARGB);
-+#if MOZ_BIG_ENDIAN
-+ // libyuv makes endian-correct result, which needs to be swapped to BGRA
-+ gfx::SwizzleData(aDstARGB, aDstStrideARGB, gfx::SurfaceFormat::A8R8G8B8,
-+ aDstARGB, aDstStrideARGB, gfx::SurfaceFormat::B8G8R8A8,
-+ IntSize(aWidth, aHeight));
-+#endif
- }
-
- } // namespace gfx