mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
merge mozilla-inbound to mozilla-central a=merge
This commit is contained in:
commit
aa8d92d1f3
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-aries.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2", "dosfstools"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": [],
|
||||
"upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
|
@ -2,7 +2,10 @@
|
||||
"config_version": 2,
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2", "bc"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": ["kernelheader", ""],
|
||||
"upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-dolphin.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2", "bc"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": ["kernelheader", ""],
|
||||
"upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-emulator-ics.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": ["droid", "package-emulator", "package-tests"],
|
||||
"upload_files": [
|
||||
"{workdir}/out/target/product/generic/*.tar.bz2",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-emulator-jb.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": ["droid", "package-emulator", "package-tests"],
|
||||
"upload_files": [
|
||||
"{workdir}/out/target/product/generic/*.tar.bz2",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-emulator-kk.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": ["droid", "package-emulator", "package-tests"],
|
||||
"upload_files": [
|
||||
"{workdir}/out/target/product/generic/*.tar.bz2",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-emulator-l.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": ["droid", "package-emulator", "package-tests"],
|
||||
"upload_files": [
|
||||
"{workdir}/out/target/product/generic/*.tar.bz2",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-emulator-kk.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": ["droid", "package-emulator", "package-tests"],
|
||||
"upload_files": [
|
||||
"{workdir}/out/target/product/generic/*.tar.bz2",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-emulator-l.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": ["droid", "package-emulator", "package-tests"],
|
||||
"upload_files": [
|
||||
"{workdir}/out/target/product/generic/*.tar.bz2",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-emulator.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": ["droid", "package-emulator", "package-tests"],
|
||||
"upload_files": [
|
||||
"{workdir}/out/target/product/generic/*.tar.bz2",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-flame-kk.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2", "dosfstools"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": [],
|
||||
"upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-flame.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2", "dosfstools"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": [],
|
||||
"upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-hamachi.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "java-1.6.0-openjdk-devel", "git", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": [],
|
||||
"upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-helix.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "java-1.6.0-openjdk-devel", "git", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": [],
|
||||
"upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
|
@ -14,3 +14,11 @@ if test -d $topsrcdir/../gcc/bin; then
|
||||
HOST_CXX="$topsrcdir/../gcc/bin/g++"
|
||||
ac_add_options --enable-stdcxx-compat
|
||||
fi
|
||||
|
||||
# Allow overriding this from the environment, and don't
|
||||
# try to set it if it doesn't exist. As per above, this file is also
|
||||
# used for local builds, and we may need to override this for builds in
|
||||
# other environments.
|
||||
if test -z "$SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE" -a -f /builds/crash-stats-api.token; then
|
||||
export SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE=/builds/crash-stats-api.token
|
||||
fi
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-mako.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": [],
|
||||
"upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-nexus5.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": [],
|
||||
"upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
|
@ -3,7 +3,10 @@
|
||||
"tooltool_manifest": "releng-wasabi.tt",
|
||||
"mock_target": "mozilla-centos6-x86_64",
|
||||
"mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "java-1.6.0-openjdk-devel", "git", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel"],
|
||||
"mock_files": [["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"]],
|
||||
"mock_files": [
|
||||
["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
|
||||
["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
|
||||
],
|
||||
"build_targets": [],
|
||||
"upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
|
@ -10994,6 +10994,18 @@ nsDocShell::DoChannelLoad(nsIChannel* aChannel,
|
||||
|
||||
(void)aChannel->SetLoadFlags(loadFlags);
|
||||
|
||||
// If the user pressed shift-reload, then do not allow ServiceWorker
|
||||
// interception to occur. See step 12.1 of the SW HandleFetch algorithm.
|
||||
if (mLoadType == LOAD_RELOAD_BYPASS_CACHE ||
|
||||
mLoadType == LOAD_RELOAD_BYPASS_PROXY ||
|
||||
mLoadType == LOAD_RELOAD_BYPASS_PROXY_AND_CACHE ||
|
||||
mLoadType == LOAD_RELOAD_ALLOW_MIXED_CONTENT) {
|
||||
nsCOMPtr<nsIHttpChannelInternal> internal = do_QueryInterface(aChannel);
|
||||
if (internal) {
|
||||
internal->ForceNoIntercept();
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t openFlags = 0;
|
||||
if (mLoadType == LOAD_LINK) {
|
||||
openFlags |= nsIURILoader::IS_CONTENT_PREFERRED;
|
||||
|
@ -528,9 +528,9 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
void UpdateAutoDirection(Directionality aDir)
|
||||
uint32_t UpdateAutoDirection(Directionality aDir)
|
||||
{
|
||||
mElements.EnumerateEntries(SetNodeDirection, &aDir);
|
||||
return mElements.EnumerateEntries(SetNodeDirection, &aDir);
|
||||
}
|
||||
|
||||
void ResetAutoDirection(nsINode* aTextNode)
|
||||
@ -562,11 +562,12 @@ public:
|
||||
map->AddEntry(aTextNode, aElement);
|
||||
}
|
||||
|
||||
static void UpdateTextNodeDirection(nsINode* aTextNode, Directionality aDir)
|
||||
static uint32_t UpdateTextNodeDirection(nsINode* aTextNode,
|
||||
Directionality aDir)
|
||||
{
|
||||
MOZ_ASSERT(aTextNode->HasTextNodeDirectionalityMap(),
|
||||
"Map missing in UpdateTextNodeDirection");
|
||||
GetDirectionalityMap(aTextNode)->UpdateAutoDirection(aDir);
|
||||
return GetDirectionalityMap(aTextNode)->UpdateAutoDirection(aDir);
|
||||
}
|
||||
|
||||
static void ResetTextNodeDirection(nsINode* aTextNode)
|
||||
@ -846,14 +847,16 @@ TextNodeChangedDirection(nsIContent* aTextNode, Directionality aOldDir,
|
||||
// This node has a strong directional character. If it has a
|
||||
// TextNodeDirectionalityMap property, it already determines the
|
||||
// directionality of some element(s), so call UpdateTextNodeDirection to
|
||||
// reresolve their directionality. Otherwise call
|
||||
// SetAncestorDirectionIfAuto to find ancestor elements which should
|
||||
// have their directionality determined by this node.
|
||||
if (aTextNode->HasTextNodeDirectionalityMap()) {
|
||||
nsTextNodeDirectionalityMap::UpdateTextNodeDirection(aTextNode, newDir);
|
||||
} else {
|
||||
SetAncestorDirectionIfAuto(aTextNode, newDir, aNotify);
|
||||
// reresolve their directionality. If it has no map, or if
|
||||
// UpdateTextNodeDirection returns zero, indicating that the map is
|
||||
// empty, call SetAncestorDirectionIfAuto to find ancestor elements
|
||||
// which should have their directionality determined by this node.
|
||||
if (aTextNode->HasTextNodeDirectionalityMap() &&
|
||||
nsTextNodeDirectionalityMap::UpdateTextNodeDirection(aTextNode,
|
||||
newDir)) {
|
||||
return;
|
||||
}
|
||||
SetAncestorDirectionIfAuto(aTextNode, newDir, aNotify);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4769,6 +4769,9 @@ nsDocument::SetScriptGlobalObject(nsIScriptGlobalObject *aScriptGlobalObject)
|
||||
nsLoadFlags loadFlags = 0;
|
||||
channel->GetLoadFlags(&loadFlags);
|
||||
// If we are shift-reloaded, don't associate with a ServiceWorker.
|
||||
// TODO: This should check the nsDocShell definition of shift-reload instead
|
||||
// of trying to infer it from LOAD_BYPASS_CACHE. The current code
|
||||
// will probably cause problems once bug 1120715 lands.
|
||||
if (loadFlags & nsIRequest::LOAD_BYPASS_CACHE) {
|
||||
NS_WARNING("Page was shift reloaded, skipping ServiceWorker control");
|
||||
return;
|
||||
@ -7876,7 +7879,11 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
|
||||
// Compute the CSS-to-LayoutDevice pixel scale as the product of the
|
||||
// widget scale and the full zoom.
|
||||
nsPresContext* context = mPresShell->GetPresContext();
|
||||
float fullZoom = context ? context->GetFullZoom() : 1.0;
|
||||
// When querying the full zoom, get it from the device context rather than
|
||||
// directly from the pres context, because the device context's value can
|
||||
// include an adjustment necessay to keep the number of app units per device
|
||||
// pixel an integer, and we want the adjusted value.
|
||||
float fullZoom = context ? context->DeviceContext()->GetFullZoom() : 1.0;
|
||||
fullZoom = (fullZoom == 0.0) ? 1.0 : fullZoom;
|
||||
nsIWidget *widget = nsContentUtils::WidgetForDocument(this);
|
||||
float widgetScale = widget ? widget->GetDefaultScale().scale : 1.0f;
|
||||
|
@ -530,6 +530,7 @@ BrowserElementChild.prototype = {
|
||||
debug('Got metaChanged: (' + e.target.name + ') ' + e.target.content);
|
||||
|
||||
let handlers = {
|
||||
'viewmode': this._viewmodeChangedHandler,
|
||||
'theme-color': this._themeColorChangedHandler,
|
||||
'application-name': this._applicationNameChangedHandler
|
||||
};
|
||||
@ -702,6 +703,16 @@ BrowserElementChild.prototype = {
|
||||
sendAsyncMsg('selectionstatechanged', detail);
|
||||
},
|
||||
|
||||
|
||||
_viewmodeChangedHandler: function(eventType, target) {
|
||||
let meta = {
|
||||
name: 'viewmode',
|
||||
content: target.content,
|
||||
type: eventType.replace('DOMMeta', '').toLowerCase()
|
||||
};
|
||||
sendAsyncMsg('metachange', meta);
|
||||
},
|
||||
|
||||
_themeColorChangedHandler: function(eventType, target) {
|
||||
let meta = {
|
||||
name: 'theme-color',
|
||||
|
71
dom/browser-element/mochitest/browserElement_Viewmode.js
Normal file
71
dom/browser-element/mochitest/browserElement_Viewmode.js
Normal file
@ -0,0 +1,71 @@
|
||||
/* Any copyright is dedicated to the public domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Test that the onmozbrowsermetachange event for viewmode works.
|
||||
"use strict";
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
browserElementTestHelpers.setEnabledPref(true);
|
||||
browserElementTestHelpers.addPermission();
|
||||
|
||||
function runTest() {
|
||||
function loadFrameScript(script) {
|
||||
SpecialPowers.getBrowserFrameMessageManager(iframe1)
|
||||
.loadFrameScript('data:,' + script,
|
||||
/* allowDelayedLoad = */ false);
|
||||
}
|
||||
|
||||
let iframe1 = document.createElement('iframe');
|
||||
iframe1.setAttribute('mozbrowser', 'true');
|
||||
iframe1.src = "http://test/tests/dom/browser-element/mochitest/file_browserElement_Viewmode.html";
|
||||
iframe1.addEventListener('mozbrowsermetachange', tests);
|
||||
document.body.appendChild(iframe1);
|
||||
|
||||
let numMetaChanges = 0;
|
||||
function tests(e) {
|
||||
let detail = e.detail;
|
||||
|
||||
switch (numMetaChanges++) {
|
||||
case 0: {
|
||||
is(detail.name, 'viewmode', 'name matches');
|
||||
is(detail.content, 'projection=stereo', 'content matches');
|
||||
is(detail.type, 'added', 'type matches');
|
||||
|
||||
let script =
|
||||
"var meta = content.document.head.querySelector('meta');" +
|
||||
"meta.content = 'projection=mono';";
|
||||
loadFrameScript(script);
|
||||
break;
|
||||
}
|
||||
|
||||
case 1: {
|
||||
is(detail.name, 'viewmode', 'name matches');
|
||||
is(detail.content, 'projection=mono', 'content matches');
|
||||
is(detail.type, 'changed', 'type matches');
|
||||
|
||||
let script =
|
||||
"var meta = content.document.head.querySelector('meta');" +
|
||||
"meta.parentNode.removeChild(meta);";
|
||||
loadFrameScript(script);
|
||||
break;
|
||||
}
|
||||
|
||||
case 2: {
|
||||
is(detail.name, 'viewmode', 'name matches');
|
||||
is(detail.content, 'projection=mono', 'content matches');
|
||||
is(detail.type, 'removed', 'type matches');
|
||||
|
||||
SimpleTest.finish();
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
ok(false, 'Too many metachange events.');
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
window.addEventListener('testready', runTest);
|
||||
|
@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewmode" content="projection=stereo">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
@ -9,6 +9,7 @@ support-files =
|
||||
file_browserElement_OpenMixedProcess.html
|
||||
browserElement_OpenTab.js
|
||||
|
||||
[test_browserElement_oop_Viewmode.html]
|
||||
[test_browserElement_oop_ThemeColor.html]
|
||||
[test_browserElement_inproc_ErrorSecurity.html]
|
||||
skip-if = toolkit=='gonk'
|
||||
|
@ -12,6 +12,7 @@ support-files =
|
||||
browserElement_Auth.js
|
||||
browserElement_BackForward.js
|
||||
browserElement_BadScreenshot.js
|
||||
browserElement_Viewmode.js
|
||||
browserElement_ThemeColor.js
|
||||
browserElement_BrowserWindowNamespace.js
|
||||
browserElement_BrowserWindowResize.js
|
||||
@ -77,6 +78,7 @@ support-files =
|
||||
file_browserElement_AllowEmbedAppsInNestedOOIframe.html
|
||||
file_browserElement_AppFramePermission.html
|
||||
file_browserElement_AppWindowNamespace.html
|
||||
file_browserElement_Viewmode.html
|
||||
file_browserElement_ThemeColor.html
|
||||
file_browserElement_BrowserWindowNamespace.html
|
||||
file_browserElement_CloseApp.html
|
||||
@ -126,6 +128,7 @@ support-files =
|
||||
[test_browserElement_NoPref.html]
|
||||
[test_browserElement_NoPermission.html]
|
||||
[test_browserElement_inproc_Alert.html]
|
||||
[test_browserElement_inproc_Viewmode.html]
|
||||
[test_browserElement_inproc_ThemeColor.html]
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_browserElement_inproc_AlertInFrame.html]
|
||||
|
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1162844
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1162844</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1162844">Mozilla Bug 1162844</a>
|
||||
|
||||
<script type="application/javascript;version=1.7" src="browserElement_Viewmode.js">
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1162844
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1162844</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1162844">Mozilla Bug 1162844</a>
|
||||
|
||||
<script type="application/javascript;version=1.7" src="browserElement_Viewmode.js">
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1298,6 +1298,13 @@ nsTextEditorState::PrepareEditor(const nsAString *aValue)
|
||||
}
|
||||
|
||||
newEditor = mEditor; // just pretend that we have a new editor!
|
||||
|
||||
// Don't lose application flags in the process.
|
||||
uint32_t originalFlags = 0;
|
||||
newEditor->GetFlags(&originalFlags);
|
||||
if (originalFlags & nsIPlaintextEditor::eEditorMailMask) {
|
||||
editorFlags |= nsIPlaintextEditor::eEditorMailMask;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the current value of the textfield from the content.
|
||||
|
@ -125,37 +125,42 @@ public:
|
||||
class ResolveOrRejectValue
|
||||
{
|
||||
public:
|
||||
void SetResolve(const ResolveValueType& aResolveValue)
|
||||
template<typename ResolveValueType_>
|
||||
void SetResolve(ResolveValueType_&& aResolveValue)
|
||||
{
|
||||
MOZ_ASSERT(IsNothing());
|
||||
mResolveValue.emplace(aResolveValue);
|
||||
mResolveValue.emplace(Forward<ResolveValueType_>(aResolveValue));
|
||||
}
|
||||
|
||||
void SetReject(const RejectValueType& aRejectValue)
|
||||
template<typename RejectValueType_>
|
||||
void SetReject(RejectValueType_&& aRejectValue)
|
||||
{
|
||||
MOZ_ASSERT(IsNothing());
|
||||
mRejectValue.emplace(aRejectValue);
|
||||
mRejectValue.emplace(Forward<RejectValueType_>(aRejectValue));
|
||||
}
|
||||
|
||||
static ResolveOrRejectValue MakeResolve(const ResolveValueType aResolveValue)
|
||||
template<typename ResolveValueType_>
|
||||
static ResolveOrRejectValue MakeResolve(ResolveValueType_&& aResolveValue)
|
||||
{
|
||||
ResolveOrRejectValue val;
|
||||
val.SetResolve(aResolveValue);
|
||||
val.SetResolve(Forward<ResolveValueType_>(aResolveValue));
|
||||
return val;
|
||||
}
|
||||
|
||||
static ResolveOrRejectValue MakeReject(const RejectValueType aRejectValue)
|
||||
template<typename RejectValueType_>
|
||||
static ResolveOrRejectValue MakeReject(RejectValueType_&& aRejectValue)
|
||||
{
|
||||
ResolveOrRejectValue val;
|
||||
val.SetReject(aRejectValue);
|
||||
val.SetReject(Forward<RejectValueType_>(aRejectValue));
|
||||
return val;
|
||||
}
|
||||
|
||||
bool IsResolve() const { return mResolveValue.isSome(); }
|
||||
bool IsReject() const { return mRejectValue.isSome(); }
|
||||
bool IsNothing() const { return mResolveValue.isNothing() && mRejectValue.isNothing(); }
|
||||
ResolveValueType& ResolveValue() { return mResolveValue.ref(); }
|
||||
RejectValueType& RejectValue() { return mRejectValue.ref(); }
|
||||
|
||||
const ResolveValueType& ResolveValue() const { return mResolveValue.ref(); }
|
||||
const RejectValueType& RejectValue() const { return mRejectValue.ref(); }
|
||||
|
||||
private:
|
||||
Maybe<ResolveValueType> mResolveValue;
|
||||
@ -183,20 +188,83 @@ public:
|
||||
// NB: We can include the definition of this class inline once B2G ICS is gone.
|
||||
class Private;
|
||||
|
||||
template<typename ResolveValueType_>
|
||||
static nsRefPtr<MediaPromise>
|
||||
CreateAndResolve(ResolveValueType aResolveValue, const char* aResolveSite)
|
||||
CreateAndResolve(ResolveValueType_&& aResolveValue, const char* aResolveSite)
|
||||
{
|
||||
nsRefPtr<typename MediaPromise::Private> p = new MediaPromise::Private(aResolveSite);
|
||||
p->Resolve(aResolveValue, aResolveSite);
|
||||
return Move(p);
|
||||
p->Resolve(Forward<ResolveValueType_>(aResolveValue), aResolveSite);
|
||||
return p.forget();
|
||||
}
|
||||
|
||||
template<typename RejectValueType_>
|
||||
static nsRefPtr<MediaPromise>
|
||||
CreateAndReject(RejectValueType aRejectValue, const char* aRejectSite)
|
||||
CreateAndReject(RejectValueType_&& aRejectValue, const char* aRejectSite)
|
||||
{
|
||||
nsRefPtr<typename MediaPromise::Private> p = new MediaPromise::Private(aRejectSite);
|
||||
p->Reject(aRejectValue, aRejectSite);
|
||||
return Move(p);
|
||||
p->Reject(Forward<RejectValueType_>(aRejectValue), aRejectSite);
|
||||
return p.forget();
|
||||
}
|
||||
|
||||
typedef MediaPromise<nsTArray<ResolveValueType>, RejectValueType, IsExclusive> AllPromiseType;
|
||||
private:
|
||||
class AllPromiseHolder : public MediaPromiseRefcountable
|
||||
{
|
||||
public:
|
||||
explicit AllPromiseHolder(size_t aDependentPromises)
|
||||
: mPromise(new typename AllPromiseType::Private(__func__))
|
||||
, mOutstandingPromises(aDependentPromises)
|
||||
{
|
||||
mResolveValues.SetLength(aDependentPromises);
|
||||
}
|
||||
|
||||
void Resolve(size_t aIndex, const ResolveValueType& aResolveValue)
|
||||
{
|
||||
if (!mPromise) {
|
||||
// Already rejected.
|
||||
return;
|
||||
}
|
||||
|
||||
mResolveValues[aIndex].emplace(aResolveValue);
|
||||
if (--mOutstandingPromises == 0) {
|
||||
nsTArray<ResolveValueType> resolveValues;
|
||||
resolveValues.SetCapacity(mResolveValues.Length());
|
||||
for (size_t i = 0; i < mResolveValues.Length(); ++i) {
|
||||
resolveValues.AppendElement(mResolveValues[i].ref());
|
||||
}
|
||||
|
||||
mPromise->Resolve(resolveValues, __func__);
|
||||
mPromise = nullptr;
|
||||
mResolveValues.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
void Reject(const RejectValueType& aRejectValue)
|
||||
{
|
||||
mPromise->Reject(aRejectValue, __func__);
|
||||
mPromise = nullptr;
|
||||
mResolveValues.Clear();
|
||||
}
|
||||
|
||||
AllPromiseType* Promise() { return mPromise; }
|
||||
|
||||
private:
|
||||
nsTArray<Maybe<ResolveValueType>> mResolveValues;
|
||||
nsRefPtr<typename AllPromiseType::Private> mPromise;
|
||||
size_t mOutstandingPromises;
|
||||
};
|
||||
public:
|
||||
|
||||
static nsRefPtr<AllPromiseType> All(AbstractThread* aProcessingThread, nsTArray<nsRefPtr<MediaPromise>>& aPromises)
|
||||
{
|
||||
nsRefPtr<AllPromiseHolder> holder = new AllPromiseHolder(aPromises.Length());
|
||||
for (size_t i = 0; i < aPromises.Length(); ++i) {
|
||||
aPromises[i]->Then(aProcessingThread, __func__,
|
||||
[holder, i] (ResolveValueType aResolveValue) -> void { holder->Resolve(i, aResolveValue); },
|
||||
[holder] (RejectValueType aRejectValue) -> void { holder->Reject(aRejectValue); }
|
||||
);
|
||||
}
|
||||
return holder->Promise();
|
||||
}
|
||||
|
||||
class Request : public MediaPromiseRefcountable
|
||||
@ -232,9 +300,12 @@ protected:
|
||||
class ResolveOrRejectRunnable : public nsRunnable
|
||||
{
|
||||
public:
|
||||
ResolveOrRejectRunnable(ThenValueBase* aThenValue, ResolveOrRejectValue& aValue)
|
||||
ResolveOrRejectRunnable(ThenValueBase* aThenValue, MediaPromise* aPromise)
|
||||
: mThenValue(aThenValue)
|
||||
, mValue(aValue) {}
|
||||
, mPromise(aPromise)
|
||||
{
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mPromise->IsPending());
|
||||
}
|
||||
|
||||
~ResolveOrRejectRunnable()
|
||||
{
|
||||
@ -244,14 +315,15 @@ protected:
|
||||
NS_IMETHODIMP Run()
|
||||
{
|
||||
PROMISE_LOG("ResolveOrRejectRunnable::Run() [this=%p]", this);
|
||||
mThenValue->DoResolveOrReject(mValue);
|
||||
mThenValue->DoResolveOrReject(mPromise->Value());
|
||||
mThenValue = nullptr;
|
||||
mPromise = nullptr;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
nsRefPtr<ThenValueBase> mThenValue;
|
||||
ResolveOrRejectValue mValue;
|
||||
nsRefPtr<MediaPromise> mPromise;
|
||||
};
|
||||
|
||||
explicit ThenValueBase(AbstractThread* aResponseTarget, const char* aCallSite)
|
||||
@ -273,7 +345,7 @@ protected:
|
||||
MOZ_ASSERT(!aPromise->IsPending());
|
||||
|
||||
nsRefPtr<nsRunnable> runnable =
|
||||
static_cast<nsRunnable*>(new (typename ThenValueBase::ResolveOrRejectRunnable)(this, aPromise->mValue));
|
||||
static_cast<nsRunnable*>(new (typename ThenValueBase::ResolveOrRejectRunnable)(this, aPromise));
|
||||
PROMISE_LOG("%s Then() call made from %s [Runnable=%p, Promise=%p, ThenValue=%p]",
|
||||
aPromise->mValue.IsResolve() ? "Resolving" : "Rejecting", ThenValueBase::mCallSite,
|
||||
runnable.get(), aPromise, this);
|
||||
@ -299,9 +371,9 @@ protected:
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<MediaPromise> DoResolveOrRejectInternal(ResolveOrRejectValue& aValue) = 0;
|
||||
virtual already_AddRefed<MediaPromise> DoResolveOrRejectInternal(const ResolveOrRejectValue& aValue) = 0;
|
||||
|
||||
void DoResolveOrReject(ResolveOrRejectValue& aValue)
|
||||
void DoResolveOrReject(const ResolveOrRejectValue& aValue)
|
||||
{
|
||||
Request::mComplete = true;
|
||||
if (Request::mDisconnected) {
|
||||
@ -349,18 +421,18 @@ protected:
|
||||
static typename EnableIf<ReturnTypeIs<MethodType, nsRefPtr<MediaPromise>>::value &&
|
||||
TakesArgument<MethodType>::value,
|
||||
already_AddRefed<MediaPromise>>::Type
|
||||
InvokeCallbackMethod(ThisType* aThisVal, MethodType aMethod, ValueType aValue)
|
||||
InvokeCallbackMethod(ThisType* aThisVal, MethodType aMethod, ValueType&& aValue)
|
||||
{
|
||||
return ((*aThisVal).*aMethod)(aValue).forget();
|
||||
return ((*aThisVal).*aMethod)(Forward<ValueType>(aValue)).forget();
|
||||
}
|
||||
|
||||
template<typename ThisType, typename MethodType, typename ValueType>
|
||||
static typename EnableIf<ReturnTypeIs<MethodType, void>::value &&
|
||||
TakesArgument<MethodType>::value,
|
||||
already_AddRefed<MediaPromise>>::Type
|
||||
InvokeCallbackMethod(ThisType* aThisVal, MethodType aMethod, ValueType aValue)
|
||||
InvokeCallbackMethod(ThisType* aThisVal, MethodType aMethod, ValueType&& aValue)
|
||||
{
|
||||
((*aThisVal).*aMethod)(aValue);
|
||||
((*aThisVal).*aMethod)(Forward<ValueType>(aValue));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -368,7 +440,7 @@ protected:
|
||||
static typename EnableIf<ReturnTypeIs<MethodType, nsRefPtr<MediaPromise>>::value &&
|
||||
!TakesArgument<MethodType>::value,
|
||||
already_AddRefed<MediaPromise>>::Type
|
||||
InvokeCallbackMethod(ThisType* aThisVal, MethodType aMethod, ValueType aValue)
|
||||
InvokeCallbackMethod(ThisType* aThisVal, MethodType aMethod, ValueType&& aValue)
|
||||
{
|
||||
return ((*aThisVal).*aMethod)().forget();
|
||||
}
|
||||
@ -377,7 +449,7 @@ protected:
|
||||
static typename EnableIf<ReturnTypeIs<MethodType, void>::value &&
|
||||
!TakesArgument<MethodType>::value,
|
||||
already_AddRefed<MediaPromise>>::Type
|
||||
InvokeCallbackMethod(ThisType* aThisVal, MethodType aMethod, ValueType aValue)
|
||||
InvokeCallbackMethod(ThisType* aThisVal, MethodType aMethod, ValueType&& aValue)
|
||||
{
|
||||
((*aThisVal).*aMethod)();
|
||||
return nullptr;
|
||||
@ -406,7 +478,7 @@ protected:
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<MediaPromise> DoResolveOrRejectInternal(ResolveOrRejectValue& aValue) override
|
||||
virtual already_AddRefed<MediaPromise> DoResolveOrRejectInternal(const ResolveOrRejectValue& aValue) override
|
||||
{
|
||||
nsRefPtr<MediaPromise> completion;
|
||||
if (aValue.IsResolve()) {
|
||||
@ -458,7 +530,7 @@ protected:
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<MediaPromise> DoResolveOrRejectInternal(ResolveOrRejectValue& aValue) override
|
||||
virtual already_AddRefed<MediaPromise> DoResolveOrRejectInternal(const ResolveOrRejectValue& aValue) override
|
||||
{
|
||||
// Note: The usage of InvokeCallbackMethod here requires that
|
||||
// ResolveFunction/RejectFunction are capture-lambdas (i.e. anonymous
|
||||
@ -542,7 +614,15 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
bool IsPending() { return mValue.IsNothing(); }
|
||||
bool IsPending() const { return mValue.IsNothing(); }
|
||||
const ResolveOrRejectValue& Value() const
|
||||
{
|
||||
// This method should only be called once the value has stabilized. As
|
||||
// such, we don't need to acquire the lock here.
|
||||
MOZ_DIAGNOSTIC_ASSERT(!IsPending());
|
||||
return mValue;
|
||||
}
|
||||
|
||||
void DispatchAll()
|
||||
{
|
||||
mMutex.AssertCurrentThreadOwns();
|
||||
@ -590,30 +670,33 @@ class MediaPromise<ResolveValueT, RejectValueT, IsExclusive>::Private
|
||||
public:
|
||||
explicit Private(const char* aCreationSite) : MediaPromise(aCreationSite) {}
|
||||
|
||||
void Resolve(ResolveValueT aResolveValue, const char* aResolveSite)
|
||||
template<typename ResolveValueT_>
|
||||
void Resolve(ResolveValueT_&& aResolveValue, const char* aResolveSite)
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
MOZ_ASSERT(IsPending());
|
||||
PROMISE_LOG("%s resolving MediaPromise (%p created at %s)", aResolveSite, this, mCreationSite);
|
||||
mValue.SetResolve(aResolveValue);
|
||||
mValue.SetResolve(Forward<ResolveValueT_>(aResolveValue));
|
||||
DispatchAll();
|
||||
}
|
||||
|
||||
void Reject(RejectValueT aRejectValue, const char* aRejectSite)
|
||||
template<typename RejectValueT_>
|
||||
void Reject(RejectValueT_&& aRejectValue, const char* aRejectSite)
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
MOZ_ASSERT(IsPending());
|
||||
PROMISE_LOG("%s rejecting MediaPromise (%p created at %s)", aRejectSite, this, mCreationSite);
|
||||
mValue.SetReject(aRejectValue);
|
||||
mValue.SetReject(Forward<RejectValueT_>(aRejectValue));
|
||||
DispatchAll();
|
||||
}
|
||||
|
||||
void ResolveOrReject(ResolveOrRejectValue aValue, const char* aSite)
|
||||
template<typename ResolveOrRejectValue_>
|
||||
void ResolveOrReject(ResolveOrRejectValue_&& aValue, const char* aSite)
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
MOZ_ASSERT(IsPending());
|
||||
PROMISE_LOG("%s resolveOrRejecting MediaPromise (%p created at %s)", aSite, this, mCreationSite);
|
||||
mValue = aValue;
|
||||
mValue = Forward<ResolveOrRejectValue_>(aValue);
|
||||
DispatchAll();
|
||||
}
|
||||
};
|
||||
@ -852,7 +935,7 @@ ProxyInternal(AbstractThread* aTarget, MethodCallBase<PromiseType>* aMethodCall,
|
||||
nsRefPtr<ProxyRunnable<PromiseType>> r = new ProxyRunnable<PromiseType>(p, aMethodCall);
|
||||
MOZ_ASSERT(aTarget->IsDispatchReliable());
|
||||
aTarget->Dispatch(r.forget());
|
||||
return Move(p);
|
||||
return p.forget();
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
@ -173,4 +173,49 @@ TEST(MediaPromise, CompletionPromises)
|
||||
});
|
||||
}
|
||||
|
||||
TEST(MediaPromise, PromiseAllResolve)
|
||||
{
|
||||
AutoTaskQueue atq;
|
||||
nsRefPtr<MediaTaskQueue> queue = atq.TaskQueue();
|
||||
RunOnTaskQueue(queue, [queue] () -> void {
|
||||
|
||||
nsTArray<nsRefPtr<TestPromise>> promises;
|
||||
promises.AppendElement(TestPromise::CreateAndResolve(22, __func__));
|
||||
promises.AppendElement(TestPromise::CreateAndResolve(32, __func__));
|
||||
promises.AppendElement(TestPromise::CreateAndResolve(42, __func__));
|
||||
|
||||
TestPromise::All(queue, promises)->Then(queue, __func__,
|
||||
[queue] (const nsTArray<int>& aResolveValues) -> void {
|
||||
EXPECT_EQ(aResolveValues.Length(), 3UL);
|
||||
EXPECT_EQ(aResolveValues[0], 22);
|
||||
EXPECT_EQ(aResolveValues[1], 32);
|
||||
EXPECT_EQ(aResolveValues[2], 42);
|
||||
queue->BeginShutdown();
|
||||
},
|
||||
DO_FAIL
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
TEST(MediaPromise, PromiseAllReject)
|
||||
{
|
||||
AutoTaskQueue atq;
|
||||
nsRefPtr<MediaTaskQueue> queue = atq.TaskQueue();
|
||||
RunOnTaskQueue(queue, [queue] () -> void {
|
||||
|
||||
nsTArray<nsRefPtr<TestPromise>> promises;
|
||||
promises.AppendElement(TestPromise::CreateAndResolve(22, __func__));
|
||||
promises.AppendElement(TestPromise::CreateAndReject(32.0, __func__));
|
||||
promises.AppendElement(TestPromise::CreateAndResolve(42, __func__));
|
||||
|
||||
TestPromise::All(queue, promises)->Then(queue, __func__,
|
||||
DO_FAIL,
|
||||
[queue] (float aRejectValue) -> void {
|
||||
EXPECT_EQ(aRejectValue, 32.0);
|
||||
queue->BeginShutdown();
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#undef DO_FAIL
|
||||
|
@ -2,8 +2,6 @@
|
||||
skip-if = e10s # Bug ?????? - most of these tests fail for currently unknown reasons.
|
||||
support-files =
|
||||
browser_frame_elements.html
|
||||
browser_geolocation_privatebrowsing_page.html
|
||||
network_geolocation.sjs
|
||||
page_privatestorageevent.html
|
||||
position.html
|
||||
test-console-api.html
|
||||
@ -23,7 +21,6 @@ skip-if= buildapp == 'mulet'
|
||||
[browser_focus_steal_from_chrome.js]
|
||||
[browser_focus_steal_from_chrome_during_mousedown.js]
|
||||
[browser_frame_elements.js]
|
||||
[browser_geolocation_privatebrowsing_perwindowpb.js]
|
||||
[browser_localStorage_privatestorageevent.js]
|
||||
[browser_test_new_window_from_content.js]
|
||||
skip-if = (toolkit == 'android' || buildapp == 'b2g' || buildapp == 'mulet')
|
||||
|
@ -1,11 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
navigator.geolocation.getCurrentPosition(function(pos) {
|
||||
var evt = document.createEvent('CustomEvent');
|
||||
evt.initCustomEvent('georesult', true, false, pos.coords.latitude);
|
||||
document.dispatchEvent(evt);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,90 +0,0 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
|
||||
let baseProvider = "http://mochi.test:8888/browser/dom/tests/browser/network_geolocation.sjs";
|
||||
prefs.setCharPref("geo.wifi.uri", baseProvider + "?desired_access_token=fff");
|
||||
|
||||
prefs.setBoolPref("geo.prompt.testing", true);
|
||||
prefs.setBoolPref("geo.prompt.testing.allow", true);
|
||||
var origScanValue = true; // same default in NetworkGeolocationProvider.js.
|
||||
try {
|
||||
origScanValue = prefs.getBoolPref("geo.wifi.scan");
|
||||
} catch(ex) {}
|
||||
prefs.setBoolPref("geo.wifi.scan", false);
|
||||
|
||||
const testPageURL = "http://mochi.test:8888/browser/" +
|
||||
"dom/tests/browser/browser_geolocation_privatebrowsing_page.html";
|
||||
waitForExplicitFinish();
|
||||
|
||||
var windowsToClose = [];
|
||||
function testOnWindow(aIsPrivate, aCallback) {
|
||||
let win = OpenBrowserWindow({private: aIsPrivate});
|
||||
let gotLoad = false;
|
||||
let gotActivate = Services.focus.activeWindow == win;
|
||||
|
||||
function maybeRunCallback() {
|
||||
if (gotLoad && gotActivate) {
|
||||
windowsToClose.push(win);
|
||||
executeSoon(function() { aCallback(win); });
|
||||
}
|
||||
}
|
||||
|
||||
if (!gotActivate) {
|
||||
win.addEventListener("activate", function onActivate() {
|
||||
info("got activate");
|
||||
win.removeEventListener("activate", onActivate, true);
|
||||
gotActivate = true;
|
||||
maybeRunCallback();
|
||||
}, true);
|
||||
} else {
|
||||
info("Was activated");
|
||||
}
|
||||
|
||||
Services.obs.addObserver(function observer(aSubject, aTopic) {
|
||||
if (win == aSubject) {
|
||||
info("Delayed startup finished");
|
||||
Services.obs.removeObserver(observer, aTopic);
|
||||
gotLoad = true;
|
||||
maybeRunCallback();
|
||||
}
|
||||
}, "browser-delayed-startup-finished", false);
|
||||
|
||||
}
|
||||
|
||||
testOnWindow(false, function(aNormalWindow) {
|
||||
aNormalWindow.gBrowser.selectedBrowser.addEventListener("georesult", function load(ev) {
|
||||
aNormalWindow.gBrowser.selectedBrowser.removeEventListener("georesult", load, false);
|
||||
is(ev.detail, 200, "unexpected access token");
|
||||
|
||||
prefs.setCharPref("geo.wifi.uri", baseProvider + "?desired_access_token=ggg");
|
||||
|
||||
testOnWindow(true, function(aPrivateWindow) {
|
||||
aPrivateWindow.gBrowser.selectedBrowser.addEventListener("georesult", function load2(ev) {
|
||||
aPrivateWindow.gBrowser.selectedBrowser.removeEventListener("georesult", load2, false);
|
||||
is(ev.detail, 200, "unexpected access token");
|
||||
|
||||
prefs.setCharPref("geo.wifi.uri", baseProvider + "?expected_access_token=fff");
|
||||
|
||||
testOnWindow(false, function(aAnotherNormalWindow) {
|
||||
aAnotherNormalWindow.gBrowser.selectedBrowser.addEventListener("georesult", function load3(ev) {
|
||||
aAnotherNormalWindow.gBrowser.selectedBrowser.removeEventListener("georesult", load3, false);
|
||||
is(ev.detail, 200, "unexpected access token");
|
||||
prefs.setBoolPref("geo.prompt.testing", false);
|
||||
prefs.setBoolPref("geo.prompt.testing.allow", false);
|
||||
prefs.setBoolPref("geo.wifi.scan", origScanValue);
|
||||
windowsToClose.forEach(function(win) {
|
||||
win.close();
|
||||
});
|
||||
finish();
|
||||
}, false, true);
|
||||
aAnotherNormalWindow.content.location = testPageURL;
|
||||
});
|
||||
}, false, true);
|
||||
aPrivateWindow.content.location = testPageURL;
|
||||
});
|
||||
}, false, true);
|
||||
aNormalWindow.content.location = testPageURL;
|
||||
});
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
function parseQueryString(str)
|
||||
{
|
||||
if (str == "")
|
||||
return {};
|
||||
|
||||
var paramArray = str.split("&");
|
||||
var regex = /^([^=]+)=(.*)$/;
|
||||
var params = {};
|
||||
for (var i = 0, sz = paramArray.length; i < sz; i++)
|
||||
{
|
||||
var match = regex.exec(paramArray[i]);
|
||||
if (!match)
|
||||
throw "Bad parameter in queryString! '" + paramArray[i] + "'";
|
||||
params[decodeURIComponent(match[1])] = decodeURIComponent(match[2]);
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
function getPosition(expectedAccessToken, providedAccessToken, desiredAccessToken)
|
||||
{
|
||||
var response = {
|
||||
status: "OK",
|
||||
location: {
|
||||
lat: providedAccessToken ?
|
||||
(expectedAccessToken == providedAccessToken ? 200 : 404) : 200,
|
||||
lng: -122.08769,
|
||||
},
|
||||
accuracy: 100,
|
||||
access_token: desiredAccessToken
|
||||
};
|
||||
|
||||
return JSON.stringify(response);
|
||||
}
|
||||
|
||||
function handleRequest(request, response)
|
||||
{
|
||||
var params = parseQueryString(request.queryString);
|
||||
|
||||
response.setStatusLine("1.0", 200, "OK");
|
||||
response.setHeader("Cache-Control", "no-cache", false);
|
||||
response.setHeader("Content-Type", "aplication/x-javascript", false);
|
||||
response.write(getPosition(params.expected_access_token, params.access_token,
|
||||
params.desired_access_token));
|
||||
}
|
25
dom/workers/test/serviceworkers/force_refresh_worker.js
Normal file
25
dom/workers/test/serviceworkers/force_refresh_worker.js
Normal file
@ -0,0 +1,25 @@
|
||||
var name = 'refresherCache';
|
||||
|
||||
self.addEventListener('install', function(event) {
|
||||
event.waitUntil(
|
||||
Promise.all([caches.open(name),
|
||||
fetch('./sw_clients/refresher_cached.html'),
|
||||
fetch('./sw_clients/refresher_cached_compressed.html')]).then(function(results) {
|
||||
var cache = results[0];
|
||||
var response = results[1];
|
||||
var compressed = results[2];
|
||||
return Promise.all([cache.put('./sw_clients/refresher.html', response),
|
||||
cache.put('./sw_clients/refresher_compressed.html', compressed)]);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', function (event) {
|
||||
event.respondWith(
|
||||
caches.open(name).then(function(cache) {
|
||||
return cache.match(event.request);
|
||||
}).then(function(response) {
|
||||
return response || fetch(event.request);
|
||||
})
|
||||
);
|
||||
});
|
@ -99,6 +99,13 @@ support-files =
|
||||
claim_clients/client.html
|
||||
claim_fetch_worker.js
|
||||
app-protocol/*
|
||||
force_refresh_worker.js
|
||||
sw_clients/refresher.html
|
||||
sw_clients/refresher_compressed.html
|
||||
sw_clients/refresher_compressed.html^headers^
|
||||
sw_clients/refresher_cached.html
|
||||
sw_clients/refresher_cached_compressed.html
|
||||
sw_clients/refresher_cached_compressed.html^headers^
|
||||
|
||||
[test_unregister.html]
|
||||
[test_installation_simple.html]
|
||||
@ -138,3 +145,4 @@ support-files =
|
||||
[test_service_worker_allowed.html]
|
||||
[test_app_protocol.html]
|
||||
[test_claim_fetch.html]
|
||||
[test_force_refresh.html]
|
||||
|
38
dom/workers/test/serviceworkers/sw_clients/refresher.html
Normal file
38
dom/workers/test/serviceworkers/sw_clients/refresher.html
Normal file
@ -0,0 +1,38 @@
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Bug 982726 - test match_all not crashing</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test"></pre>
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
if (!parent) {
|
||||
info("sw_clients/simple.html shouldn't be launched directly!");
|
||||
}
|
||||
|
||||
window.addEventListener("message", function(event) {
|
||||
if (event.data === "REFRESH") {
|
||||
window.location.reload();
|
||||
} else if (event.data === "FORCE_REFRESH") {
|
||||
window.location.reload(true);
|
||||
}
|
||||
});
|
||||
|
||||
navigator.serviceWorker.ready.then(function() {
|
||||
parent.postMessage("READY", "*");
|
||||
});
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,38 @@
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Bug 982726 - test match_all not crashing</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test"></pre>
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
if (!parent) {
|
||||
info("sw_clients/simple.html shouldn't be launched directly!");
|
||||
}
|
||||
|
||||
window.addEventListener("message", function(event) {
|
||||
if (event.data === "REFRESH") {
|
||||
window.location.reload();
|
||||
} else if (event.data === "FORCE_REFRESH") {
|
||||
window.location.reload(true);
|
||||
}
|
||||
});
|
||||
|
||||
navigator.serviceWorker.ready.then(function() {
|
||||
parent.postMessage("READY_CACHED", "*");
|
||||
});
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
Content-Type: text/html
|
||||
Content-Encoding: gzip
|
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
Content-Type: text/html
|
||||
Content-Encoding: gzip
|
84
dom/workers/test/serviceworkers/test_force_refresh.html
Normal file
84
dom/workers/test/serviceworkers/test_force_refresh.html
Normal file
@ -0,0 +1,84 @@
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Bug 982726 - Test service worker post message </title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test"></pre>
|
||||
<script class="testbody" type="text/javascript">
|
||||
var registration;
|
||||
function start() {
|
||||
return navigator.serviceWorker.register("force_refresh_worker.js",
|
||||
{ scope: "./sw_clients/" })
|
||||
.then((swr) => registration = swr);
|
||||
}
|
||||
|
||||
function unregister() {
|
||||
return registration.unregister().then(function(result) {
|
||||
ok(result, "Unregister should return true.");
|
||||
}, function(e) {
|
||||
dump("Unregistering the SW failed with " + e + "\n");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function testForceRefresh(swr) {
|
||||
var p = new Promise(function(res, rej) {
|
||||
var count = 0;
|
||||
var cachedCount = 0;
|
||||
window.onmessage = function(e) {
|
||||
if (e.data === "READY") {
|
||||
count += 1;
|
||||
if (count == 2) {
|
||||
is(cachedCount, 1, "should have received cached message before " +
|
||||
"second non-cached message");
|
||||
res();
|
||||
}
|
||||
iframe.contentWindow.postMessage("REFRESH", "*");
|
||||
} else if (e.data === "READY_CACHED") {
|
||||
cachedCount += 1;
|
||||
is(count, 1, "should have received non-cached message before " +
|
||||
"cached message");
|
||||
iframe.contentWindow.postMessage("FORCE_REFRESH", "*");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var content = document.getElementById("content");
|
||||
ok(content, "Parent exists.");
|
||||
|
||||
iframe = document.createElement("iframe");
|
||||
iframe.setAttribute('src', "sw_clients/refresher_compressed.html");
|
||||
content.appendChild(iframe);
|
||||
|
||||
return p.then(() => content.removeChild(iframe));
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
start()
|
||||
.then(testForceRefresh)
|
||||
.then(unregister)
|
||||
.catch(function(e) {
|
||||
ok(false, "Some test failed with error " + e);
|
||||
}).then(SimpleTest.finish);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.caches.enabled", true],
|
||||
]}, runTest);
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -205,7 +205,11 @@ DrawTargetD2D1::DrawSurfaceWithShadow(SourceSurface *aSurface,
|
||||
|
||||
// Step 1, create the shadow effect.
|
||||
RefPtr<ID2D1Effect> shadowEffect;
|
||||
mDC->CreateEffect(CLSID_D2D1Shadow, byRef(shadowEffect));
|
||||
HRESULT hr = mDC->CreateEffect(CLSID_D2D1Shadow, byRef(shadowEffect));
|
||||
if (FAILED(hr) || !shadowEffect) {
|
||||
gfxWarning() << "Failed to create shadow effect. Code: " << hexa(hr);
|
||||
return;
|
||||
}
|
||||
shadowEffect->SetInput(0, image);
|
||||
shadowEffect->SetValue(D2D1_SHADOW_PROP_BLUR_STANDARD_DEVIATION, aSigma);
|
||||
D2D1_VECTOR_4F color = { aColor.r, aColor.g, aColor.b, aColor.a };
|
||||
@ -1086,9 +1090,9 @@ DrawTargetD2D1::FinalizeDrawing(CompositionOp aOp, const Pattern &aPattern)
|
||||
}
|
||||
|
||||
if (!mBlendEffect) {
|
||||
mDC->CreateEffect(CLSID_D2D1Blend, byRef(mBlendEffect));
|
||||
HRESULT hr = mDC->CreateEffect(CLSID_D2D1Blend, byRef(mBlendEffect));
|
||||
|
||||
if (!mBlendEffect) {
|
||||
if (FAILED(hr) || !mBlendEffect) {
|
||||
gfxWarning() << "Failed to create blend effect!";
|
||||
return;
|
||||
}
|
||||
@ -1131,7 +1135,11 @@ DrawTargetD2D1::FinalizeDrawing(CompositionOp aOp, const Pattern &aPattern)
|
||||
|
||||
RefPtr<ID2D1Effect> radialGradientEffect;
|
||||
|
||||
mDC->CreateEffect(CLSID_RadialGradientEffect, byRef(radialGradientEffect));
|
||||
HRESULT hr = mDC->CreateEffect(CLSID_RadialGradientEffect, byRef(radialGradientEffect));
|
||||
if (FAILED(hr) || !radialGradientEffect) {
|
||||
gfxWarning() << "Failed to create radial gradient effect. Code: " << hexa(hr);
|
||||
return;
|
||||
}
|
||||
|
||||
radialGradientEffect->SetValue(RADIAL_PROP_STOP_COLLECTION,
|
||||
static_cast<const GradientStopsD2D*>(pat->mStops.get())->mStopCollection);
|
||||
|
@ -859,7 +859,7 @@ FilterNodeConvolveD2D1::FilterNodeConvolveD2D1(ID2D1DeviceContext *aDC)
|
||||
|
||||
hr = aDC->CreateEffect(CLSID_D2D1ConvolveMatrix, byRef(mEffect));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
if (FAILED(hr) || !mEffect) {
|
||||
gfxWarning() << "Failed to create ConvolveMatrix filter!";
|
||||
return;
|
||||
}
|
||||
@ -868,14 +868,14 @@ FilterNodeConvolveD2D1::FilterNodeConvolveD2D1(ID2D1DeviceContext *aDC)
|
||||
|
||||
hr = aDC->CreateEffect(CLSID_ExtendInputEffect, byRef(mExtendInputEffect));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
if (FAILED(hr) || !mExtendInputEffect) {
|
||||
gfxWarning() << "Failed to create ConvolveMatrix filter!";
|
||||
return;
|
||||
}
|
||||
|
||||
hr = aDC->CreateEffect(CLSID_D2D1Border, byRef(mBorderEffect));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
if (FAILED(hr) || !mBorderEffect) {
|
||||
gfxWarning() << "Failed to create ConvolveMatrix filter!";
|
||||
return;
|
||||
}
|
||||
@ -1018,7 +1018,7 @@ FilterNodeExtendInputAdapterD2D1::FilterNodeExtendInputAdapterD2D1(ID2D1DeviceCo
|
||||
|
||||
hr = aDC->CreateEffect(CLSID_ExtendInputEffect, byRef(mExtendInputEffect));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
if (FAILED(hr) || !mExtendInputEffect) {
|
||||
gfxWarning() << "Failed to create extend input effect for filter: " << hexa(hr);
|
||||
return;
|
||||
}
|
||||
@ -1062,14 +1062,14 @@ FilterNodePremultiplyAdapterD2D1::FilterNodePremultiplyAdapterD2D1(ID2D1DeviceCo
|
||||
|
||||
hr = aDC->CreateEffect(CLSID_D2D1Premultiply, byRef(mPrePremultiplyEffect));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
if (FAILED(hr) || !mPrePremultiplyEffect) {
|
||||
gfxWarning() << "Failed to create ComponentTransfer filter!";
|
||||
return;
|
||||
}
|
||||
|
||||
hr = aDC->CreateEffect(CLSID_D2D1UnPremultiply, byRef(mPostUnpremultiplyEffect));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
if (FAILED(hr) || !mPostUnpremultiplyEffect) {
|
||||
gfxWarning() << "Failed to create ComponentTransfer filter!";
|
||||
return;
|
||||
}
|
||||
|
@ -161,13 +161,16 @@ As we saw in a previous section, the input event needs to be untransformed by th
|
||||
But, because of the preventDefault problem, we cannot fully process the touch event in the APZ code until content has had a chance to handle it.
|
||||
Web browsers in general solve this problem by inserting a delay of up to 300ms before processing the input - that is, web content is allowed up to 300ms to process the event and call preventDefault on it.
|
||||
If web content takes longer than 300ms, or if it completes handling of the event without calling preventDefault, then the browser immediately starts processing the events.
|
||||
The touch-action CSS property from the pointer-events spec is intended to allow eliminating this 300ms delay, although for backwards compatibility it will still be needed for a while.
|
||||
|
||||
The way the APZ implementation deals with this is that upon receiving a touch event, it immediately returns an untransformed version that can be dispatched to content.
|
||||
It also schedules a 300ms timeout during which content is allowed to prevent scrolling.
|
||||
There is an API that allows the main-thread event dispatching code to notify the APZ as to whether or not the default action should be prevented.
|
||||
If the APZ content response timeout expires, or if the main-thread event dispatching code notifies the APZ of the preventDefault status, then the APZ continues with the processing of the events (which may involve discarding the events).
|
||||
|
||||
The touch-action CSS property from the pointer-events spec is intended to allow eliminating this 300ms delay in many cases (although for backwards compatibility it will still be needed for a while).
|
||||
Note that even with touch-action implemented, there may be cases where the APZ code does not know the touch-action behaviour of the point the user touched.
|
||||
In such cases, the APZ code will still wait up to 300ms for the main thread to provide it with the touch-action behaviour information.
|
||||
|
||||
## Technical details
|
||||
|
||||
This section describes various pieces of the APZ code, and goes into more specific detail on APIs and code than the previous sections.
|
||||
|
@ -53,7 +53,7 @@ WrapTexCoord(GLfloat v)
|
||||
|
||||
void
|
||||
DecomposeIntoNoRepeatTriangles(const gfx::IntRect& aTexCoordRect,
|
||||
const nsIntSize& aTexSize,
|
||||
const gfx::IntSize& aTexSize,
|
||||
RectTriangles& aRects,
|
||||
bool aFlipY /* = false */)
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ private:
|
||||
* and rects.numRects * 3 * 6
|
||||
*/
|
||||
void DecomposeIntoNoRepeatTriangles(const gfx::IntRect& aTexCoordRect,
|
||||
const nsIntSize& aTexSize,
|
||||
const gfx::IntSize& aTexSize,
|
||||
RectTriangles& aRects,
|
||||
bool aFlipY = false);
|
||||
|
||||
|
@ -109,10 +109,10 @@ public:
|
||||
void BindOffscreenFramebuffer();
|
||||
|
||||
static already_AddRefed<GLContextEGL>
|
||||
CreateEGLPixmapOffscreenContext(const gfxIntSize& size);
|
||||
CreateEGLPixmapOffscreenContext(const gfx::IntSize& size);
|
||||
|
||||
static already_AddRefed<GLContextEGL>
|
||||
CreateEGLPBufferOffscreenContext(const gfxIntSize& size);
|
||||
CreateEGLPBufferOffscreenContext(const gfx::IntSize& size);
|
||||
|
||||
protected:
|
||||
friend class GLContextProviderEGL;
|
||||
@ -135,7 +135,7 @@ protected:
|
||||
|
||||
static EGLSurface CreatePBufferSurfaceTryingPowerOfTwo(EGLConfig config,
|
||||
EGLenum bindToTextureFormat,
|
||||
gfxIntSize& pbsize);
|
||||
gfx::IntSize& pbsize);
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "SurfaceTypes.h"
|
||||
|
||||
#include "nsSize.h" // for gfxIntSize (needed by GLContextProviderImpl.h below)
|
||||
#include "nsSize.h" // for gfx::IntSize (needed by GLContextProviderImpl.h below)
|
||||
|
||||
class nsIWidget;
|
||||
|
||||
|
@ -303,7 +303,7 @@ GLContextProviderCGL::CreateHeadless(bool requireCompatProfile)
|
||||
}
|
||||
|
||||
already_AddRefed<GLContext>
|
||||
GLContextProviderCGL::CreateOffscreen(const gfxIntSize& size,
|
||||
GLContextProviderCGL::CreateOffscreen(const IntSize& size,
|
||||
const SurfaceCaps& caps,
|
||||
bool requireCompatProfile)
|
||||
{
|
||||
|
@ -549,7 +549,7 @@ GLContextEGL::CreateGLContext(const SurfaceCaps& caps,
|
||||
EGLSurface
|
||||
GLContextEGL::CreatePBufferSurfaceTryingPowerOfTwo(EGLConfig config,
|
||||
EGLenum bindToTextureFormat,
|
||||
gfxIntSize& pbsize)
|
||||
mozilla::gfx::IntSize& pbsize)
|
||||
{
|
||||
nsTArray<EGLint> pbattrs(16);
|
||||
EGLSurface surface = nullptr;
|
||||
@ -838,7 +838,7 @@ GLContextProviderEGL::DestroyEGLSurface(EGLSurface surface)
|
||||
#endif // defined(ANDROID)
|
||||
|
||||
already_AddRefed<GLContextEGL>
|
||||
GLContextEGL::CreateEGLPBufferOffscreenContext(const gfxIntSize& size)
|
||||
GLContextEGL::CreateEGLPBufferOffscreenContext(const mozilla::gfx::IntSize& size)
|
||||
{
|
||||
EGLConfig config;
|
||||
EGLSurface surface;
|
||||
@ -861,7 +861,7 @@ GLContextEGL::CreateEGLPBufferOffscreenContext(const gfxIntSize& size)
|
||||
if (GLContext::ShouldSpew())
|
||||
sEGLLibrary.DumpEGLConfig(config);
|
||||
|
||||
gfxIntSize pbSize(size);
|
||||
mozilla::gfx::IntSize pbSize(size);
|
||||
surface = GLContextEGL::CreatePBufferSurfaceTryingPowerOfTwo(config,
|
||||
LOCAL_EGL_NONE,
|
||||
pbSize);
|
||||
@ -891,7 +891,7 @@ GLContextEGL::CreateEGLPBufferOffscreenContext(const gfxIntSize& size)
|
||||
}
|
||||
|
||||
already_AddRefed<GLContextEGL>
|
||||
GLContextEGL::CreateEGLPixmapOffscreenContext(const gfxIntSize& size)
|
||||
GLContextEGL::CreateEGLPixmapOffscreenContext(const mozilla::gfx::IntSize& size)
|
||||
{
|
||||
gfxASurface *thebesSurface = nullptr;
|
||||
EGLNativePixmapType pixmap = 0;
|
||||
@ -937,7 +937,7 @@ GLContextProviderEGL::CreateHeadless(bool)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
gfxIntSize dummySize = gfxIntSize(16, 16);
|
||||
mozilla::gfx::IntSize dummySize = mozilla::gfx::IntSize(16, 16);
|
||||
nsRefPtr<GLContext> glContext;
|
||||
glContext = GLContextEGL::CreateEGLPBufferOffscreenContext(dummySize);
|
||||
if (!glContext)
|
||||
@ -949,7 +949,7 @@ GLContextProviderEGL::CreateHeadless(bool)
|
||||
// Under EGL, on Android, pbuffers are supported fine, though
|
||||
// often without the ability to texture from them directly.
|
||||
already_AddRefed<GLContext>
|
||||
GLContextProviderEGL::CreateOffscreen(const gfxIntSize& size,
|
||||
GLContextProviderEGL::CreateOffscreen(const mozilla::gfx::IntSize& size,
|
||||
const SurfaceCaps& caps,
|
||||
bool requireCompatProfile)
|
||||
{
|
||||
|
@ -1099,7 +1099,7 @@ GLContextProviderGLX::CreateForWindow(nsIWidget *aWidget)
|
||||
}
|
||||
|
||||
static already_AddRefed<GLContextGLX>
|
||||
CreateOffscreenPixmapContext(const gfxIntSize& size)
|
||||
CreateOffscreenPixmapContext(const IntSize& size)
|
||||
{
|
||||
GLXLibrary& glx = sGLXLibrary;
|
||||
if (!glx.EnsureInitialized()) {
|
||||
@ -1162,7 +1162,7 @@ CreateOffscreenPixmapContext(const gfxIntSize& size)
|
||||
GLXPixmap glxpixmap = 0;
|
||||
bool error = false;
|
||||
|
||||
gfxIntSize dummySize(16, 16);
|
||||
IntSize dummySize(16, 16);
|
||||
nsRefPtr<gfxXlibSurface> xsurface = gfxXlibSurface::Create(DefaultScreenOfDisplay(display),
|
||||
visual,
|
||||
dummySize);
|
||||
@ -1217,7 +1217,7 @@ DONE_CREATING_PIXMAP:
|
||||
already_AddRefed<GLContext>
|
||||
GLContextProviderGLX::CreateHeadless(bool)
|
||||
{
|
||||
gfxIntSize dummySize = gfxIntSize(16, 16);
|
||||
IntSize dummySize = IntSize(16, 16);
|
||||
nsRefPtr<GLContext> glContext = CreateOffscreenPixmapContext(dummySize);
|
||||
if (!glContext)
|
||||
return nullptr;
|
||||
@ -1226,7 +1226,7 @@ GLContextProviderGLX::CreateHeadless(bool)
|
||||
}
|
||||
|
||||
already_AddRefed<GLContext>
|
||||
GLContextProviderGLX::CreateOffscreen(const gfxIntSize& size,
|
||||
GLContextProviderGLX::CreateOffscreen(const IntSize& size,
|
||||
const SurfaceCaps& caps,
|
||||
bool requireCompatProfile)
|
||||
{
|
||||
@ -1260,7 +1260,7 @@ GLContextProviderGLX::GetGlobalContext()
|
||||
if (!triedToCreateContext && !gGlobalContext) {
|
||||
triedToCreateContext = true;
|
||||
|
||||
gfxIntSize dummySize = gfxIntSize(16, 16);
|
||||
IntSize dummySize = IntSize(16, 16);
|
||||
// StaticPtr doesn't support assignments from already_AddRefed,
|
||||
// so use a temporary nsRefPtr to make the reference counting
|
||||
// fall out correctly.
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
* @return Context to use for offscreen rendering
|
||||
*/
|
||||
static already_AddRefed<GLContext>
|
||||
CreateOffscreen(const gfxIntSize& size,
|
||||
CreateOffscreen(const mozilla::gfx::IntSize& size,
|
||||
const SurfaceCaps& caps,
|
||||
bool requireCompatProfile);
|
||||
|
||||
|
@ -21,7 +21,7 @@ GLContextProviderNull::CreateWrappingExisting(void*, void*)
|
||||
}
|
||||
|
||||
already_AddRefed<GLContext>
|
||||
GLContextProviderNull::CreateOffscreen(const gfxIntSize&,
|
||||
GLContextProviderNull::CreateOffscreen(const gfx::IntSize&,
|
||||
const SurfaceCaps&,
|
||||
bool)
|
||||
{
|
||||
|
@ -362,7 +362,7 @@ GLContextWGL::SetupLookupFunction()
|
||||
}
|
||||
|
||||
static bool
|
||||
GetMaxSize(HDC hDC, int format, gfxIntSize& size)
|
||||
GetMaxSize(HDC hDC, int format, IntSize& size)
|
||||
{
|
||||
int query[] = {LOCAL_WGL_MAX_PBUFFER_WIDTH_ARB, LOCAL_WGL_MAX_PBUFFER_HEIGHT_ARB};
|
||||
int result[2];
|
||||
@ -378,9 +378,9 @@ GetMaxSize(HDC hDC, int format, gfxIntSize& size)
|
||||
|
||||
static bool
|
||||
IsValidSizeForFormat(HDC hDC, int format,
|
||||
const gfxIntSize& requested)
|
||||
const IntSize& requested)
|
||||
{
|
||||
gfxIntSize max;
|
||||
IntSize max;
|
||||
if (!GetMaxSize(hDC, format, max))
|
||||
return true;
|
||||
|
||||
@ -466,7 +466,7 @@ GLContextProviderWGL::CreateForWindow(nsIWidget *aWidget)
|
||||
}
|
||||
|
||||
static already_AddRefed<GLContextWGL>
|
||||
CreatePBufferOffscreenContext(const gfxIntSize& aSize,
|
||||
CreatePBufferOffscreenContext(const IntSize& aSize,
|
||||
GLContextWGL *aShareContext)
|
||||
{
|
||||
WGLLibrary& wgl = sWGLLib;
|
||||
@ -620,7 +620,7 @@ GLContextProviderWGL::CreateHeadless(bool)
|
||||
if (sWGLLib.fCreatePbuffer &&
|
||||
sWGLLib.fChoosePixelFormat)
|
||||
{
|
||||
gfxIntSize dummySize = gfxIntSize(16, 16);
|
||||
IntSize dummySize = IntSize(16, 16);
|
||||
glContext = CreatePBufferOffscreenContext(dummySize, GetGlobalContextWGL());
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ CreateTextureImage(GLContext* gl,
|
||||
|
||||
static already_AddRefed<TextureImage>
|
||||
TileGenFunc(GLContext* gl,
|
||||
const nsIntSize& aSize,
|
||||
const IntSize& aSize,
|
||||
TextureImage::ContentType aContentType,
|
||||
TextureImage::Flags aFlags,
|
||||
TextureImage::ImageFormat aImageFormat)
|
||||
@ -633,7 +633,7 @@ void TiledTextureImage::Resize(const gfx::IntSize& aSize)
|
||||
|
||||
int col;
|
||||
for (col = 0; col < (int)columns; col++) {
|
||||
nsIntSize size( // use tilesize first, then the remainder
|
||||
IntSize size( // use tilesize first, then the remainder
|
||||
(col+1) * mTileSize > (unsigned int)aSize.width ? aSize.width % mTileSize : mTileSize,
|
||||
(row+1) * mTileSize > (unsigned int)aSize.height ? aSize.height % mTileSize : mTileSize);
|
||||
|
||||
|
@ -19,7 +19,7 @@ class TextureImageCGL : public BasicTextureImage
|
||||
public:
|
||||
|
||||
TextureImageCGL(GLuint aTexture,
|
||||
const nsIntSize& aSize,
|
||||
const gfx::IntSize& aSize,
|
||||
GLenum aWrapMode,
|
||||
ContentType aContentType,
|
||||
GLContext* aContext,
|
||||
@ -49,7 +49,7 @@ CreateTextureImageCGL(GLContext *gl,
|
||||
|
||||
already_AddRefed<TextureImage>
|
||||
TileGenFuncCGL(GLContext *gl,
|
||||
const nsIntSize& aSize,
|
||||
const gfx::IntSize& aSize,
|
||||
TextureImage::ContentType aContentType,
|
||||
TextureImage::Flags aFlags,
|
||||
TextureImage::ImageFormat aImageFormat);
|
||||
|
@ -17,7 +17,7 @@ using namespace gfx;
|
||||
namespace gl {
|
||||
|
||||
TextureImageCGL::TextureImageCGL(GLuint aTexture,
|
||||
const nsIntSize& aSize,
|
||||
const IntSize& aSize,
|
||||
GLenum aWrapMode,
|
||||
ContentType aContentType,
|
||||
GLContext* aContext,
|
||||
@ -81,7 +81,7 @@ CreateTextureImageCGL(GLContext* gl,
|
||||
|
||||
already_AddRefed<TextureImage>
|
||||
TileGenFuncCGL(GLContext *gl,
|
||||
const nsIntSize& aSize,
|
||||
const IntSize& aSize,
|
||||
TextureImage::ContentType aContentType,
|
||||
TextureImage::Flags aFlags,
|
||||
TextureImage::ImageFormat aImageFormat)
|
||||
|
@ -48,7 +48,7 @@ GLTypeForImage(gfx::SurfaceFormat aFormat)
|
||||
}
|
||||
|
||||
TextureImageEGL::TextureImageEGL(GLuint aTexture,
|
||||
const nsIntSize& aSize,
|
||||
const gfx::IntSize& aSize,
|
||||
GLenum aWrapMode,
|
||||
ContentType aContentType,
|
||||
GLContext* aContext,
|
||||
@ -318,7 +318,7 @@ CreateTextureImageEGL(GLContext *gl,
|
||||
|
||||
already_AddRefed<TextureImage>
|
||||
TileGenFuncEGL(GLContext *gl,
|
||||
const nsIntSize& aSize,
|
||||
const gfx::IntSize& aSize,
|
||||
TextureImage::ContentType aContentType,
|
||||
TextureImage::Flags aFlags,
|
||||
TextureImage::ImageFormat aImageFormat)
|
||||
|
@ -16,7 +16,7 @@ class TextureImageEGL final
|
||||
{
|
||||
public:
|
||||
TextureImageEGL(GLuint aTexture,
|
||||
const nsIntSize& aSize,
|
||||
const gfx::IntSize& aSize,
|
||||
GLenum aWrapMode,
|
||||
ContentType aContentType,
|
||||
GLContext* aContext,
|
||||
@ -87,7 +87,7 @@ CreateTextureImageEGL(GLContext *gl,
|
||||
|
||||
already_AddRefed<TextureImage>
|
||||
TileGenFuncEGL(GLContext *gl,
|
||||
const nsIntSize& aSize,
|
||||
const gfx::IntSize& aSize,
|
||||
TextureImage::ContentType aContentType,
|
||||
TextureImage::Flags aFlags,
|
||||
TextureImage::ImageFormat aImageFormat);
|
||||
|
@ -426,9 +426,9 @@ struct ParamTraits<nsIntRegion>
|
||||
{};
|
||||
|
||||
template<>
|
||||
struct ParamTraits<nsIntSize>
|
||||
struct ParamTraits<mozilla::gfx::IntSize>
|
||||
{
|
||||
typedef nsIntSize paramType;
|
||||
typedef mozilla::gfx::IntSize paramType;
|
||||
|
||||
static void Write(Message* msg, const paramType& param)
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ SharedDIBSurface::InitSurface(uint32_t aWidth, uint32_t aHeight,
|
||||
|
||||
gfxImageFormat format = aTransparent ? gfxImageFormat::ARGB32 : gfxImageFormat::RGB24;
|
||||
|
||||
gfxImageSurface::InitWithData(data, gfxIntSize(aWidth, aHeight),
|
||||
gfxImageSurface::InitWithData(data, IntSize(aWidth, aHeight),
|
||||
stride, format);
|
||||
|
||||
cairo_surface_set_user_data(mSurface, &SHAREDDIB_KEY, this, nullptr);
|
||||
|
@ -16,10 +16,10 @@
|
||||
#include "gfx2DGlue.h" // for thebes --> moz2d transition
|
||||
#include "mozilla/gfx/BaseSize.h" // for BaseSize
|
||||
#include "mozilla/gfx/Tools.h"
|
||||
#include "mozilla/gfx/Point.h" // for IntSize
|
||||
#include "nsDebug.h" // for NS_ASSERTION, NS_WARNING, etc
|
||||
#include "nsISupportsImpl.h" // for gfxContext::AddRef, etc
|
||||
#include "nsRect.h" // for mozilla::gfx::IntRect
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
#include "gfxUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "nsDebug.h" // for NS_ASSERTION
|
||||
#include "nsISupportsImpl.h" // for Image::Release, etc
|
||||
#include "nsRect.h" // for mozilla::gfx::IntRect
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
#include "nsTArray.h" // for nsTArray
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/WeakPtr.h"
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "ImageDataSerializer.h"
|
||||
#include "gfx2DGlue.h" // for SurfaceFormatToImageFormat
|
||||
#include "gfxPoint.h" // for gfxIntSize
|
||||
#include "mozilla/gfx/Point.h" // for IntSize
|
||||
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
||||
#include "mozilla/gfx/2D.h" // for DataSourceSurface, Factory
|
||||
#include "mozilla/gfx/Logging.h" // for gfxDebug
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "nsISupportsImpl.h" // for Layer::Release, etc
|
||||
#include "nsRect.h" // for mozilla::gfx::IntRect
|
||||
#include "nsRegion.h" // for nsIntRegion
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
#include "nsString.h" // for nsCString
|
||||
#include "nsTArray.h" // for nsTArray
|
||||
#include "nsTArrayForwardDeclare.h" // for InfallibleTArray
|
||||
|
@ -9,10 +9,10 @@
|
||||
#include <stdint.h> // for uint8_t
|
||||
#include "gfxColor.h" // for gfxRGBA
|
||||
#include "mozilla/gfx/Matrix.h" // for Matrix4x4, Matrix
|
||||
#include "mozilla/gfx/Point.h" // for IntSize
|
||||
#include "nsDebug.h" // for NS_ERROR
|
||||
#include "nsPoint.h" // for nsIntPoint
|
||||
#include "nsRect.h" // for mozilla::gfx::IntRect
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
|
@ -16,12 +16,12 @@
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/gfx/BasePoint.h" // for BasePoint
|
||||
#include "mozilla/gfx/BaseRect.h" // for BaseRect
|
||||
#include "mozilla/gfx/Point.h" // for Intsize
|
||||
#include "nsAutoPtr.h" // for nsRefPtr, nsAutoPtr
|
||||
#include "nsDebug.h" // for NS_ASSERTION
|
||||
#include "nsISupportsImpl.h" // for gfxContext::Release, etc
|
||||
#include "nsPoint.h" // for nsIntPoint
|
||||
#include "nsRegion.h" // for nsIntRegion
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "mozilla/gfx/Types.h" // for ExtendMode::ExtendMode::CLAMP, etc
|
||||
#include "mozilla/layers/ShadowLayers.h" // for ShadowableLayer
|
||||
#include "mozilla/layers/TextureClient.h" // for TextureClient
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
#include "mozilla/gfx/Point.h" // for IntSize
|
||||
#include "gfx2DGlue.h"
|
||||
#include "nsLayoutUtils.h" // for invalidation debugging
|
||||
|
||||
|
@ -105,8 +105,7 @@ TextureClientMemoryDIB::AllocateForSurface(gfx::IntSize aSize, TextureAllocation
|
||||
MOZ_ASSERT(!IsAllocated());
|
||||
mSize = aSize;
|
||||
|
||||
mSurface = new gfxWindowsSurface(gfxIntSize(aSize.width, aSize.height),
|
||||
SurfaceFormatToImageFormat(mFormat));
|
||||
mSurface = new gfxWindowsSurface(aSize, SurfaceFormatToImageFormat(mFormat));
|
||||
if (!mSurface || mSurface->CairoStatus())
|
||||
{
|
||||
NS_WARNING("Could not create surface");
|
||||
|
@ -1915,6 +1915,13 @@ void AsyncPanZoomController::HandlePanningWithTouchAction(double aAngle) {
|
||||
} else {
|
||||
SetState(NOTHING);
|
||||
}
|
||||
if (!IsInPanningState()) {
|
||||
// If we didn't enter a panning state because touch-action disallowed it,
|
||||
// make sure to clear any leftover velocity from the pre-threshold
|
||||
// touchmoves.
|
||||
mX.SetVelocity(0);
|
||||
mY.SetVelocity(0);
|
||||
}
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::HandlePanning(double aAngle) {
|
||||
@ -1974,11 +1981,6 @@ nsEventStatus AsyncPanZoomController::StartPanning(const MultiTouchInput& aEvent
|
||||
float dx = mX.PanDistance(point.x);
|
||||
float dy = mY.PanDistance(point.y);
|
||||
|
||||
// When the touch move breaks through the pan threshold, reposition the touch down origin
|
||||
// so the page won't jump when we start panning.
|
||||
mX.StartTouch(point.x, aEvent.mTime);
|
||||
mY.StartTouch(point.y, aEvent.mTime);
|
||||
|
||||
double angle = atan2(dy, dx); // range [-pi, pi]
|
||||
angle = fabs(angle); // range [0, pi]
|
||||
|
||||
|
@ -126,6 +126,12 @@ CancelableBlockState::TimeoutContentResponse()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
CancelableBlockState::IsContentResponseTimerExpired() const
|
||||
{
|
||||
return mContentResponseTimerExpired;
|
||||
}
|
||||
|
||||
bool
|
||||
CancelableBlockState::IsDefaultPrevented() const
|
||||
{
|
||||
@ -136,8 +142,9 @@ CancelableBlockState::IsDefaultPrevented() const
|
||||
bool
|
||||
CancelableBlockState::IsReadyForHandling() const
|
||||
{
|
||||
if (!IsTargetConfirmed())
|
||||
if (!IsTargetConfirmed()) {
|
||||
return false;
|
||||
}
|
||||
return mContentResponded || mContentResponseTimerExpired;
|
||||
}
|
||||
|
||||
@ -447,7 +454,7 @@ TouchBlockState::CopyPropertiesFrom(const TouchBlockState& aOther)
|
||||
{
|
||||
TBS_LOG("%p copying properties from %p\n", this, &aOther);
|
||||
if (gfxPrefs::TouchActionEnabled()) {
|
||||
MOZ_ASSERT(aOther.mAllowedTouchBehaviorSet);
|
||||
MOZ_ASSERT(aOther.mAllowedTouchBehaviorSet || aOther.IsContentResponseTimerExpired());
|
||||
SetAllowedTouchBehaviors(aOther.mAllowedTouchBehaviors);
|
||||
}
|
||||
mTransformToApzc = aOther.mTransformToApzc;
|
||||
@ -460,11 +467,11 @@ TouchBlockState::IsReadyForHandling() const
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: for long-tap blocks we probably don't need the touch behaviour?
|
||||
if (gfxPrefs::TouchActionEnabled() && !mAllowedTouchBehaviorSet) {
|
||||
return false;
|
||||
if (!gfxPrefs::TouchActionEnabled()) {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
return mAllowedTouchBehaviorSet || IsContentResponseTimerExpired();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -100,6 +100,11 @@ public:
|
||||
*/
|
||||
bool TimeoutContentResponse();
|
||||
|
||||
/**
|
||||
* Checks if the content response timer has already expired.
|
||||
*/
|
||||
bool IsContentResponseTimerExpired() const;
|
||||
|
||||
/**
|
||||
* @return true iff web content cancelled this block of events.
|
||||
*/
|
||||
|
@ -83,6 +83,11 @@ InputQueue::ReceiveTouchInput(const nsRefPtr<AsyncPanZoomController>& aTarget,
|
||||
haveBehaviors = true;
|
||||
} else if (!mInputBlockQueue.IsEmpty() && CurrentBlock()->AsTouchBlock()) {
|
||||
haveBehaviors = CurrentTouchBlock()->GetAllowedTouchBehaviors(currentBehaviors);
|
||||
// If the behaviours aren't set, but the main-thread response timer on
|
||||
// the block is expired we still treat it as though it has behaviors,
|
||||
// because in that case we still want to interrupt the fast-fling and
|
||||
// use the default behaviours.
|
||||
haveBehaviors |= CurrentTouchBlock()->IsContentResponseTimerExpired();
|
||||
}
|
||||
|
||||
block = StartNewTouchBlock(aTarget, aTargetConfirmed, false);
|
||||
@ -221,19 +226,26 @@ void
|
||||
InputQueue::MaybeRequestContentResponse(const nsRefPtr<AsyncPanZoomController>& aTarget,
|
||||
CancelableBlockState* aBlock)
|
||||
{
|
||||
bool waitForMainThread = !aBlock->IsTargetConfirmed();
|
||||
bool waitForMainThread = false;
|
||||
if (aBlock->IsTargetConfirmed()) {
|
||||
// Content won't prevent-default this, so we can just set the flag directly.
|
||||
INPQ_LOG("not waiting for content response on block %p\n", aBlock);
|
||||
aBlock->SetContentResponse(false);
|
||||
} else {
|
||||
waitForMainThread = true;
|
||||
}
|
||||
if (aBlock->AsTouchBlock() && gfxPrefs::TouchActionEnabled()) {
|
||||
// TODO: once bug 1101628 is fixed, waitForMainThread should only be set
|
||||
// to true if the APZCTM didn't know the touch-action behaviours for this
|
||||
// block.
|
||||
waitForMainThread = true;
|
||||
}
|
||||
if (waitForMainThread) {
|
||||
// We either don't know for sure if aTarget is the right APZC, or we may
|
||||
// need to wait to give content the opportunity to prevent-default the
|
||||
// touch events. Either way we schedule a timeout so the main thread stuff
|
||||
// can run.
|
||||
ScheduleMainThreadTimeout(aTarget, aBlock->GetBlockId());
|
||||
} else {
|
||||
// Content won't prevent-default this, so we can just pretend like we scheduled
|
||||
// a timeout and it expired. Note that we will still receive a ContentReceivedInputBlock
|
||||
// callback for this block, and so we need to make sure we adjust the touch balance.
|
||||
INPQ_LOG("not waiting for content response on block %p\n", aBlock);
|
||||
aBlock->TimeoutContentResponse();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "gfxMatrix.h" // for gfxMatrix
|
||||
#include "gfxPlatform.h" // for gfxPlatform
|
||||
#include "gfxPrefs.h" // for gfxPrefs
|
||||
#include "gfxPoint.h" // for gfxIntSize, gfxPoint
|
||||
#include "gfxPoint.h" // for IntSize, gfxPoint
|
||||
#include "gfxRect.h" // for gfxRect
|
||||
#include "gfxUtils.h" // for gfxUtils
|
||||
#include "gfx2DGlue.h" // for thebes --> moz2d transition
|
||||
@ -773,8 +773,8 @@ Transform3D(RefPtr<SourceSurface> aSource,
|
||||
|
||||
// Create a surface the size of the transformed object.
|
||||
nsRefPtr<gfxASurface> dest = aDest->CurrentSurface();
|
||||
nsRefPtr<gfxImageSurface> destImage = new gfxImageSurface(gfxIntSize(aDestRect.width,
|
||||
aDestRect.height),
|
||||
nsRefPtr<gfxImageSurface> destImage = new gfxImageSurface(IntSize(aDestRect.width,
|
||||
aDestRect.height),
|
||||
gfxImageFormat::ARGB32);
|
||||
gfxPoint offset = aDestRect.TopLeft();
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "gfxContext.h" // for gfxContext, etc
|
||||
#include "gfxPlatform.h" // for gfxPlatform
|
||||
#include "gfxPrefs.h" // for gfxPrefs
|
||||
#include "gfxPoint.h" // for gfxIntSize, gfxPoint
|
||||
#include "gfxPoint.h" // for IntSize, gfxPoint
|
||||
#include "gfxTeeSurface.h" // for gfxTeeSurface
|
||||
#include "gfxUtils.h" // for gfxUtils
|
||||
#include "ipc/ShadowLayers.h" // for ShadowLayerForwarder
|
||||
@ -293,7 +293,7 @@ ContentClientRemoteBuffer::BuildTextureClients(SurfaceFormat aFormat,
|
||||
DestroyBuffers();
|
||||
|
||||
mSurfaceFormat = aFormat;
|
||||
mSize = gfx::IntSize(aRect.width, aRect.height);
|
||||
mSize = IntSize(aRect.width, aRect.height);
|
||||
mTextureFlags = TextureFlagsForRotatedContentBufferFlags(aFlags);
|
||||
|
||||
if (aFlags & BUFFER_COMPONENT_ALPHA) {
|
||||
@ -309,7 +309,7 @@ ContentClientRemoteBuffer::CreateBackBuffer(const IntRect& aBufferRect)
|
||||
// gfx::BackendType::NONE means fallback to the content backend
|
||||
mTextureClient = CreateTextureClientForDrawing(
|
||||
mSurfaceFormat, mSize, gfx::BackendType::NONE,
|
||||
mTextureFlags,
|
||||
mTextureFlags | ExtraTextureFlags(),
|
||||
TextureAllocationFlags::ALLOC_CLEAR_BUFFER
|
||||
);
|
||||
if (!mTextureClient || !AddTextureClient(mTextureClient)) {
|
||||
@ -319,7 +319,7 @@ ContentClientRemoteBuffer::CreateBackBuffer(const IntRect& aBufferRect)
|
||||
|
||||
if (mTextureFlags & TextureFlags::COMPONENT_ALPHA) {
|
||||
mTextureClientOnWhite = mTextureClient->CreateSimilar(
|
||||
mTextureFlags,
|
||||
mTextureFlags | ExtraTextureFlags(),
|
||||
TextureAllocationFlags::ALLOC_CLEAR_BUFFER_WHITE
|
||||
);
|
||||
if (!mTextureClientOnWhite || !AddTextureClient(mTextureClientOnWhite)) {
|
||||
|
@ -259,6 +259,11 @@ public:
|
||||
virtual void CreateBuffer(ContentType aType, const gfx::IntRect& aRect, uint32_t aFlags,
|
||||
RefPtr<gfx::DrawTarget>* aBlackDT, RefPtr<gfx::DrawTarget>* aWhiteDT) override;
|
||||
|
||||
virtual TextureFlags ExtraTextureFlags() const
|
||||
{
|
||||
return TextureFlags::NO_FLAGS;
|
||||
}
|
||||
|
||||
protected:
|
||||
void DestroyBuffers();
|
||||
|
||||
@ -390,7 +395,12 @@ public:
|
||||
|
||||
virtual TextureInfo GetTextureInfo() const override
|
||||
{
|
||||
return TextureInfo(CompositableType::CONTENT_SINGLE, mTextureFlags);
|
||||
return TextureInfo(CompositableType::CONTENT_SINGLE, mTextureFlags | ExtraTextureFlags());
|
||||
}
|
||||
|
||||
virtual TextureFlags ExtraTextureFlags() const override
|
||||
{
|
||||
return TextureFlags::IMMEDIATE_UPLOAD;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "TextureClientPool.h"
|
||||
#include "nsDebug.h" // for NS_ASSERTION
|
||||
#include "nsISupportsImpl.h" // for gfxContext::AddRef, etc
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
#include "gfxReusableSharedImageSurfaceWrapper.h"
|
||||
#include "nsExpirationTracker.h" // for nsExpirationTracker
|
||||
#include "nsMathUtils.h" // for NS_lroundf
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "PaintedLayerComposite.h" // for PaintedLayerComposite
|
||||
#include "mozilla/gfx/BaseSize.h" // for BaseSize
|
||||
#include "mozilla/gfx/Matrix.h" // for Matrix4x4
|
||||
#include "mozilla/gfx/Point.h" // for IntSize
|
||||
#include "mozilla/layers/Compositor.h" // for Compositor
|
||||
#include "mozilla/layers/Effects.h" // for TexturedEffect, Effect, etc
|
||||
#include "mozilla/layers/LayerMetricsWrapper.h" // for LayerMetricsWrapper
|
||||
@ -16,7 +17,6 @@
|
||||
#include "nsPoint.h" // for IntPoint
|
||||
#include "nsPrintfCString.h" // for nsPrintfCString
|
||||
#include "nsRect.h" // for IntRect
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
#include "mozilla/layers/TiledContentClient.h"
|
||||
|
||||
class gfxReusableSurfaceWrapper;
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "mozilla/Monitor.h" // for Monitor
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "mozilla/TimeStamp.h" // for TimeStamp
|
||||
#include "mozilla/gfx/Point.h" // for IntSize
|
||||
#include "mozilla/ipc/ProtocolUtils.h"
|
||||
#include "mozilla/layers/GeckoContentController.h"
|
||||
#include "mozilla/layers/LayersMessages.h" // for TargetConfig
|
||||
@ -33,7 +34,6 @@
|
||||
#include "mozilla/layers/APZTestData.h"
|
||||
#include "nsAutoPtr.h" // for nsRefPtr
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
#include "ThreadSafeRefcountingWithMainThreadDestruction.h"
|
||||
#include "mozilla/VsyncDispatcher.h"
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "mozilla/layers/TextureClient.h" // for TextureClient
|
||||
#include "mozilla/mozalloc.h" // for operator new, etc
|
||||
#include "nsAutoPtr.h" // for nsRefPtr, getter_AddRefs, etc
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc
|
||||
#include "nsXULAppAPI.h" // for XRE_GetProcessType, etc
|
||||
#include "mozilla/ReentrantMonitor.h"
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "Shmem.h" // for Shmem
|
||||
#include "gfx2DGlue.h" // for ImageFormatToSurfaceFormat, etc
|
||||
#include "gfxPlatform.h" // for gfxPlatform, gfxImageFormat
|
||||
#include "mozilla/gfx/Point.h" // for IntSIze
|
||||
#include "mozilla/layers/ISurfaceAllocator.h" // for ISurfaceAllocator, etc
|
||||
#include "mozilla/layers/ImageClient.h" // for ImageClient
|
||||
#include "mozilla/layers/ImageDataSerializer.h" // for ImageDataSerializer
|
||||
@ -18,7 +19,6 @@
|
||||
#include "nsDebug.h" // for NS_WARNING, NS_ASSERTION
|
||||
#include "nsISupportsImpl.h" // for Image::AddRef, etc
|
||||
#include "nsRect.h" // for mozilla::gfx::IntRect
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
|
||||
// Just big enough for a 1080p RGBA32 frame
|
||||
#define MAX_FRAME_SIZE (16 * 1024 * 1024)
|
||||
|
@ -126,8 +126,7 @@ CompositorOGL::CreateContext()
|
||||
caps.bpp16 = gfxPlatform::GetPlatform()->GetOffscreenFormat() == gfxImageFormat::RGB16_565;
|
||||
|
||||
bool requireCompatProfile = true;
|
||||
context = GLContextProvider::CreateOffscreen(gfxIntSize(mSurfaceSize.width,
|
||||
mSurfaceSize.height),
|
||||
context = GLContextProvider::CreateOffscreen(mSurfaceSize,
|
||||
caps, requireCompatProfile);
|
||||
}
|
||||
|
||||
@ -1342,7 +1341,7 @@ CompositorOGL::EndFrameForExternalComposition(const gfx::Matrix& aTransform)
|
||||
}
|
||||
|
||||
void
|
||||
CompositorOGL::SetDestinationSurfaceSize(const gfx::IntSize& aSize)
|
||||
CompositorOGL::SetDestinationSurfaceSize(const IntSize& aSize)
|
||||
{
|
||||
mSurfaceSize.width = aSize.width;
|
||||
mSurfaceSize.height = aSize.height;
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "nsCOMPtr.h" // for already_AddRefed
|
||||
#include "nsDebug.h" // for NS_ASSERTION, NS_WARNING
|
||||
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc
|
||||
#include "nsThreadUtils.h" // for nsRunnable
|
||||
#include "nsXULAppAPI.h" // for XRE_GetProcessType
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
||||
#include "mozilla/layers/ISurfaceAllocator.h"
|
||||
#include "mozilla/layers/TextureClientOGL.h"
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
#include "mozilla/gfx/Point.h" // for IntSize
|
||||
#include "GLLibraryEGL.h"
|
||||
|
||||
using namespace mozilla::gl;
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "nsCoord.h" // for nscoord, etc
|
||||
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
|
||||
#include "nsPoint.h" // for nsIntPoint, nsPoint
|
||||
#include "nsSize.h" // for nsIntSize, nsSize
|
||||
#include "nsSize.h" // for IntSize, nsSize
|
||||
#include "nscore.h" // for NS_BUILD_REFCNT_LOGGING
|
||||
|
||||
struct nsMargin;
|
||||
|
@ -22,9 +22,9 @@ struct nsSize : public mozilla::gfx::BaseSize<nscoord, nsSize> {
|
||||
nsSize() : Super() {}
|
||||
nsSize(nscoord aWidth, nscoord aHeight) : Super(aWidth, aHeight) {}
|
||||
|
||||
inline nsIntSize ScaleToNearestPixels(float aXScale, float aYScale,
|
||||
inline mozilla::gfx::IntSize ScaleToNearestPixels(float aXScale, float aYScale,
|
||||
nscoord aAppUnitsPerPixel) const;
|
||||
inline nsIntSize ToNearestPixels(nscoord aAppUnitsPerPixel) const;
|
||||
inline mozilla::gfx::IntSize ToNearestPixels(nscoord aAppUnitsPerPixel) const;
|
||||
|
||||
/**
|
||||
* Return this size scaled to a different appunits per pixel (APP) ratio.
|
||||
@ -35,16 +35,16 @@ struct nsSize : public mozilla::gfx::BaseSize<nscoord, nsSize> {
|
||||
ScaleToOtherAppUnits(int32_t aFromAPP, int32_t aToAPP) const;
|
||||
};
|
||||
|
||||
inline nsIntSize
|
||||
inline mozilla::gfx::IntSize
|
||||
nsSize::ScaleToNearestPixels(float aXScale, float aYScale,
|
||||
nscoord aAppUnitsPerPixel) const
|
||||
{
|
||||
return nsIntSize(
|
||||
return mozilla::gfx::IntSize(
|
||||
NSToIntRoundUp(NSAppUnitsToDoublePixels(width, aAppUnitsPerPixel) * aXScale),
|
||||
NSToIntRoundUp(NSAppUnitsToDoublePixels(height, aAppUnitsPerPixel) * aYScale));
|
||||
}
|
||||
|
||||
inline nsIntSize
|
||||
inline mozilla::gfx::IntSize
|
||||
nsSize::ToNearestPixels(nscoord aAppUnitsPerPixel) const
|
||||
{
|
||||
return ScaleToNearestPixels(1.0f, 1.0f, aAppUnitsPerPixel);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -45,7 +45,7 @@ public:
|
||||
caps.preserve = false;
|
||||
caps.bpp16 = false;
|
||||
nsRefPtr<GLContext> context = GLContextProvider::CreateOffscreen(
|
||||
gfxIntSize(gCompWidth, gCompHeight), caps, true);
|
||||
IntSize(gCompWidth, gCompHeight), caps, true);
|
||||
return context.forget().take();
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -269,7 +269,7 @@ TEST(Layers, TextureSerialization) {
|
||||
};
|
||||
|
||||
for (int f = 0; f < 3; ++f) {
|
||||
RefPtr<gfxImageSurface> surface = new gfxImageSurface(gfxIntSize(400,300), formats[f]);
|
||||
RefPtr<gfxImageSurface> surface = new gfxImageSurface(IntSize(400,300), formats[f]);
|
||||
SetupSurface(surface.get());
|
||||
AssertSurfacesEqual(surface, surface);
|
||||
|
||||
@ -286,9 +286,9 @@ TEST(Layers, TextureSerialization) {
|
||||
}
|
||||
|
||||
TEST(Layers, TextureYCbCrSerialization) {
|
||||
RefPtr<gfxImageSurface> ySurface = new gfxImageSurface(gfxIntSize(400,300), gfxImageFormat::A8);
|
||||
RefPtr<gfxImageSurface> cbSurface = new gfxImageSurface(gfxIntSize(200,150), gfxImageFormat::A8);
|
||||
RefPtr<gfxImageSurface> crSurface = new gfxImageSurface(gfxIntSize(200,150), gfxImageFormat::A8);
|
||||
RefPtr<gfxImageSurface> ySurface = new gfxImageSurface(IntSize(400,300), gfxImageFormat::A8);
|
||||
RefPtr<gfxImageSurface> cbSurface = new gfxImageSurface(IntSize(200,150), gfxImageFormat::A8);
|
||||
RefPtr<gfxImageSurface> crSurface = new gfxImageSurface(IntSize(200,150), gfxImageFormat::A8);
|
||||
SetupSurface(ySurface.get());
|
||||
SetupSurface(cbSurface.get());
|
||||
SetupSurface(crSurface.get());
|
||||
|
@ -44,7 +44,7 @@ TestNewSurface () {
|
||||
int failures = 0;
|
||||
int destroyed = 0;
|
||||
|
||||
nsRefPtr<gfxASurface> s = new gfxImageSurface (gfxIntSize(10, 10), gfxImageFormat::ARGB32);
|
||||
nsRefPtr<gfxASurface> s = new gfxImageSurface (mozilla::gfx::IntSize(10, 10), gfxImageFormat::ARGB32);
|
||||
cairo_surface_t *cs = s->CairoSurface();
|
||||
|
||||
cairo_surface_set_user_data (cs, &destruction_key, &destroyed, SurfaceDestroyNotifier);
|
||||
|
@ -155,7 +155,7 @@ gfxASurface::SetSurfaceWrapper(cairo_surface_t *csurf, gfxASurface *asurf)
|
||||
}
|
||||
|
||||
already_AddRefed<gfxASurface>
|
||||
gfxASurface::Wrap (cairo_surface_t *csurf, const gfxIntSize& aSize)
|
||||
gfxASurface::Wrap (cairo_surface_t *csurf, const IntSize& aSize)
|
||||
{
|
||||
nsRefPtr<gfxASurface> result;
|
||||
|
||||
@ -323,7 +323,7 @@ gfxASurface::Finish()
|
||||
|
||||
already_AddRefed<gfxASurface>
|
||||
gfxASurface::CreateSimilarSurface(gfxContentType aContent,
|
||||
const nsIntSize& aSize)
|
||||
const IntSize& aSize)
|
||||
{
|
||||
if (!mSurface || !mSurfaceValid) {
|
||||
return nullptr;
|
||||
@ -359,7 +359,7 @@ gfxASurface::CopyToARGB32ImageSurface()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const nsIntSize size = GetSize();
|
||||
const IntSize size = GetSize();
|
||||
nsRefPtr<gfxImageSurface> imgSurface =
|
||||
new gfxImageSurface(size, gfxImageFormat::ARGB32);
|
||||
|
||||
@ -382,7 +382,7 @@ gfxASurface::CairoStatus()
|
||||
|
||||
/* static */
|
||||
bool
|
||||
gfxASurface::CheckSurfaceSize(const nsIntSize& sz, int32_t limit)
|
||||
gfxASurface::CheckSurfaceSize(const IntSize& sz, int32_t limit)
|
||||
{
|
||||
if (sz.width < 0 || sz.height < 0) {
|
||||
NS_WARNING("Surface width or height < 0!");
|
||||
@ -702,10 +702,10 @@ gfxASurface::GetEmptyOpaqueRect()
|
||||
return empty;
|
||||
}
|
||||
|
||||
const nsIntSize
|
||||
const IntSize
|
||||
gfxASurface::GetSize() const
|
||||
{
|
||||
return nsIntSize(-1, -1);
|
||||
return IntSize(-1, -1);
|
||||
}
|
||||
|
||||
already_AddRefed<gfxImageSurface>
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
/** Wrap the given cairo surface and return a gfxASurface for it.
|
||||
* This adds a reference to csurf (owned by the returned gfxASurface).
|
||||
*/
|
||||
static already_AddRefed<gfxASurface> Wrap(cairo_surface_t *csurf, const gfxIntSize& aSize = gfxIntSize(-1, -1));
|
||||
static already_AddRefed<gfxASurface> Wrap(cairo_surface_t *csurf, const mozilla::gfx::IntSize& aSize = mozilla::gfx::IntSize(-1, -1));
|
||||
|
||||
/*** this DOES NOT addref the surface */
|
||||
cairo_surface_t *CairoSurface() {
|
||||
@ -90,7 +90,7 @@ public:
|
||||
* Returns null on error.
|
||||
*/
|
||||
virtual already_AddRefed<gfxASurface> CreateSimilarSurface(gfxContentType aType,
|
||||
const nsIntSize& aSize);
|
||||
const mozilla::gfx::IntSize& aSize);
|
||||
|
||||
/**
|
||||
* Returns an image surface for this surface, or nullptr if not supported.
|
||||
@ -118,7 +118,7 @@ public:
|
||||
* using 4 bytes per pixel; optionally, make sure that either dimension
|
||||
* doesn't exceed the given limit.
|
||||
*/
|
||||
static bool CheckSurfaceSize(const nsIntSize& sz, int32_t limit = 0);
|
||||
static bool CheckSurfaceSize(const mozilla::gfx::IntSize& sz, int32_t limit = 0);
|
||||
|
||||
/* Provide a stride value that will respect all alignment requirements of
|
||||
* the accelerated image-rendering code.
|
||||
@ -167,7 +167,7 @@ public:
|
||||
|
||||
static int32_t BytePerPixelFromFormat(gfxImageFormat format);
|
||||
|
||||
virtual const nsIntSize GetSize() const;
|
||||
virtual const mozilla::gfx::IntSize GetSize() const;
|
||||
|
||||
void SetOpaqueRect(const gfxRect& aRect);
|
||||
|
||||
@ -221,17 +221,17 @@ protected:
|
||||
*/
|
||||
class gfxUnknownSurface : public gfxASurface {
|
||||
public:
|
||||
gfxUnknownSurface(cairo_surface_t *surf, const gfxIntSize& aSize)
|
||||
gfxUnknownSurface(cairo_surface_t *surf, const mozilla::gfx::IntSize& aSize)
|
||||
: mSize(aSize)
|
||||
{
|
||||
Init(surf, true);
|
||||
}
|
||||
|
||||
virtual ~gfxUnknownSurface() { }
|
||||
virtual const nsIntSize GetSize() const override { return mSize; }
|
||||
virtual const mozilla::gfx::IntSize GetSize() const override { return mSize; }
|
||||
|
||||
private:
|
||||
nsIntSize mSize;
|
||||
mozilla::gfx::IntSize mSize;
|
||||
};
|
||||
|
||||
#endif /* GFX_ASURFACE_H */
|
||||
|
@ -14,7 +14,7 @@
|
||||
gfxAlphaRecovery::RecoverAlpha(gfxImageSurface* blackSurf,
|
||||
const gfxImageSurface* whiteSurf)
|
||||
{
|
||||
gfxIntSize size = blackSurf->GetSize();
|
||||
mozilla::gfx::IntSize size = blackSurf->GetSize();
|
||||
|
||||
if (size != whiteSurf->GetSize() ||
|
||||
(blackSurf->Format() != gfxImageFormat::ARGB32 &&
|
||||
|
@ -30,7 +30,7 @@ bool
|
||||
gfxAlphaRecovery::RecoverAlphaSSE2(gfxImageSurface* blackSurf,
|
||||
const gfxImageSurface* whiteSurf)
|
||||
{
|
||||
gfxIntSize size = blackSurf->GetSize();
|
||||
mozilla::gfx::IntSize size = blackSurf->GetSize();
|
||||
|
||||
if (size != whiteSurf->GetSize() ||
|
||||
(blackSurf->Format() != gfxImageFormat::ARGB32 &&
|
||||
@ -187,7 +187,7 @@ gfxAlphaRecovery::AlignRectForSubimageRecovery(const mozilla::gfx::IntRect& aRec
|
||||
// SIMD-ized alpha recovery won't make a difference so this code
|
||||
// shouldn't be called.)
|
||||
//
|
||||
gfxIntSize surfaceSize = aSurface->GetSize();
|
||||
mozilla::gfx::IntSize surfaceSize = aSurface->GetSize();
|
||||
const int32_t stride = bpp * surfaceSize.width;
|
||||
if (stride != aSurface->Stride()) {
|
||||
NS_WARNING("Unexpected stride, falling back on slow alpha recovery");
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
template<class ShmemAllocator>
|
||||
static already_AddRefed<Sub>
|
||||
Create(ShmemAllocator* aAllocator,
|
||||
const gfxIntSize& aSize,
|
||||
const mozilla::gfx::IntSize& aSize,
|
||||
gfxImageFormat aFormat,
|
||||
SharedMemory::SharedMemoryType aShmType = SharedMemory::TYPE_BASIC)
|
||||
{
|
||||
@ -74,7 +74,7 @@ public:
|
||||
Open(const Shmem& aShmem)
|
||||
{
|
||||
SharedImageInfo* shmInfo = GetShmInfoPtr(aShmem);
|
||||
gfxIntSize size(shmInfo->width, shmInfo->height);
|
||||
mozilla::gfx::IntSize size(shmInfo->width, shmInfo->height);
|
||||
if (!gfxASurface::CheckSurfaceSize(size))
|
||||
return nullptr;
|
||||
|
||||
@ -93,7 +93,7 @@ public:
|
||||
template<class ShmemAllocator>
|
||||
static already_AddRefed<Sub>
|
||||
CreateUnsafe(ShmemAllocator* aAllocator,
|
||||
const gfxIntSize& aSize,
|
||||
const mozilla::gfx::IntSize& aSize,
|
||||
gfxImageFormat aFormat,
|
||||
SharedMemory::SharedMemoryType aShmType = SharedMemory::TYPE_BASIC)
|
||||
{
|
||||
@ -110,7 +110,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
gfxBaseSharedMemorySurface(const gfxIntSize& aSize, long aStride,
|
||||
gfxBaseSharedMemorySurface(const mozilla::gfx::IntSize& aSize, long aStride,
|
||||
gfxImageFormat aFormat,
|
||||
const Shmem& aShmem)
|
||||
: Base(aShmem.get<unsigned char>(), aSize, aStride, aFormat)
|
||||
@ -152,7 +152,7 @@ private:
|
||||
return shmInfo->readCount;
|
||||
}
|
||||
|
||||
static size_t GetAlignedSize(const gfxIntSize& aSize, long aStride)
|
||||
static size_t GetAlignedSize(const mozilla::gfx::IntSize& aSize, long aStride)
|
||||
{
|
||||
#define MOZ_ALIGN_WORD(x) (((x) + 3) & ~3)
|
||||
return MOZ_ALIGN_WORD(sizeof(SharedImageInfo) + aSize.height * aStride);
|
||||
@ -161,7 +161,7 @@ private:
|
||||
template<class ShmemAllocator, bool Unsafe>
|
||||
static already_AddRefed<Sub>
|
||||
Create(ShmemAllocator* aAllocator,
|
||||
const gfxIntSize& aSize,
|
||||
const mozilla::gfx::IntSize& aSize,
|
||||
gfxImageFormat aFormat,
|
||||
SharedMemory::SharedMemoryType aShmType)
|
||||
{
|
||||
|
@ -29,8 +29,8 @@ gfxAlphaBoxBlur::~gfxAlphaBoxBlur()
|
||||
|
||||
gfxContext*
|
||||
gfxAlphaBoxBlur::Init(const gfxRect& aRect,
|
||||
const gfxIntSize& aSpreadRadius,
|
||||
const gfxIntSize& aBlurRadius,
|
||||
const IntSize& aSpreadRadius,
|
||||
const IntSize& aBlurRadius,
|
||||
const gfxRect* aDirtyRect,
|
||||
const gfxRect* aSkipRect)
|
||||
{
|
||||
@ -152,11 +152,11 @@ gfxAlphaBoxBlur::Paint(gfxContext* aDestinationCtx)
|
||||
DrawBlur(aDestinationCtx, mask, topLeft, dirtyRect);
|
||||
}
|
||||
|
||||
gfxIntSize gfxAlphaBoxBlur::CalculateBlurRadius(const gfxPoint& aStd)
|
||||
IntSize gfxAlphaBoxBlur::CalculateBlurRadius(const gfxPoint& aStd)
|
||||
{
|
||||
mozilla::gfx::Point std(Float(aStd.x), Float(aStd.y));
|
||||
IntSize size = AlphaBoxBlur::CalculateBlurRadius(std);
|
||||
return gfxIntSize(size.width, size.height);
|
||||
return IntSize(size.width, size.height);
|
||||
}
|
||||
|
||||
struct BlurCacheKey : public PLDHashEntryHdr {
|
||||
@ -165,11 +165,11 @@ struct BlurCacheKey : public PLDHashEntryHdr {
|
||||
enum { ALLOW_MEMMOVE = true };
|
||||
|
||||
gfxRect mRect;
|
||||
gfxIntSize mBlurRadius;
|
||||
IntSize mBlurRadius;
|
||||
gfxRect mSkipRect;
|
||||
BackendType mBackend;
|
||||
|
||||
BlurCacheKey(const gfxRect& aRect, const gfxIntSize &aBlurRadius, const gfxRect& aSkipRect, BackendType aBackend)
|
||||
BlurCacheKey(const gfxRect& aRect, const IntSize &aBlurRadius, const gfxRect& aSkipRect, BackendType aBackend)
|
||||
: mRect(aRect)
|
||||
, mBlurRadius(aBlurRadius)
|
||||
, mSkipRect(aSkipRect)
|
||||
@ -260,7 +260,7 @@ class BlurCache final : public nsExpirationTracker<BlurCacheData,4>
|
||||
}
|
||||
|
||||
BlurCacheData* Lookup(const gfxRect& aRect,
|
||||
const gfxIntSize& aBlurRadius,
|
||||
const IntSize& aBlurRadius,
|
||||
const gfxRect& aSkipRect,
|
||||
BackendType aBackendType,
|
||||
const gfxRect* aDirtyRect)
|
||||
@ -309,7 +309,7 @@ static BlurCache* gBlurCache = nullptr;
|
||||
SourceSurface*
|
||||
GetCachedBlur(DrawTarget *aDT,
|
||||
const gfxRect& aRect,
|
||||
const gfxIntSize& aBlurRadius,
|
||||
const IntSize& aBlurRadius,
|
||||
const gfxRect& aSkipRect,
|
||||
const gfxRect& aDirtyRect,
|
||||
IntPoint* aTopLeft)
|
||||
@ -330,7 +330,7 @@ GetCachedBlur(DrawTarget *aDT,
|
||||
void
|
||||
CacheBlur(DrawTarget *aDT,
|
||||
const gfxRect& aRect,
|
||||
const gfxIntSize& aBlurRadius,
|
||||
const IntSize& aBlurRadius,
|
||||
const gfxRect& aSkipRect,
|
||||
SourceSurface* aBlur,
|
||||
const IntPoint& aTopLeft,
|
||||
@ -372,14 +372,14 @@ gfxAlphaBoxBlur::BlurRectangle(gfxContext *aDestinationCtx,
|
||||
{
|
||||
DrawTarget& aDrawTarget = *aDestinationCtx->GetDrawTarget();
|
||||
|
||||
gfxIntSize blurRadius = CalculateBlurRadius(aBlurStdDev);
|
||||
IntSize blurRadius = CalculateBlurRadius(aBlurStdDev);
|
||||
|
||||
IntPoint topLeft;
|
||||
RefPtr<SourceSurface> surface = GetCachedBlur(&aDrawTarget, aRect, blurRadius, aSkipRect, aDirtyRect, &topLeft);
|
||||
if (!surface) {
|
||||
// Create the temporary surface for blurring
|
||||
gfxAlphaBoxBlur blur;
|
||||
gfxContext* blurCtx = blur.Init(aRect, gfxIntSize(), blurRadius, &aDirtyRect, &aSkipRect);
|
||||
gfxContext* blurCtx = blur.Init(aRect, IntSize(), blurRadius, &aDirtyRect, &aSkipRect);
|
||||
if (!blurCtx) {
|
||||
return;
|
||||
}
|
||||
|
@ -73,8 +73,8 @@ public:
|
||||
* for speed reasons. It is safe to pass nullptr here.
|
||||
*/
|
||||
gfxContext* Init(const gfxRect& aRect,
|
||||
const gfxIntSize& aSpreadRadius,
|
||||
const gfxIntSize& aBlurRadius,
|
||||
const mozilla::gfx::IntSize& aSpreadRadius,
|
||||
const mozilla::gfx::IntSize& aBlurRadius,
|
||||
const gfxRect* aDirtyRect,
|
||||
const gfxRect* aSkipRect);
|
||||
|
||||
@ -106,7 +106,7 @@ public:
|
||||
* this function should be used as the aBlurRadius parameter to Init,
|
||||
* above.
|
||||
*/
|
||||
static gfxIntSize CalculateBlurRadius(const gfxPoint& aStandardDeviation);
|
||||
static mozilla::gfx::IntSize CalculateBlurRadius(const gfxPoint& aStandardDeviation);
|
||||
|
||||
/**
|
||||
* Blurs a coloured rectangle onto aDestinationCtx. This is equivalent
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user