68.14.6 - everything else

This commit is contained in:
Fedor 2025-01-22 01:37:59 +02:00
parent 02671ecd7b
commit 9320211f15
1264 changed files with 111624 additions and 64984 deletions

View File

@ -37,11 +37,6 @@ browser/components/translation/cld2/
# Screenshots is imported as a system add-on and has
# their own lint rules currently.
browser/extensions/screenshots/
browser/extensions/pdfjs/content/build
browser/extensions/pdfjs/content/web
# generated or library files in pocket
browser/components/pocket/content/panels/js/tmpl.js
browser/components/pocket/content/panels/js/vendor/
# Ignore newtab files
# Kept in sync with browser/components/newtab/.eslintignore
@ -320,6 +315,10 @@ toolkit/components/extensions/profiler_get_symbols.js
# Intentionally invalid JS
toolkit/components/workerloader/tests/moduleF-syntax-error.js
# Built files
toolkit/components/pdfjs/content/build
toolkit/components/pdfjs/content/web
# External code:
toolkit/components/reader/Readability.js
toolkit/components/reader/JSDOMParser.js

View File

@ -9,7 +9,10 @@
# you are either running lldb from the top level source directory, the objdir,
# or the dist/bin directory. (.lldbinit files in the objdir and dist/bin set
# topsrcdir appropriately.)
script topsrcdir = topsrcdir if locals().has_key("topsrcdir") else os.getcwd(); sys.path.append(os.path.join(topsrcdir, "third_party/python/lldbutils")); import lldbutils; lldbutils.init()
script topsrcdir = topsrcdir if "topsrcdir" in locals() else os.getcwd()
script sys.path.append(os.path.join(topsrcdir, "python/lldbutils"))
script import lldbutils
script lldbutils.init()
# Mozilla's use of UNIFIED_SOURCES to include multiple source files into a
# single compiled file breaks lldb breakpoint setting. This works around that.

601
Cargo.lock generated
View File

@ -69,7 +69,7 @@ dependencies = [
"log",
"memmap",
"mio-named-pipes",
"scoped-tls 0.1.0",
"scoped-tls",
"serde",
"serde_derive",
"tokio-core",
@ -136,27 +136,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875"
[[package]]
name = "backtrace"
version = "0.3.9"
name = "autocfg"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a"
dependencies = [
"backtrace-sys",
"cfg-if",
"libc",
"rustc-demangle",
"winapi 0.3.7",
]
[[package]]
name = "backtrace-sys"
version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0"
dependencies = [
"cc",
"libc",
]
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]]
name = "baldrdash"
@ -294,17 +277,6 @@ dependencies = [
"xpcom",
]
[[package]]
name = "blake2b_simd"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0"
dependencies = [
"arrayref",
"arrayvec",
"constant_time_eq",
]
[[package]]
name = "block-buffer"
version = "0.7.3"
@ -372,26 +344,6 @@ dependencies = [
"iovec",
]
[[package]]
name = "bzip2"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3eafc42c44e0d827de6b1c131175098fe7fb53b8ce8a47e65cb3ea94688be24"
dependencies = [
"bzip2-sys",
"libc",
]
[[package]]
name = "bzip2-sys"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c5162604199bbb17690ede847eaa6120a3f33d5ab4dcc8e7c25b16d849ae79b"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "c2-chacha"
version = "0.2.3"
@ -444,17 +396,6 @@ version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "chrono"
version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01"
dependencies = [
"num-integer",
"num-traits",
"time",
]
[[package]]
name = "clang-sys"
version = "0.29.2"
@ -466,19 +407,6 @@ dependencies = [
"libloading",
]
[[package]]
name = "clap"
version = "2.31.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536"
dependencies = [
"bitflags",
"strsim",
"term_size",
"textwrap",
"unicode-width",
]
[[package]]
name = "cloudabi"
version = "0.0.3"
@ -508,21 +436,6 @@ dependencies = [
"winapi 0.3.7",
]
[[package]]
name = "constant_time_eq"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e"
[[package]]
name = "cookie"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1465f8134efa296b4c19db34d909637cb2bf0f7aaf21299e23e18fa29ac557cf"
dependencies = [
"time",
]
[[package]]
name = "core-foundation"
version = "0.6.3"
@ -584,7 +497,7 @@ dependencies = [
[[package]]
name = "cranelift-bforest"
version = "0.44.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=182414f15c18538dfebbe040469ec8001e93ecc5#182414f15c18538dfebbe040469ec8001e93ecc5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cranelift-entity",
]
@ -592,7 +505,7 @@ dependencies = [
[[package]]
name = "cranelift-codegen"
version = "0.44.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=182414f15c18538dfebbe040469ec8001e93ecc5#182414f15c18538dfebbe040469ec8001e93ecc5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cranelift-bforest",
"cranelift-codegen-meta",
@ -608,7 +521,7 @@ dependencies = [
[[package]]
name = "cranelift-codegen-meta"
version = "0.44.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=182414f15c18538dfebbe040469ec8001e93ecc5#182414f15c18538dfebbe040469ec8001e93ecc5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cranelift-codegen-shared",
"cranelift-entity",
@ -617,17 +530,17 @@ dependencies = [
[[package]]
name = "cranelift-codegen-shared"
version = "0.44.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=182414f15c18538dfebbe040469ec8001e93ecc5#182414f15c18538dfebbe040469ec8001e93ecc5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cranelift-entity"
version = "0.44.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=182414f15c18538dfebbe040469ec8001e93ecc5#182414f15c18538dfebbe040469ec8001e93ecc5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cranelift-frontend"
version = "0.44.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=182414f15c18538dfebbe040469ec8001e93ecc5#182414f15c18538dfebbe040469ec8001e93ecc5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cranelift-codegen",
"log",
@ -638,7 +551,7 @@ dependencies = [
[[package]]
name = "cranelift-wasm"
version = "0.44.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=182414f15c18538dfebbe040469ec8001e93ecc5#182414f15c18538dfebbe040469ec8001e93ecc5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cranelift-codegen",
"cranelift-entity",
@ -703,9 +616,9 @@ dependencies = [
[[package]]
name = "cssparser"
version = "0.28.0"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "809d22aba9ffd53e9028f2d37261f1826ef613d0e96b1a5ddeefa97cde82bcca"
checksum = "2a3a85949f6cbf49a4e1ab98a98e0f9aabfe7d827a7f156da36c98a86dede2df"
dependencies = [
"cssparser-macros",
"dtoa-short",
@ -730,22 +643,12 @@ dependencies = [
[[package]]
name = "cstr"
version = "0.1.3"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6557bdb1dc9647eae1cf7f5601b14cd45fc3c7ccf2df618387416fe542da6ea"
checksum = "f2846d3636dcaff720d311ea8983f5fa7a8288632b2f95145dd4b5819c397fd8"
dependencies = [
"cstr-macros",
"procedural-masquerade",
]
[[package]]
name = "cstr-macros"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd670e5ff58768ef624207fb95709ce63b8d05573fb9a05165f0eef471ea6a3a"
dependencies = [
"procedural-masquerade",
"syn",
"proc-macro2",
"quote",
]
[[package]]
@ -881,17 +784,6 @@ dependencies = [
"generic-array",
]
[[package]]
name = "dirs"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901"
dependencies = [
"libc",
"redox_users",
"winapi 0.3.7",
]
[[package]]
name = "dns-parser"
version = "0.8.0"
@ -1011,9 +903,9 @@ checksum = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3"
[[package]]
name = "euclid"
version = "0.20.0"
version = "0.20.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c4786521fec183792e755bf32cd0188e4e7628c6d0fcfd51426435b9081a106"
checksum = "2bb7ef65b3777a325d1eeefefab5b6d4959da54747e33bd6258e789640f307ad"
dependencies = [
"num-traits",
"serde",
@ -1025,7 +917,6 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9"
dependencies = [
"backtrace",
"failure_derive",
]
@ -1065,17 +956,6 @@ dependencies = [
"winapi 0.3.7",
]
[[package]]
name = "flate2"
version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2adaffba6388640136149e18ed080b77a78611c1e1d6de75aedcdf78df5d4682"
dependencies = [
"crc32fast",
"libc",
"miniz_oxide",
]
[[package]]
name = "fluent-langneg"
version = "0.11.1"
@ -1165,28 +1045,6 @@ dependencies = [
"byteorder",
]
[[package]]
name = "geckodriver"
version = "0.24.0"
dependencies = [
"base64",
"chrono",
"clap",
"hyper",
"lazy_static",
"log",
"mozprofile",
"mozrunner",
"mozversion",
"regex",
"serde",
"serde_derive",
"serde_json",
"uuid",
"webdriver",
"zip",
]
[[package]]
name = "geckoservo"
version = "0.0.1"
@ -1351,22 +1209,10 @@ dependencies = [
]
[[package]]
name = "h2"
version = "0.1.12"
name = "hashbrown"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a27e7ed946e8335bdf9a191bc1b9b14a03ba822d013d2f58437f4fabcbd7fc2c"
dependencies = [
"byteorder",
"bytes",
"fnv",
"futures",
"http",
"indexmap",
"log",
"slab 0.4.1",
"string",
"tokio-io",
]
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
[[package]]
name = "hashglobe"
@ -1375,55 +1221,6 @@ dependencies = [
"libc",
]
[[package]]
name = "headers"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc6e2e51d356081258ef05ff4c648138b5d3fe64b7300aaad3b820554a2b7fb6"
dependencies = [
"base64",
"bitflags",
"bytes",
"headers-core",
"headers-derive",
"http",
"mime",
"sha-1",
"time",
]
[[package]]
name = "headers-core"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "967131279aaa9f7c20c7205b45a391638a83ab118e6509b2d0ccbe08de044237"
dependencies = [
"bytes",
"http",
]
[[package]]
name = "headers-derive"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f33cf300c485e3cbcba0235013fcc768723451c9b84d1b31aa7fec0491ac9a11"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "http"
version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eed324f0f0daf6ec10c474f150505af2c143f251722bf9dbd1261bd1f2ee2c1a"
dependencies = [
"bytes",
"fnv",
"itoa",
]
[[package]]
name = "httparse"
version = "1.3.3"
@ -1439,33 +1236,6 @@ dependencies = [
"quick-error",
]
[[package]]
name = "hyper"
version = "0.12.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1ebec079129e43af5e234ef36ee3d7e6085687d145b7ea653b262d16c6b65f1"
dependencies = [
"bytes",
"futures",
"futures-cpupool",
"h2",
"http",
"httparse",
"iovec",
"itoa",
"log",
"net2",
"time",
"tokio",
"tokio-executor",
"tokio-io",
"tokio-reactor",
"tokio-tcp",
"tokio-threadpool",
"tokio-timer",
"want",
]
[[package]]
name = "ident_case"
version = "1.0.0"
@ -1499,9 +1269,13 @@ dependencies = [
[[package]]
name = "indexmap"
version = "1.1.0"
version = "1.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4d6d89e0948bf10c08b9ecc8ac5b83f07f857ebe2c0cbe38de15b4e4f510356"
checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3"
dependencies = [
"autocfg 1.0.1",
"hashbrown",
]
[[package]]
name = "inflate"
@ -1680,15 +1454,6 @@ dependencies = [
"vcpkg",
]
[[package]]
name = "line-wrap"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9"
dependencies = [
"safemem",
]
[[package]]
name = "lmdb-rkv"
version = "0.14.0"
@ -1814,31 +1579,6 @@ dependencies = [
"rustc_version",
]
[[package]]
name = "mime"
version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
[[package]]
name = "mime_guess"
version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212"
dependencies = [
"mime",
"unicase",
]
[[package]]
name = "miniz_oxide"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7108aff85b876d06f22503dcce091e29f76733b2bfdd91eebce81f5e68203a10"
dependencies = [
"adler32",
]
[[package]]
name = "mio"
version = "0.6.16"
@ -1955,24 +1695,6 @@ dependencies = [
"num_cpus",
]
[[package]]
name = "mozprofile"
version = "0.5.0"
dependencies = [
"tempfile",
]
[[package]]
name = "mozrunner"
version = "0.9.0"
dependencies = [
"dirs",
"log",
"mozprofile",
"plist",
"winreg",
]
[[package]]
name = "mozurl"
version = "0.0.1"
@ -1984,15 +1706,6 @@ dependencies = [
"xpcom",
]
[[package]]
name = "mozversion"
version = "0.2.1"
dependencies = [
"regex",
"rust-ini",
"semver",
]
[[package]]
name = "mp4parse"
version = "0.11.4"
@ -2025,16 +1738,6 @@ version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "704f773471ac3e7110427b6bdf93184932b19319c9b7717688da5424e519b10a"
[[package]]
name = "msdos_time"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aad9dfe950c057b1bfe9c1f2aa51583a8468ef2a5baba2ebbe06d775efeb7729"
dependencies = [
"time",
"winapi 0.3.7",
]
[[package]]
name = "murmurhash3"
version = "0.0.5"
@ -2163,7 +1866,7 @@ version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4c81ffc11c212fa327657cb19dd85eb7419e163b5b076bede2bdb5c974c07e4"
dependencies = [
"autocfg",
"autocfg 0.1.6",
]
[[package]]
@ -2352,20 +2055,6 @@ dependencies = [
"num-traits",
]
[[package]]
name = "plist"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31850d149352e2b75f0e4b206045ee3775076c422892328343beca48a2b5cf17"
dependencies = [
"base64",
"humantime",
"indexmap",
"line-wrap",
"serde",
"xml-rs",
]
[[package]]
name = "png"
version = "0.15.0"
@ -2378,12 +2067,6 @@ dependencies = [
"inflate",
]
[[package]]
name = "podio"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5422a1ee1bc57cc47ae717b0137314258138f38fd5f3cea083f43a9725383a0"
[[package]]
name = "ppv-lite86"
version = "0.2.6"
@ -2402,30 +2085,19 @@ version = "0.0.1"
[[package]]
name = "proc-macro-hack"
version = "0.5.11"
version = "0.5.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
[[package]]
name = "proc-macro2"
version = "1.0.5"
version = "1.0.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90cf5f418035b98e655e9cdb225047638296b862b42411c4e45bb88d700f7fc0"
checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a"
dependencies = [
"unicode-xid",
]
[[package]]
name = "procedural-masquerade"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f566249236c6ca4340f7ca78968271f0ed2b0f234007a61b66f9ecd0af09260"
[[package]]
name = "profiler_helper"
version = "0.1.0"
@ -2474,7 +2146,7 @@ version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
dependencies = [
"autocfg",
"autocfg 0.1.6",
"libc",
"rand_chacha 0.1.1",
"rand_core 0.4.0",
@ -2507,7 +2179,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
dependencies = [
"autocfg",
"autocfg 0.1.6",
"rand_core 0.3.1",
]
@ -2603,7 +2275,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"
dependencies = [
"autocfg",
"autocfg 0.1.6",
"rand_core 0.4.0",
]
@ -2673,18 +2345,6 @@ dependencies = [
"redox_syscall",
]
[[package]]
name = "redox_users"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d"
dependencies = [
"failure",
"rand_os",
"redox_syscall",
"rust-argon2",
]
[[package]]
name = "regex"
version = "1.3.3"
@ -2757,23 +2417,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d79b4b604167921892e84afbbaad9d5ad74e091bf6c511d9dbfb0593f09fabd"
[[package]]
name = "rust-argon2"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf"
dependencies = [
"base64",
"blake2b_simd",
"crossbeam-utils",
]
[[package]]
name = "rust-ini"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a654c5bda722c699be6b0fe4c0d90de218928da5b724c3e467fc48865c37263"
[[package]]
name = "rust_cascade"
version = "0.3.4"
@ -2818,12 +2461,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8"
[[package]]
name = "safemem"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9"
[[package]]
name = "same-file"
version = "1.0.2"
@ -2839,12 +2476,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d"
[[package]]
name = "scoped-tls"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
[[package]]
name = "scopeguard"
version = "1.0.0"
@ -2945,18 +2576,6 @@ dependencies = [
"serde",
]
[[package]]
name = "serde_urlencoded"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97"
dependencies = [
"dtoa",
"itoa",
"serde",
"url",
]
[[package]]
name = "servo_arc"
version = "0.1.1"
@ -3025,9 +2644,9 @@ checksum = "797a4eaffb90d896f29698d45676f9f940a71936d7574996a7df54593ba209fa"
[[package]]
name = "smallvec"
version = "1.2.0"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc"
checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"
dependencies = [
"serde",
]
@ -3081,18 +2700,6 @@ dependencies = [
"xpcom",
]
[[package]]
name = "string"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00caf261d6f90f588f8450b8e1230fa0d5be49ee6140fdfbcb55335aff350970"
[[package]]
name = "strsim"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
[[package]]
name = "style"
version = "0.0.1"
@ -3207,9 +2814,9 @@ checksum = "c666f0fed8e1e20e057af770af9077d72f3d5a33157b8537c1475dd8ffd6d32b"
[[package]]
name = "syn"
version = "1.0.5"
version = "1.0.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf"
checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59"
dependencies = [
"proc-macro2",
"quote",
@ -3248,17 +2855,6 @@ dependencies = [
"winapi 0.3.7",
]
[[package]]
name = "term_size"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209"
dependencies = [
"kernel32-sys",
"libc",
"winapi 0.2.8",
]
[[package]]
name = "termcolor"
version = "1.0.5"
@ -3279,16 +2875,6 @@ dependencies = [
"redox_termios",
]
[[package]]
name = "textwrap"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"
dependencies = [
"term_size",
"unicode-width",
]
[[package]]
name = "thin-slice"
version = "0.1.1"
@ -3409,7 +2995,7 @@ dependencies = [
"iovec",
"log",
"mio",
"scoped-tls 0.1.0",
"scoped-tls",
"tokio",
"tokio-executor",
"tokio-io",
@ -3558,12 +3144,6 @@ dependencies = [
"serde",
]
[[package]]
name = "try-lock"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382"
[[package]]
name = "typenum"
version = "1.10.0"
@ -3608,15 +3188,6 @@ dependencies = [
"tinystr",
]
[[package]]
name = "unicase"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
dependencies = [
"version_check",
]
[[package]]
name = "unicode-bidi"
version = "0.3.4"
@ -3638,12 +3209,6 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa6024fc12ddfd1c6dbc14a80fa2324d4568849869b779f6bd37e5e4c03344d1"
[[package]]
name = "unicode-width"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479"
[[package]]
name = "unicode-xid"
version = "0.2.0"
@ -3670,12 +3235,6 @@ dependencies = [
"percent-encoding",
]
[[package]]
name = "urlencoding"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3df3561629a8bb4c57e5a2e4c43348d9e29c7c29d9b1c4c1f47166deca8f37ed"
[[package]]
name = "uuid"
version = "0.8.1"
@ -3713,41 +3272,6 @@ dependencies = [
"winapi 0.3.7",
]
[[package]]
name = "want"
version = "0.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3"
dependencies = [
"futures",
"log",
"try-lock",
]
[[package]]
name = "warp"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33857527c63bc514452f885d0a57019f28139c58fef2b3566016ecc0d44e5d24"
dependencies = [
"bytes",
"futures",
"headers",
"http",
"hyper",
"log",
"mime",
"mime_guess",
"scoped-tls 1.0.0",
"serde",
"serde_json",
"serde_urlencoded",
"tokio",
"tokio-io",
"tokio-threadpool",
"urlencoding",
]
[[package]]
name = "wasmparser"
version = "0.39.1"
@ -3772,26 +3296,6 @@ dependencies = [
"wast",
]
[[package]]
name = "webdriver"
version = "0.40.1"
dependencies = [
"base64",
"cookie",
"http",
"lazy_static",
"log",
"regex",
"serde",
"serde_derive",
"serde_json",
"time",
"tokio",
"unicode-segmentation",
"url",
"warp",
]
[[package]]
name = "webrender"
version = "0.60.0"
@ -3869,6 +3373,7 @@ dependencies = [
"nsstring",
"num_cpus",
"rayon",
"thin-vec",
"thread_profiler",
"uuid",
"webrender",
@ -3945,15 +3450,6 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "winreg"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a27a759395c1195c4cc5cda607ef6f8f6498f64e78f7900f5de0a127a424704a"
dependencies = [
"winapi 0.3.7",
]
[[package]]
name = "wr_malloc_size_of"
version = "0.0.1"
@ -4046,16 +3542,3 @@ dependencies = [
"tempfile",
"xpcom",
]
[[package]]
name = "zip"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36b9e08fb518a65cf7e08a1e482573eb87a2f4f8c6619316612a3c1f162fe822"
dependencies = [
"bzip2",
"flate2",
"msdos_time",
"podio",
"time",
]

View File

@ -7,9 +7,7 @@
members = [
"js/src",
"js/src/rust",
"js/src/wasm/cranelift",
"js/rust",
"testing/geckodriver",
"toolkit/crashreporter/rust",
"toolkit/library/gtest/rust",
"toolkit/library/rust/",
@ -58,10 +56,3 @@ codegen-units = 1
libudev-sys = { path = "dom/webauthn/libudev-sys" }
packed_simd = { git = "https://github.com/hsivonen/packed_simd", branch = "rust_1_32" }
[patch.crates-io.cranelift-codegen]
git = "https://github.com/CraneStation/Cranelift"
rev = "182414f15c18538dfebbe040469ec8001e93ecc5"
[patch.crates-io.cranelift-wasm]
git = "https://github.com/CraneStation/Cranelift"
rev = "182414f15c18538dfebbe040469ec8001e93ecc5"

View File

@ -5,12 +5,21 @@ A browser for Windows XP based on Firefox 68.
![image](https://user-images.githubusercontent.com/19492771/152347482-f51058cd-2967-4bc5-80fd-5d269c328774.png)
## WARNING
## KNOWN PROBLEMS
This browser does not run well on winxp SP2 and lower. If you do not want to install SP3, be ready for crashes and blue screens.
- 1.5gb memory limit on winxp, if the browser reaches the limit it crashes inevitably, singleporess mode crashes all,
multiprocess only this which reaches 1.5gb, so it better here.
I think this is OS limitation, nothing to do with this.
- x64 does not run on winxp64, wont fix, there is an issue #35 about
- Graphics error on some videocards, look further the issue #428
- This browser does not run well on winxp SP2 and lower. If you do not want to install SP3, be ready for crashes and blue screens.
If you are on SP2 and lower, there is no need to post a screenshot from blue_screen_view. And i suggest to apply postready updates of 2019.
Some say that it runs fine on sp2 but it is no accurate data what to do.
## IF YOU GOT A BLUE SCREEN
Don't post a screenshot of the blue screen, as the screen isn't useful for troubleshooting.

View File

@ -5,6 +5,7 @@
#include "Accessible-inl.h"
#include "DocAccessibleWrap.h"
#include "nsIDocShell.h"
#include "nsIScrollableFrame.h"
#include "nsLayoutUtils.h"
#include "DocAccessibleChild.h"
#include "nsAccessibilityService.h"
@ -98,7 +99,7 @@ void DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer,
nsRect scrollPort = sf ? sf->GetScrollPortRect() : rootFrame->GetRect();
nsLayoutUtils::GetFramesForArea(
presShell->GetRootFrame(), scrollPort, frames,
RelativeTo{presShell->GetRootFrame()}, scrollPort, frames,
nsLayoutUtils::FrameForPointOption::OnlyVisible);
AccessibleHashtable inViewAccs;
for (size_t i = 0; i < frames.Length(); i++) {

View File

@ -10,7 +10,7 @@
#include "mozilla/Tuple.h"
#include "nsCycleCollectionParticipant.h"
#include "nsRefreshDriver.h"
#include "nsRefreshObservers.h"
#include <utility>

View File

@ -201,3 +201,5 @@ void SelectionManager::ProcessSelectionChanged(SelData* aSelData) {
nsIAccessibleEvent::EVENT_TEXT_ATTRIBUTE_CHANGED, text);
}
}
SelectionManager::~SelectionManager() = default;

View File

@ -5,7 +5,6 @@
#ifndef mozilla_a11y_SelectionManager_h__
#define mozilla_a11y_SelectionManager_h__
#include "nsIFrame.h"
#include "nsISelectionListener.h"
#include "mozilla/WeakPtr.h"
@ -106,6 +105,8 @@ class SelectionManager : public nsISelectionListener {
mAccWithCaret = nullptr;
}
~SelectionManager();
protected:
SelectionManager();

View File

@ -19,12 +19,16 @@ StyleInfo::StyleInfo(dom::Element* aElement) : mElement(aElement) {
void StyleInfo::Display(nsAString& aValue) {
aValue.Truncate();
mComputedStyle->GetComputedPropertyValue(eCSSProperty_display, aValue);
nsAutoCString value;
mComputedStyle->GetComputedPropertyValue(eCSSProperty_display, value);
CopyUTF8toUTF16(value, aValue);
}
void StyleInfo::TextAlign(nsAString& aValue) {
aValue.Truncate();
mComputedStyle->GetComputedPropertyValue(eCSSProperty_text_align, aValue);
nsAutoCString value;
mComputedStyle->GetComputedPropertyValue(eCSSProperty_text_align, value);
CopyUTF8toUTF16(value, aValue);
}
void StyleInfo::TextIndent(nsAString& aValue) {
@ -51,8 +55,18 @@ void StyleInfo::Margin(Side aSide, nsAString& aValue) {
" mElement->GetPrimaryFrame() needs to be valid pointer");
aValue.Truncate();
nscoord coordVal = mElement->GetPrimaryFrame()->GetUsedMargin().Side(aSide);
aValue.AppendFloat(nsPresContext::AppUnitsToFloatCSSPixels(coordVal));
nsIFrame* frame = mElement->GetPrimaryFrame();
// This is here only to guarantee that we do the same as getComputedStyle
// does, so that we don't hit precision errors in tests.
auto& margin = frame->StyleMargin()->mMargin.Get(aSide);
if (margin.ConvertsToLength()) {
aValue.AppendFloat(margin.AsLengthPercentage().ToLengthInCSSPixels());
} else {
nscoord coordVal = frame->GetUsedMargin().Side(aSide);
aValue.AppendFloat(CSSPixel::FromAppUnits(coordVal));
}
aValue.AppendLiteral("px");
}

View File

@ -83,7 +83,6 @@ LOCAL_INCLUDES += [
'/ipc/chromium/src',
'/layout/generic',
'/layout/style',
'/layout/svg',
'/layout/xul',
'/layout/xul/tree/',
]

View File

@ -58,7 +58,6 @@
#include "nsIObserverService.h"
#include "nsLayoutUtils.h"
#include "nsPluginFrame.h"
#include "SVGGeometryFrame.h"
#include "nsTreeBodyFrame.h"
#include "nsTreeColumns.h"
#include "nsTreeUtils.h"
@ -71,6 +70,7 @@
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/Services.h"
#include "mozilla/SVGGeometryFrame.h"
#include "nsDeckFrame.h"
#ifdef MOZ_XUL

View File

@ -527,26 +527,8 @@ Accessible* Accessible::ChildAtPoint(int32_t aX, int32_t aY,
nsPoint offset(presContext->DevPixelsToAppUnits(aX) - screenRect.X(),
presContext->DevPixelsToAppUnits(aY) - screenRect.Y());
// We need to take into account a non-1 resolution set on the presshell.
// This happens in mobile platforms with async pinch zooming.
offset = offset.RemoveResolution(presContext->PresShell()->GetResolution());
// We need to translate with the offset of the edge of the visual
// viewport from top edge of the layout viewport.
offset += presContext->PresShell()->GetVisualViewportOffset() -
presContext->PresShell()->GetLayoutViewportOffset();
EnumSet<nsLayoutUtils::FrameForPointOption> options = {
#ifdef MOZ_WIDGET_ANDROID
// This is needed in Android to ignore the clipping of the scroll frame
// when zoomed in. May regress something on other platforms, so
// keeping it Android-exclusive for now.
nsLayoutUtils::FrameForPointOption::IgnoreRootScrollFrame
#endif
};
nsIFrame* foundFrame =
nsLayoutUtils::GetFrameForPoint(startFrame, offset, options);
nsIFrame* foundFrame = nsLayoutUtils::GetFrameForPoint(
RelativeTo{startFrame, ViewportType::Visual}, offset);
nsIContent* content = nullptr;
if (!foundFrame || !(content = foundFrame->GetContent()))

View File

@ -10,9 +10,9 @@
#include "nsIAccessibleTypes.h"
#include "nsDirection.h"
#include "WordMovementType.h"
#include "nsIFrame.h"
class nsFrameSelection;
class nsIFrame;
class nsRange;
class nsIWidget;

View File

@ -39,7 +39,8 @@ HTMLLIAccessible::HTMLLIAccessible(nsIContent* aContent, DocAccessible* aDoc)
if (nsBulletFrame* bulletFrame =
do_QueryFrame(nsLayoutUtils::GetMarkerFrame(aContent))) {
const nsStyleList* styleList = bulletFrame->StyleList();
if (styleList->GetListStyleImage() || !styleList->mCounterStyle.IsNone()) {
if (!styleList->mListStyleImage.IsNone() ||
!styleList->mCounterStyle.IsNone()) {
mBullet = new HTMLListBulletAccessible(mContent, mDoc);
Document()->BindToDocument(mBullet, nullptr);
AppendChild(mBullet);
@ -132,7 +133,7 @@ ENameValueFlag HTMLListBulletAccessible::Name(nsString& aName) const {
return eNameOK;
}
if (frame->StyleList()->GetListStyleImage()) {
if (!frame->StyleList()->mListStyleImage.IsNone()) {
// Bullet is an image, so use default bullet character.
const char16_t kDiscCharacter = 0x2022;
aName.Assign(kDiscCharacter);

View File

@ -0,0 +1,6 @@
<script>
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('id_0').type = ''
})
</script>
<input id="id_0" type="time">

View File

@ -10,6 +10,7 @@ load 1463962.html
load 1484778.html
load 1494707.html
load 1503964.html
load 1655983.html
# last_test_to_unload_testsuite.xul MUST be the last test in the list because it
# is responsible for shutting down accessibility service affecting later tests.

View File

@ -144,13 +144,7 @@
// Name from the @title attribute of <toolbaritem/> (original bug 237249).
// Direct child of toolbaritem.
var textboxAcc = testName("toolbaritem_textbox", "ooospspss");
// Element from anonymous content of direct child of toolbaritem.
var entryAcc = textboxAcc.firstChild;
testRole(entryAcc, ROLE_ENTRY);
is(entryAcc.name, "ooospspss",
"Wrong name for text entry of autocomplete textbox 'toolbaritem_textbox'.");
var toolbarItemChildAcc = testName("toolbaritem_child", "ooospspss");
// Child from subtree of toolbaritem.
testName("toolbaritem_hboxbutton", "ooospspss");
@ -330,14 +324,13 @@
<!-- and the name from label of a toolbarbutton -->
<toolbar>
<toolbaritem title="ooospspss">
<textbox id="toolbaritem_textbox"
flex="1"
type="autocomplete"
enablehistory="true">
<box id="toolbaritem_child"
role="group"
flex="1">
<hbox role="button" id="toolbaritem_hboxbutton">
<description value="button"/>
</hbox>
</textbox>
</box>
</toolbaritem>
<toolbarbutton id="toolbarbuttonwithlabel">
<label flex="1">I am the button</label>

View File

@ -82,41 +82,6 @@
testAccessibleTree("autocomplete", accTree);
//////////////////////////////////////////////////////////////////////////
// textbox@type=autocomplete #2 (child menupoup)
accTree = {
// textbox
role: ROLE_AUTOCOMPLETE,
children: [
{
// menupopup
role: ROLE_COMBOBOX_LIST, // autocomplete menu popup
children: [
{
// menuitem
role: ROLE_COMBOBOX_OPTION,
children: []
}
]
},
{
// html:input
role: ROLE_ENTRY,
children: [
// no text leaf accessible for text node
]
},
{
// xul:menupopup
role: ROLE_COMBOBOX_LIST, // context menu popup
children: []
}
]
};
testAccessibleTree("autocomplete2", accTree);
SimpleTest.finish()
}
@ -155,12 +120,6 @@
<textbox id="autocomplete" type="autocomplete"
autocompletesearch="unifiedcomplete"
value="http://mochi.test:8888/redirect-a11y.html"/>
<textbox id="autocomplete2" type="autocomplete">
<menupopup>
<menuitem label="item1"/>
</menupopup>
</textbox>
</vbox>
</hbox>

View File

@ -343,7 +343,7 @@ static bool IsTypelibPreferred() {
}
return psClsid.Equals(kUniversalMarshalerClsid,
nsCaseInsensitiveStringComparator());
nsCaseInsensitiveStringComparator);
}
static bool IsIAccessibleTypelibRegistered() {

View File

@ -217,7 +217,7 @@ sdnAccessible::get_computedStyle(
for (index = realIndex = 0; index < length && realIndex < aMaxStyleProperties;
index++) {
nsAutoCString property;
nsAutoString value;
nsAutoCString value;
// Ignore -moz-* properties.
cssDecl->Item(index, property);
@ -227,7 +227,8 @@ sdnAccessible::get_computedStyle(
if (!value.IsEmpty()) {
aStyleProperties[realIndex] =
::SysAllocString(NS_ConvertUTF8toUTF16(property).get());
aStyleValues[realIndex] = ::SysAllocString(value.get());
aStyleValues[realIndex] =
::SysAllocString(NS_ConvertUTF8toUTF16(value).get());
++realIndex;
}
}
@ -253,12 +254,12 @@ sdnAccessible::get_computedStyleForProperties(
uint32_t index = 0;
for (index = 0; index < aNumStyleProperties; index++) {
nsAutoString value;
nsAutoCString value;
if (aStyleProperties[index])
cssDecl->GetPropertyValue(
NS_ConvertUTF16toUTF8(nsDependentString(aStyleProperties[index])),
value); // Get property value
aStyleValues[index] = ::SysAllocString(value.get());
aStyleValues[index] = ::SysAllocString(NS_ConvertUTF8toUTF16(value).get());
}
return S_OK;

View File

@ -395,7 +395,7 @@ pref("browser.tabs.insertRelatedAfterCurrent", true);
// the value of browser.tabs.insertRelatedAfterCurrent.
pref("browser.tabs.insertAfterCurrent", false);
pref("browser.tabs.warnOnClose", 1);
pref("browser.tabs.warnOnCloseOtherTabs", true);
pref("browser.tabs.warnOnCloseOtherTabs", 1);
pref("browser.tabs.warnOnOpen", true);
pref("browser.tabs.maxOpenBeforeWarn", 15);
pref("browser.tabs.loadInBackground", true);
@ -530,13 +530,8 @@ pref("browser.gesture.swipe.left", "Browser:BackOrBackDuplicate");
pref("browser.gesture.swipe.right", "Browser:ForwardOrForwardDuplicate");
pref("browser.gesture.swipe.up", "cmd_scrollTop");
pref("browser.gesture.swipe.down", "cmd_scrollBottom");
#ifdef XP_MACOSX
pref("browser.gesture.pinch.latched", true);
pref("browser.gesture.pinch.threshold", 150);
#else
pref("browser.gesture.pinch.latched", false);
pref("browser.gesture.pinch.threshold", 25);
#endif
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
// Enabled for touch input display zoom.
pref("browser.gesture.pinch.out", "cmd_fullZoomEnlarge");
@ -1369,6 +1364,12 @@ pref("media.autoplay.default", 1); // 0=Allowed, 1=Blocked, 5=All Blocked
pref("media.autoplay.block-webaudio", false);
#endif
// Picture-in-Picture is currently enabled by default on Windows.
#if defined(XP_WIN)
pref("media.videocontrols.picture-in-picture.enabled", true);
pref("media.videocontrols.picture-in-picture.video-toggle.enabled", true);
#endif
pref("browser.translation.detectLanguage", false);
pref("browser.translation.neverForLanguages", "");
// Show the translation UI bits, like the info bar, notification icon and preferences.
@ -1632,11 +1633,6 @@ pref("fission.frontend.simulate-messages", false);
pref("toolkit.coverage.enabled", false);
pref("toolkit.coverage.endpoint.base", "data:text/plain,");
// Discovery prefs
pref("browser.discovery.enabled", true);
pref("browser.discovery.containers.enabled", true);
pref("browser.discovery.sites", "addons.mozilla.org");
pref("browser.engagement.recent_visited_origins.expiry", 86400); // 24 * 60 * 60 (24 hours in seconds)
pref("browser.aboutConfig.showWarning", true);
@ -1657,10 +1653,6 @@ pref("identity.fxaccounts.toolbar.accessed", false);
pref("corroborator.enabled", true);
#endif
// Disable WebIDE and ConnectPage by default (Bug 1539451)
pref("devtools.webide.enabled", false);
pref("devtools.connectpage.enabled", false);
// Toolbox preferences
pref("devtools.toolbox.footer.height", 250);
pref("devtools.toolbox.sidebar.width", 500);
@ -2057,12 +2049,3 @@ pref("devtools.debugger.features.map-await-expression", true);
// about:devtools-toolbox tabs unusable by mistake.
pref("devtools.popup.disable_autohide", false);
pref("devtools.webide.templatesURL", "https://code.cdn.mozilla.net/templates/list.json");
pref("devtools.webide.autoinstallADBExtension", true);
pref("devtools.webide.autoConnectRuntime", true);
pref("devtools.webide.restoreLastProject", true);
pref("devtools.webide.enableLocalRuntime", false);
pref("devtools.webide.lastConnectedRuntime", "");
pref("devtools.webide.lastSelectedProject", "");
pref("devtools.webide.zoom", "1");
pref("devtools.webide.busyTimeout", 10000);

View File

@ -167,6 +167,10 @@ var FullZoom = {
return;
}
if (this._isPDFViewer(browser)) {
return;
}
let ctxt = this._loadContextFromBrowser(browser);
let domain = this._cps2.extractDomain(browser.currentURI.spec);
if (aGroup) {
@ -268,6 +272,17 @@ var FullZoom = {
return;
}
// The PDF viewer zooming isn't handled by `ZoomManager`, ensure that the
// browser zoom level always gets reset on load.
if (this._isPDFViewer(browser)) {
this._applyPrefToZoom(
undefined,
browser,
this._notifyOnLocationChange.bind(this, browser)
);
return;
}
// See if the zoom pref is cached.
let ctxt = this._loadContextFromBrowser(browser);
let pref = this._cps2.getCachedByDomainAndName(aURI.spec, this.name, ctxt);
@ -312,23 +327,37 @@ var FullZoom = {
// Setting & Pref Manipulation
/**
* Reduces the zoom level of the page in the current browser.
* If browser in reader mode sends message to reader in order to decrease font size,
* Otherwise reduces the zoom level of the page in the current browser.
*/
async reduce() {
ZoomManager.reduce();
let browser = gBrowser.selectedBrowser;
if (browser.currentURI.spec.startsWith("about:reader")) {
browser.messageManager.sendAsyncMessage("Reader:ZoomOut");
} else if (this._isPDFViewer(browser)) {
browser.messageManager.sendAsyncMessage("PDFJS:ZoomOut");
} else {
ZoomManager.reduce();
this._ignorePendingZoomAccesses(browser);
await this._applyZoomToPref(browser);
}
},
/**
* Enlarges the zoom level of the page in the current browser.
* If browser in reader mode sends message to reader in order to increase font size,
* Otherwise enlarges the zoom level of the page in the current browser.
*/
async enlarge() {
ZoomManager.enlarge();
let browser = gBrowser.selectedBrowser;
if (browser.currentURI.spec.startsWith("about:reader")) {
browser.messageManager.sendAsyncMessage("Reader:ZoomIn");
} else if (this._isPDFViewer(browser)) {
browser.messageManager.sendAsyncMessage("PDFJS:ZoomIn");
} else {
ZoomManager.enlarge();
this._ignorePendingZoomAccesses(browser);
await this._applyZoomToPref(browser);
}
},
/**
@ -336,6 +365,9 @@ var FullZoom = {
* point value, where 1 is the default zoom level.
*/
setZoom(value, browser = gBrowser.selectedBrowser) {
if (this._isPDFViewer(browser)) {
return;
}
ZoomManager.setZoomForBrowser(browser, value);
this._ignorePendingZoomAccesses(browser);
this._applyZoomToPref(browser);
@ -348,6 +380,11 @@ var FullZoom = {
* @return A promise which resolves when the zoom reset has been applied.
*/
reset: function FullZoom_reset(browser = gBrowser.selectedBrowser) {
if (browser.currentURI.spec.startsWith("about:reader")) {
browser.messageManager.sendAsyncMessage("Reader:ResetZoom");
} else if (this._isPDFViewer(browser)) {
browser.messageManager.sendAsyncMessage("PDFJS:ZoomReset");
}
let token = this._getBrowserToken(browser);
let result = this._getGlobalValue(browser).then(value => {
if (token.isCurrent) {
@ -618,4 +655,12 @@ var FullZoom = {
}
Services.tm.dispatchToMainThread(callback);
},
_isPDFViewer(browser) {
return !!(
browser.contentPrincipal &&
browser.contentPrincipal.URI &&
browser.contentPrincipal.URI.spec == "resource://pdf.js/web/viewer.html"
);
},
};

View File

@ -100,9 +100,7 @@ var gGestureSupport = {
break;
case "MozMagnifyGestureStart":
aEvent.preventDefault();
let pinchPref =
AppConstants.platform == "win" ? def(25, 0) : def(150, 1);
this._setupGesture(aEvent, "pinch", pinchPref, "out", "in");
this._setupGesture(aEvent, "pinch", def(25, 0), "out", "in");
break;
case "MozRotateGestureStart":
aEvent.preventDefault();

View File

@ -43,6 +43,7 @@
<command id="View:PageInfo" oncommand="BrowserPageInfo();"/>
<command id="View:FullScreen" oncommand="BrowserFullScreen();"/>
<command id="View:ReaderView" oncommand="ReaderParent.toggleReaderMode(event);"/>
<command id="View:PictureInPicture" oncommand="PictureInPicture.onCommand(event);"/>
<command id="cmd_find" oncommand="gLazyFindCommand('onFindCommand')"/>
<command id="cmd_findAgain" oncommand="gLazyFindCommand('onFindAgainCommand', false)"/>
<command id="cmd_findPrevious" oncommand="gLazyFindCommand('onFindAgainCommand', true)"/>
@ -209,6 +210,12 @@
#else
<key id="key_toggleReaderMode" keycode="&toggleReaderMode.win.keycode;" command="View:ReaderView" disabled="true"/>
#endif
#ifdef XP_WIN
<key id="key_togglePictureInPicture" key="&togglePictureInPicture.key;" command="View:PictureInPicture" modifiers="accel,shift"/>
<key key="&togglePictureInPicture.key2;" command="View:PictureInPicture" modifiers="accel,shift"/>
#endif
<key key="&reloadCmd.commandkey;" command="Browser:Reload" modifiers="accel" id="key_reload"/>
<key key="&reloadCmd.commandkey;" command="Browser:ReloadSkipCache" modifiers="accel,shift"/>
<key id="key_viewSource" key="&pageSourceCmd.commandkey;" command="View:PageSource" modifiers="accel"/>

View File

@ -55,17 +55,13 @@
min-width: -moz-fit-content;
}
.searchbar-textbox {
-moz-binding: url("chrome://browser/content/search/search.xml#searchbar-textbox");
}
.search-one-offs[compact=true] .search-setting-button,
.search-one-offs:not([compact=true]) .search-setting-button-compact {
display: none;
}
/* Prevent shrinking the page content to 0 height and width */
.browserStack > browser {
.browserStack {
min-height: 25px;
min-width: 25px;
}

View File

@ -44,6 +44,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
PageThumbs: "resource://gre/modules/PageThumbs.jsm",
PanelMultiView: "resource:///modules/PanelMultiView.jsm",
PanelView: "resource:///modules/PanelMultiView.jsm",
PictureInPicture: "resource://gre/modules/PictureInPicture.jsm",
PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
PlacesUIUtils: "resource:///modules/PlacesUIUtils.jsm",
PlacesTransactions: "resource://gre/modules/PlacesTransactions.jsm",
@ -5947,107 +5948,6 @@ var XULBrowserWindow = {
"not attached to this tabbrowser is unsupported"
);
},
// data for updating sessionStore
_sessionData: {},
composeChildren: function XWB_composeScrollPositionsData(
aPositions,
aDescendants,
aStartIndex,
aNumberOfDescendants
) {
let children = [];
let lastIndexOfNonNullbject = -1;
for (let i = 0; i < aNumberOfDescendants; i++) {
let currentIndex = aStartIndex + i;
let obj = {};
let objWithData = false;
if (aPositions[currentIndex]) {
obj.scroll = aPositions[currentIndex];
objWithData = true;
}
if (aDescendants[currentIndex]) {
let descendantsTree = this.composeChildren(
aPositions,
aDescendants,
currentIndex + 1,
aDescendants[currentIndex]
);
i += aDescendants[currentIndex];
if (descendantsTree) {
obj.children = descendantsTree;
objWithData = true;
}
}
if (objWithData) {
lastIndexOfNonNullbject = children.length;
children.push(obj);
} else {
children.push(null);
}
}
if (lastIndexOfNonNullbject == -1) {
return null;
}
return children.slice(0, lastIndexOfNonNullbject + 1);
},
updateScrollPositions: function XWB_updateScrollPositions(
aPositions,
aDescendants
) {
let obj = {};
let objWithData = false;
if (aPositions[0]) {
obj.scroll = aPositions[0];
objWithData = true;
}
if (aPositions.length > 1) {
let children = this.composeChildren(
aPositions,
aDescendants,
1,
aDescendants[0]
);
if (children) {
obj.children = children;
objWithData = true;
}
}
if (objWithData) {
this._sessionData.scroll = obj;
} else {
this._sessionData.scroll = null;
}
},
updateDocShellCaps: function XWB_updateDocShellCaps(aDisCaps) {
this._sessionData.disallow = aDisCaps ? aDisCaps : null;
},
updateIsPrivate: function XWB_updateIsPrivate(aIsPrivate) {
this._sessionData.isPrivate = aIsPrivate;
},
updateSessionStore: function XWB_updateSessionStore(
aBrowser,
aFlushId,
aIsFinal
) {
SessionStore.updateSessionStoreFromTablistener(aBrowser, {
data: this._sessionData,
flushID: aFlushId,
isFinal: false,
});
this._sessionData = {};
},
};
var LinkTargetDisplay = {

View File

@ -455,6 +455,12 @@
#include browser-context.inc
</menupopup>
<menupopup id="pictureInPictureToggleContextMenu">
<menuitem label="&pictureInPictureHideToggle.label;"
accesskey="&pictureInPictureHideToggle.accesskey;"
oncommand="PictureInPicture.hideToggle();" />
</menupopup>
#include ../../components/places/content/placesContextMenu.inc.xul
<panel id="ctrlTab-panel" hidden="true" norestorefocus="true" level="top">

View File

@ -1986,7 +1986,7 @@ nsContextMenu.prototype = {
: this.linkTextStr;
// Store searchTerms in context menu item so we know what to search onclick
menuItem.searchTerms = selectedText;
menuItem.searchTerms = '"' + selectedText.replace(/"/g, '') + '"';
menuItem.principal = this.principal;
menuItem.csp = this.csp;

View File

@ -11,7 +11,7 @@
.tab-icon-image:not([src]):not([pinned]):not([crashed]):not([sharing]),
.tab-icon-image[busy],
.tab-throbber:not([busy]),
.tab-icon-sound:not([soundplaying]):not([muted]):not([activemedia-blocked]),
.tab-icon-sound:not([soundplaying]):not([muted]):not([activemedia-blocked]):not([pictureinpicture]),
.tab-icon-sound[pinned],
.tab-sharing-icon-overlay,
.tab-icon-overlay {

View File

@ -2938,12 +2938,10 @@
},
warnAboutClosingTabs(tabsToClose, aCloseTabs) {
var shouldPrompt;
if (aCloseTabs == this.closingTabsEnum.ALL) {
shouldPrompt = Services.prefs.getIntPref("browser.tabs.warnOnClose") <= tabsToClose;
} else {
shouldPrompt = Services.prefs.getBoolPref("browser.tabs.warnOnCloseOtherTabs");
}
const pref = aCloseTabs == this.closingTabsEnum.ALL ?
"browser.tabs.warnOnClose" : "browser.tabs.warnOnCloseOtherTabs";
var p = Services.prefs.getIntPref(pref);
var shouldPrompt = p > 0 && p <= tabsToClose;
if (!shouldPrompt) {
return true;
}
@ -3002,7 +3000,7 @@
reallyClose &&
!warnOnClose.value
) {
Services.prefs.setBoolPref(pref, false);
Services.prefs.setIntPref(pref, 0);
}
return reallyClose;

View File

@ -1948,7 +1948,10 @@
xbl:inherits="xbl:text=label,accesskey,fadein,pinned,selected=visuallyselected,attention"
role="presentation"/>
</xul:hbox>
<xul:image xbl:inherits="soundplaying,soundplaying-scheduledremoval,pinned,muted,blocked,selected=visuallyselected,activemedia-blocked"
<xul:image xbl:inherits="pictureinpicture"
class="tab-icon-pip"
role="presentation"/>
<xul:image xbl:inherits="soundplaying,soundplaying-scheduledremoval,pinned,muted,blocked,selected=visuallyselected,activemedia-blocked,pictureinpicture"
anonid="soundplaying-icon"
class="tab-icon-sound"
role="presentation"/>
@ -2060,6 +2063,12 @@
</getter>
</property>
<property name="pictureinpicture" readonly="true">
<getter>
return this.getAttribute("pictureinpicture") == "true";
</getter>
</property>
<property name="activeMediaBlocked" readonly="true">
<getter>
return this.getAttribute("activemedia-blocked") == "true";

View File

@ -61,7 +61,6 @@ add_task(async function test_realHistoryCheck() {
testData.output.URISpec = principal.URI.spec;
}
testData.output.originAttributes = principal.originAttributes;
testData.output.cspJSON = principal.cspJSON;
tests.push(testData);
}

View File

@ -1170,3 +1170,82 @@ add_task(async function test_handling_user_input() {
BrowserTestUtils.removeTab(tab);
});
// Test that input and change events are dispatched consistently (bug 1561882).
add_task(async function test_event_destroys_popup() {
const PAGE_CONTENT = `
<!doctype html>
<select>
<option>a</option>
<option>b</option>
</select>
<script>
gChangeEvents = 0;
gInputEvents = 0;
let select = document.querySelector("select");
select.addEventListener("input", function() {
gInputEvents++;
this.style.display = "none";
this.getBoundingClientRect();
})
select.addEventListener("change", function() {
gChangeEvents++;
})
</script>`;
const pageUrl = "data:text/html," + escape(PAGE_CONTENT);
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl);
let menulist = document.getElementById("ContentSelectDropdown");
let selectPopup = menulist.menupopup;
// Test change and input events get handled consistently
await openSelectPopup(selectPopup, "click");
EventUtils.synthesizeKey("KEY_ArrowDown");
await hideSelectPopup(selectPopup);
is(
await getChangeEvents(),
1,
"Should get change and input events consistently"
);
is(
await getInputEvents(),
1,
"Should get change and input events consistently (input)"
);
BrowserTestUtils.removeTab(tab);
});
add_task(async function test_label_not_text() {
const PAGE_CONTENT = `
<!doctype html>
<select>
<option label="Some nifty Label">Some Element Text Instead</option>
<option label="">Element Text</option>
</select>
`;
const pageUrl = "data:text/html," + escape(PAGE_CONTENT);
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl);
let menulist = document.getElementById("ContentSelectDropdown");
let selectPopup = menulist.menupopup;
await openSelectPopup(selectPopup, "click");
is(
selectPopup.children[0].label,
"Some nifty Label",
"Use the label not the text."
);
is(
selectPopup.children[1].label,
"Element Text",
"Uses the text if the label is empty, like HTMLOptionElement::GetRenderedLabel."
);
BrowserTestUtils.removeTab(tab);
});

View File

@ -1,5 +1,3 @@
[DEFAULT]
[browser_file_menu_import_wizard.js]
[browser_window_menu_list.js]
skip-if = os != "mac" # Mac only feature

View File

@ -1,45 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_task(async function test_window_menu_list() {
// This title is different depending on the build. For example, it's "Nightly"
// for a local build, "Mozilla Firefox" for an official release build.
const windowTitle = window.document.title;
await checkWindowMenu([windowTitle, "Browser chrome tests"]);
let newWindow = await BrowserTestUtils.openNewBrowserWindow();
await checkWindowMenu([windowTitle, "Browser chrome tests", windowTitle]);
await BrowserTestUtils.closeWindow(newWindow);
});
async function checkWindowMenu(labels) {
let menu = document.querySelector("#windowMenu");
// We can't toggle menubar items on OSX, so mocking instead.
await new Promise(resolve => {
menu.addEventListener("popupshown", resolve, { once: true });
menu.dispatchEvent(new MouseEvent("popupshowing"));
menu.dispatchEvent(new MouseEvent("popupshown"));
});
let menuitems = [...menu.querySelectorAll("menuseparator ~ menuitem")];
is(menuitems.length, labels.length, "Correct number of windows in the menu");
is(
menuitems.map(item => item.label).join(","),
labels.join(","),
"Correct labels on menuitems"
);
for (let menuitem of menuitems) {
ok(
menuitem instanceof customElements.get("menuitem"),
"sibling is menuitem"
);
}
// We can't toggle menubar items on OSX, so mocking instead.
await new Promise(resolve => {
menu.addEventListener("popuphidden", resolve, { once: true });
menu.dispatchEvent(new MouseEvent("popuphiding"));
menu.dispatchEvent(new MouseEvent("popuphidden"));
});
}

View File

@ -55,7 +55,7 @@ if (AppConstants.platform == "macosx") {
// referencing the whitelisted file in a way that the test can't detect, or a
// bug number to remove or use the file if it is indeed currently unreferenced.
var whitelist = [
// browser/extensions/pdfjs/content/PdfStreamConverter.jsm
// toolkt/components/pdfjs/content/PdfStreamConverter.jsm
{ file: "chrome://pdf.js/locale/chrome.properties" },
{ file: "chrome://pdf.js/locale/viewer.properties" },
@ -145,7 +145,7 @@ var whitelist = [
platforms: ["linux", "macosx"],
},
// browser/extensions/pdfjs/content/web/viewer.js#7450
// toolkt/components/pdfjs/content/web/viewer.js#7450
{ file: "resource://pdf.js/web/debugger.js" },
// resource://app/modules/translation/TranslationContentHandler.jsm
@ -184,8 +184,6 @@ var whitelist = [
{ file: "chrome://global/content/test-ipc.xul" },
// Bug 1378173 (warning: still used by devtools)
{ file: "resource://gre/modules/Promise.jsm" },
// Still used by WebIDE, which is going away but not entirely gone.
{ file: "resource://gre/modules/ZipUtils.jsm" },
// Bug 1494170
// (The references to these files are dynamically generated, so the test can't
// find the references)
@ -807,7 +805,6 @@ add_task(async function checkAllTheFiles() {
// Keep only chrome:// files, and filter out either the devtools paths or
// the non-devtools paths:
let devtoolsPrefixes = [
"chrome://webide/",
"chrome://devtools",
"resource://devtools/",
"resource://devtools-client-jsonview/",

View File

@ -24,18 +24,18 @@ let whitelist = [
},
// UA-only media features.
{
sourceName: /\b(autocomplete-item|svg)\.css$/,
sourceName: /\b(autocomplete-item)\.css$/,
errorMessage: /Expected media feature name but found \u2018-moz.*/i,
isFromDevTools: false,
platforms: ["windows"],
},
{
sourceName: /\b(contenteditable|EditorOverride|svg|forms|html|mathml|ua|pluginproblem)\.css$/i,
errorMessage: /Unknown pseudo-class.*-moz-/i,
isFromDevTools: false,
},
{
sourceName: /\b(minimal-xul|html|mathml|ua|forms|svg)\.css$/i,
sourceName: /\b(minimal-xul|html|mathml|ua|forms|svg|manageDialog|autocomplete-item-shared|formautofill)\.css$/i,
errorMessage: /Unknown property.*-moz-/i,
isFromDevTools: false,
},
@ -50,13 +50,6 @@ let whitelist = [
errorMessage: /Unknown property.*overflow-clip-box/i,
isFromDevTools: false,
},
// System colors reserved to UA / chrome sheets
{
sourceName: /(?:res|gre-resources)\/forms\.css$/i,
errorMessage: /Expected color but found \u2018-moz.*/i,
platforms: ["linux"],
isFromDevTools: false,
},
// These variables are declared somewhere else, and error when we load the
// files directly. They're all marked intermittent because their appearance
// in the error console seems to not be consistent.
@ -66,42 +59,8 @@ let whitelist = [
errorMessage: /Property contained reference to invalid variable.*color/i,
isFromDevTools: true,
},
{
sourceName: /webide\/skin\/logs\.css$/i,
intermittent: true,
errorMessage: /Property contained reference to invalid variable.*color/i,
isFromDevTools: true,
},
{
sourceName: /webide\/skin\/logs\.css$/i,
intermittent: true,
errorMessage: /Property contained reference to invalid variable.*background/i,
isFromDevTools: true,
},
];
if (
!Services.prefs.getBoolPref(
"layout.css.xul-box-display-values.content.enabled"
)
) {
// These are UA sheets which use non-content-exposed `display` values.
whitelist.push({
sourceName: /(skin\/shared\/Heartbeat|((?:res|gre-resources)\/(ua|html)))\.css$/i,
errorMessage: /Error in parsing value for .*\bdisplay\b/i,
isFromDevTools: false,
});
}
if (!Services.prefs.getBoolPref("layout.css.file-chooser-button.enabled")) {
// Reserved to UA sheets, behind a pref for content.
whitelist.push({
sourceName: /(?:res|gre-resources)\/forms\.css$/i,
errorMessage: /Unknown pseudo-.*file-chooser-button/i,
isFromDevTools: false,
});
}
if (!Services.prefs.getBoolPref("layout.css.scroll-anchoring.enabled")) {
whitelist.push({
sourceName: /webconsole\.css$/i,
@ -393,7 +352,7 @@ add_task(async function checkAllTheCSS() {
// filter out either the devtools paths or the non-devtools paths:
let isDevtools = SimpleTest.harnessParameters.subsuite == "devtools";
let devtoolsPathBits = ["webide", "devtools"];
let devtoolsPathBits = ["devtools"];
uris = uris.filter(
uri => isDevtools == devtoolsPathBits.some(path => uri.spec.includes(path))
);
@ -500,9 +459,9 @@ add_task(async function checkAllTheCSS() {
checkWhitelist(propNameWhitelist);
// Clean up to avoid leaks:
iframe.remove();
doc.head.innerHTML = "";
doc = null;
iframe.remove();
iframe = null;
win = null;
hiddenFrame.destroy();

View File

@ -25,10 +25,10 @@ browser.jar:
content/browser/aboutTabCrashed.xhtml (content/aboutTabCrashed.xhtml)
* content/browser/browser.css (content/browser.css)
content/browser/browser.js (content/browser.js)
#ifdef MOZ_BROWSER_XUL
* content/browser/browser.xul (content/browser.xul)
#else
#ifdef MOZ_BROWSER_XHTML
* content/browser/browser.xhtml (content/browser.xhtml)
#else
* content/browser/browser.xul (content/browser.xul)
#endif
content/browser/browser-addons.js (content/browser-addons.js)
content/browser/browser-allTabsMenu.js (content/browser-allTabsMenu.js)

View File

@ -57,8 +57,8 @@ BROWSER_CHROME_MANIFESTS += [
DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
DEFINES['MOZ_APP_VERSION_DISPLAY'] = CONFIG['MOZ_APP_VERSION_DISPLAY']
if CONFIG['MOZ_BROWSER_XUL']:
DEFINES['MOZ_BROWSER_XUL'] = CONFIG['MOZ_BROWSER_XUL']
if CONFIG['MOZ_BROWSER_XHTML']:
DEFINES['MOZ_BROWSER_XHTML'] = CONFIG['MOZ_BROWSER_XHTML']
DEFINES['APP_LICENSE_BLOCK'] = '%s/content/overrides/app-license.html' % SRCDIR

View File

@ -8,6 +8,7 @@
background-repeat: no-repeat;
background-color: rgb(10,17,37);
color: #fff;
background-size: 100%;
}
.text-link {

View File

@ -562,6 +562,7 @@ const listeners = {
"PictureInPicture:Close": ["PictureInPicture"],
"PictureInPicture:Playing": ["PictureInPicture"],
"PictureInPicture:Paused": ["PictureInPicture"],
"PictureInPicture:OpenToggleContextMenu": ["PictureInPicture"],
"Prompt:Open": ["RemotePrompt"],
"Reader:FaviconRequest": ["ReaderParent"],
"Reader:UpdateReaderButton": ["ReaderParent"],
@ -1366,39 +1367,6 @@ BrowserGlue.prototype = {
);
},
_firstWindowTelemetry(aWindow) {
let scaling = aWindow.devicePixelRatio * 100;
try {
Services.telemetry.getHistogramById("DISPLAY_SCALING").add(scaling);
} catch (ex) {}
},
_collectStartupConditionsTelemetry() {
let nowSeconds = Math.round(Date.now() / 1000);
// Don't include cases where we don't have the pref. This rules out the first install
// as well as the first run of a build since this was introduced. These could by some
// definitions be referred to as "cold" startups, but probably not since we likely
// just wrote many of the files we use to disk. This way we should approximate a lower
// bound to the number of cold startups rather than an upper bound.
let lastCheckSeconds = Services.prefs.getIntPref(
"browser.startup.lastColdStartupCheck",
nowSeconds
);
Services.prefs.setIntPref(
"browser.startup.lastColdStartupCheck",
nowSeconds
);
try {
let secondsSinceLastOSRestart =
Services.startup.secondsSinceLastOSRestart;
let isColdStartup =
nowSeconds - secondsSinceLastOSRestart > lastCheckSeconds;
Services.telemetry.scalarSet("startup.is_cold", isColdStartup);
} catch (ex) {
Cu.reportError(ex);
}
},
// the first browser window has finished initializing
_onFirstWindowLoaded: function BG__onFirstWindowLoaded(aWindow) {
TabCrashHandler.init();
@ -1489,11 +1457,8 @@ BrowserGlue.prototype = {
PageActions.init();
this._firstWindowTelemetry(aWindow);
this._firstWindowLoaded();
this._collectStartupConditionsTelemetry();
// Set the default favicon size for UI views that use the page-icon protocol.
PlacesUtils.favicons.setDefaultIconURIPreferredSize(
16 * aWindow.devicePixelRatio
@ -1956,6 +1921,7 @@ BrowserGlue.prototype = {
var windowcount = 0;
var pagecount = 0;
const prfwrn = "browser.tabs.warnOnClose";
for (let win of BrowserWindowTracker.orderedWindows) {
if (win.closed) {
continue;
@ -1983,6 +1949,7 @@ BrowserGlue.prototype = {
let sessionWillBeRestored =
Services.prefs.getIntPref("browser.startup.page") == 3 ||
Services.prefs.getBoolPref("browser.sessionstore.resume_session_once");
// In the sessionWillBeRestored case, we only check the sessionstore-specific pref:
if (sessionWillBeRestored) {
if (
@ -1991,8 +1958,9 @@ BrowserGlue.prototype = {
return;
}
// Otherwise, we check browser.tabs.warnOnClose
} else if (Services.prefs.getIntPref("browser.tabs.warnOnClose") >= pagecount) {
return;
} else {
var p = Services.prefs.getIntPref(prfwrn);
if (p == 0 || p > pagecount) return;
}
let win = BrowserWindowTracker.getTopWindow();
@ -2056,7 +2024,7 @@ BrowserGlue.prototype = {
// If the user has unticked the box, and has confirmed closing, stop showing
// the warning.
if (!sessionWillBeRestored && buttonPressed == 0 && !warnOnClose.value) {
Services.prefs.setBoolPref("browser.tabs.warnOnClose", false);
Services.prefs.setIntPref(prfwrn, 0);
}
aCancelQuit.data = buttonPressed != 0;
},
@ -2545,22 +2513,11 @@ BrowserGlue.prototype = {
}
},
_migrateXULStoreForDocument(fromURL, toURL) {
Array.from(Services.xulStore.getIDsEnumerator(fromURL)).forEach((id) => {
Array.from(Services.xulStore.getAttributeEnumerator(fromURL, id)).forEach(
attr => {
let value = Services.xulStore.getValue(fromURL, id, attr);
Services.xulStore.setValue(toURL, id, attr, value);
}
);
});
},
// eslint-disable-next-line complexity
_migrateUI: function BG__migrateUI() {
// Use an increasing number to keep track of the current migration state.
// Completely unrelated to the current Firefox release number.
const UI_VERSION = 82;
const UI_VERSION = 81;
const BROWSER_DOCURL = AppConstants.BROWSER_CHROME_URL;
let currentUIVersion;
@ -2905,11 +2862,6 @@ BrowserGlue.prototype = {
}
}
if (currentUIVersion < 82) {
this._migrateXULStoreForDocument("chrome://browser/content/browser.xul",
"chrome://browser/content/browser.xhtml");
}
// Update the migration version.
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
},

View File

@ -197,8 +197,5 @@ input[type="url"][readOnly]:hover:active {
outline: 2px solid var(--in-content-border-active);
/* offset outline to align with 1px border-width set for buttons/menulists above. */
outline-offset: -1px;
/* Make outline-radius slightly bigger than the border-radius set above,
* to make the thicker outline corners look smooth */
-moz-outline-radius: 3px;
box-shadow: 0 0 0 4px var(--in-content-border-active-shadow);
}

View File

@ -2021,7 +2021,7 @@ var CustomizableUIInternal = {
}
}
let tagName = target.localName;
inInput = tagName == "input" || tagName == "textbox";
inInput = tagName == "input" || tagName == "searchbar";
inItem = tagName == "toolbaritem" || tagName == "toolbarbutton";
let isMenuItem = tagName == "menuitem";
inMenu = inMenu || isMenuItem;

View File

@ -1007,7 +1007,7 @@ XPCOMUtils.defineConstant(this, "PanelUI", PanelUI);
* @return the selected locale
*/
function getLocale() {
return Services.locale.appLocaleAsLangTag;
return Services.locale.appLocaleAsBCP47;
}
/**

View File

@ -357,7 +357,7 @@ this.ActivityStream = class ActivityStream {
this.geo = "";
}
this.locale = Services.locale.appLocaleAsLangTag;
this.locale = Services.locale.appLocaleAsBCP47;
// Update the pref config of those with dynamic values
for (const pref of PREFS_CONFIG.keys()) {

View File

@ -19,9 +19,6 @@
// the width of the textfield.
let DOMUtils = window.windowUtils;
let textboxRect = DOMUtils.getBoundsWithoutFlushing(this.mInput);
let inputRect = DOMUtils.getBoundsWithoutFlushing(
this.mInput.inputField
);
// Ensure the panel is wide enough to fit at least 3 engines.
let minWidth = Math.max(
@ -29,12 +26,6 @@
this.oneOffButtons.buttonWidth * 3
);
this.style.minWidth = Math.round(minWidth) + "px";
// Alignment of the panel with the searchbar is obtained with negative
// margins.
this.style.marginLeft = textboxRect.left - inputRect.left + "px";
// This second margin is needed when the direction is reversed,
// eg. when using command+shift+X.
this.style.marginRight = inputRect.right - textboxRect.right + "px";
// First handle deciding if we are showing the reduced version of the
// popup containing only the preferences button. We do this if the
@ -60,13 +51,6 @@
this.updateHeader();
});
this.addEventListener("popuphiding", event => {
this._isHiding = true;
Services.tm.dispatchToMainThread(() => {
this._isHiding = false;
});
});
/**
* This handles clicks on the topmost "Foo Search" header in the
* popup (hbox.search-panel-header]).
@ -84,14 +68,6 @@
this.oneOffButtons.handleSearchCommand(event, engine);
});
/**
* Popup rollup is triggered by native events before the mousedown event
* reaches the DOM. The will be set to true by the popuphiding event and
* false after the mousedown event has been triggered to detect what
* caused rollup.
*/
this._isHiding = false;
this._bundle = null;
}
@ -247,10 +223,9 @@
this.removeAttribute("src");
}
let headerText = this.bundle.formatStringFromName(
"searchHeader",
[currentEngine.name]
);
let headerText = this.bundle.formatStringFromName("searchHeader", [
currentEngine.name,
]);
this.searchbarEngineName.setAttribute("value", headerText);
this.searchbarEngine.engine = currentEngine;
});

View File

@ -1,369 +0,0 @@
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- XULCommandEvent is a specialised global. -->
<!-- global XULCommandEvent -->
<!DOCTYPE bindings [
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
]>
<bindings id="SearchBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="searchbar-textbox"
extends="chrome://global/content/bindings/autocomplete.xml#autocomplete">
<implementation>
<constructor><![CDATA[
if (this.closest("searchbar").parentNode.parentNode.localName ==
"toolbarpaletteitem")
return;
if (Services.prefs.getBoolPref("browser.urlbar.clickSelectsAll"))
this.setAttribute("clickSelectsAll", true);
let textBox = document.getAnonymousElementByAttribute(this,
"anonid", "moz-input-box");
// Force the Custom Element to upgrade until Bug 1470242 handles this:
customElements.upgrade(textBox);
let cxmenu = textBox.menupopup;
cxmenu.addEventListener("popupshowing",
() => { this.initContextMenu(cxmenu); },
{capture: true, once: true});
this.setAttribute("aria-owns", this.popup.id);
this.closest("searchbar")._textboxInitialized = true;
]]></constructor>
<destructor><![CDATA[
// If the context menu has never been opened, there won't be anything
// to remove here.
// Also, XBL and the customize toolbar code sometimes interact poorly.
try {
this.closest("searchbar")._textboxInitialized = false;
this.controllers.removeController(this.searchbarController);
} catch (ex) { }
]]></destructor>
// Add items to context menu and attach controller to handle them the
// first time the context menu is opened.
<method name="initContextMenu">
<parameter name="aMenu"/>
<body><![CDATA[
let stringBundle = this.closest("searchbar")._stringBundle;
let pasteAndSearch, suggestMenuItem;
let element, label, akey;
element = document.createXULElement("menuseparator");
aMenu.appendChild(element);
let insertLocation = aMenu.firstElementChild;
while (insertLocation.nextElementSibling &&
insertLocation.getAttribute("cmd") != "cmd_paste")
insertLocation = insertLocation.nextElementSibling;
if (insertLocation) {
element = document.createXULElement("menuitem");
label = stringBundle.getString("cmd_pasteAndSearch");
element.setAttribute("label", label);
element.setAttribute("anonid", "paste-and-search");
element.setAttribute("oncommand", "BrowserSearch.pasteAndSearch(event)");
aMenu.insertBefore(element, insertLocation.nextElementSibling);
pasteAndSearch = element;
}
element = document.createXULElement("menuitem");
label = stringBundle.getString("cmd_clearHistory");
akey = stringBundle.getString("cmd_clearHistory_accesskey");
element.setAttribute("label", label);
element.setAttribute("accesskey", akey);
element.setAttribute("cmd", "cmd_clearhistory");
aMenu.appendChild(element);
element = document.createXULElement("menuitem");
label = stringBundle.getString("cmd_showSuggestions");
akey = stringBundle.getString("cmd_showSuggestions_accesskey");
element.setAttribute("anonid", "toggle-suggest-item");
element.setAttribute("label", label);
element.setAttribute("accesskey", akey);
element.setAttribute("cmd", "cmd_togglesuggest");
element.setAttribute("type", "checkbox");
element.setAttribute("autocheck", "false");
suggestMenuItem = element;
aMenu.appendChild(element);
if (AppConstants.platform == "macosx") {
this.addEventListener("keypress", aEvent => {
if (aEvent.keyCode == KeyEvent.DOM_VK_F4)
this.openSearch();
}, true);
}
this.controllers.appendController(this.searchbarController);
let onpopupshowing = function() {
BrowserSearch.searchBar._textbox.closePopup();
if (suggestMenuItem) {
let enabled =
Services.prefs.getBoolPref("browser.search.suggest.enabled");
suggestMenuItem.setAttribute("checked", enabled);
}
if (!pasteAndSearch)
return;
let controller = document.commandDispatcher.getControllerForCommand("cmd_paste");
let enabled = controller.isCommandEnabled("cmd_paste");
if (enabled)
pasteAndSearch.removeAttribute("disabled");
else
pasteAndSearch.setAttribute("disabled", "true");
};
aMenu.addEventListener("popupshowing", onpopupshowing);
onpopupshowing();
]]></body>
</method>
<!--
This overrides the searchParam property in autocomplete.xml. We're
hijacking this property as a vehicle for delivering the privacy
information about the window into the guts of nsSearchSuggestions.
Note that the setter is the same as the parent. We were not sure whether
we can override just the getter. If that proves to be the case, the setter
can be removed.
-->
<property name="searchParam"
onget="return this.getAttribute('autocompletesearchparam') +
(PrivateBrowsingUtils.isWindowPrivate(window) ? '|private' : '');"
onset="this.setAttribute('autocompletesearchparam', val); return val;"/>
<!-- This is implemented so that when textbox.value is set directly (e.g.,
by tests), the one-off query is updated. -->
<method name="onBeforeValueSet">
<parameter name="aValue"/>
<body><![CDATA[
this.popup.oneOffButtons.query = aValue;
return aValue;
]]></body>
</method>
<!--
This method overrides the autocomplete binding's openPopup (essentially
duplicating the logic from the autocomplete popup binding's
openAutocompletePopup method), modifying it so that the popup is aligned with
the inner textbox, but sized to not extend beyond the search bar border.
-->
<method name="openPopup">
<body><![CDATA[
// Entering customization mode after the search bar had focus causes
// the popup to appear again, due to focus returning after the
// hamburger panel closes. Don't open in that spurious event.
if (document.documentElement.getAttribute("customizing") == "true") {
return;
}
let popup = this.popup;
if (!popup.mPopupOpen) {
// Initially the panel used for the searchbar (PopupSearchAutoComplete
// in browser.xul) is hidden to avoid impacting startup / new
// window performance. The base binding's openPopup would normally
// call the overriden openAutocompletePopup in
// browser-search-autocomplete-result-popup binding to unhide the popup,
// but since we're overriding openPopup we need to unhide the panel
// ourselves.
popup.hidden = false;
// Don't roll up on mouse click in the anchor for the search UI.
if (popup.id == "PopupSearchAutoComplete") {
popup.setAttribute("norolluponanchor", "true");
}
popup.mInput = this;
// clear any previous selection, see bugs 400671 and 488357
popup.selectedIndex = -1;
document.popupNode = null;
let outerRect = this.getBoundingClientRect();
let innerRect = this.inputField.getBoundingClientRect();
let width = RTL_UI ?
innerRect.right - outerRect.left :
outerRect.right - innerRect.left;
popup.setAttribute("width", width > 100 ? width : 100);
// invalidate() depends on the width attribute
popup._invalidate();
let yOffset = outerRect.bottom - innerRect.bottom;
popup.openPopup(this.inputField, "after_start", 0, yOffset, false, false);
}
]]></body>
</method>
<method name="openSearch">
<body>
<![CDATA[
if (!this.popupOpen) {
this.closest("searchbar").openSuggestionsPanel();
return false;
}
return true;
]]>
</body>
</method>
<method name="handleEnter">
<parameter name="event"/>
<body><![CDATA[
// Toggle the open state of the add-engine menu button if it's
// selected. We're using handleEnter for this instead of listening
// for the command event because a command event isn't fired.
if (this.selectedButton &&
this.selectedButton.getAttribute("anonid") ==
"addengine-menu-button") {
this.selectedButton.open = !this.selectedButton.open;
return true;
}
// Otherwise, "call super": do what the autocomplete binding's
// handleEnter implementation does.
return this.mController.handleEnter(false, event || null);
]]></body>
</method>
<!-- override |onTextEntered| in autocomplete.xml -->
<method name="onTextEntered">
<parameter name="aEvent"/>
<body><![CDATA[
let engine;
let oneOff = this.selectedButton;
if (oneOff) {
if (!oneOff.engine) {
oneOff.doCommand();
return;
}
engine = oneOff.engine;
}
if (this._selectionDetails) {
BrowserSearch.searchBar.telemetrySearchDetails = this._selectionDetails;
this._selectionDetails = null;
}
this.closest("searchbar").handleSearchCommand(aEvent, engine);
]]></body>
</method>
<property name="selectedButton">
<getter><![CDATA[
return this.popup.oneOffButtons.selectedButton;
]]></getter>
<setter><![CDATA[
return this.popup.oneOffButtons.selectedButton = val;
]]></setter>
</property>
<method name="handleKeyboardNavigation">
<parameter name="aEvent"/>
<body><![CDATA[
let popup = this.popup;
if (!popup.popupOpen)
return;
// accel + up/down changes the default engine and shouldn't affect
// the selection on the one-off buttons.
if (aEvent.getModifierState("Accel"))
return;
let suggestionsHidden =
popup.richlistbox.getAttribute("collapsed") == "true";
let numItems = suggestionsHidden ? 0 : this.popup.matchCount;
this.popup.oneOffButtons.handleKeyPress(aEvent, numItems, true);
]]></body>
</method>
<!-- nsIController -->
<field name="searchbarController" readonly="true"><![CDATA[({
_self: this,
supportsCommand(aCommand) {
return aCommand == "cmd_clearhistory" ||
aCommand == "cmd_togglesuggest";
},
isCommandEnabled(aCommand) {
return true;
},
doCommand(aCommand) {
switch (aCommand) {
case "cmd_clearhistory":
let param = this._self.getAttribute("autocompletesearchparam");
BrowserSearch.searchBar.FormHistory.update({ op: "remove", fieldname: param }, null);
this._self.value = "";
break;
case "cmd_togglesuggest":
let enabled =
Services.prefs.getBoolPref("browser.search.suggest.enabled");
Services.prefs.setBoolPref("browser.search.suggest.enabled",
!enabled);
break;
default:
// do nothing with unrecognized command
}
},
})]]></field>
</implementation>
<handlers>
<handler event="input"><![CDATA[
this.popup.removeAttribute("showonlysettings");
]]></handler>
<handler event="keypress" phase="capturing"
action="return this.handleKeyboardNavigation(event);"/>
<handler event="keypress" keycode="VK_UP" modifiers="accel"
phase="capturing"
action='this.closest("searchbar").selectEngine(event, false);'/>
<handler event="keypress" keycode="VK_DOWN" modifiers="accel"
phase="capturing"
action='this.closest("searchbar").selectEngine(event, true);'/>
<handler event="keypress" keycode="VK_DOWN" modifiers="alt"
phase="capturing"
action="return this.openSearch();"/>
<handler event="keypress" keycode="VK_UP" modifiers="alt"
phase="capturing"
action="return this.openSearch();"/>
<handler event="dragover">
<![CDATA[
let types = event.dataTransfer.types;
if (types.includes("text/plain") || types.includes("text/x-moz-text-internal"))
event.preventDefault();
]]>
</handler>
<handler event="drop">
<![CDATA[
let dataTransfer = event.dataTransfer;
let data = dataTransfer.getData("text/plain");
if (!data)
data = dataTransfer.getData("text/x-moz-text-internal");
if (data) {
event.preventDefault();
this.value = data;
this.closest("searchbar").openSuggestionsPanel();
}
]]>
</handler>
</handlers>
</binding>
</bindings>

View File

@ -23,6 +23,7 @@
constructor() {
super();
this.destroy = this.destroy.bind(this);
this._setupEventListeners();
let searchbar = this;
@ -42,23 +43,24 @@
},
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver]),
};
this.content = MozXULElement.parseXULToFragment(
`
<stringbundle src="chrome://browser/locale/search.properties"></stringbundle>
<textbox class="searchbar-textbox" type="autocomplete" inputtype="search" placeholder="&searchInput.placeholder;" flex="1" autocompletepopup="PopupSearchAutoComplete" autocompletesearch="search-autocomplete" autocompletesearchparam="searchbar-history" maxrows="10" completeselectedindex="true" minresultsforpopup="0">
<box>
<hbox class="searchbar-search-button" tooltiptext="&searchIcon.tooltip;">
<image class="searchbar-search-icon"></image>
<image class="searchbar-search-icon-overlay"></image>
</hbox>
</box>
<textbox class="searchbar-textbox" type="autocomplete" inputtype="search" placeholder="&searchInput.placeholder;" flex="1" autocompletepopup="PopupSearchAutoComplete" autocompletesearch="search-autocomplete" autocompletesearchparam="searchbar-history" maxrows="10" completeselectedindex="true" minresultsforpopup="0"/>
<hbox class="search-go-container">
<image class="search-go-button urlbar-icon" hidden="true" onclick="handleSearchCommand(event);" tooltiptext="&contentSearchSubmit.tooltip;"></image>
</hbox>
</textbox>
`,
["chrome://browser/locale/browser.dtd"]
);
this._ignoreFocus = false;
this._engines = null;
}
connectedCallback() {
@ -69,28 +71,25 @@
this.appendChild(document.importNode(this.content, true));
this.initializeAttributeInheritance();
window.addEventListener("unload", this.destroy);
this._ignoreFocus = false;
this._clickClosedPopup = false;
// Don't go further if in Customize mode.
if (this.parentNode.parentNode.localName == "toolbarpaletteitem") {
return;
}
this._stringBundle = this.querySelector("stringbundle");
this._textboxInitialized = false;
this._textbox = this.querySelector(".searchbar-textbox");
this._engines = null;
this._setupTextboxEventListeners();
this._initTextbox();
window.addEventListener("unload", this.destroy);
this.FormHistory = ChromeUtils.import(
"resource://gre/modules/FormHistory.jsm",
{}
).FormHistory;
if (this.parentNode.parentNode.localName == "toolbarpaletteitem") {
return;
}
Services.obs.addObserver(this.observer, "browser-search-engine-modified");
Services.obs.addObserver(this.observer, "browser-search-service");
@ -188,7 +187,11 @@
// Also make sure the textbox has ever been constructed, otherwise the
// _textbox getter will cause the textbox constructor to run, add an
// observer, and leak the world too.
if (this._textboxInitialized && this._textbox.mController.input == this) {
if (
this._textbox &&
this._textbox.mController &&
this._textbox.mController.input == this
) {
this._textbox.mController.input = null;
}
}
@ -498,18 +501,6 @@
true
);
this.addEventListener(
"mousedown",
event => {
if (
event.originalTarget.classList.contains("searchbar-search-button")
) {
this._clickClosedPopup = this._textbox.popup._isHiding;
}
},
true
);
this.addEventListener("mousedown", event => {
// Ignore right clicks
if (event.button != 0) {
@ -530,18 +521,380 @@
"searchbar-search-button"
);
// Ignore clicks on the icon if they were made to close the popup
if (isIconClick && this._clickClosedPopup) {
return;
}
// Hide popup when icon is clicked while popup is open
if (isIconClick && this.textbox.popup.popupOpen) {
this.textbox.popup.closePopup();
} else if (isIconClick || this._textbox.value) {
// Open the suggestions whenever clicking on the search icon or if there
// is text in the textbox.
if (isIconClick || this._textbox.value) {
this.openSuggestionsPanel(true);
}
});
}
_setupTextboxEventListeners() {
this.textbox.addEventListener("input", event => {
this.textbox.popup.removeAttribute("showonlysettings");
});
this.textbox.addEventListener(
"keypress",
event => {
// accel + up/down changes the default engine and shouldn't affect
// the selection on the one-off buttons.
let popup = this.textbox.popup;
if (!popup.popupOpen || event.getModifierState("Accel")) {
return;
}
let suggestionsHidden =
popup.richlistbox.getAttribute("collapsed") == "true";
let numItems = suggestionsHidden ? 0 : popup.matchCount;
popup.oneOffButtons.handleKeyPress(event, numItems, true);
},
true
);
this.textbox.addEventListener(
"keypress",
event => {
if (
event.keyCode == KeyEvent.DOM_VK_UP &&
event.getModifierState("Accel")
) {
this.selectEngine(event, false);
}
},
true
);
this.textbox.addEventListener(
"keypress",
event => {
if (
event.keyCode == KeyEvent.DOM_VK_DOWN &&
event.getModifierState("Accel")
) {
this.selectEngine(event, true);
}
},
true
);
this.textbox.addEventListener(
"keypress",
event => {
if (
event.getModifierState("Alt") &&
(event.keyCode == KeyEvent.DOM_VK_DOWN ||
event.keyCode == KeyEvent.DOM_VK_UP)
) {
this.textbox.openSearch();
}
},
true
);
this.textbox.addEventListener("dragover", event => {
let types = event.dataTransfer.types;
if (
types.includes("text/plain") ||
types.includes("text/x-moz-text-internal")
) {
event.preventDefault();
}
});
this.textbox.addEventListener("drop", event => {
let dataTransfer = event.dataTransfer;
let data = dataTransfer.getData("text/plain");
if (!data) {
data = dataTransfer.getData("text/x-moz-text-internal");
}
if (data) {
event.preventDefault();
this.textbox.value = data;
this.openSuggestionsPanel();
}
});
}
_initTextbox() {
// nsIController
this.searchbarController = {
textbox: this.textbox,
supportsCommand(command) {
return (
command == "cmd_clearhistory" || command == "cmd_togglesuggest"
);
},
isCommandEnabled(command) {
return true;
},
doCommand(command) {
switch (command) {
case "cmd_clearhistory":
let param = this.textbox.getAttribute("autocompletesearchparam");
BrowserSearch.searchBar.FormHistory.update(
{ op: "remove", fieldname: param },
null
);
this.textbox.value = "";
break;
case "cmd_togglesuggest":
let enabled = Services.prefs.getBoolPref(
"browser.search.suggest.enabled"
);
Services.prefs.setBoolPref(
"browser.search.suggest.enabled",
!enabled
);
break;
default:
// do nothing with unrecognized command
}
},
};
if (this.parentNode.parentNode.localName == "toolbarpaletteitem") {
return;
}
if (Services.prefs.getBoolPref("browser.urlbar.clickSelectsAll")) {
this.textbox.setAttribute("clickSelectsAll", true);
}
let inputBox = document.getAnonymousElementByAttribute(
this.textbox,
"anonid",
"moz-input-box"
);
// Force the Custom Element to upgrade until Bug 1470242 handles this:
window.customElements.upgrade(inputBox);
let cxmenu = inputBox.menupopup;
cxmenu.addEventListener(
"popupshowing",
() => {
this._initContextMenu(cxmenu);
},
{ capture: true, once: true }
);
this.textbox.setAttribute("aria-owns", this.textbox.popup.id);
// This overrides the searchParam property in autocomplete.xml. We're
// hijacking this property as a vehicle for delivering the privacy
// information about the window into the guts of nsSearchSuggestions.
// Note that the setter is the same as the parent. We were not sure whether
// we can override just the getter. If that proves to be the case, the setter
// can be removed.
Object.defineProperty(this.textbox, "searchParam", {
get() {
return (
this.getAttribute("autocompletesearchparam") +
(PrivateBrowsingUtils.isWindowPrivate(window) ? "|private" : "")
);
},
set(val) {
this.setAttribute("autocompletesearchparam", val);
return val;
},
});
Object.defineProperty(this.textbox, "selectedButton", {
get() {
return this.popup.oneOffButtons.selectedButton;
},
set(val) {
return (this.popup.oneOffButtons.selectedButton = val);
},
});
// This is implemented so that when textbox.value is set directly (e.g.,
// by tests), the one-off query is updated.
this.textbox.onBeforeValueSet = aValue => {
this.textbox.popup.oneOffButtons.query = aValue;
return aValue;
};
// This method overrides the autocomplete binding's openPopup (essentially
// duplicating the logic from the autocomplete popup binding's
// openAutocompletePopup method), modifying it so that the popup is aligned with
// the inner textbox, but sized to not extend beyond the search bar border.
this.textbox.openPopup = () => {
// Entering customization mode after the search bar had focus causes
// the popup to appear again, due to focus returning after the
// hamburger panel closes. Don't open in that spurious event.
if (document.documentElement.getAttribute("customizing") == "true") {
return;
}
let popup = this.textbox.popup;
if (!popup.mPopupOpen) {
// Initially the panel used for the searchbar (PopupSearchAutoComplete
// in browser.xhtml) is hidden to avoid impacting startup / new
// window performance. The base binding's openPopup would normally
// call the overriden openAutocompletePopup in
// browser-search-autocomplete-result-popup binding to unhide the popup,
// but since we're overriding openPopup we need to unhide the panel
// ourselves.
popup.hidden = false;
// Don't roll up on mouse click in the anchor for the search UI.
if (popup.id == "PopupSearchAutoComplete") {
popup.setAttribute("norolluponanchor", "true");
}
popup.mInput = this.textbox;
// clear any previous selection, see bugs 400671 and 488357
popup.selectedIndex = -1;
document.popupNode = null;
let { width } = this.getBoundingClientRect();
popup.setAttribute("width", width > 100 ? width : 100);
// invalidate() depends on the width attribute
popup._invalidate();
popup.openPopup(this, "after_start");
}
};
this.textbox.openSearch = () => {
if (!this.textbox.popupOpen) {
this.openSuggestionsPanel();
return false;
}
return true;
};
this.textbox.handleEnter = event => {
// Toggle the open state of the add-engine menu button if it's
// selected. We're using handleEnter for this instead of listening
// for the command event because a command event isn't fired.
if (
this.textbox.selectedButton &&
this.textbox.selectedButton.getAttribute("anonid") ==
"addengine-menu-button"
) {
this.textbox.selectedButton.open = !this.textbox.selectedButton.open;
return true;
}
// Otherwise, "call super": do what the autocomplete binding's
// handleEnter implementation does.
return this.textbox.mController.handleEnter(false, event || null);
};
// override |onTextEntered| in autocomplete.xml
this.textbox.onTextEntered = event => {
let engine;
let oneOff = this.textbox.selectedButton;
if (oneOff) {
if (!oneOff.engine) {
oneOff.doCommand();
return;
}
engine = oneOff.engine;
}
if (this.textbox._selectionDetails) {
BrowserSearch.searchBar.telemetrySearchDetails = this.textbox._selectionDetails;
this.textbox._selectionDetails = null;
}
this.handleSearchCommand(event, engine);
};
}
_initContextMenu(aMenu) {
let stringBundle = this._stringBundle;
let pasteAndSearch, suggestMenuItem;
let element, label, akey;
element = document.createXULElement("menuseparator");
aMenu.appendChild(element);
let insertLocation = aMenu.firstElementChild;
while (
insertLocation.nextElementSibling &&
insertLocation.getAttribute("cmd") != "cmd_paste"
) {
insertLocation = insertLocation.nextElementSibling;
}
if (insertLocation) {
element = document.createXULElement("menuitem");
label = stringBundle.getString("cmd_pasteAndSearch");
element.setAttribute("label", label);
element.setAttribute("anonid", "paste-and-search");
element.setAttribute(
"oncommand",
"BrowserSearch.pasteAndSearch(event)"
);
aMenu.insertBefore(element, insertLocation.nextElementSibling);
pasteAndSearch = element;
}
element = document.createXULElement("menuitem");
label = stringBundle.getString("cmd_clearHistory");
akey = stringBundle.getString("cmd_clearHistory_accesskey");
element.setAttribute("label", label);
element.setAttribute("accesskey", akey);
element.setAttribute("cmd", "cmd_clearhistory");
aMenu.appendChild(element);
element = document.createXULElement("menuitem");
label = stringBundle.getString("cmd_showSuggestions");
akey = stringBundle.getString("cmd_showSuggestions_accesskey");
element.setAttribute("anonid", "toggle-suggest-item");
element.setAttribute("label", label);
element.setAttribute("accesskey", akey);
element.setAttribute("cmd", "cmd_togglesuggest");
element.setAttribute("type", "checkbox");
element.setAttribute("autocheck", "false");
suggestMenuItem = element;
aMenu.appendChild(element);
if (AppConstants.platform == "macosx") {
this.textbox.addEventListener(
"keypress",
event => {
if (event.keyCode == KeyEvent.DOM_VK_F4) {
this.textbox.openSearch();
}
},
true
);
}
this.textbox.controllers.appendController(this.searchbarController);
let onpopupshowing = function() {
BrowserSearch.searchBar._textbox.closePopup();
if (suggestMenuItem) {
let enabled = Services.prefs.getBoolPref(
"browser.search.suggest.enabled"
);
suggestMenuItem.setAttribute("checked", enabled);
}
if (!pasteAndSearch) {
return;
}
let controller = document.commandDispatcher.getControllerForCommand(
"cmd_paste"
);
let enabled = controller.isCommandEnabled("cmd_paste");
if (enabled) {
pasteAndSearch.removeAttribute("disabled");
} else {
pasteAndSearch.setAttribute("disabled", "true");
}
};
aMenu.addEventListener("popupshowing", onpopupshowing);
onpopupshowing();
}
}
customElements.define("searchbar", MozSearchbar);

View File

@ -3,7 +3,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
browser.jar:
content/browser/search/search.xml (content/search.xml)
content/browser/search/autocomplete-popup.js (content/autocomplete-popup.js)
content/browser/search/searchbar.js (content/searchbar.js)
content/browser/search/search-one-offs.js (content/search-one-offs.js)

View File

@ -25,9 +25,6 @@ ChromeUtils.defineModuleGetter(
"resource://gre/modules/sessionstore/SessionHistory.jsm"
);
// A bound to the size of data to store for DOM Storage.
const DOM_STORAGE_LIMIT_PREF = "browser.sessionstore.dom_storage_limit";
// This pref controls whether or not we send updates to the parent on a timeout
// or not, and should only be used for tests or debugging.
const TIMEOUT_DISABLED_PREF = "browser.sessionstore.debug.no_auto_updates";
@ -313,187 +310,6 @@ SessionHistoryListener.prototype.QueryInterface = ChromeUtils.generateQI([
Ci.nsISupportsWeakReference,
]);
/**
* Listens for changes to input elements. Whenever the value of an input
* element changes we will re-collect data for the current frame tree and send
* a message to the parent process.
*
* Causes a SessionStore:update message to be sent that contains the form data
* for all reachable frames.
*
* Example:
* {
* formdata: {url: "http://mozilla.org/", id: {input_id: "input value"}},
* children: [
* null,
* {url: "http://sub.mozilla.org/", id: {input_id: "input value 2"}}
* ]
* }
*/
class FormDataListener extends Handler {
constructor(store) {
super(store);
SessionStoreUtils.addDynamicFrameFilteredListener(
this.mm,
"input",
this,
true
);
this.stateChangeNotifier.addObserver(this);
}
handleEvent() {
this.messageQueue.push("formdata", () => this.collect());
}
onPageLoadStarted() {
this.messageQueue.push("formdata", () => null);
}
collect() {
return SessionStoreUtils.collectFormData(this.mm.content);
}
}
/**
* Listens for changes to the DOMSessionStorage. Whenever new keys are added,
* existing ones removed or changed, or the storage is cleared we will send a
* message to the parent process containing up-to-date sessionStorage data.
*
* Causes a SessionStore:update message to be sent that contains the current
* DOMSessionStorage contents. The data is a nested object using host names
* as keys and per-host DOMSessionStorage data as values.
*/
class SessionStorageListener extends Handler {
constructor(store) {
super(store);
// We don't want to send all the session storage data for all the frames
// for every change. So if only a few value changed we send them over as
// a "storagechange" event. If however for some reason before we send these
// changes we have to send over the entire sessions storage data, we just
// reset these changes.
this._changes = undefined;
// The event listener waiting for MozSessionStorageChanged events.
this._listener = null;
Services.obs.addObserver(this, "browser:purge-sessionStorage");
this.stateChangeNotifier.addObserver(this);
this.resetEventListener();
}
uninit() {
Services.obs.removeObserver(this, "browser:purge-sessionStorage");
}
observe() {
// Collect data on the next tick so that any other observer
// that needs to purge data can do its work first.
setTimeoutWithTarget(() => this.collect(), 0, this.mm.tabEventTarget);
}
resetChanges() {
this._changes = undefined;
}
resetEventListener() {
if (!this._listener) {
this._listener = SessionStoreUtils.addDynamicFrameFilteredListener(
this.mm,
"MozSessionStorageChanged",
this,
true
);
}
}
removeEventListener() {
SessionStoreUtils.removeDynamicFrameFilteredListener(
this.mm,
"MozSessionStorageChanged",
this._listener,
true
);
this._listener = null;
}
handleEvent(event) {
if (!this.mm.docShell) {
return;
}
let { content } = this.mm;
// How much data does DOMSessionStorage contain?
let usage = content.windowUtils.getStorageUsage(event.storageArea);
// Don't store any data if we exceed the limit. Wipe any data we previously
// collected so that we don't confuse websites with partial state.
if (usage > Services.prefs.getIntPref(DOM_STORAGE_LIMIT_PREF)) {
this.messageQueue.push("storage", () => null);
this.removeEventListener();
this.resetChanges();
return;
}
let { url, key, newValue } = event;
let uri = Services.io.newURI(url);
let domain = uri.prePath;
if (!this._changes) {
this._changes = {};
}
if (!this._changes[domain]) {
this._changes[domain] = {};
}
// If the key isn't defined, then .clear() was called, and we send
// up null for this domain to indicate that storage has been cleared
// for it.
if (!key) {
this._changes[domain] = null;
} else {
this._changes[domain][key] = newValue;
}
this.messageQueue.push("storagechange", () => {
let tmp = this._changes;
// If there were multiple changes we send them merged.
// First one will collect all the changes the rest of
// these messages will be ignored.
this.resetChanges();
return tmp;
});
}
collect() {
if (!this.mm.docShell) {
return;
}
let { content } = this.mm;
// We need the entire session storage, let's reset the pending individual change
// messages.
this.resetChanges();
this.messageQueue.push("storage", () => {
let data = SessionStoreUtils.collectSessionStorage(content);
return Object.keys(data).length ? data : null;
});
}
onPageLoadCompleted() {
this.collect();
}
onPageLoadStarted() {
this.resetEventListener();
this.collect();
}
}
/**
* A message queue that takes collected data and will take care of sending it
* to the chrome process. It allows flushing using synchronous messages and
@ -757,9 +573,7 @@ class ContentSessionStore {
this.handlers = [
new EventListener(this),
new FormDataListener(this),
new SessionHistoryListener(this),
new SessionStorageListener(this),
this.stateChangeNotifier,
this.messageQueue,
];

View File

@ -905,6 +905,11 @@ var SessionStoreInternal = {
return;
}
// Ignore sessionStore update from previous epochs
if (!this.isCurrentEpoch(aBrowser, aData.epoch)) {
return;
}
TabState.update(aBrowser, aData);
let win = aBrowser.ownerGlobal;
this.saveStateDelayed(win);
@ -5824,6 +5829,10 @@ var SessionStoreInternal = {
"SessionStore:restoreHistory",
options
);
if (browser && browser.frameLoader) {
browser.frameLoader.requestEpochUpdate(options.epoch);
}
},
};

View File

@ -1,23 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// This test is two fold:
// a) if security.data_uri.unique_opaque_origin == false, then
// this tests that session restore component does restore the right
// content security policy with the document. (The policy being
// tested disallows inline scripts).
// b) if security.data_uri.unique_opaque_origin == true, then
// this tests that data: URIs do not inherit the CSP from
// it's enclosing context.
// This test tests that session restore component does restore the right
// content security policy with the document. (The policy being tested
// disallows inline scripts).
add_task(async function test() {
// allow top level data: URI navigations, otherwise clicking a data: link fails
await SpecialPowers.pushPrefEnv({
set: [["security.data_uri.block_toplevel_data_uri_navigations", false]],
});
let dataURIPref = Services.prefs.getBoolPref(
"security.data_uri.unique_opaque_origin"
);
// create a tab that has a CSP
let testURL =
"http://mochi.test:8888/browser/browser/components/sessionstore/test/browser_911547_sample.html";
@ -41,32 +33,18 @@ add_task(async function test() {
"id1_initial",
"CSP should block the inline script that modifies test_id"
);
// (a) if security.data_uri.unique_opaque_origin == false:
// attempt to click a link to a data: URI (will inherit the CSP of
// the origin document) and navigate to the data URI in the link.
// (b) if security.data_uri.unique_opaque_origin == true:
// attempt to click a link to a data: URI (will *not* inherit the CSP of
// the origin document) and navigate to the data URI in the link.
content.document.getElementById("test_data_link").click();
});
await loadedPromise;
await ContentTask.spawn(browser, {dataURIPref}, function( {dataURIPref}) { // eslint-disable-line
if (dataURIPref) {
is(
content.document.getElementById("test_id2").value,
"id2_modified",
"data: URI should *not* inherit the CSP of the enclosing context"
);
} else {
await ContentTask.spawn(browser, {}, function( {}) { // eslint-disable-line
// the data: URI inherits the CSP and the inline script needs to be blocked
is(
content.document.getElementById("test_id2").value,
"id2_initial",
"CSP should block the script loaded by the clicked data URI"
);
}
});
// close the tab
@ -77,20 +55,14 @@ add_task(async function test() {
await promiseTabRestored(tab);
browser = tab.linkedBrowser;
await ContentTask.spawn(browser, {dataURIPref}, function({dataURIPref}) { // eslint-disable-line
if (dataURIPref) {
is(
content.document.getElementById("test_id2").value,
"id2_modified",
"data: URI should *not* inherit the CSP of the enclosing context"
);
} else {
await ContentTask.spawn(browser, {}, function({}) { // eslint-disable-line
// the data: URI should be restored including the inherited CSP and the
// inline script should be blocked.
is(
content.document.getElementById("test_id2").value,
"id2_initial",
"CSP should block the script loaded by the clicked data URI after restore"
);
}
});
// clean up

View File

@ -8,8 +8,7 @@
<!--
this element gets modified by an injected script;
that script should be blocked by CSP if security.data_uri.unique_opaque_origin == false;
Inline scripts can modify it, but not data uris.
that script should be blocked by CSP
-->
<input type="text" id="test_id1" value="id1_initial">

View File

@ -60,7 +60,7 @@ var Translation = {
_defaultTargetLanguage: "",
get defaultTargetLanguage() {
if (!this._defaultTargetLanguage) {
this._defaultTargetLanguage = Services.locale.appLocaleAsLangTag.split(
this._defaultTargetLanguage = Services.locale.appLocaleAsBCP47.split(
"-"
)[0];
}

View File

@ -245,7 +245,7 @@ class MozTranslationNotification extends MozElements.Notification {
],
};
let locale = Services.locale.appLocaleAsLangTag;
let locale = Services.locale.appLocaleAsBCP47;
if (!(locale in localizedStrings)) {
locale = "en";
}

View File

@ -1 +1 @@
68.14.5
68.14.6

View File

@ -1 +1 @@
68.14.5b
68.14.6b

View File

@ -26,10 +26,10 @@ if test "$OS_ARCH" = "WINNT"; then
fi
fi
if [ "${MOZ_BROWSER_XUL}" = "1" ]; then
BROWSER_CHROME_URL=chrome://browser/content/browser.xul
else
if [ "${MOZ_BROWSER_XHTML}" = "1" ]; then
BROWSER_CHROME_URL=chrome://browser/content/browser.xhtml
else
BROWSER_CHROME_URL=chrome://browser/content/browser.xul
fi
# MOZ_APP_DISPLAYNAME will be set by branding/configure.sh

View File

@ -3,6 +3,5 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += [
'pdfjs',
'webcompat',
]

View File

@ -1,5 +0,0 @@
This is the PDF.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 2.2.178
Taken from upstream commit: 3e869a28

View File

@ -1,308 +0,0 @@
/* Copyright 2012 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
"use strict";
var EXPORTED_SYMBOLS = ["PdfJs"];
const PREF_PREFIX = "pdfjs";
const PREF_DISABLED = PREF_PREFIX + ".disabled";
const PREF_MIGRATION_VERSION = PREF_PREFIX + ".migrationVersion";
const PREF_PREVIOUS_ACTION = PREF_PREFIX + ".previousHandler.preferredAction";
const PREF_PREVIOUS_ASK =
PREF_PREFIX + ".previousHandler.alwaysAskBeforeHandling";
const PREF_DISABLED_PLUGIN_TYPES = "plugin.disable_full_page_plugin_for_types";
const PREF_ENABLED_CACHE_STATE = PREF_PREFIX + ".enabledCache.state";
const PREF_ENABLED_CACHE_INITIALIZED =
PREF_PREFIX + ".enabledCache.initialized";
const PREF_APP_UPDATE_POSTUPDATE = "app.update.postupdate";
const TOPIC_PDFJS_HANDLER_CHANGED = "pdfjs:handlerChanged";
const TOPIC_PLUGINS_LIST_UPDATED = "plugins-list-updated";
const TOPIC_PLUGIN_INFO_UPDATED = "plugin-info-updated";
const PDF_CONTENT_TYPE = "application/pdf";
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var Svc = {};
XPCOMUtils.defineLazyServiceGetter(
Svc,
"mime",
"@mozilla.org/mime;1",
"nsIMIMEService"
);
XPCOMUtils.defineLazyServiceGetter(
Svc,
"pluginHost",
"@mozilla.org/plugin/host;1",
"nsIPluginHost"
);
ChromeUtils.defineModuleGetter(
this,
"PdfjsChromeUtils",
"resource://pdf.js/PdfjsChromeUtils.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"PdfJsDefaultPreferences",
"resource://pdf.js/PdfJsDefaultPreferences.jsm"
);
function getBoolPref(aPref, aDefaultValue) {
try {
return Services.prefs.getBoolPref(aPref);
} catch (ex) {
return aDefaultValue;
}
}
function getIntPref(aPref, aDefaultValue) {
try {
return Services.prefs.getIntPref(aPref);
} catch (ex) {
return aDefaultValue;
}
}
function isDefaultHandler() {
if (Services.appinfo.processType !== Services.appinfo.PROCESS_TYPE_DEFAULT) {
throw new Error(
"isDefaultHandler should only get called in the parent process."
);
}
return PdfjsChromeUtils.isDefaultHandlerApp();
}
function initializeDefaultPreferences() {
var defaultBranch = Services.prefs.getDefaultBranch(PREF_PREFIX + ".");
var defaultValue;
for (var key in PdfJsDefaultPreferences) {
defaultValue = PdfJsDefaultPreferences[key];
switch (typeof defaultValue) {
case "boolean":
defaultBranch.setBoolPref(key, defaultValue);
break;
case "number":
defaultBranch.setIntPref(key, defaultValue);
break;
case "string":
defaultBranch.setCharPref(key, defaultValue);
break;
}
}
}
var PdfJs = {
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver]),
_initialized: false,
init: function init(remote) {
if (
Services.appinfo.processType !== Services.appinfo.PROCESS_TYPE_DEFAULT
) {
throw new Error(
"PdfJs.init should only get called in the parent process."
);
}
PdfjsChromeUtils.init();
this.initPrefs();
Services.ppmm.sharedData.set("pdfjs.enabled", this.checkEnabled());
},
earlyInit() {
// Note: Please keep this in sync with the duplicated logic in
// BrowserGlue.jsm.
Services.ppmm.sharedData.set("pdfjs.enabled", this.checkEnabled());
},
initPrefs: function initPrefs() {
if (this._initialized) {
return;
}
this._initialized = true;
if (!getBoolPref(PREF_DISABLED, true)) {
this._migrate();
}
// Listen for when pdf.js is completely disabled or a different pdf handler
// is chosen.
Services.prefs.addObserver(PREF_DISABLED, this);
Services.prefs.addObserver(PREF_DISABLED_PLUGIN_TYPES, this);
Services.obs.addObserver(this, TOPIC_PDFJS_HANDLER_CHANGED);
Services.obs.addObserver(this, TOPIC_PLUGINS_LIST_UPDATED);
Services.obs.addObserver(this, TOPIC_PLUGIN_INFO_UPDATED);
initializeDefaultPreferences();
},
uninit: function uninit() {
if (this._initialized) {
Services.prefs.removeObserver(PREF_DISABLED, this);
Services.prefs.removeObserver(PREF_DISABLED_PLUGIN_TYPES, this);
Services.obs.removeObserver(this, TOPIC_PDFJS_HANDLER_CHANGED);
Services.obs.removeObserver(this, TOPIC_PLUGINS_LIST_UPDATED);
Services.obs.removeObserver(this, TOPIC_PLUGIN_INFO_UPDATED);
this._initialized = false;
}
},
_migrate: function migrate() {
const VERSION = 2;
var currentVersion = getIntPref(PREF_MIGRATION_VERSION, 0);
if (currentVersion >= VERSION) {
return;
}
// Make pdf.js the default pdf viewer on the first migration.
if (currentVersion < 1) {
this._becomeHandler();
}
if (currentVersion < 2) {
// cleaning up of unused database preference (see #3994)
Services.prefs.clearUserPref(PREF_PREFIX + ".database");
}
Services.prefs.setIntPref(PREF_MIGRATION_VERSION, VERSION);
},
_becomeHandler: function _becomeHandler() {
let handlerInfo = Svc.mime.getFromTypeAndExtension(PDF_CONTENT_TYPE, "pdf");
let prefs = Services.prefs;
if (
handlerInfo.preferredAction !== Ci.nsIHandlerInfo.handleInternally &&
handlerInfo.preferredAction !== false
) {
// Store the previous settings of preferredAction and
// alwaysAskBeforeHandling in case we need to revert them in a hotfix that
// would turn pdf.js off.
prefs.setIntPref(PREF_PREVIOUS_ACTION, handlerInfo.preferredAction);
prefs.setBoolPref(PREF_PREVIOUS_ASK, handlerInfo.alwaysAskBeforeHandling);
}
let handlerService = Cc[
"@mozilla.org/uriloader/handler-service;1"
].getService(Ci.nsIHandlerService);
// Change and save mime handler settings.
handlerInfo.alwaysAskBeforeHandling = false;
handlerInfo.preferredAction = Ci.nsIHandlerInfo.handleInternally;
handlerService.store(handlerInfo);
// Also disable any plugins for pdfs.
var stringTypes = "";
var types = [];
if (prefs.prefHasUserValue(PREF_DISABLED_PLUGIN_TYPES)) {
stringTypes = prefs.getCharPref(PREF_DISABLED_PLUGIN_TYPES);
}
if (stringTypes !== "") {
types = stringTypes.split(",");
}
if (!types.includes(PDF_CONTENT_TYPE)) {
types.push(PDF_CONTENT_TYPE);
}
prefs.setCharPref(PREF_DISABLED_PLUGIN_TYPES, types.join(","));
// Update the category manager in case the plugins are already loaded.
Services.catMan.deleteCategoryEntry(
"Gecko-Content-Viewers",
PDF_CONTENT_TYPE,
false
);
},
_isEnabled: function _isEnabled() {
var disabled = getBoolPref(PREF_DISABLED, true);
if (disabled) {
return false;
}
// Check if the 'application/pdf' preview handler is configured properly.
if (!isDefaultHandler()) {
return false;
}
// Check if we have disabled plugin handling of 'application/pdf' in prefs
if (Services.prefs.prefHasUserValue(PREF_DISABLED_PLUGIN_TYPES)) {
let disabledPluginTypes = Services.prefs
.getCharPref(PREF_DISABLED_PLUGIN_TYPES)
.split(",");
if (disabledPluginTypes.includes(PDF_CONTENT_TYPE)) {
return true;
}
}
// Check if there is an enabled pdf plugin.
// Note: this check is performed last because getPluginTags() triggers
// costly plugin list initialization (bug 881575)
let tags = Cc["@mozilla.org/plugin/host;1"]
.getService(Ci.nsIPluginHost)
.getPluginTags();
let enabledPluginFound = tags.some(function(tag) {
if (tag.disabled) {
return false;
}
let mimeTypes = tag.getMimeTypes();
return mimeTypes.some(function(mimeType) {
return mimeType === PDF_CONTENT_TYPE;
});
});
// Use pdf.js if pdf plugin is not present or disabled
return !enabledPluginFound;
},
checkEnabled: function checkEnabled() {
let isEnabled = this._isEnabled();
// This will be updated any time we observe a dependency changing, since
// updateRegistration internally calls enabled.
Services.prefs.setBoolPref(PREF_ENABLED_CACHE_STATE, isEnabled);
return isEnabled;
},
// nsIObserver
observe: function observe(aSubject, aTopic, aData) {
if (
Services.appinfo.processType !== Services.appinfo.PROCESS_TYPE_DEFAULT
) {
throw new Error(
"Only the parent process should be observing PDF handler changes."
);
}
Services.ppmm.sharedData.set("pdfjs.enabled", this.checkEnabled());
},
/**
* pdf.js is only enabled if it is both selected as the pdf viewer and if the
* global switch enabling it is true.
* @return {boolean} Whether or not it's enabled.
*/
get enabled() {
if (!Services.prefs.getBoolPref(PREF_ENABLED_CACHE_INITIALIZED, false)) {
// If we just updated, and the cache hasn't been initialized, then we
// can't assume a default state, and need to synchronously initialize
// PdfJs
if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_POSTUPDATE)) {
this.checkEnabled();
}
Services.prefs.setBoolPref(PREF_ENABLED_CACHE_INITIALIZED, true);
}
return Services.prefs.getBoolPref(PREF_ENABLED_CACHE_STATE, true);
},
};

View File

@ -1,82 +0,0 @@
/* Copyright 2013 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint max-len: ["error", 100] */
"use strict";
var EXPORTED_SYMBOLS = ["PdfJsTelemetry"];
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var PdfJsTelemetry = {
onViewerIsUsed() {
let histogram = Services.telemetry.getHistogramById("PDF_VIEWER_USED");
histogram.add(true);
},
onFallback() {
let histogram = Services.telemetry.getHistogramById(
"PDF_VIEWER_FALLBACK_SHOWN"
);
histogram.add(true);
},
onDocumentSize(size) {
let histogram = Services.telemetry.getHistogramById(
"PDF_VIEWER_DOCUMENT_SIZE_KB"
);
histogram.add(size / 1024);
},
onDocumentVersion(versionId) {
let histogram = Services.telemetry.getHistogramById(
"PDF_VIEWER_DOCUMENT_VERSION"
);
histogram.add(versionId);
},
onDocumentGenerator(generatorId) {
let histogram = Services.telemetry.getHistogramById(
"PDF_VIEWER_DOCUMENT_GENERATOR"
);
histogram.add(generatorId);
},
onEmbed(isObject) {
let histogram = Services.telemetry.getHistogramById("PDF_VIEWER_EMBED");
histogram.add(isObject);
},
onFontType(fontTypeId) {
let histogram = Services.telemetry.getHistogramById(
"PDF_VIEWER_FONT_TYPES"
);
histogram.add(fontTypeId);
},
onForm(isAcroform) {
let histogram = Services.telemetry.getHistogramById("PDF_VIEWER_FORM");
histogram.add(isAcroform);
},
onPrint() {
let histogram = Services.telemetry.getHistogramById("PDF_VIEWER_PRINT");
histogram.add(true);
},
onStreamType(streamTypeId) {
let histogram = Services.telemetry.getHistogramById(
"PDF_VIEWER_STREAM_TYPES"
);
histogram.add(streamTypeId);
},
onTimeToView(ms) {
let histogram = Services.telemetry.getHistogramById(
"PDF_VIEWER_TIME_TO_VIEW_MS"
);
histogram.add(ms);
},
};

View File

@ -1,410 +0,0 @@
/* Copyright 2012 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
"use strict";
var EXPORTED_SYMBOLS = ["PdfjsChromeUtils"];
const PREF_PREFIX = "pdfjs";
const PDF_CONTENT_TYPE = "application/pdf";
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(
this,
"PdfJsDefaultPreferences",
"resource://pdf.js/PdfJsDefaultPreferences.jsm"
);
var Svc = {};
XPCOMUtils.defineLazyServiceGetter(
Svc,
"mime",
"@mozilla.org/mime;1",
"nsIMIMEService"
);
XPCOMUtils.defineLazyPreferenceGetter(
this,
"matchesCountLimit",
"accessibility.typeaheadfind.matchesCountLimit"
);
var PdfjsChromeUtils = {
// For security purposes when running remote, we restrict preferences
// content can access.
_allowedPrefNames: Object.keys(PdfJsDefaultPreferences),
_ppmm: null,
_mmg: null,
/*
* Public API
*/
init() {
this._browsers = new WeakSet();
if (!this._ppmm) {
// global parent process message manager (PPMM)
this._ppmm = Services.ppmm;
this._ppmm.addMessageListener("PDFJS:Parent:clearUserPref", this);
this._ppmm.addMessageListener("PDFJS:Parent:setIntPref", this);
this._ppmm.addMessageListener("PDFJS:Parent:setBoolPref", this);
this._ppmm.addMessageListener("PDFJS:Parent:setCharPref", this);
this._ppmm.addMessageListener("PDFJS:Parent:setStringPref", this);
this._ppmm.addMessageListener("PDFJS:Parent:isDefaultHandlerApp", this);
// global dom message manager (MMg)
this._mmg = Services.mm;
this._mmg.addMessageListener("PDFJS:Parent:displayWarning", this);
this._mmg.addMessageListener("PDFJS:Parent:addEventListener", this);
this._mmg.addMessageListener("PDFJS:Parent:removeEventListener", this);
this._mmg.addMessageListener("PDFJS:Parent:updateControlState", this);
this._mmg.addMessageListener("PDFJS:Parent:updateMatchesCount", this);
// Observer to handle shutdown.
Services.obs.addObserver(this, "quit-application");
}
},
uninit() {
if (this._ppmm) {
this._ppmm.removeMessageListener("PDFJS:Parent:clearUserPref", this);
this._ppmm.removeMessageListener("PDFJS:Parent:setIntPref", this);
this._ppmm.removeMessageListener("PDFJS:Parent:setBoolPref", this);
this._ppmm.removeMessageListener("PDFJS:Parent:setCharPref", this);
this._ppmm.removeMessageListener("PDFJS:Parent:setStringPref", this);
this._ppmm.removeMessageListener(
"PDFJS:Parent:isDefaultHandlerApp",
this
);
this._mmg.removeMessageListener("PDFJS:Parent:displayWarning", this);
this._mmg.removeMessageListener("PDFJS:Parent:addEventListener", this);
this._mmg.removeMessageListener("PDFJS:Parent:removeEventListener", this);
this._mmg.removeMessageListener("PDFJS:Parent:updateControlState", this);
this._mmg.removeMessageListener("PDFJS:Parent:updateMatchesCount", this);
Services.obs.removeObserver(this, "quit-application");
this._mmg = null;
this._ppmm = null;
}
},
/*
* Events
*/
observe(aSubject, aTopic, aData) {
if (aTopic === "quit-application") {
this.uninit();
}
},
receiveMessage(aMsg) {
switch (aMsg.name) {
case "PDFJS:Parent:clearUserPref":
this._clearUserPref(aMsg.data.name);
break;
case "PDFJS:Parent:setIntPref":
this._setIntPref(aMsg.data.name, aMsg.data.value);
break;
case "PDFJS:Parent:setBoolPref":
this._setBoolPref(aMsg.data.name, aMsg.data.value);
break;
case "PDFJS:Parent:setCharPref":
this._setCharPref(aMsg.data.name, aMsg.data.value);
break;
case "PDFJS:Parent:setStringPref":
this._setStringPref(aMsg.data.name, aMsg.data.value);
break;
case "PDFJS:Parent:isDefaultHandlerApp":
return this.isDefaultHandlerApp();
case "PDFJS:Parent:displayWarning":
this._displayWarning(aMsg);
break;
case "PDFJS:Parent:updateControlState":
return this._updateControlState(aMsg);
case "PDFJS:Parent:updateMatchesCount":
return this._updateMatchesCount(aMsg);
case "PDFJS:Parent:addEventListener":
return this._addEventListener(aMsg);
case "PDFJS:Parent:removeEventListener":
return this._removeEventListener(aMsg);
}
return undefined;
},
/*
* Internal
*/
_updateControlState(aMsg) {
let data = aMsg.data;
let browser = aMsg.target;
let tabbrowser = browser.getTabBrowser();
let tab = tabbrowser.getTabForBrowser(browser);
tabbrowser.getFindBar(tab).then(fb => {
if (!fb) {
// The tab or window closed.
return;
}
fb.updateControlState(data.result, data.findPrevious);
const matchesCount = this._requestMatchesCount(data.matchesCount);
fb.onMatchesCountResult(matchesCount);
});
},
_updateMatchesCount(aMsg) {
let data = aMsg.data;
let browser = aMsg.target;
let tabbrowser = browser.getTabBrowser();
let tab = tabbrowser.getTabForBrowser(browser);
tabbrowser.getFindBar(tab).then(fb => {
if (!fb) {
// The tab or window closed.
return;
}
const matchesCount = this._requestMatchesCount(data);
fb.onMatchesCountResult(matchesCount);
});
},
_requestMatchesCount(data) {
if (!data) {
return { current: 0, total: 0 };
}
let result = {
current: data.current,
total: data.total,
limit: typeof matchesCountLimit === "number" ? matchesCountLimit : 0,
};
if (result.total > result.limit) {
result.total = -1;
}
return result;
},
handleEvent(aEvent) {
const type = aEvent.type;
// Handle the tab find initialized event specially:
if (type == "TabFindInitialized") {
let browser = aEvent.target.linkedBrowser;
this._hookupEventListeners(browser);
aEvent.target.removeEventListener(type, this);
return;
}
// To avoid forwarding the message as a CPOW, create a structured cloneable
// version of the event for both performance, and ease of usage, reasons.
let detail = null;
if (type !== "findbarclose") {
detail = {
query: aEvent.detail.query,
caseSensitive: aEvent.detail.caseSensitive,
entireWord: aEvent.detail.entireWord,
highlightAll: aEvent.detail.highlightAll,
findPrevious: aEvent.detail.findPrevious,
};
}
let browser = aEvent.currentTarget.browser;
if (!this._browsers.has(browser)) {
throw new Error(
"FindEventManager was not bound for the current browser."
);
}
// Only forward the events if the current browser is a registered browser.
let mm = browser.messageManager;
mm.sendAsyncMessage("PDFJS:Child:handleEvent", { type, detail });
aEvent.preventDefault();
},
_types: [
"find",
"findagain",
"findhighlightallchange",
"findcasesensitivitychange",
"findbarclose",
],
_addEventListener(aMsg) {
let browser = aMsg.target;
if (this._browsers.has(browser)) {
throw new Error(
"FindEventManager was bound 2nd time without unbinding it first."
);
}
// Since this jsm is global, we need to store all the browsers
// we have to forward the messages for.
this._browsers.add(browser);
this._hookupEventListeners(browser);
},
/**
* Either hook up all the find event listeners if a findbar exists,
* or listen for a find bar being created and hook up event listeners
* when it does get created.
*/
_hookupEventListeners(aBrowser) {
let tabbrowser = aBrowser.getTabBrowser();
let tab = tabbrowser.getTabForBrowser(aBrowser);
let findbar = tabbrowser.getCachedFindBar(tab);
if (findbar) {
// And we need to start listening to find events.
for (var i = 0; i < this._types.length; i++) {
var type = this._types[i];
findbar.addEventListener(type, this, true);
}
} else {
tab.addEventListener("TabFindInitialized", this);
}
return !!findbar;
},
_removeEventListener(aMsg) {
let browser = aMsg.target;
if (!this._browsers.has(browser)) {
throw new Error("FindEventManager was unbound without binding it first.");
}
this._browsers.delete(browser);
let tabbrowser = browser.getTabBrowser();
let tab = tabbrowser.getTabForBrowser(browser);
tab.removeEventListener("TabFindInitialized", this);
let findbar = tabbrowser.getCachedFindBar(tab);
if (findbar) {
// No reason to listen to find events any longer.
for (var i = 0; i < this._types.length; i++) {
var type = this._types[i];
findbar.removeEventListener(type, this, true);
}
}
},
_ensurePreferenceAllowed(aPrefName) {
let unPrefixedName = aPrefName.split(PREF_PREFIX + ".");
if (
unPrefixedName[0] !== "" ||
!this._allowedPrefNames.includes(unPrefixedName[1])
) {
let msg =
'"' +
aPrefName +
'" ' +
"can't be accessed from content. See PdfjsChromeUtils.";
throw new Error(msg);
}
},
_clearUserPref(aPrefName) {
this._ensurePreferenceAllowed(aPrefName);
Services.prefs.clearUserPref(aPrefName);
},
_setIntPref(aPrefName, aPrefValue) {
this._ensurePreferenceAllowed(aPrefName);
Services.prefs.setIntPref(aPrefName, aPrefValue);
},
_setBoolPref(aPrefName, aPrefValue) {
this._ensurePreferenceAllowed(aPrefName);
Services.prefs.setBoolPref(aPrefName, aPrefValue);
},
_setCharPref(aPrefName, aPrefValue) {
this._ensurePreferenceAllowed(aPrefName);
Services.prefs.setCharPref(aPrefName, aPrefValue);
},
_setStringPref(aPrefName, aPrefValue) {
this._ensurePreferenceAllowed(aPrefName);
Services.prefs.setStringPref(aPrefName, aPrefValue);
},
/*
* Svc.mime doesn't have profile information in the child, so
* we bounce this pdfjs enabled configuration check over to the
* parent.
*/
isDefaultHandlerApp() {
var handlerInfo = Svc.mime.getFromTypeAndExtension(PDF_CONTENT_TYPE, "pdf");
return (
!handlerInfo.alwaysAskBeforeHandling &&
handlerInfo.preferredAction === Ci.nsIHandlerInfo.handleInternally
);
},
/*
* Display a notification warning when the renderer isn't sure
* a pdf displayed correctly.
*/
_displayWarning(aMsg) {
let data = aMsg.data;
let browser = aMsg.target;
let tabbrowser = browser.getTabBrowser();
let notificationBox = tabbrowser.getNotificationBox(browser);
// Flag so we don't send the message twice, since if the user clicks
// "open with different viewer" both the button callback and
// eventCallback will be called.
let messageSent = false;
function sendMessage(download) {
let mm = browser.messageManager;
mm.sendAsyncMessage("PDFJS:Child:fallbackDownload", { download });
}
let buttons = [
{
label: data.label,
accessKey: data.accessKey,
callback() {
messageSent = true;
sendMessage(true);
},
},
];
notificationBox.appendNotification(
data.message,
"pdfjs-fallback",
null,
notificationBox.PRIORITY_WARNING_LOW,
buttons,
function eventsCallback(eventType) {
// Currently there is only one event "removed" but if there are any other
// added in the future we still only care about removed at the moment.
if (eventType !== "removed") {
return;
}
// Don't send a response again if we already responded when the button was
// clicked.
if (messageSent) {
return;
}
sendMessage(false);
}
);
},
};

View File

@ -1,82 +0,0 @@
/* Copyright 2012 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
"use strict";
var EXPORTED_SYMBOLS = ["PdfjsContentUtils"];
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var PdfjsContentUtils = {
_mm: Services.cpmm,
/*
* Public API
*/
/*
* prefs utilities - the child does not have write access to prefs.
* note, the pref names here are cross-checked against a list of
* approved pdfjs prefs in chrome utils.
*/
clearUserPref(aPrefName) {
this._mm.sendSyncMessage("PDFJS:Parent:clearUserPref", {
name: aPrefName,
});
},
setIntPref(aPrefName, aPrefValue) {
this._mm.sendSyncMessage("PDFJS:Parent:setIntPref", {
name: aPrefName,
value: aPrefValue,
});
},
setBoolPref(aPrefName, aPrefValue) {
this._mm.sendSyncMessage("PDFJS:Parent:setBoolPref", {
name: aPrefName,
value: aPrefValue,
});
},
setCharPref(aPrefName, aPrefValue) {
this._mm.sendSyncMessage("PDFJS:Parent:setCharPref", {
name: aPrefName,
value: aPrefValue,
});
},
setStringPref(aPrefName, aPrefValue) {
this._mm.sendSyncMessage("PDFJS:Parent:setStringPref", {
name: aPrefName,
value: aPrefValue,
});
},
/*
* Request the display of a notification warning in the associated window
* when the renderer isn't sure a pdf displayed correctly.
*/
displayWarning(aWindow, aMessage, aLabel, aAccessKey) {
// the child's dom frame mm associated with the window.
let winmm = aWindow.docShell.messageManager;
winmm.sendAsyncMessage("PDFJS:Parent:displayWarning", {
message: aMessage,
label: aLabel,
accessKey: aAccessKey,
});
},
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

Some files were not shown because too many files have changed in this diff Show More