diff --git a/.clang-format-ignore b/.clang-format-ignore index b1b7ef1b6b..bfa911029d 100644 --- a/.clang-format-ignore +++ b/.clang-format-ignore @@ -59,7 +59,6 @@ xpcom/reflect/xptcall/md/unix/.* # awk '{print ""$1".*"}' ./tools/rewriting/ThirdPartyPaths.txt browser/components/translation/cld2/.* browser/extensions/mortar/ppapi/.* -db/sqlite3/src/.* devtools/client/shared/sourceeditor/codemirror/.* devtools/client/shared/sourceeditor/tern/.* dom/canvas/test/webgl-conf/checkout/closure-library/.* diff --git a/.eslintrc.js b/.eslintrc.js index caa53dd19e..205c3837d6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -145,23 +145,6 @@ module.exports = { "no-redeclare": "off", "no-global-assign": "off", } - }, { - "files": [ - "image/**", - ], - "rules": { - "mozilla/consistent-if-bracing": "off", - "mozilla/use-chromeutils-generateqi": "off", - "mozilla/use-services": "off", - "no-array-constructor": "off", - "no-implied-eval": "off", - "no-redeclare": "off", - "no-self-assign": "off", - "no-throw-literal": "off", - "no-undef": "off", - "no-unneeded-ternary": "off", - "no-unused-vars": "off", - } }, { "files": [ "netwerk/cookie/test/browser/**", diff --git a/CLOBBER b/CLOBBER index daca32d69e..3f6f0c390e 100644 --- a/CLOBBER +++ b/CLOBBER @@ -22,4 +22,4 @@ # changes to stick? As of bug 928195, this shouldn't be necessary! Please # don't change CLOBBER for WebIDL changes any more. -Bug 1632434 - Update to ICU 67 requires clobber +Bug 1551084 - Part 2. Make QCMS transform files use C++. r=miko diff --git a/Cargo.lock b/Cargo.lock index 9a84ca8a36..ea51ecc9b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -85,7 +85,7 @@ dependencies = [ "futures", "iovec", "libc", - "log 0.4.6", + "log", "memmap", "mio-named-pipes", "scoped-tls 0.1.0", @@ -93,7 +93,7 @@ dependencies = [ "serde_derive", "tokio-core", "tokio-io", - "tokio-uds 0.1.7", + "tokio-uds", "winapi 0.3.7", ] @@ -107,9 +107,9 @@ dependencies = [ "futures", "futures-cpupool", "libc", - "log 0.4.6", + "log", "tokio-core", - "tokio-uds 0.1.7", + "tokio-uds", ] [[package]] @@ -124,10 +124,10 @@ dependencies = [ "lazy_static", "lazycell 0.4.0", "libc", - "log 0.4.6", + "log", "slab 0.3.0", "tokio-core", - "tokio-uds 0.1.7", + "tokio-uds", ] [[package]] @@ -142,7 +142,7 @@ dependencies = [ "devd-rs", "libc", "libudev", - "log 0.4.6", + "log", "rand 0.6.5", "runloop", "winapi 0.3.7", @@ -185,8 +185,8 @@ dependencies = [ "cranelift-codegen", "cranelift-wasm", "env_logger", - "log 0.4.6", - "smallvec 1.0.0", + "log", + "smallvec", ] [[package]] @@ -221,15 +221,15 @@ dependencies = [ "clap", "env_logger", "itertools", - "log 0.4.6", + "log", "yaml-rust", ] [[package]] name = "bincode" -version = "1.0.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda13183df33055cbb84b847becce220d392df502ebe7a4a78d7021771ed94d0" +checksum = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" dependencies = [ "byteorder", "serde", @@ -237,18 +237,19 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.51.1" +version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd71393f1ec0509b553aa012b9b58e81dadbdff7130bd3b8cba576e69b32f75" +checksum = "6bb26d6a69a335b8cb0e7c7e9775cd5666611dc50a37177c3f2cedcfc040e8c8" dependencies = [ "bitflags", "cexpr", "cfg-if", "clang-sys", "lazy_static", + "lazycell 1.2.1", "peeking_take_while", - "proc-macro2 1.0.5", - "quote 1.0.2", + "proc-macro2", + "quote", "regex", "rustc-hash", "shlex", @@ -256,13 +257,13 @@ dependencies = [ [[package]] name = "binjs_meta" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c9a0da2208ceb785c1626fa8b7d250d2e5546ae230294b4a998e4f818c1768e" +checksum = "d535cc5246fd9035268770420afd76c05f87e68b83ebed0ac94e8258e88fc353" dependencies = [ "Inflector", "itertools", - "log 0.4.6", + "log", "weedle", ] @@ -286,9 +287,12 @@ checksum = "8a606a02debe2813760609f57a64a2ffd27d9fdf5b2f133eaca0b248dd92cdd2" [[package]] name = "bitreader" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80b13e2ab064ff3aa0bdbf1eff533f9822dc37899821f5f98c67f263eab51707" +checksum = "5fa7f0adf37cd5472c978a1ff4be89c1880a923d10df4cfef6a10855a666e09b" +dependencies = [ + "cfg-if", +] [[package]] name = "bits" @@ -327,7 +331,7 @@ dependencies = [ "failure", "failure_derive", "libc", - "log 0.4.6", + "log", "moz_task", "nserror", "nsstring", @@ -374,7 +378,7 @@ dependencies = [ "cstr", "dogear", "libc", - "log 0.4.6", + "log", "moz_task", "nserror", "nsstring", @@ -454,8 +458,8 @@ dependencies = [ "base64", "byteorder", "crossbeam-utils", - "lmdb-rkv", - "log 0.4.6", + "cstr", + "log", "moz_task", "nserror", "nsstring", @@ -463,7 +467,6 @@ dependencies = [ "rust_cascade", "sha2", "storage_variant", - "style", "tempfile", "thin-vec", "time", @@ -472,24 +475,24 @@ dependencies = [ [[package]] name = "cexpr" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc0086be9ca82f7fc89fc873435531cb898b86e850005850de1f820e2db6e9b" +checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" dependencies = [ "nom", ] [[package]] name = "cfg-if" -version = "0.1.6" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "chrono" -version = "0.4.6" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" +checksum = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" dependencies = [ "num-integer", "num-traits", @@ -498,9 +501,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "0.28.1" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853" +checksum = "f92986241798376849e1a007827041fed9bb36195822c2049d18e174420e0534" dependencies = [ "glob", "libc", @@ -644,9 +647,9 @@ dependencies = [ "cranelift-entity", "failure", "failure_derive", - "log 0.4.6", - "smallvec 0.6.10", - "target-lexicon 0.8.1", + "log", + "smallvec", + "target-lexicon", ] [[package]] @@ -674,9 +677,9 @@ version = "0.44.0" source = "git+https://github.com/CraneStation/Cranelift?rev=182414f15c18538dfebbe040469ec8001e93ecc5#182414f15c18538dfebbe040469ec8001e93ecc5" dependencies = [ "cranelift-codegen", - "log 0.4.6", - "smallvec 0.6.10", - "target-lexicon 0.8.1", + "log", + "smallvec", + "target-lexicon", ] [[package]] @@ -689,7 +692,7 @@ dependencies = [ "cranelift-frontend", "failure", "failure_derive", - "log 0.4.6", + "log", "wasmparser", ] @@ -756,10 +759,10 @@ dependencies = [ "itoa", "matches", "phf", - "proc-macro2 1.0.5", - "quote 1.0.2", - "smallvec 1.0.0", - "syn 1.0.5", + "proc-macro2", + "quote", + "smallvec", + "syn", ] [[package]] @@ -768,8 +771,8 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e" dependencies = [ - "quote 1.0.2", - "syn 1.0.5", + "quote", + "syn", ] [[package]] @@ -789,7 +792,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd670e5ff58768ef624207fb95709ce63b8d05573fb9a05165f0eef471ea6a3a" dependencies = [ "procedural-masquerade", - "syn 1.0.5", + "syn", ] [[package]] @@ -858,9 +861,9 @@ checksum = "ee54512bec54b41cf2337a22ddfadb53c7d4c738494dc2a186d7b037ad683b85" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -870,8 +873,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cd3e432e52c0810b72898296a69d66b1d78d1517dff6cde7a130557a55a62c1" dependencies = [ "darling_core", - "quote 1.0.2", - "syn 1.0.5", + "quote", + "syn", ] [[package]] @@ -889,9 +892,9 @@ name = "derive_common" version = "0.0.1" dependencies = [ "darling", - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", + "proc-macro2", + "quote", + "syn", "synstructure", ] @@ -901,16 +904,16 @@ version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2159be042979966de68315bce7034bb000c775f22e3e834e1c52ff78f041cae8" dependencies = [ - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "devd-rs" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d009f166c0d9e9f9909dc751630b3a6411ab7f85a153d32d01deb364ffe52a7" +checksum = "1945ccb7caedabdfb9347766ead740fb1e0582b7425598325f546adbd832cce1" dependencies = [ "libc", "nom", @@ -952,7 +955,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b7583e1427e296c852f3217eaab3890e698f742b8d7349beb1f40c4e946fc9" dependencies = [ - "log 0.4.6", + "log", "smallbitvec", ] @@ -1042,7 +1045,7 @@ checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" dependencies = [ "atty", "humantime", - "log 0.4.6", + "log", "regex", "termcolor", ] @@ -1079,9 +1082,9 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" dependencies = [ - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", + "proc-macro2", + "quote", + "syn", "synstructure", ] @@ -1096,7 +1099,7 @@ name = "fallible" version = "0.0.1" dependencies = [ "hashglobe", - "smallvec 1.0.0", + "smallvec", ] [[package]] @@ -1218,7 +1221,7 @@ dependencies = [ "clap", "hyper", "lazy_static", - "log 0.4.6", + "log", "mozprofile", "mozrunner", "mozversion", @@ -1240,14 +1243,14 @@ dependencies = [ "cssparser", "cstr", "libc", - "log 0.4.6", + "log", "malloc_size_of", "nsstring", "num-traits", "parking_lot", "selectors", "servo_arc", - "smallvec 1.0.0", + "smallvec", "style", "style_traits", "to_shmem", @@ -1316,7 +1319,7 @@ dependencies = [ "jsrust_shared", "kvstore", "lmdb-rkv-sys", - "log 0.4.6", + "log", "mapped_hyph", "mdns_service", "mozurl", @@ -1352,7 +1355,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39a23d5e872a275135d66895d954269cf5e8661d234eb1c2480f4ce0d586acbd" dependencies = [ "khronos_api", - "log 0.4.6", + "log", "xml-rs", ] @@ -1373,11 +1376,11 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "goblin" -version = "0.0.24" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3fa261d919c1ae9d1e4533c4a2f99e10938603c4208d56c05bec7a872b661b0" +checksum = "88a79ef1f0dad46fd78075b6f80f92d97710eddf87b3e18a15a66761e8942672" dependencies = [ - "log 0.4.6", + "log", "plain", "scroll", ] @@ -1404,7 +1407,7 @@ dependencies = [ "futures", "http", "indexmap", - "log 0.4.6", + "log", "slab 0.4.1", "string", "tokio-io", @@ -1450,9 +1453,9 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f33cf300c485e3cbcba0235013fcc768723451c9b84d1b31aa7fec0491ac9a11" dependencies = [ - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1495,7 +1498,7 @@ dependencies = [ "httparse", "iovec", "itoa", - "log 0.4.6", + "log", "net2", "time", "tokio", @@ -1589,7 +1592,7 @@ dependencies = [ "glob", "lazy_static", "libc", - "log 0.4.6", + "log", "mozjs_sys", "num-traits", ] @@ -1634,11 +1637,12 @@ version = "0.1.0" dependencies = [ "atomic_refcell", "crossbeam-utils", + "cstr", "failure", "lazy_static", "libc", "lmdb-rkv", - "log 0.4.6", + "log", "moz_task", "nserror", "nsstring", @@ -1730,9 +1734,9 @@ checksum = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e" [[package]] name = "lmdb-rkv" -version = "0.12.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "605061e5465304475be2041f19967a900175ea1b6d8f47fbab84a84fb8c48452" +checksum = "447a296f7aca299cfbb50f4e4f3d49451549af655fb7215d7f8c0c3d64bad42b" dependencies = [ "bitflags", "byteorder", @@ -1742,11 +1746,10 @@ dependencies = [ [[package]] name = "lmdb-rkv-sys" -version = "0.9.5" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e4b19a1fdf5b74bc802cc9aa7c0c86a775e8b872ba9d5a4e606ffc5d076953" +checksum = "b27470ac25167b3afdfb6af8fcd3bc1be67de50ffbdaf4073378cfded6ae24a5" dependencies = [ - "bindgen", "cc", "libc", "pkg-config", @@ -1754,27 +1757,18 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" dependencies = [ "scopeguard", ] [[package]] name = "log" -version = "0.3.9" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -dependencies = [ - "log 0.4.6", -] - -[[package]] -name = "log" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" +checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" dependencies = [ "cfg-if", ] @@ -1796,7 +1790,7 @@ dependencies = [ "selectors", "servo_arc", "smallbitvec", - "smallvec 1.0.0", + "smallvec", "thin-slice", "void", ] @@ -1807,8 +1801,8 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e37c5d4cd9473c5f4c9c111f033f15d4df9bd378fdf615944e360a4f55a05f0b" dependencies = [ - "proc-macro2 1.0.5", - "syn 1.0.5", + "proc-macro2", + "syn", "synstructure", ] @@ -1833,7 +1827,7 @@ version = "0.1.0" dependencies = [ "byteorder", "dns-parser", - "log 0.4.6", + "log", "socket2", "uuid", ] @@ -1865,18 +1859,15 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.13" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e27ca21f40a310bd06d9031785f4801710d566c184a6e15bad4f1d9b65f9425" -dependencies = [ - "unicase", -] +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mime_guess" -version = "2.0.1" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a0ed03949aef72dbdf3116a383d7b38b4768e6f960528cd6a6044aa9ed68599" +checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" dependencies = [ "mime", "unicase", @@ -1903,7 +1894,7 @@ dependencies = [ "kernel32-sys", "lazycell 1.2.1", "libc", - "log 0.4.6", + "log", "miow", "net2", "ntdll-sys", @@ -1918,7 +1909,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" dependencies = [ "lazycell 1.2.1", - "log 0.4.6", + "log", "mio", "slab 0.4.1", ] @@ -1930,7 +1921,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82f43a815b57d2d652550f3d20cec88a495bb2d0956aa873dc43040278455677" dependencies = [ "kernel32-sys", - "log 0.3.9", + "log", "mio", "miow", "winapi 0.2.8", @@ -1987,12 +1978,12 @@ dependencies = [ name = "mozilla-central-workspace-hack" version = "0.1.0" dependencies = [ - "log 0.4.6", - "proc-macro2 0.4.27", - "quote 0.6.11", + "bindgen", + "libc", + "quote", "serde", "serde_derive", - "syn 0.15.30", + "syn", "void", "winapi 0.3.7", ] @@ -2019,7 +2010,7 @@ name = "mozrunner" version = "0.9.0" dependencies = [ "dirs", - "log 0.4.6", + "log", "mozprofile", "plist", "winreg", @@ -2051,7 +2042,7 @@ version = "0.11.4" dependencies = [ "bitreader", "byteorder", - "log 0.4.6", + "log", "mp4parse_fallible", "num-traits", "static_assertions", @@ -2066,16 +2057,16 @@ name = "mp4parse_capi" version = "0.11.2" dependencies = [ "byteorder", - "log 0.4.6", + "log", "mp4parse", "num-traits", ] [[package]] name = "mp4parse_fallible" -version = "0.0.1" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6626c2aef76eb8f984eef02e475883d3fe9112e114720446c5810fc5f045cd30" +checksum = "704f773471ac3e7110427b6bdf93184932b19319c9b7717688da5424e519b10a" [[package]] name = "msdos_time" @@ -2129,11 +2120,12 @@ checksum = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" [[package]] name = "nom" -version = "4.1.1" +version = "5.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c349f68f25f596b9f44cf0e7c69752a5c633b0550c3ff849518bfba0233774a" +checksum = "0b471253da97532da4b61552249c521e01e736071f71c1a4f7ebbfbf0a06aad6" dependencies = [ "memchr", + "version_check", ] [[package]] @@ -2174,9 +2166,9 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c8b15b261814f992e33760b1fca9fe8b693d8a65299f20c9901688636cfb746" dependencies = [ - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2228,13 +2220,13 @@ dependencies = [ [[package]] name = "object" -version = "0.13.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89ec45bc6b810c6ee998e22953fbf387a40fcbf5014dcbb9e5ba9a09a81ee15" +checksum = "a3c61759aa254402e53c79a68dc519cda1ceee2ff2b6d70b3e58bf64ac2f03e3" dependencies = [ "goblin", "scroll", - "target-lexicon 0.4.0", + "target-lexicon", "uuid", ] @@ -2272,27 +2264,25 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" dependencies = [ "lock_api", "parking_lot_core", - "rustc_version", ] [[package]] name = "parking_lot_core" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +checksum = "0e136c1904604defe99ce5fd71a28d473fa60a12255d511aa78a9ddf11237aeb" dependencies = [ "cfg-if", "cloudabi", "libc", "redox_syscall", - "rustc_version", - "smallvec 0.6.10", + "smallvec", "winapi 0.3.7", ] @@ -2308,11 +2298,11 @@ dependencies = [ name = "peek-poke-derive" version = "0.2.1" dependencies = [ - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", + "proc-macro2", + "quote", + "syn", "synstructure", - "unicode-xid 0.2.0", + "unicode-xid", ] [[package]] @@ -2367,9 +2357,9 @@ dependencies = [ "phf_generator", "phf_shared", "proc-macro-hack", - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2401,7 +2391,7 @@ checksum = "ffe16a646a08f4b4dd74035b9ff8e378eb1a4012a74f14f5889e7001cdbece33" dependencies = [ "binary-space-partition", "euclid", - "log 0.4.6", + "log", "num-traits", ] @@ -2459,18 +2449,9 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" dependencies = [ - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", -] - -[[package]] -name = "proc-macro2" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915" -dependencies = [ - "unicode-xid 0.1.0", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2479,7 +2460,7 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90cf5f418035b98e655e9cdb225047638296b862b42411c4e45bb88d700f7fc0" dependencies = [ - "unicode-xid 0.2.0", + "unicode-xid", ] [[package]] @@ -2520,22 +2501,13 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4" -[[package]] -name = "quote" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdd8e04bd9c52e0342b406469d494fcb033be4bdbe5c606016defbb1681411e1" -dependencies = [ - "proc-macro2 0.4.27", -] - [[package]] name = "quote" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" dependencies = [ - "proc-macro2 1.0.5", + "proc-macro2", ] [[package]] @@ -2757,9 +2729,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.3.1" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" +checksum = "b5508c1941e4e7cb19965abef075d35a9a8b5cdf0846f30b4050e9b55dc55e87" dependencies = [ "aho-corasick", "memchr", @@ -2784,9 +2756,9 @@ dependencies = [ [[package]] name = "rkv" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aab7c645d32e977e186448b0a5c2c3139a91a7f630cfd8a8c314d1d145e78bf" +checksum = "30a3dbc1f4971372545ed4175f23ef206c81e5874cd574d153646e7ee78f6793" dependencies = [ "arrayref", "bincode", @@ -2816,7 +2788,7 @@ name = "rsdparsa_capi" version = "0.1.0" dependencies = [ "libc", - "log 0.4.6", + "log", "nserror", "webrtc-sdp", ] @@ -2923,41 +2895,39 @@ checksum = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" [[package]] name = "scroll" -version = "0.9.2" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f84d114ef17fd144153d608fba7c446b0145d038985e7a8cc5d08bb0ce20383" +checksum = "abb2332cb595d33f7edd5700f4cbf94892e680c7f0ae56adab58a35190b66cb1" dependencies = [ - "rustc_version", "scroll_derive", ] [[package]] name = "scroll_derive" -version = "0.9.5" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1aa96c45e7f5a91cb7fabe7b279f02fea7126239fc40b732316e8b6a2d0fcb" +checksum = "f8584eea9b9ff42825b46faf46a8c24d2cff13ec152fa2a50df788b87c07ee28" dependencies = [ - "proc-macro2 0.4.27", - "quote 0.6.11", - "syn 0.15.30", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "selectors" -version = "0.21.0" +version = "0.22.0" dependencies = [ "bitflags", "cssparser", "derive_more", "fxhash", - "log 0.4.6", + "log", "matches", "phf", "phf_codegen", "precomputed-hash", "servo_arc", - "smallvec 1.0.0", - "thin-slice", + "smallvec", "to_shmem", "to_shmem_derive", ] @@ -2979,9 +2949,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.102" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b39bd9b0b087684013a792c59e3e07a46a01d2322518d8a1104641a0b1be0" +checksum = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" dependencies = [ "serde_derive", ] @@ -2997,13 +2967,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.102" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" +checksum = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" dependencies = [ - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -3091,25 +3061,19 @@ checksum = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d" [[package]] name = "smallbitvec" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1764fe2b30ee783bfe3b9b37b2649d8d590b3148bb12e0079715d4d5c673562e" +checksum = "797a4eaffb90d896f29698d45676f9f940a71936d7574996a7df54593ba209fa" [[package]] name = "smallvec" -version = "0.6.10" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" +checksum = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" dependencies = [ "serde", ] -[[package]] -name = "smallvec" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" - [[package]] name = "socket2" version = "0.3.10" @@ -3191,7 +3155,7 @@ dependencies = [ "itertools", "itoa", "lazy_static", - "log 0.4.6", + "log", "malloc_size_of", "malloc_size_of_derive", "matches", @@ -3201,7 +3165,6 @@ dependencies = [ "num-integer", "num-traits", "num_cpus", - "ordered-float", "owning_ref", "parking_lot", "precomputed-hash", @@ -3211,7 +3174,7 @@ dependencies = [ "serde", "servo_arc", "smallbitvec", - "smallvec 1.0.0", + "smallvec", "static_prefs", "style_derive", "style_traits", @@ -3233,9 +3196,9 @@ version = "0.0.1" dependencies = [ "darling", "derive_common", - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", + "proc-macro2", + "quote", + "syn", "synstructure", ] @@ -3267,12 +3230,12 @@ dependencies = [ "env_logger", "geckoservo", "libc", - "log 0.4.6", + "log", "malloc_size_of", "num-traits", "selectors", "size_of_test", - "smallvec 1.0.0", + "smallvec", "style", "style_traits", "to_shmem", @@ -3284,26 +3247,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c666f0fed8e1e20e057af770af9077d72f3d5a33157b8537c1475dd8ffd6d32b" -[[package]] -name = "syn" -version = "0.15.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c8865bf5a7cbb662d8b011950060b3c8743dca141b054bf7195b20d314d8e2" -dependencies = [ - "proc-macro2 0.4.27", - "quote 0.6.11", - "unicode-xid 0.1.0", -] - [[package]] name = "syn" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf" dependencies = [ - "proc-macro2 1.0.5", - "quote 1.0.2", - "unicode-xid 0.2.0", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] @@ -3312,33 +3264,17 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f085a5855930c0441ca1288cf044ea4aecf4f43a91668abdb870b4ba546a203" dependencies = [ - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", - "unicode-xid 0.2.0", + "proc-macro2", + "quote", + "syn", + "unicode-xid", ] [[package]] name = "target-lexicon" -version = "0.4.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b0ab4982b8945c35cc1c46a83a9094c414f6828a099ce5dcaa8ee2b04642dcb" -dependencies = [ - "failure", - "failure_derive", - "serde_json", -] - -[[package]] -name = "target-lexicon" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7975cb2c6f37d77b190bc5004a2bb015971464756fde9514651a525ada2a741a" -dependencies = [ - "failure", - "failure_derive", - "serde_json", -] +checksum = "6f4c118a7a38378f305a9e111fcb2f7f838c0be324bfb31a77ea04f7f6e684b4" [[package]] name = "tempfile" @@ -3412,9 +3348,9 @@ dependencies = [ [[package]] name = "thread_local" -version = "0.3.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" dependencies = [ "lazy_static", ] @@ -3455,7 +3391,7 @@ dependencies = [ "cssparser", "servo_arc", "smallbitvec", - "smallvec 1.0.0", + "smallvec", "thin-slice", ] @@ -3465,9 +3401,9 @@ version = "0.0.1" dependencies = [ "darling", "derive_common", - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", + "proc-macro2", + "quote", + "syn", "synstructure", ] @@ -3490,7 +3426,7 @@ dependencies = [ "tokio-threadpool", "tokio-timer", "tokio-udp", - "tokio-uds 0.2.5", + "tokio-uds", ] [[package]] @@ -3513,7 +3449,7 @@ dependencies = [ "bytes", "futures", "iovec", - "log 0.4.6", + "log", "mio", "scoped-tls 0.1.0", "tokio", @@ -3562,7 +3498,7 @@ checksum = "a5c9635ee806f26d302b8baa1e145689a280d8f5aa8d0552e7344808da54cc21" dependencies = [ "bytes", "futures", - "log 0.4.6", + "log", ] [[package]] @@ -3572,7 +3508,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8703a5762ff6913510dc64272c714c4389ffd8c4b3cf602879b8bd14ff06b604" dependencies = [ "futures", - "log 0.4.6", + "log", "mio", "slab 0.4.1", "tokio-executor", @@ -3603,7 +3539,7 @@ dependencies = [ "crossbeam-queue", "crossbeam-utils", "futures", - "log 0.4.6", + "log", "num_cpus", "rand 0.6.5", "slab 0.4.1", @@ -3630,30 +3566,13 @@ checksum = "43eb534af6e8f37d43ab1b612660df14755c42bd003c5f8d2475ee78cc4600c0" dependencies = [ "bytes", "futures", - "log 0.4.6", + "log", "mio", "tokio-codec", "tokio-io", "tokio-reactor", ] -[[package]] -name = "tokio-uds" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ae5d255ce739e8537221ed2942e0445f4b3b813daebac1c0050ddaaa3587f9" -dependencies = [ - "bytes", - "futures", - "iovec", - "libc", - "log 0.3.9", - "mio", - "mio-uds", - "tokio-core", - "tokio-io", -] - [[package]] name = "tokio-uds" version = "0.2.5" @@ -3664,7 +3583,7 @@ dependencies = [ "futures", "iovec", "libc", - "log 0.4.6", + "log", "mio", "mio-uds", "tokio-codec", @@ -3733,9 +3652,9 @@ dependencies = [ [[package]] name = "unicase" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84e5511b2a947f3ae965dcb29b13b7b1691b6e7332cf5dbc1744138d5acb7f6" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" dependencies = [ "version_check", ] @@ -3767,12 +3686,6 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.0" @@ -3807,11 +3720,11 @@ checksum = "3df3561629a8bb4c57e5a2e4c43348d9e29c7c29d9b1c4c1f47166deca8f37ed" [[package]] name = "uuid" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" +checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" dependencies = [ - "rand 0.6.5", + "rand 0.7.2", ] [[package]] @@ -3828,9 +3741,9 @@ checksum = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c" [[package]] name = "version_check" -version = "0.1.5" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" +checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" [[package]] name = "void" @@ -3855,7 +3768,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3" dependencies = [ "futures", - "log 0.4.6", + "log", "try-lock", ] @@ -3870,7 +3783,7 @@ dependencies = [ "headers", "http", "hyper", - "log 0.4.6", + "log", "mime", "mime_guess", "scoped-tls 1.0.0", @@ -3897,7 +3810,7 @@ dependencies = [ "cookie", "http", "lazy_static", - "log 0.4.6", + "log", "regex", "serde", "serde_derive", @@ -3930,7 +3843,7 @@ dependencies = [ "image", "lazy_static", "libc", - "log 0.4.6", + "log", "malloc_size_of_derive", "num-traits", "plane-split", @@ -3939,7 +3852,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "smallvec 0.6.10", + "smallvec", "svg_fmt", "thread_profiler", "time", @@ -3982,7 +3895,7 @@ dependencies = [ "foreign-types", "fxhash", "gleam", - "log 0.4.6", + "log", "nsstring", "num_cpus", "rayon", @@ -4005,15 +3918,15 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75fb1417c7262d8bdc0f0a2b0e32607675c9315dcbb6fccfdf75ece04e01326a" dependencies = [ - "log 0.4.6", + "log", "url", ] [[package]] name = "weedle" -version = "0.8.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a4c67f132386d965390b8a734d5d10adbcd30eb5cc74bd9229af8b83f10044" +checksum = "8a7d4f9feb723a800d8f7b74edc9fa44ff35cb0b2ec64886714362f423427f37" dependencies = [ "nom", ] @@ -4097,7 +4010,7 @@ dependencies = [ "byteorder", "bytes", "httparse", - "log 0.4.6", + "log", "mio", "mio-extras", "rand 0.6.5", @@ -4148,9 +4061,9 @@ name = "xpcom_macros" version = "0.1.0" dependencies = [ "lazy_static", - "proc-macro2 1.0.5", - "quote 1.0.2", - "syn 1.0.5", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -4163,7 +4076,7 @@ dependencies = [ "lazy_static", "libc", "lmdb-rkv", - "log 0.4.6", + "log", "moz_task", "nserror", "nsstring", diff --git a/Cargo.toml b/Cargo.toml index 324c82e09b..a21e00fda0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,6 @@ exclude = [ "gfx/webrender_bindings", "media/mp4parse-rust/mp4parse", "media/mp4parse-rust/mp4parse_capi", - "media/mp4parse-rust/mp4parse_fallible", "xpcom/rust/gkrust_utils", ] diff --git a/accessible/android/DocAccessibleWrap.cpp b/accessible/android/DocAccessibleWrap.cpp index d2b3e4e005..7149f66357 100644 --- a/accessible/android/DocAccessibleWrap.cpp +++ b/accessible/android/DocAccessibleWrap.cpp @@ -117,7 +117,7 @@ void DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer, if (inViewAccs.Contains(acc->UniqueID())) { break; } - inViewAccs.Put(acc->UniqueID(), acc); + inViewAccs.Put(acc->UniqueID(), RefPtr{acc}); } } @@ -213,7 +213,7 @@ void DocAccessibleWrap::CacheFocusPath(AccessibleWrap* aAccessible) { acc->ActionCount(), name, textValue, nodeID, description, acc->CurValue(), acc->MinValue(), acc->MaxValue(), acc->Step(), attributes)); - mFocusPath.Put(acc->UniqueID(), acc); + mFocusPath.Put(acc->UniqueID(), RefPtr{acc}); } ipcDoc->SendBatch(eBatch_FocusPath, cacheData); @@ -223,7 +223,7 @@ void DocAccessibleWrap::CacheFocusPath(AccessibleWrap* aAccessible) { for (AccessibleWrap* acc = aAccessible; acc && acc != this->Parent(); acc = static_cast(acc->Parent())) { accessibles.AppendElement(acc); - mFocusPath.Put(acc->UniqueID(), acc); + mFocusPath.Put(acc->UniqueID(), RefPtr{acc}); } sessionAcc->ReplaceFocusPathCache(accessibles); diff --git a/accessible/aom/AccessibleNode.h b/accessible/aom/AccessibleNode.h index cea73daf4b..6509d87008 100644 --- a/accessible/aom/AccessibleNode.h +++ b/accessible/aom/AccessibleNode.h @@ -186,7 +186,7 @@ class AccessibleNode : public nsISupports, public nsWrapperCache { if (!aValue) { mRelationProperties.Remove(static_cast(aProperty)); } else { - mRelationProperties.Put(static_cast(aProperty), aValue); + mRelationProperties.Put(static_cast(aProperty), RefPtr{aValue}); } } diff --git a/accessible/base/AccEvent.cpp b/accessible/base/AccEvent.cpp index bca83e8ef5..524e5249bb 100644 --- a/accessible/base/AccEvent.cpp +++ b/accessible/base/AccEvent.cpp @@ -9,8 +9,8 @@ #include "xpcAccEvents.h" #include "States.h" -#include "mozilla/EventStateManager.h" #include "mozilla/dom/Selection.h" +#include "mozilla/dom/UserActivation.h" using namespace mozilla; using namespace mozilla::a11y; @@ -30,7 +30,7 @@ AccEvent::AccEvent(uint32_t aEventType, Accessible* aAccessible, EIsFromUserInput aIsFromUserInput, EEventRule aEventRule) : mEventType(aEventType), mEventRule(aEventRule), mAccessible(aAccessible) { if (aIsFromUserInput == eAutoDetect) - mIsFromUserInput = EventStateManager::IsHandlingUserInput(); + mIsFromUserInput = dom::UserActivation::IsHandlingUserInput(); else mIsFromUserInput = aIsFromUserInput == eFromUserInput ? true : false; } diff --git a/accessible/base/AccGroupInfo.h b/accessible/base/AccGroupInfo.h index 9382ae4231..2bf96bb1b3 100644 --- a/accessible/base/AccGroupInfo.h +++ b/accessible/base/AccGroupInfo.h @@ -15,7 +15,7 @@ namespace a11y { */ class AccGroupInfo { public: - ~AccGroupInfo() { MOZ_COUNT_DTOR(AccGroupInfo); } + MOZ_COUNTED_DTOR(AccGroupInfo) /** * Return 1-based position in the group. diff --git a/accessible/base/DocManager.cpp b/accessible/base/DocManager.cpp index 089110afcb..ef87a00320 100644 --- a/accessible/base/DocManager.cpp +++ b/accessible/base/DocManager.cpp @@ -125,7 +125,7 @@ xpcAccessibleDocument* DocManager::GetXPCDocument(DocAccessible* aDocument) { xpcAccessibleDocument* xpcDoc = mXPCDocumentCache.GetWeak(aDocument); if (!xpcDoc) { xpcDoc = new xpcAccessibleDocument(aDocument); - mXPCDocumentCache.Put(aDocument, xpcDoc); + mXPCDocumentCache.Put(aDocument, RefPtr{xpcDoc}); } return xpcDoc; } @@ -144,7 +144,7 @@ xpcAccessibleDocument* DocManager::GetXPCDocument(DocAccessibleParent* aDoc) { doc = new xpcAccessibleDocument(aDoc, Interfaces::DOCUMENT | Interfaces::HYPERTEXT); - sRemoteXPCDocumentCache->Put(aDoc, doc); + sRemoteXPCDocumentCache->Put(aDoc, RefPtr{doc}); return doc; } @@ -458,7 +458,7 @@ DocAccessible* DocManager::CreateDocOrRootAccessible(Document* aDocument) { : new DocAccessibleWrap(aDocument, presShell); // Cache the document accessible into document cache. - mDocAccessibleCache.Put(aDocument, docAcc); + mDocAccessibleCache.Put(aDocument, RefPtr{docAcc}); // Initialize the document accessible. docAcc->Init(); diff --git a/accessible/base/EventQueue.cpp b/accessible/base/EventQueue.cpp index 921399b80f..a169686d49 100644 --- a/accessible/base/EventQueue.cpp +++ b/accessible/base/EventQueue.cpp @@ -30,7 +30,9 @@ bool EventQueue::PushEvent(AccEvent* aEvent) { aEvent->Document() == mDocument, "Queued event belongs to another document!"); - if (!mEvents.AppendElement(aEvent)) return false; + // XXX(Bug 1631371) Check if this should use a fallible operation as it + // pretended earlier, or change the return type to void. + mEvents.AppendElement(aEvent); // Filter events. CoalesceEvents(); diff --git a/accessible/base/Logging.cpp b/accessible/base/Logging.cpp index c39712448a..2761689168 100644 --- a/accessible/base/Logging.cpp +++ b/accessible/base/Logging.cpp @@ -119,7 +119,7 @@ static void LogDocShellTree(dom::Document* aDocumentNode) { nsCOMPtr parentTreeItem; treeItem->GetInProcessParent(getter_AddRefs(parentTreeItem)); nsCOMPtr rootTreeItem; - treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem)); + treeItem->GetInProcessRootTreeItem(getter_AddRefs(rootTreeItem)); printf("docshell hierarchy, parent: %p, root: %p, is tab document: %s;", static_cast(parentTreeItem), static_cast(rootTreeItem), (nsCoreUtils::IsTabDocument(aDocumentNode) ? "yes" : "no")); diff --git a/accessible/base/MarkupMap.h b/accessible/base/MarkupMap.h index a45a2b8be3..6aa4ab011c 100644 --- a/accessible/base/MarkupMap.h +++ b/accessible/base/MarkupMap.h @@ -392,7 +392,7 @@ MARKUPMAP( [](Element* aElement, Accessible* aContext) -> Accessible* { return new HTMLOutputAccessible(aElement, aContext->Document()); }, - roles::SECTION, Attr(live, polite)) + roles::STATUSBAR, Attr(live, polite)) MARKUPMAP(p, nullptr, roles::PARAGRAPH) diff --git a/accessible/base/NotificationController.cpp b/accessible/base/NotificationController.cpp index afced0dc57..c5ad952c60 100644 --- a/accessible/base/NotificationController.cpp +++ b/accessible/base/NotificationController.cpp @@ -948,7 +948,7 @@ void NotificationController::EventMap::PutEvent(AccTreeMutationEvent* aEvent) { uint64_t addr = reinterpret_cast(aEvent->GetAccessible()); MOZ_ASSERT((addr & 0x3) == 0, "accessible is not 4 byte aligned"); addr |= type; - mTable.Put(addr, aEvent); + mTable.Put(addr, RefPtr{aEvent}); } AccTreeMutationEvent* NotificationController::EventMap::GetEvent( diff --git a/accessible/base/NotificationController.h b/accessible/base/NotificationController.h index 00e7a1f80b..18c2b4a3fc 100644 --- a/accessible/base/NotificationController.h +++ b/accessible/base/NotificationController.h @@ -197,7 +197,10 @@ class NotificationController final : public EventQueue, * Pend an accessible subtree relocation. */ void ScheduleRelocation(Accessible* aOwner) { - if (!mRelocations.Contains(aOwner) && mRelocations.AppendElement(aOwner)) { + if (!mRelocations.Contains(aOwner)) { + // XXX(Bug 1631371) Check if this should use a fallible operation as it + // pretended earlier, or change the return type to void. + mRelocations.AppendElement(aOwner); ScheduleProcessing(); } } @@ -233,8 +236,12 @@ class NotificationController final : public EventQueue, RefPtr notification = new TNotification(aInstance, aMethod, aArgs...); - if (notification && mNotifications.AppendElement(notification)) + if (notification) { + // XXX(Bug 1631371) Check if this should use a fallible operation as it + // pretended earlier. + mNotifications.AppendElement(notification); ScheduleProcessing(); + } } /** @@ -248,8 +255,12 @@ class NotificationController final : public EventQueue, Class* aInstance, typename TNotification::Callback aMethod) { RefPtr notification = new TNotification(aInstance, aMethod); - if (notification && mNotifications.AppendElement(notification)) + if (notification) { + // XXX(Bug 1631371) Check if this should use a fallible operation as it + // pretended earlier. + mNotifications.AppendElement(notification); ScheduleProcessing(); + } } template @@ -258,7 +269,10 @@ class NotificationController final : public EventQueue, Arg* aArg) { RefPtr notification = new TNotification(aInstance, aMethod, aArg); - if (notification && mNotifications.AppendElement(notification)) { + if (notification) { + // XXX(Bug 1631371) Check if this should use a fallible operation as it + // pretended earlier. + mNotifications.AppendElement(notification); ScheduleProcessing(); } } diff --git a/accessible/base/RoleMap.h b/accessible/base/RoleMap.h index 5e5d79146e..68e45fac2c 100644 --- a/accessible/base/RoleMap.h +++ b/accessible/base/RoleMap.h @@ -492,7 +492,7 @@ ROLE(SPINBUTTON, NSAccessibilityIncrementorRole, //Subroles: Increment/Decrement. ROLE_SYSTEM_SPINBUTTON, ROLE_SYSTEM_SPINBUTTON, - java::SessionAccessibility::CLASSNAME_VIEW, // A composite widget + java::SessionAccessibility::CLASSNAME_EDITTEXT, eNameFromValueRule) ROLE(DIAGRAM, diff --git a/accessible/base/StyleInfo.cpp b/accessible/base/StyleInfo.cpp index b215d8356e..2c6a18d936 100644 --- a/accessible/base/StyleInfo.cpp +++ b/accessible/base/StyleInfo.cpp @@ -19,15 +19,12 @@ StyleInfo::StyleInfo(dom::Element* aElement) : mElement(aElement) { void StyleInfo::Display(nsAString& aValue) { aValue.Truncate(); - Servo_GetPropertyValue(mComputedStyle, eCSSProperty_display, &aValue); + mComputedStyle->GetComputedPropertyValue(eCSSProperty_display, aValue); } void StyleInfo::TextAlign(nsAString& aValue) { aValue.Truncate(); - AppendASCIItoUTF16( - nsCSSProps::ValueToKeyword(mComputedStyle->StyleText()->mTextAlign, - nsCSSProps::kTextAlignKTable), - aValue); + mComputedStyle->GetComputedPropertyValue(eCSSProperty_text_align, aValue); } void StyleInfo::TextIndent(nsAString& aValue) { @@ -72,7 +69,23 @@ void StyleInfo::FormatColor(const nscolor& aValue, nsString& aFormattedValue) { void StyleInfo::FormatTextDecorationStyle(uint8_t aValue, nsAString& aFormattedValue) { - nsCSSKeyword keyword = nsCSSProps::ValueToKeywordEnum( - aValue, nsCSSProps::kTextDecorationStyleKTable); - AppendUTF8toUTF16(nsCSSKeywords::GetStringValue(keyword), aFormattedValue); + // TODO: When these are enum classes that rust also understands we should just + // make an FFI call here. + switch (aValue) { + case NS_STYLE_TEXT_DECORATION_STYLE_NONE: + return aFormattedValue.AssignASCII("-moz-none"); + case NS_STYLE_TEXT_DECORATION_STYLE_SOLID: + return aFormattedValue.AssignASCII("solid"); + case NS_STYLE_TEXT_DECORATION_STYLE_DOUBLE: + return aFormattedValue.AssignASCII("double"); + case NS_STYLE_TEXT_DECORATION_STYLE_DOTTED: + return aFormattedValue.AssignASCII("dotted"); + case NS_STYLE_TEXT_DECORATION_STYLE_DASHED: + return aFormattedValue.AssignASCII("dashed"); + case NS_STYLE_TEXT_DECORATION_STYLE_WAVY: + return aFormattedValue.AssignASCII("wavy"); + default: + MOZ_ASSERT_UNREACHABLE("Unknown decoration style"); + break; + } } diff --git a/accessible/base/nsAccUtils.cpp b/accessible/base/nsAccUtils.cpp index 065d27e769..b3bc48cd82 100644 --- a/accessible/base/nsAccUtils.cpp +++ b/accessible/base/nsAccUtils.cpp @@ -19,6 +19,7 @@ #include "nsIPersistentProperties2.h" #include "mozilla/a11y/PDocAccessibleChild.h" #include "mozilla/dom/Element.h" +#include "nsAccessibilityService.h" using namespace mozilla; using namespace mozilla::a11y; @@ -137,7 +138,11 @@ void nsAccUtils::SetLiveContainerAttributes( live); } else if (role) { GetLiveAttrValue(role->liveAttRule, live); + } else if (nsStaticAtom* value = GetAccService()->MarkupAttribute( + ancestor, nsGkAtoms::live)) { + value->ToString(live); } + if (!live.IsEmpty()) { SetAccAttr(aAttributes, nsGkAtoms::containerLive, live); if (role) { @@ -487,6 +492,9 @@ bool nsAccUtils::IsARIALive(const Accessible* aAccessible) { docLive); } else if (role) { GetLiveAttrValue(role->liveAttRule, docLive); + } else if (nsStaticAtom* value = GetAccService()->MarkupAttribute( + ancestor, nsGkAtoms::live)) { + value->ToString(docLive); } if (!docLive.IsEmpty()) { live = docLive; diff --git a/accessible/base/nsAccessibilityService.cpp b/accessible/base/nsAccessibilityService.cpp index 9f3d651a9a..ee7cfffcb6 100644 --- a/accessible/base/nsAccessibilityService.cpp +++ b/accessible/base/nsAccessibilityService.cpp @@ -335,6 +335,25 @@ void nsAccessibilityService::FireAccessibleEvent(uint32_t aEvent, nsEventShell::FireEvent(aEvent, aTarget); } +void nsAccessibilityService::NotifyOfImageSizeAvailable( + mozilla::PresShell* aPresShell, nsIContent* aContent) { + // If the size of an image is initially unknown, it will have the invisible + // state (and a 0 width and height), causing it to be ignored by some screen + // readers. Fire a state change event to update any client caches. + DocAccessible* document = GetDocAccessible(aPresShell); + if (document) { + Accessible* accessible = document->GetAccessible(aContent); + // The accessible may not be an ImageAccessible if this was previously a + // broken image with an alt attribute. In that case, do nothing; the + // accessible will be recreated if this becomes a valid image. + if (accessible && accessible->IsImage()) { + RefPtr event = + new AccStateChangeEvent(accessible, states::INVISIBLE, false); + document->FireDelayedEvent(event); + } + } +} + Accessible* nsAccessibilityService::GetRootDocumentAccessible( PresShell* aPresShell, bool aCanCreate) { PresShell* presShell = aPresShell; @@ -343,7 +362,7 @@ Accessible* nsAccessibilityService::GetRootDocumentAccessible( nsCOMPtr treeItem(documentNode->GetDocShell()); if (treeItem) { nsCOMPtr rootTreeItem; - treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem)); + treeItem->GetInProcessRootTreeItem(getter_AddRefs(rootTreeItem)); if (treeItem != rootTreeItem) { nsCOMPtr docShell(do_QueryInterface(rootTreeItem)); presShell = docShell->GetPresShell(); diff --git a/accessible/base/nsAccessibilityService.h b/accessible/base/nsAccessibilityService.h index 5ecd7ab608..8800f07f2b 100644 --- a/accessible/base/nsAccessibilityService.h +++ b/accessible/base/nsAccessibilityService.h @@ -222,6 +222,15 @@ class nsAccessibilityService final : public mozilla::a11y::DocManager, void FireAccessibleEvent(uint32_t aEvent, Accessible* aTarget); + /** + * Notify accessibility that the size has become available for an image. + * This occurs when the size of an image is initially not known, but we've + * now loaded enough data to know the size. + * Called by layout. + */ + void NotifyOfImageSizeAvailable(mozilla::PresShell* aPresShell, + nsIContent* aContent); + // nsAccessibiltiyService /** @@ -246,6 +255,25 @@ class nsAccessibilityService final : public mozilla::a11y::DocManager, return markupMap ? markupMap->role : mozilla::a11y::roles::NOTHING; } + /** + * Return the associated value for a given attribute if + * it appears in the MarkupMap. Otherwise, it returns null. + */ + nsStaticAtom* MarkupAttribute(const nsIContent* aContent, + nsStaticAtom* aAtom) const { + const mozilla::a11y::HTMLMarkupMapInfo* markupMap = + mHTMLMarkupMap.Get(aContent->NodeInfo()->NameAtom()); + if (markupMap) { + for (size_t i = 0; i < mozilla::ArrayLength(markupMap->attrs); i++) { + const mozilla::a11y::MarkupAttrInfo* info = markupMap->attrs + i; + if (info->name == aAtom) { + return info->value; + } + } + } + return nullptr; + } + /** * Set the object attribute defined by markup for the given element. */ diff --git a/accessible/base/nsCoreUtils.cpp b/accessible/base/nsCoreUtils.cpp index e4d604c15c..a16e2b0cd3 100644 --- a/accessible/base/nsCoreUtils.cpp +++ b/accessible/base/nsCoreUtils.cpp @@ -364,7 +364,7 @@ bool nsCoreUtils::IsTabDocument(Document* aDocumentNode) { // Parent of docshell for tab document running in chrome process is root. nsCOMPtr rootTreeItem; - treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem)); + treeItem->GetInProcessRootTreeItem(getter_AddRefs(rootTreeItem)); return parentTreeItem == rootTreeItem; } diff --git a/accessible/base/nsCoreUtils.h b/accessible/base/nsCoreUtils.h index 0fb641465a..b92b3fb716 100644 --- a/accessible/base/nsCoreUtils.h +++ b/accessible/base/nsCoreUtils.h @@ -142,8 +142,8 @@ class nsCoreUtils { * @param aRange the range to scroll to * @param aScrollType the place a range should be scrolled to */ - static nsresult ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange, - uint32_t aScrollType); + MOZ_CAN_RUN_SCRIPT_BOUNDARY static nsresult ScrollSubstringTo( + nsIFrame* aFrame, nsRange* aRange, uint32_t aScrollType); /** Helper method to scroll range into view, used for implementation of * nsIAccessibleText::scrollSubstringTo[Point](). @@ -155,9 +155,9 @@ class nsCoreUtils { * @param aHorizontal how to align horizontally, specified in percents, * and when. */ - static nsresult ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange, - mozilla::ScrollAxis aVertical, - mozilla::ScrollAxis aHorizontal); + MOZ_CAN_RUN_SCRIPT_BOUNDARY static nsresult ScrollSubstringTo( + nsIFrame* aFrame, nsRange* aRange, mozilla::ScrollAxis aVertical, + mozilla::ScrollAxis aHorizontal); /** * Scrolls the given frame to the point, used for implememntation of diff --git a/accessible/generic/Accessible.cpp b/accessible/generic/Accessible.cpp index 131a46ef44..1ff146a7bb 100644 --- a/accessible/generic/Accessible.cpp +++ b/accessible/generic/Accessible.cpp @@ -65,7 +65,6 @@ #include "mozilla/Assertions.h" #include "mozilla/BasicEvents.h" #include "mozilla/ErrorResult.h" -#include "mozilla/EventStateManager.h" #include "mozilla/EventStates.h" #include "mozilla/FloatingPoint.h" #include "mozilla/MouseEvents.h" @@ -79,6 +78,7 @@ #include "mozilla/dom/HTMLBodyElement.h" #include "mozilla/dom/KeyboardEventBinding.h" #include "mozilla/dom/TreeWalker.h" +#include "mozilla/dom/UserActivation.h" using namespace mozilla; using namespace mozilla::a11y; @@ -736,7 +736,7 @@ void Accessible::TakeFocus() const { nsFocusManager* fm = nsFocusManager::GetFocusManager(); if (fm) { - AutoHandlingUserInputStatePusher inputStatePusher(true); + dom::AutoHandlingUserInputStatePusher inputStatePusher(true); // XXXbz: Can we actually have a non-element content here? RefPtr element = focusContent->IsElement() ? focusContent->AsElement() : nullptr; @@ -2074,7 +2074,7 @@ RootAccessible* Accessible::RootAccessible() const { } nsCOMPtr root; - docShell->GetRootTreeItem(getter_AddRefs(root)); + docShell->GetInProcessRootTreeItem(getter_AddRefs(root)); NS_ASSERTION(root, "No root content tree item"); if (!root) { return nullptr; @@ -2106,10 +2106,13 @@ bool Accessible::InsertChildAt(uint32_t aIndex, Accessible* aChild) { if (!aChild) return false; if (aIndex == mChildren.Length()) { - if (!mChildren.AppendElement(aChild)) return false; - + // XXX(Bug 1631371) Check if this should use a fallible operation as it + // pretended earlier. + mChildren.AppendElement(aChild); } else { - if (!mChildren.InsertElementAt(aIndex, aChild)) return false; + // XXX(Bug 1631371) Check if this should use a fallible operation as it + // pretended earlier. + mChildren.InsertElementAt(aIndex, aChild); MOZ_ASSERT(mStateFlags & eKidsMutating, "Illicit children change"); diff --git a/accessible/generic/DocAccessible-inl.h b/accessible/generic/DocAccessible-inl.h index b65ac7a299..1ac54ed4e1 100644 --- a/accessible/generic/DocAccessible-inl.h +++ b/accessible/generic/DocAccessible-inl.h @@ -110,8 +110,10 @@ inline void DocAccessible::NotifyOfLoad(uint32_t aLoadEventType) { } inline void DocAccessible::MaybeNotifyOfValueChange(Accessible* aAccessible) { - if (aAccessible->IsCombobox() || aAccessible->Role() == roles::ENTRY) + if (aAccessible->IsCombobox() || aAccessible->Role() == roles::ENTRY || + aAccessible->Role() == roles::SPINBUTTON) { FireDelayedEvent(nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE, aAccessible); + } } inline Accessible* DocAccessible::GetAccessibleEvenIfNotInMapOrContainer( diff --git a/accessible/generic/DocAccessible.cpp b/accessible/generic/DocAccessible.cpp index 1f0ac4abfe..08db4e89db 100644 --- a/accessible/generic/DocAccessible.cpp +++ b/accessible/generic/DocAccessible.cpp @@ -35,15 +35,16 @@ #include "nsFocusManager.h" #include "mozilla/ArrayUtils.h" #include "mozilla/Assertions.h" -#include "mozilla/EventStateManager.h" #include "mozilla/EventStates.h" #include "mozilla/HTMLEditor.h" #include "mozilla/PresShell.h" #include "mozilla/TextEditor.h" +#include "mozilla/dom/AncestorIterator.h" #include "mozilla/dom/BrowserChild.h" #include "mozilla/dom/DocumentType.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/MutationEventBinding.h" +#include "mozilla/dom/UserActivation.h" using namespace mozilla; using namespace mozilla::a11y; @@ -290,7 +291,7 @@ void DocAccessible::TakeFocus() const { // Focus the document. nsFocusManager* fm = nsFocusManager::GetFocusManager(); RefPtr newFocus; - AutoHandlingUserInputStatePusher inputStatePusher(true); + dom::AutoHandlingUserInputStatePusher inputStatePusher(true); fm->MoveFocus(mDocumentNode->GetWindow(), nullptr, nsFocusManager::MOVEFOCUS_ROOT, 0, getter_AddRefs(newFocus)); } @@ -1136,24 +1137,20 @@ Accessible* DocAccessible::GetAccessibleOrContainer( return nullptr; } - nsINode* currNode = nullptr; - if (aNode->IsShadowRoot()) { + nsINode* start = aNode; + if (auto* shadowRoot = dom::ShadowRoot::FromNode(aNode)) { // This can happen, for example, when called within // SelectionManager::ProcessSelectionChanged due to focusing a direct // child of a shadow root. // GetFlattenedTreeParent works on children of a shadow root, but not the // shadow root itself. - const dom::ShadowRoot* shadowRoot = dom::ShadowRoot::FromNode(aNode); - currNode = shadowRoot->GetHost(); - if (!currNode) { + start = shadowRoot->GetHost(); + if (!start) { return nullptr; } - } else { - currNode = aNode; } - MOZ_ASSERT(currNode); - for (; currNode; currNode = currNode->GetFlattenedTreeParentNode()) { + for (nsINode* currNode : dom::InclusiveFlatTreeAncestors(*start)) { // No container if is inside of aria-hidden subtree. if (aNoContainerIfPruned && currNode->IsElement() && aria::HasDefinedARIAHidden(currNode->AsElement())) { @@ -1218,7 +1215,7 @@ void DocAccessible::BindToDocument(Accessible* aAccessible, mNodeToAccessibleMap.Put(aAccessible->GetNode(), aAccessible); // Put into unique ID cache. - mAccessibleCache.Put(aAccessible->UniqueID(), aAccessible); + mAccessibleCache.Put(aAccessible->UniqueID(), RefPtr{aAccessible}); aAccessible->SetRoleMapEntry(aRoleMapEntry); @@ -1639,7 +1636,7 @@ class InsertIterator final { MOZ_ASSERT(aNodes, "No nodes to search for accessible elements"); MOZ_COUNT_CTOR(InsertIterator); } - ~InsertIterator() { MOZ_COUNT_DTOR(InsertIterator); } + MOZ_COUNTED_DTOR(InsertIterator) Accessible* Context() const { return mWalker.Context(); } Accessible* Child() const { return mChild; } @@ -2287,7 +2284,7 @@ bool DocAccessible::IsLoadEventTarget() const { // Return true if it's either: // a) tab document; nsCOMPtr rootTreeItem; - treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem)); + treeItem->GetInProcessRootTreeItem(getter_AddRefs(rootTreeItem)); if (parentTreeItem == rootTreeItem) return true; // b) frame/iframe document and its parent document is not in loading state diff --git a/accessible/generic/DocAccessible.h b/accessible/generic/DocAccessible.h index f35449664a..3264e282a9 100644 --- a/accessible/generic/DocAccessible.h +++ b/accessible/generic/DocAccessible.h @@ -432,7 +432,10 @@ class DocAccessible : public HyperTextAccessibleWrap, * accessibles. */ bool AppendChildDocument(DocAccessible* aChildDocument) { - return mChildDocuments.AppendElement(aChildDocument); + // XXX(Bug 1631371) Check if this should use a fallible operation as it + // pretended earlier, or change the return type to void. + mChildDocuments.AppendElement(aChildDocument); + return true; } /** diff --git a/accessible/generic/HyperTextAccessible.cpp b/accessible/generic/HyperTextAccessible.cpp index e30dd169cc..2520b1c47b 100644 --- a/accessible/generic/HyperTextAccessible.cpp +++ b/accessible/generic/HyperTextAccessible.cpp @@ -68,7 +68,7 @@ role HyperTextAccessible::NativeRole() const { uint64_t HyperTextAccessible::NativeState() const { uint64_t states = AccessibleWrap::NativeState(); - if (mContent->AsElement()->State().HasState(NS_EVENT_STATE_MOZ_READWRITE)) { + if (mContent->AsElement()->State().HasState(NS_EVENT_STATE_READWRITE)) { states |= states::EDITABLE; } else if (mContent->IsHTMLElement(nsGkAtoms::article)) { @@ -324,7 +324,7 @@ static nsIContent* GetElementAsContentOf(nsINode* aNode) { bool HyperTextAccessible::OffsetsToDOMRange(int32_t aStartOffset, int32_t aEndOffset, - nsRange* aRange) { + nsRange* aRange) const { DOMPoint startPoint = OffsetToDOMPoint(aStartOffset); if (!startPoint.node) return false; @@ -357,7 +357,7 @@ bool HyperTextAccessible::OffsetsToDOMRange(int32_t aStartOffset, return true; } -DOMPoint HyperTextAccessible::OffsetToDOMPoint(int32_t aOffset) { +DOMPoint HyperTextAccessible::OffsetToDOMPoint(int32_t aOffset) const { // 0 offset is valid even if no children. In this case the associated editor // is empty so return a DOM point for editor root element. if (aOffset == 0) { @@ -404,7 +404,7 @@ DOMPoint HyperTextAccessible::OffsetToDOMPoint(int32_t aOffset) { } DOMPoint HyperTextAccessible::ClosestNotGeneratedDOMPoint( - const DOMPoint& aDOMPoint, nsIContent* aElementContent) { + const DOMPoint& aDOMPoint, nsIContent* aElementContent) const { MOZ_ASSERT(aDOMPoint.node, "The node must not be null"); // ::before pseudo element @@ -521,8 +521,10 @@ uint32_t HyperTextAccessible::FindOffset(uint32_t aOffset, nsresult rv = frameAtOffset->PeekOffset(&pos); // PeekOffset fails on last/first lines of the text in certain cases. + bool fallBackToSelectEndLine = false; if (NS_FAILED(rv) && aAmount == eSelectLine) { - pos.mAmount = (aDirection == eDirNext) ? eSelectEndLine : eSelectBeginLine; + fallBackToSelectEndLine = aDirection == eDirNext; + pos.mAmount = fallBackToSelectEndLine ? eSelectEndLine : eSelectBeginLine; frameAtOffset->PeekOffset(&pos); } if (!pos.mResultContent) { @@ -534,6 +536,14 @@ uint32_t HyperTextAccessible::FindOffset(uint32_t aOffset, uint32_t hyperTextOffset = DOMPointToOffset( pos.mResultContent, pos.mContentOffset, aDirection == eDirNext); + if (fallBackToSelectEndLine && IsLineEndCharAt(hyperTextOffset)) { + // We used eSelectEndLine, but the caller requested eSelectLine. + // If there's a '\n' at the end of the line, eSelectEndLine will stop + // on it rather than after it. This is not what we want, since the caller + // wants the next line, not the same line. + ++hyperTextOffset; + } + if (aDirection == eDirPrevious) { // If we reached the end during search, this means we didn't find the DOM // point and we're actually at the start of the paragraph @@ -1260,13 +1270,15 @@ nsresult HyperTextAccessible::SetSelectionRange(int32_t aStartPos, // some input controls if (isFocusable) TakeFocus(); - dom::Selection* domSel = DOMSelection(); + RefPtr domSel = DOMSelection(); NS_ENSURE_STATE(domSel); // Set up the selection. - for (int32_t idx = domSel->RangeCount() - 1; idx > 0; idx--) - domSel->RemoveRangeAndUnselectFramesAndNotifyListeners( - *domSel->GetRangeAt(idx), IgnoreErrors()); + for (int32_t idx = domSel->RangeCount() - 1; idx > 0; idx--) { + RefPtr range{domSel->GetRangeAt(idx)}; + domSel->RemoveRangeAndUnselectFramesAndNotifyListeners(*range, + IgnoreErrors()); + } SetSelectionBoundsAt(0, aStartPos, aEndPos); // Make sure it is visible @@ -1552,15 +1564,16 @@ bool HyperTextAccessible::SetSelectionBoundsAt(int32_t aSelectionNum, return false; } - dom::Selection* domSel = DOMSelection(); + RefPtr domSel = DOMSelection(); if (!domSel) return false; RefPtr range; uint32_t rangeCount = domSel->RangeCount(); - if (aSelectionNum == static_cast(rangeCount)) - range = new nsRange(mContent); - else + if (aSelectionNum == static_cast(rangeCount)) { + range = nsRange::Create(mContent); + } else { range = domSel->GetRangeAt(aSelectionNum); + } if (!range) return false; @@ -1589,22 +1602,23 @@ bool HyperTextAccessible::SetSelectionBoundsAt(int32_t aSelectionNum, } bool HyperTextAccessible::RemoveFromSelection(int32_t aSelectionNum) { - dom::Selection* domSel = DOMSelection(); + RefPtr domSel = DOMSelection(); if (!domSel) return false; if (aSelectionNum < 0 || aSelectionNum >= static_cast(domSel->RangeCount())) return false; - domSel->RemoveRangeAndUnselectFramesAndNotifyListeners( - *domSel->GetRangeAt(aSelectionNum), IgnoreErrors()); + const RefPtr range{domSel->GetRangeAt(aSelectionNum)}; + domSel->RemoveRangeAndUnselectFramesAndNotifyListeners(*range, + IgnoreErrors()); return true; } void HyperTextAccessible::ScrollSubstringTo(int32_t aStartOffset, int32_t aEndOffset, uint32_t aScrollType) { - RefPtr range = new nsRange(mContent); + RefPtr range = nsRange::Create(mContent); if (OffsetsToDOMRange(aStartOffset, aEndOffset, range)) nsCoreUtils::ScrollSubstringTo(GetFrame(), range, aScrollType); } @@ -1619,7 +1633,7 @@ void HyperTextAccessible::ScrollSubstringToPoint(int32_t aStartOffset, nsIntPoint coords = nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType, this); - RefPtr range = new nsRange(mContent); + RefPtr range = nsRange::Create(mContent); if (!OffsetsToDOMRange(aStartOffset, aEndOffset, range)) return; nsPresContext* presContext = frame->PresContext(); @@ -1683,7 +1697,7 @@ void HyperTextAccessible::SelectionRanges( aRanges->SetCapacity(sel->RangeCount()); for (uint32_t idx = 0; idx < sel->RangeCount(); idx++) { - nsRange* DOMRange = sel->GetRangeAt(idx); + const nsRange* DOMRange = sel->GetRangeAt(idx); HyperTextAccessible* startContainer = nsAccUtils::GetTextContainer(DOMRange->GetStartContainer()); HyperTextAccessible* endContainer = @@ -2003,7 +2017,7 @@ void HyperTextAccessible::GetSpellTextAttr( uint32_t startOffset = 0, endOffset = 0; for (int32_t idx = 0; idx < rangeCount; idx++) { - nsRange* range = domSel->GetRangeAt(idx); + const nsRange* range = domSel->GetRangeAt(idx); if (range->Collapsed()) continue; // See if the point comes after the range in which case we must continue in @@ -2057,7 +2071,7 @@ void HyperTextAccessible::GetSpellTextAttr( endOffset = DOMPointToOffset(startNode, startNodeOffset); if (idx > 0) { - nsRange* prevRange = domSel->GetRangeAt(idx - 1); + const nsRange* prevRange = domSel->GetRangeAt(idx - 1); startOffset = DOMPointToOffset(prevRange->GetEndContainer(), prevRange->EndOffset()); } @@ -2077,7 +2091,7 @@ void HyperTextAccessible::GetSpellTextAttr( // the point is not in a range, that we do not need to compute an end offset, // and that we should use the end offset of the last range to compute the // start offset of the text attribute range. - nsRange* prevRange = domSel->GetRangeAt(rangeCount - 1); + const nsRange* prevRange = domSel->GetRangeAt(rangeCount - 1); startOffset = DOMPointToOffset(prevRange->GetEndContainer(), prevRange->EndOffset()); diff --git a/accessible/generic/HyperTextAccessible.h b/accessible/generic/HyperTextAccessible.h index d2d35b73e1..694764d1c6 100644 --- a/accessible/generic/HyperTextAccessible.h +++ b/accessible/generic/HyperTextAccessible.h @@ -142,7 +142,7 @@ class HyperTextAccessible : public AccessibleWrap { * @return true if conversion was successful */ bool OffsetsToDOMRange(int32_t aStartOffset, int32_t aEndOffset, - nsRange* aRange); + nsRange* aRange) const; /** * Convert the given offset into DOM point. @@ -151,7 +151,7 @@ class HyperTextAccessible : public AccessibleWrap { * if before embedded object then (parent node, indexInParent), if after then * (parent node, indexInParent + 1). */ - DOMPoint OffsetToDOMPoint(int32_t aOffset); + DOMPoint OffsetToDOMPoint(int32_t aOffset) const; /** * Return true if the used ARIA role (if any) allows the hypertext accessible @@ -340,8 +340,10 @@ class HyperTextAccessible : public AccessibleWrap { * Changes the start and end offset of the specified selection. * @return true if succeeded */ - bool SetSelectionBoundsAt(int32_t aSelectionNum, int32_t aStartOffset, - int32_t aEndOffset); + // TODO: annotate this with `MOZ_CAN_RUN_SCRIPT` instead. + MOZ_CAN_RUN_SCRIPT_BOUNDARY bool SetSelectionBoundsAt(int32_t aSelectionNum, + int32_t aStartOffset, + int32_t aEndOffset); /** * Adds a selection bounded by the specified offsets. @@ -353,7 +355,8 @@ class HyperTextAccessible : public AccessibleWrap { * Removes the specified selection. * @return true if succeeded */ - bool RemoveFromSelection(int32_t aSelectionNum); + // TODO: annotate this with `MOZ_CAN_RUN_SCRIPT` instead. + MOZ_CAN_RUN_SCRIPT_BOUNDARY bool RemoveFromSelection(int32_t aSelectionNum); /** * Scroll the given text range into view. @@ -507,7 +510,9 @@ class HyperTextAccessible : public AccessibleWrap { void GetSelectionDOMRanges(SelectionType aSelectionType, nsTArray* aRanges); - nsresult SetSelectionRange(int32_t aStartPos, int32_t aEndPos); + // TODO: annotate this with `MOZ_CAN_RUN_SCRIPT` instead. + MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult SetSelectionRange(int32_t aStartPos, + int32_t aEndPos); /** * Convert the given DOM point to a DOM point in non-generated contents. @@ -524,7 +529,7 @@ class HyperTextAccessible : public AccessibleWrap { * contents. */ DOMPoint ClosestNotGeneratedDOMPoint(const DOMPoint& aDOMPoint, - nsIContent* aElementContent); + nsIContent* aElementContent) const; // Helpers nsresult GetDOMPointByFrameOffset(nsIFrame* aFrame, int32_t aOffset, diff --git a/accessible/generic/ImageAccessible.cpp b/accessible/generic/ImageAccessible.cpp index 8a1968a182..46441a57cd 100644 --- a/accessible/generic/ImageAccessible.cpp +++ b/accessible/generic/ImageAccessible.cpp @@ -47,13 +47,30 @@ uint64_t ImageAccessible::NativeState() const { content->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST, getter_AddRefs(imageRequest)); - nsCOMPtr imgContainer; - if (imageRequest) imageRequest->GetImage(getter_AddRefs(imgContainer)); + if (imageRequest) { + nsCOMPtr imgContainer; + imageRequest->GetImage(getter_AddRefs(imgContainer)); + if (imgContainer) { + bool animated = false; + imgContainer->GetAnimated(&animated); + if (animated) { + state |= states::ANIMATED; + } + } - if (imgContainer) { - bool animated = false; - imgContainer->GetAnimated(&animated); - if (animated) state |= states::ANIMATED; + nsIFrame* frame = GetFrame(); + MOZ_ASSERT(!frame || frame->AccessibleType() == eImageType || + frame->AccessibleType() == a11y::eHTMLImageMapType); + if (frame && !(frame->GetStateBits() & IMAGE_SIZECONSTRAINED)) { + uint32_t status = imgIRequest::STATUS_NONE; + imageRequest->GetImageStatus(&status); + if (!(status & imgIRequest::STATUS_SIZE_AVAILABLE)) { + // The size of this image hasn't been constrained and we haven't loaded + // enough of the image to know its size yet. This means it currently + // has 0 width and height. + state |= states::INVISIBLE; + } + } } return state; diff --git a/accessible/html/HTMLFormControlAccessible.cpp b/accessible/html/HTMLFormControlAccessible.cpp index 09584d6e52..f75a66b43e 100644 --- a/accessible/html/HTMLFormControlAccessible.cpp +++ b/accessible/html/HTMLFormControlAccessible.cpp @@ -459,7 +459,7 @@ Accessible* HTMLFileInputAccessible::CurrentItem() const { role HTMLSpinnerAccessible::NativeRole() const { return roles::SPINBUTTON; } void HTMLSpinnerAccessible::Value(nsString& aValue) const { - AccessibleWrap::Value(aValue); + HTMLTextFieldAccessible::Value(aValue); if (!aValue.IsEmpty()) return; // Pass NonSystem as the caller type, to be safe. We don't expect to have a @@ -468,28 +468,28 @@ void HTMLSpinnerAccessible::Value(nsString& aValue) const { } double HTMLSpinnerAccessible::MaxValue() const { - double value = AccessibleWrap::MaxValue(); + double value = HTMLTextFieldAccessible::MaxValue(); if (!IsNaN(value)) return value; return HTMLInputElement::FromNode(mContent)->GetMaximum().toDouble(); } double HTMLSpinnerAccessible::MinValue() const { - double value = AccessibleWrap::MinValue(); + double value = HTMLTextFieldAccessible::MinValue(); if (!IsNaN(value)) return value; return HTMLInputElement::FromNode(mContent)->GetMinimum().toDouble(); } double HTMLSpinnerAccessible::Step() const { - double value = AccessibleWrap::Step(); + double value = HTMLTextFieldAccessible::Step(); if (!IsNaN(value)) return value; return HTMLInputElement::FromNode(mContent)->GetStep().toDouble(); } double HTMLSpinnerAccessible::CurValue() const { - double value = AccessibleWrap::CurValue(); + double value = HTMLTextFieldAccessible::CurValue(); if (!IsNaN(value)) return value; return HTMLInputElement::FromNode(mContent)->GetValueAsDecimal().toDouble(); diff --git a/accessible/html/HTMLFormControlAccessible.h b/accessible/html/HTMLFormControlAccessible.h index 7a10b88ec0..80efad908e 100644 --- a/accessible/html/HTMLFormControlAccessible.h +++ b/accessible/html/HTMLFormControlAccessible.h @@ -62,7 +62,7 @@ class HTMLButtonAccessible : public HyperTextAccessibleWrap { * Accessible for HTML input@type="text", input@type="password", textarea and * other HTML text controls. */ -class HTMLTextFieldAccessible final : public HyperTextAccessibleWrap { +class HTMLTextFieldAccessible : public HyperTextAccessibleWrap { public: enum { eAction_Click = 0 }; @@ -128,10 +128,10 @@ class HTMLFileInputAccessible : public HyperTextAccessibleWrap { /** * Used for HTML input@type="number". */ -class HTMLSpinnerAccessible : public AccessibleWrap { +class HTMLSpinnerAccessible final : public HTMLTextFieldAccessible { public: HTMLSpinnerAccessible(nsIContent* aContent, DocAccessible* aDoc) - : AccessibleWrap(aContent, aDoc) { + : HTMLTextFieldAccessible(aContent, aDoc) { mStateFlags |= eHasNumericValue; } diff --git a/accessible/html/HTMLListAccessible.cpp b/accessible/html/HTMLListAccessible.cpp index a9db22a5d9..9bbc6c3c75 100644 --- a/accessible/html/HTMLListAccessible.cpp +++ b/accessible/html/HTMLListAccessible.cpp @@ -9,7 +9,7 @@ #include "Role.h" #include "States.h" -#include "nsContainerFrame.h" +#include "nsBulletFrame.h" #include "nsLayoutUtils.h" using namespace mozilla; @@ -36,10 +36,14 @@ HTMLLIAccessible::HTMLLIAccessible(nsIContent* aContent, DocAccessible* aDoc) : HyperTextAccessibleWrap(aContent, aDoc), mBullet(nullptr) { mType = eHTMLLiType; - if (nsLayoutUtils::GetMarkerFrame(aContent)) { - mBullet = new HTMLListBulletAccessible(mContent, mDoc); - Document()->BindToDocument(mBullet, nullptr); - AppendChild(mBullet); + if (nsBulletFrame* bulletFrame = + do_QueryFrame(nsLayoutUtils::GetMarkerFrame(aContent))) { + const nsStyleList* styleList = bulletFrame->StyleList(); + if (styleList->GetListStyleImage() || !styleList->mCounterStyle.IsNone()) { + mBullet = new HTMLListBulletAccessible(mContent, mDoc); + Document()->BindToDocument(mBullet, nullptr); + AppendChild(mBullet); + } } } @@ -123,10 +127,20 @@ ENameValueFlag HTMLListBulletAccessible::Name(nsString& aName) const { aName.Truncate(); // Native anonymous content, ARIA can't be used. Get list bullet text. - if (nsContainerFrame* frame = do_QueryFrame(mContent->GetPrimaryFrame())) { - frame->GetSpokenMarkerText(aName); + nsBulletFrame* frame = do_QueryFrame(GetFrame()); + if (!frame) { + return eNameOK; + } + + if (frame->StyleList()->GetListStyleImage()) { + // Bullet is an image, so use default bullet character. + const char16_t kDiscCharacter = 0x2022; + aName.Assign(kDiscCharacter); + aName.Append(' '); + return eNameOK; } + frame->GetSpokenText(aName); return eNameOK; } diff --git a/accessible/html/HTMLTableAccessible.cpp b/accessible/html/HTMLTableAccessible.cpp index ea70fb6905..4224466905 100644 --- a/accessible/html/HTMLTableAccessible.cpp +++ b/accessible/html/HTMLTableAccessible.cpp @@ -658,36 +658,36 @@ bool HTMLTableAccessible::IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx) { void HTMLTableAccessible::SelectRow(uint32_t aRowIdx) { DebugOnly rv = - RemoveRowsOrColumnsFromSelection(aRowIdx, TableSelection::Row, true); + RemoveRowsOrColumnsFromSelection(aRowIdx, TableSelectionMode::Row, true); NS_ASSERTION(NS_SUCCEEDED(rv), "RemoveRowsOrColumnsFromSelection() Shouldn't fail!"); - AddRowOrColumnToSelection(aRowIdx, TableSelection::Row); + AddRowOrColumnToSelection(aRowIdx, TableSelectionMode::Row); } void HTMLTableAccessible::SelectCol(uint32_t aColIdx) { - DebugOnly rv = - RemoveRowsOrColumnsFromSelection(aColIdx, TableSelection::Column, true); + DebugOnly rv = RemoveRowsOrColumnsFromSelection( + aColIdx, TableSelectionMode::Column, true); NS_ASSERTION(NS_SUCCEEDED(rv), "RemoveRowsOrColumnsFromSelection() Shouldn't fail!"); - AddRowOrColumnToSelection(aColIdx, TableSelection::Column); + AddRowOrColumnToSelection(aColIdx, TableSelectionMode::Column); } void HTMLTableAccessible::UnselectRow(uint32_t aRowIdx) { - RemoveRowsOrColumnsFromSelection(aRowIdx, TableSelection::Row, false); + RemoveRowsOrColumnsFromSelection(aRowIdx, TableSelectionMode::Row, false); } void HTMLTableAccessible::UnselectCol(uint32_t aColIdx) { - RemoveRowsOrColumnsFromSelection(aColIdx, TableSelection::Column, false); + RemoveRowsOrColumnsFromSelection(aColIdx, TableSelectionMode::Column, false); } //////////////////////////////////////////////////////////////////////////////// // HTMLTableAccessible: protected implementation nsresult HTMLTableAccessible::AddRowOrColumnToSelection( - int32_t aIndex, TableSelection aTarget) { - bool doSelectRow = (aTarget == TableSelection::Row); + int32_t aIndex, TableSelectionMode aTarget) { + bool doSelectRow = (aTarget == TableSelectionMode::Row); nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame()); if (!tableFrame) return NS_OK; @@ -716,7 +716,7 @@ nsresult HTMLTableAccessible::AddRowOrColumnToSelection( } nsresult HTMLTableAccessible::RemoveRowsOrColumnsFromSelection( - int32_t aIndex, TableSelection aTarget, bool aIsOuter) { + int32_t aIndex, TableSelectionMode aTarget, bool aIsOuter) { nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame()); if (!tableFrame) return NS_OK; @@ -724,7 +724,7 @@ nsresult HTMLTableAccessible::RemoveRowsOrColumnsFromSelection( RefPtr tableSelection = const_cast(presShell->ConstFrameSelection()); - bool doUnselectRow = (aTarget == TableSelection::Row); + bool doUnselectRow = (aTarget == TableSelectionMode::Row); uint32_t count = doUnselectRow ? ColCount() : RowCount(); int32_t startRowIdx = doUnselectRow ? aIndex : 0; diff --git a/accessible/html/HTMLTableAccessible.h b/accessible/html/HTMLTableAccessible.h index baacfa3deb..248524085b 100644 --- a/accessible/html/HTMLTableAccessible.h +++ b/accessible/html/HTMLTableAccessible.h @@ -14,7 +14,7 @@ class nsTableCellFrame; namespace mozilla { -enum class TableSelection : uint32_t; +enum class TableSelectionMode : uint32_t; namespace a11y { @@ -176,7 +176,8 @@ class HTMLTableAccessible : public HyperTextAccessibleWrap, * @param aTarget [in] indicates what should be selected, either row or * column (see nsFrameSelection) */ - nsresult AddRowOrColumnToSelection(int32_t aIndex, TableSelection aTarget); + nsresult AddRowOrColumnToSelection(int32_t aIndex, + TableSelectionMode aTarget); /** * Removes rows or columns at the given index or outside it from selection. @@ -188,7 +189,7 @@ class HTMLTableAccessible : public HyperTextAccessibleWrap, * should be unselected only */ nsresult RemoveRowsOrColumnsFromSelection(int32_t aIndex, - TableSelection aTarget, + TableSelectionMode aTarget, bool aIsOuter); #ifdef SHOW_LAYOUT_HEURISTIC diff --git a/accessible/ipc/other/ProxyAccessible.h b/accessible/ipc/other/ProxyAccessible.h index c66766c1ae..cbbec8c441 100644 --- a/accessible/ipc/other/ProxyAccessible.h +++ b/accessible/ipc/other/ProxyAccessible.h @@ -25,7 +25,7 @@ class ProxyAccessible : public ProxyAccessibleBase { MOZ_COUNT_CTOR(ProxyAccessible); } - ~ProxyAccessible() { MOZ_COUNT_DTOR(ProxyAccessible); } + MOZ_COUNTED_DTOR(ProxyAccessible) #include "mozilla/a11y/ProxyAccessibleShared.h" diff --git a/accessible/ipc/other/moz.build b/accessible/ipc/other/moz.build index 7cd6551478..47a4e13f3a 100644 --- a/accessible/ipc/other/moz.build +++ b/accessible/ipc/other/moz.build @@ -2,11 +2,10 @@ # 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/. -# With --disable-accessibility, we need to compile PDocAccessible.ipdl, but -# not the C++. -IPDL_SOURCES += ['PDocAccessible.ipdl'] if CONFIG['ACCESSIBILITY']: + IPDL_SOURCES += ['PDocAccessible.ipdl'] + EXPORTS.mozilla.a11y += [ 'DocAccessibleChild.h', 'ProxyAccessible.h', diff --git a/accessible/ipc/win/ProxyAccessible.h b/accessible/ipc/win/ProxyAccessible.h index 7a016c10ca..07ddc82eb2 100644 --- a/accessible/ipc/win/ProxyAccessible.h +++ b/accessible/ipc/win/ProxyAccessible.h @@ -26,7 +26,7 @@ class ProxyAccessible : public ProxyAccessibleBase { MOZ_COUNT_CTOR(ProxyAccessible); } - ~ProxyAccessible() { MOZ_COUNT_DTOR(ProxyAccessible); } + MOZ_COUNTED_DTOR(ProxyAccessible) #include "mozilla/a11y/ProxyAccessibleShared.h" diff --git a/accessible/ipc/win/moz.build b/accessible/ipc/win/moz.build index 19591d49bf..eee052a254 100644 --- a/accessible/ipc/win/moz.build +++ b/accessible/ipc/win/moz.build @@ -8,15 +8,9 @@ if CONFIG['COMPILE_ENVIRONMENT'] and CONFIG['ACCESSIBILITY']: 'typelib', ] -# With --disable-accessibility, we need to compile PDocAccessible.ipdl (which -# also depends on COMPtrTypes.h), but not the C++. -IPDL_SOURCES += ['PDocAccessible.ipdl'] - -EXPORTS.mozilla.a11y += [ - 'COMPtrTypes.h', -] - if CONFIG['ACCESSIBILITY']: + IPDL_SOURCES += ['PDocAccessible.ipdl'] + if not CONFIG['HAVE_64BIT_BUILD']: EXPORTS += [ 'IAccessible32.manifest', @@ -27,6 +21,7 @@ if CONFIG['ACCESSIBILITY']: ] EXPORTS.mozilla.a11y += [ + 'COMPtrTypes.h', 'DocAccessibleChild.h', 'HandlerProvider.h', 'PlatformChild.h', diff --git a/accessible/tests/mochitest/attributes/test_obj.html b/accessible/tests/mochitest/attributes/test_obj.html index 9afb08e648..701ea79a6c 100644 --- a/accessible/tests/mochitest/attributes/test_obj.html +++ b/accessible/tests/mochitest/attributes/test_obj.html @@ -88,6 +88,9 @@ testAttrs("statusChild", {"container-live": "polite"}, true); testAttrs("timerChild", {"container-live": "off"}, true); testAbsentAttrs("tablistChild", {"container-live": "polite"}); + testAttrs("containerLiveOutput", {"container-live": "polite"}, true); + testAttrs("containerLiveOutput1", {"container-live": "polite"}, true); + testAttrs("containerLiveOutput2", {"container-live": "polite"}, true); // container-live-role object attribute testAttrs("log", {"container-live-role": "log"}, true); @@ -121,7 +124,7 @@ testAttrs("search", {"text-input-type": "search"}, true); testAttrs("tel", {"text-input-type": "tel"}, true); testAttrs("url", {"text-input-type": "url"}, true); - testAttrs(getAccessible("number").firstChild, {"text-input-type": "number"}, true); + testAttrs("number", {"text-input-type": "number"}, true); // ARIA testAttrs("searchbox", {"text-input-type": "search"}, true); @@ -166,6 +169,9 @@
   
+ +
Test
+
live region
live region
diff --git a/accessible/tests/mochitest/elm/test_HTMLSpec.html b/accessible/tests/mochitest/elm/test_HTMLSpec.html index 177d985d54..3ff01eaf5d 100644 --- a/accessible/tests/mochitest/elm/test_HTMLSpec.html +++ b/accessible/tests/mochitest/elm/test_HTMLSpec.html @@ -190,7 +190,10 @@ obj = { role: ROLE_PARAGRAPH, - children: [ { role: ROLE_WHITESPACE } ], + children: [ + { role: ROLE_WHITESPACE }, + { role: ROLE_WHITESPACE } + ] }; testElm("br_container", obj); @@ -707,25 +710,9 @@ obj = { role: ROLE_SPINBUTTON, - interfaces: [ nsIAccessibleValue ], + interfaces: [ nsIAccessibleValue, nsIAccessibleText, nsIAccessibleEditableText ], children: [ - { - role: ROLE_ENTRY, - extraStates: EXT_STATE_EDITABLE | EXT_STATE_SINGLE_LINE, - actions: "activate", - interfaces: [ nsIAccessibleText, nsIAccessibleEditableText ], - children: [ - { role: ROLE_TEXT_LEAF }, - ], - }, - { - role: ROLE_PUSHBUTTON, - actions: "press", - }, - { - role: ROLE_PUSHBUTTON, - actions: "press", - }, + { role: ROLE_TEXT_LEAF }, ], }; testElm("input_number", obj); @@ -1114,7 +1101,7 @@ // HTML:output obj = { - role: ROLE_SECTION, + role: ROLE_STATUSBAR, attributes: { "live": "polite" }, todo_relations: { RELATION_CONTROLLED_BY: "output_input", @@ -1428,7 +1415,7 @@

This is a quotation taken from the Mozilla Developer Center.

- +



diff --git a/accessible/tests/mochitest/events/test_valuechange.html b/accessible/tests/mochitest/events/test_valuechange.html index 45b8e64f00..d7c18e4696 100644 --- a/accessible/tests/mochitest/events/test_valuechange.html +++ b/accessible/tests/mochitest/events/test_valuechange.html @@ -171,6 +171,8 @@ let shadowSelect = getAccessible("selectShadow").firstChild; gQueue.push(new changeSelectValue(shadowSelect, "VK_DOWN", "2")); + gQueue.push(new changeValue("number", "2")); + gQueue.invoke(); // Will call SimpleTest.finish(); } @@ -269,5 +271,7 @@ select.appendChild(option); shadow.appendChild(select); + + diff --git a/accessible/tests/mochitest/text/test_gettext.html b/accessible/tests/mochitest/text/test_gettext.html index 376807d7a8..2f221a416b 100644 --- a/accessible/tests/mochitest/text/test_gettext.html +++ b/accessible/tests/mochitest/text/test_gettext.html @@ -112,12 +112,12 @@ two words -
oneword

two words

+
oneword

two words
oneword two words
-
oneword

two words

+
oneword

two words
-

This is some editable text.

-

First letter Middle Last part

+
+
+ + + + diff --git a/editor/libeditor/tests/test_middle_click_paste.html b/editor/libeditor/tests/test_middle_click_paste.html index 9f76149759..a757daab6b 100644 --- a/editor/libeditor/tests/test_middle_click_paste.html +++ b/editor/libeditor/tests/test_middle_click_paste.html @@ -76,81 +76,151 @@ }); } -function checkInputEvent(aEvent, aInputType, aData, aDataTransfer, aDescription) { +function checkInputEvent(aEvent, aInputType, aData, aDataTransfer, aTargetRanges, aDescription) { ok(aEvent instanceof InputEvent, - `"input" event should be dispatched with InputEvent interface ${aDescription}`); - is(aEvent.cancelable, false, - `"input" event should be never cancelable ${aDescription}`); + `"${aEvent.type}" event should be dispatched with InputEvent interface ${aDescription}`); + is(aEvent.cancelable, aEvent.type === "beforeinput", + `"${aEvent.type}" event should ${aEvent.type === "beforeinput" ? "be" : "be never"} cancelable ${aDescription}`); is(aEvent.bubbles, true, - `"input" event should always bubble ${aDescription}`); + `"${aEvent.type}" event should always bubble ${aDescription}`); is(aEvent.inputType, aInputType, - `inputType should be "${aInputType}" ${aDescription}`); + `inputType of "${aEvent.type}" event should be "${aInputType}" ${aDescription}`); is(aEvent.data, aData, - `data should be ${aData} ${aDescription}`); + `data of "${aEvent.type}" event should be ${aData} ${aDescription}`); if (aDataTransfer === null) { is(aEvent.dataTransfer, null, - `dataTransfer should be null ${aDescription}`); + `dataTransfer of "${aEvent.type}" event should be null ${aDescription}`); } else { for (let dataTransfer of aDataTransfer) { is(aEvent.dataTransfer.getData(dataTransfer.type), dataTransfer.data, - `dataTransfer should have "${dataTransfer.data}" whose type is "${dataTransfer.type}" ${aDescription}`); + `dataTransfer of "${aEvent.type}" should have "${dataTransfer.data}" whose type is "${dataTransfer.type}" ${aDescription}`); + } + } + let targetRanges = aEvent.getTargetRanges(); + if (aTargetRanges.length === 0) { + is(targetRanges.length, 0, + `getTargetRange() of "${aEvent.type}" event should return empty array: ${aDescription}`); + } else { + is(targetRanges.length, aTargetRanges.length, + `getTargetRange() of "${aEvent.type}" event should return static range array: ${aDescription}`); + if (targetRanges.length == aTargetRanges.length) { + for (let i = 0; i < targetRanges.length; i++) { + is(targetRanges[i].startContainer, aTargetRanges[i].startContainer, + `startContainer of getTargetRanges()[${i}] of "${aEvent.type}" event does not match: ${aDescription}`); + is(targetRanges[i].startOffset, aTargetRanges[i].startOffset, + `startOffset of getTargetRanges()[${i}] of "${aEvent.type}" event does not match: ${aDescription}`); + is(targetRanges[i].endContainer, aTargetRanges[i].endContainer, + `endContainer of getTargetRanges()[${i}] of "${aEvent.type}" event does not match: ${aDescription}`); + is(targetRanges[i].endOffset, aTargetRanges[i].endOffset, + `endOffset of getTargetRanges()[${i}] of "${aEvent.type}" event does not match: ${aDescription}`); + } } } } async function doTextareaTests(aTextarea) { + let beforeInputEvents = []; let inputEvents = []; + function onBeforeInput(aEvent) { + beforeInputEvents.push(aEvent); + } function onInput(aEvent) { inputEvents.push(aEvent); } + aTextarea.addEventListener("beforeinput", onBeforeInput); aTextarea.addEventListener("input", onInput); await copyPlaintext("abc\ndef\nghi"); aTextarea.focus(); + beforeInputEvents = []; inputEvents = []; synthesizeMouseAtCenter(aTextarea, {button: 1, ctrlKey: true}); is(aTextarea.value, "> abc\n> def\n> ghi\n\n", "Pasted each line should start with \"> \""); + is(beforeInputEvents.length, 1, + 'One "beforeinput" event should be fired #1'); + checkInputEvent(beforeInputEvents[0], "insertFromPasteAsQuotation", "abc\ndef\nghi", null, [], "#1"); is(inputEvents.length, 1, 'One "input" event should be fired #1'); - checkInputEvent(inputEvents[0], "insertFromPasteAsQuotation", "abc\ndef\nghi", null, "#1"); + checkInputEvent(inputEvents[0], "insertFromPasteAsQuotation", "abc\ndef\nghi", null, [], "#1"); aTextarea.value = ""; await copyPlaintext("> abc\n> def\n> ghi"); aTextarea.focus(); + beforeInputEvents = []; inputEvents = []; synthesizeMouseAtCenter(aTextarea, {button: 1, ctrlKey: true}); is(aTextarea.value, ">> abc\n>> def\n>> ghi\n\n", "Pasted each line should be start with \">> \" when already quoted one level"); + is(beforeInputEvents.length, 1, + 'One "beforeinput" event should be fired #2'); + checkInputEvent(beforeInputEvents[0], "insertFromPasteAsQuotation", "> abc\n> def\n> ghi", null, [], "#2"); is(inputEvents.length, 1, 'One "input" event should be fired #2'); - checkInputEvent(inputEvents[0], "insertFromPasteAsQuotation", "> abc\n> def\n> ghi", null, "#2"); + checkInputEvent(inputEvents[0], "insertFromPasteAsQuotation", "> abc\n> def\n> ghi", null, [], "#2"); aTextarea.value = ""; await copyPlaintext("> abc\n> def\n\nghi"); aTextarea.focus(); + beforeInputEvents = []; inputEvents = []; synthesizeMouseAtCenter(aTextarea, {button: 1, ctrlKey: true}); is(aTextarea.value, ">> abc\n>> def\n> \n> ghi\n\n", "Pasted each line should be start with \">> \" when already quoted one level"); + is(beforeInputEvents.length, 1, + 'One "beforeinput" event should be fired #3'); + checkInputEvent(beforeInputEvents[0], "insertFromPasteAsQuotation", "> abc\n> def\n\nghi", null, [], "#3"); is(inputEvents.length, 1, 'One "input" event should be fired #3'); - checkInputEvent(inputEvents[0], "insertFromPasteAsQuotation", "> abc\n> def\n\nghi", null, "#3"); + checkInputEvent(inputEvents[0], "insertFromPasteAsQuotation", "> abc\n> def\n\nghi", null, [], "#3"); aTextarea.value = ""; await copyPlaintext("abc\ndef\n\n"); aTextarea.focus(); + beforeInputEvents = []; inputEvents = []; synthesizeMouseAtCenter(aTextarea, {button: 1, ctrlKey: true}); is(aTextarea.value, "> abc\n> def\n> \n", "If pasted text ends with \"\\n\", only the last line should not started with \">\""); + is(beforeInputEvents.length, 1, + 'One "beforeinput" event should be fired #4'); + checkInputEvent(beforeInputEvents[0], "insertFromPasteAsQuotation", "abc\ndef\n\n", null, [], "#4"); is(inputEvents.length, 1, 'One "input" event should be fired #4'); - checkInputEvent(inputEvents[0], "insertFromPasteAsQuotation", "abc\ndef\n\n", null, "#4"); + checkInputEvent(inputEvents[0], "insertFromPasteAsQuotation", "abc\ndef\n\n", null, [], "#4"); + aTextarea.value = ""; + + await copyPlaintext("abc\ndef\n\n"); + aTextarea.addEventListener("paste", (event) => { event.preventDefault(); }, {once: true}); + aTextarea.focus(); + beforeInputEvents = []; + inputEvents = []; + synthesizeMouseAtCenter(aTextarea, {button: 1, ctrlKey: true}); + is(aTextarea.value, "", + 'Pasting as quote should have been canceled if "paste" event was canceled'); + is(beforeInputEvents.length, 0, + 'No "beforeinput" event should be fired since "paste" event was canceled #5'); + is(inputEvents.length, 0, + 'No "input" event should be fired since "paste" was canceled #5'); + aTextarea.value = ""; + + await copyPlaintext("abc\ndef\n\n"); + aTextarea.addEventListener("beforeinput", (event) => { event.preventDefault(); }, {once: true}); + aTextarea.focus(); + beforeInputEvents = []; + inputEvents = []; + synthesizeMouseAtCenter(aTextarea, {button: 1, ctrlKey: true}); + is(aTextarea.value, "", + 'Pasting as quote should have been canceled if "beforeinput" event was canceled'); + is(beforeInputEvents.length, 1, + 'One "beforeinput" event should be fired #5'); + checkInputEvent(beforeInputEvents[0], "insertFromPasteAsQuotation", "abc\ndef\n\n", null, [], "#6"); + is(inputEvents.length, 0, + 'No "input" event should be fired since "beforeinput" was canceled #6'); aTextarea.value = ""; let pasteEventCount = 0; @@ -162,82 +232,152 @@ await copyPlaintext("abc"); aTextarea.focus(); document.body.addEventListener("click", (event) => { event.preventDefault(); }, {capture: true, once: true}); + beforeInputEvents = []; inputEvents = []; synthesizeMouseAtCenter(aTextarea, {button: 1}); is(aTextarea.value, "abc", "If 'click' event is consumed at capturing phase of the , paste should not be canceled"); is(pasteEventCount, 1, "If 'click' event is consumed at capturing phase of the , 'paste' event should still be fired"); + is(beforeInputEvents.length, 1, + '"beforeinput" event should be fired when the "click" event is canceled'); + checkInputEvent(beforeInputEvents[0], "insertFromPaste", "abc", null, [], 'when the "click" event is canceled'); is(inputEvents.length, 1, '"input" event should be fired when the "click" event is canceled'); + checkInputEvent(inputEvents[0], "insertFromPaste", "abc", null, [], 'when the "click" event is canceled'); aTextarea.value = ""; await copyPlaintext("abc"); aTextarea.focus(); aTextarea.addEventListener("mouseup", (event) => { event.preventDefault(); }, {once: true}); pasteEventCount = 0; + beforeInputEvents = []; inputEvents = []; synthesizeMouseAtCenter(aTextarea, {button: 1}); is(aTextarea.value, "abc", "Even if 'mouseup' event is consumed, paste should be done"); is(pasteEventCount, 1, "Even if 'mouseup' event is consumed, 'paste' event should be fired once"); + is(beforeInputEvents.length, 1, + 'One "beforeinput" event should be fired even if "mouseup" event is canceled'); + checkInputEvent(beforeInputEvents[0], "insertFromPaste", "abc", null, [], 'even if "mouseup" event is canceled'); is(inputEvents.length, 1, 'One "input" event should be fired even if "mouseup" event is canceled'); - checkInputEvent(inputEvents[0], "insertFromPaste", "abc", null, 'even if "mouseup" event is canceled'); + checkInputEvent(inputEvents[0], "insertFromPaste", "abc", null, [], 'even if "mouseup" event is canceled'); aTextarea.value = ""; await copyPlaintext("abc"); aTextarea.focus(); aTextarea.addEventListener("click", (event) => { event.preventDefault(); }, {once: true}); pasteEventCount = 0; + beforeInputEvents = []; inputEvents = []; synthesizeMouseAtCenter(aTextarea, {button: 1}); is(aTextarea.value, "abc", "If 'click' event handler is added to the "; await doTextareaTests(document.getElementById("editor")); diff --git a/editor/libeditor/tests/test_nsIEditorMailSupport_insertAsCitedQuotation.html b/editor/libeditor/tests/test_nsIEditorMailSupport_insertAsCitedQuotation.html index 67b74338a5..118347f2ce 100644 --- a/editor/libeditor/tests/test_nsIEditorMailSupport_insertAsCitedQuotation.html +++ b/editor/libeditor/tests/test_nsIEditorMailSupport_insertAsCitedQuotation.html @@ -15,23 +15,79 @@ + + + +
+
+ + +
+
+
+ + + + + diff --git a/editor/libeditor/tests/test_nsIHTMLEditor_getElementOrParentByTagName.html b/editor/libeditor/tests/test_nsIHTMLEditor_getElementOrParentByTagName.html new file mode 100644 index 0000000000..c78ec6763d --- /dev/null +++ b/editor/libeditor/tests/test_nsIHTMLEditor_getElementOrParentByTagName.html @@ -0,0 +1,449 @@ + + + + Test for nsIHTMLEditor.getElementOrParentByTagName() + + + + +
+
+
+
+
+
+
+ + + + + diff --git a/editor/libeditor/tests/test_nsIHTMLEditor_getParagraphState.html b/editor/libeditor/tests/test_nsIHTMLEditor_getParagraphState.html new file mode 100644 index 0000000000..0297464c3f --- /dev/null +++ b/editor/libeditor/tests/test_nsIHTMLEditor_getParagraphState.html @@ -0,0 +1,156 @@ + + + + Test for nsIHTMLEditor.getParagraphState() + + + + +
+
+
+
+
+ + + + + diff --git a/editor/libeditor/tests/test_nsIHTMLEditor_removeInlineProperty.html b/editor/libeditor/tests/test_nsIHTMLEditor_removeInlineProperty.html index b09b60e83e..1c0040c491 100644 --- a/editor/libeditor/tests/test_nsIHTMLEditor_removeInlineProperty.html +++ b/editor/libeditor/tests/test_nsIHTMLEditor_removeInlineProperty.html @@ -13,28 +13,70 @@ - - - -
-
- - -
-
-
- - - - - diff --git a/editor/libeditor/tests/test_nsITableEditor_deleteTableCell.html b/editor/libeditor/tests/test_nsITableEditor_deleteTableCell.html index 80f1a532ed..3971b82d2b 100644 --- a/editor/libeditor/tests/test_nsITableEditor_deleteTableCell.html +++ b/editor/libeditor/tests/test_nsITableEditor_deleteTableCell.html @@ -13,48 +13,93 @@ + + + + +Mozilla Bug 1320229 +

+
+
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+ +
+
+
+
+ + diff --git a/editor/libeditor/tests/test_resizers_resizing_elements.html b/editor/libeditor/tests/test_resizers_resizing_elements.html index ebfe17df69..6694a05582 100644 --- a/editor/libeditor/tests/test_resizers_resizing_elements.html +++ b/editor/libeditor/tests/test_resizers_resizing_elements.html @@ -21,7 +21,11 @@ "use strict"; SimpleTest.waitForExplicitFinish(); -SimpleTest.waitForFocus(async function() { +SimpleTest.waitForFocus(async () => { + await SpecialPowers.pushPrefEnv({ + set: [["dom.input_events.beforeinput.enabled", true]], + }); + document.execCommand("enableObjectResizing", false, true); ok(document.queryCommandState("enableObjectResizing"), "Object resizer should be enabled by the call of execCommand"); @@ -62,6 +66,7 @@ * In specifying baseX, W can be considered to be the width of the image, and for baseY, H * can be considered to be the height of the image. deltaX and deltaY are regular pixel values * which can be positive or negative. + * TODO: Should test canceling "beforeinput" events case. */ const W = 1; const H = 1; @@ -88,23 +93,46 @@ let inputEventExpected = true; function onInput(aEvent) { if (!inputEventExpected) { - ok(false, "\"input\" event shouldn't be fired after stopping resizing"); + ok(false, `"${aEvent.type}" event shouldn't be fired after stopping resizing`); return; } ok(aEvent instanceof InputEvent, - '"input" event should be dispatched with InputEvent interface'); + `"${aEvent.type}" event should be dispatched with InputEvent interface`); is(aEvent.cancelable, false, - '"input" event should be never cancelable'); + `"${aEvent.type}" event should be never cancelable`); is(aEvent.bubbles, true, - '"input" event should always bubble'); + `"${aEvent.type}" event should always bubble`); is(aEvent.inputType, "", - `inputType should be empty string when an element is resized`); + `inputType of "${aEvent.type}" event should be empty string when an element is resized`); is(aEvent.data, null, - `data should be null ${aDescription}`); + `data of "${aEvent.type}" event should be null ${aDescription}`); is(aEvent.dataTransfer, null, - `data should be null ${aDescription}`); + `data of "${aEvent.type}" event should be null ${aDescription}`); + let targetRanges = aEvent.getTargetRanges(); + if (aEvent.type === "beforeinput") { + let selection = document.getSelection(); + is(targetRanges.length, selection.rangeCount, + `getTargetRanges() of "beforeinput" event for position changing of absolute position should return selection ranges ${aDescription}`); + if (targetRanges.length === selection.rangeCount) { + for (let i = 0; i < selection.rangeCount; i++) { + let range = selection.getRangeAt(i); + is(targetRanges[i].startContainer, range.startContainer, + `startContainer of getTargetRanges()[${i}] of "beforeinput" event for position changing of absolute position does not match ${aDescription}`); + is(targetRanges[i].startOffset, range.startOffset, + `startOffset of getTargetRanges()[${i}] of "beforeinput" event for position changing of absolute position does not match ${aDescription}`); + is(targetRanges[i].endContainer, range.endContainer, + `endContainer of getTargetRanges()[${i}] of "beforeinput" event for position changing of absolute position does not match ${aDescription}`); + is(targetRanges[i].endOffset, range.endOffset, + `endOffset of getTargetRanges()[${i}] of "beforeinput" event for position changing of absolute position does not match ${aDescription}`); + } + } + } else { + is(targetRanges.length, 0, + `getTargetRanges() of "${aEvent.type}" event for position changing of absolute position should return empty array ${aDescription}`); + } } + content.addEventListener("beforeinput", onInput); content.addEventListener("input", onInput); // Click on the correct resizer @@ -130,6 +158,7 @@ isfuzzy(newRect.width, rect.width + expectedDeltaX, 2, description + "The width should be increased by " + expectedDeltaX + " pixels"); isfuzzy(newRect.height, rect.height + expectedDeltaY, 2, description + "The height should be increased by " + expectedDeltaY + "pixels"); + content.removeEventListener("beforeinput", onInput); content.removeEventListener("input", onInput); } diff --git a/editor/libeditor/tests/test_setting_value_longer_than_maxlength_with_setUserInput.html b/editor/libeditor/tests/test_setting_value_longer_than_maxlength_with_setUserInput.html new file mode 100644 index 0000000000..b7b9b40a6c --- /dev/null +++ b/editor/libeditor/tests/test_setting_value_longer_than_maxlength_with_setUserInput.html @@ -0,0 +1,75 @@ + + + + + + Test setting value longer than maxlength with setUserInput + + + + + + + Mozilla Bug 1320229 +
+
+
+
+
+ + + + + diff --git a/editor/libeditor/tests/test_textarea_value_not_include_cr.html b/editor/libeditor/tests/test_textarea_value_not_include_cr.html index c6b3c78a90..335c0a0525 100644 --- a/editor/libeditor/tests/test_textarea_value_not_include_cr.html +++ b/editor/libeditor/tests/test_textarea_value_not_include_cr.html @@ -52,8 +52,8 @@ is(textarea.value, "ab\ncd\nef", "Pasting \\r from clipboard should be converted to \\n"); textarea.value = ""; - SpecialPowers.wrap(textarea).editor.QueryInterface(SpecialPowers.Ci.nsIPlaintextEditor).insertText("ab\r\ncd\ref"); - is(textarea.value, "ab\ncd\nef", "Inserting \\r with nsIPlaintextEditor.insertText() should be converted to \\n"); + SpecialPowers.wrap(textarea).editor.insertText("ab\r\ncd\ref"); + is(textarea.value, "ab\ncd\nef", "Inserting \\r with nsIEditor.insertText() should be converted to \\n"); textarea.value = ""; synthesizeCompositionChange( diff --git a/editor/libeditor/tests/test_texteditor_keyevent_handling.html b/editor/libeditor/tests/test_texteditor_keyevent_handling.html index cd86577803..2ecdf55254 100644 --- a/editor/libeditor/tests/test_texteditor_keyevent_handling.html +++ b/editor/libeditor/tests/test_texteditor_keyevent_handling.html @@ -350,11 +350,11 @@ // make non-tabbable plaintext editor textarea.removeAttribute("readonly"); - const nsIPlaintextEditor = SpecialPowers.Ci.nsIPlaintextEditor; + const nsIEditor = SpecialPowers.Ci.nsIEditor; var editor = SpecialPowers.wrap(textarea).editor; var flags = editor.flags; - editor.flags = flags & ~(nsIPlaintextEditor.eEditorWidgetMask | - nsIPlaintextEditor.eEditorAllowInteraction); + editor.flags = flags & ~(nsIEditor.eEditorWidgetMask | + nsIEditor.eEditorAllowInteraction); doTest(textarea, "non-tabbable