diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 8466b710e5f3..0091f987598b 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,7 +1,12 @@ +# Bug 1016240 - Exterminate CR+LF line endings. r=briansmith,cpearce,ehsan,gavin +# https://hg.mozilla.org/mozilla-central/rev/ca251a28d3dd +741fa39165c4bec22e115d1d501631ae499c4180 # cinnabar +51ba75d1355026c53c89c0c08bb36cada57d21a5 # gecko-dev + # Bug 1128203 - Reduce indentation from 4 to 2 spaces. rs=dolske DONTBUILD CLOSED TREE # https://hg.mozilla.org/mozilla-central/rev/a569f5a4bb6a27f25e99b5b45ee241db2660b7e3 b8ffa2c11b99bd5762b5ed612acd755b29d1eae6 # cinnabar -174ae94f90f1b5edc83b737b4006c82bb830db7c # gecko-div +174ae94f90f1b5edc83b737b4006c82bb830db7c # gecko-dev # Bug 1204606 - Reformat of dom/media # https://hg.mozilla.org/mozilla-central/rev/0ceae9db9ec0be18daa1a279511ad305723185d4 diff --git a/.hg-annotate-ignore-revs b/.hg-annotate-ignore-revs index fade764b4161..e7936ede226e 100644 --- a/.hg-annotate-ignore-revs +++ b/.hg-annotate-ignore-revs @@ -1,3 +1,4 @@ +ca251a28d3ddae784436d28829fb019025f4b127 - Birunthan Mohanathas - Bug 1016240 - Exterminate CR+LF line endings. r=briansmith,cpearce,ehsan,gavin a569f5a4bb6a27f25e99b5b45ee241db2660b7e3 - Paolo Amadini - Bug 1128203 - Reduce indentation from 4 to 2 spaces. rs=dolske DONTBUILD CLOSED TREE 0ceae9db9ec0be18daa1a279511ad305723185d4 - Sylvestre Ledru - Bug 1204606 - Reformat of dom/media. r=jya dcfc73c043c01c3185631262605e3511bebe4cca - Mark Banner - Bug 1309842 - Fix eslint/espree parsing errors for ignored directories in browser/. r=jaws diff --git a/Cargo.lock b/Cargo.lock index 3c6c71de7b15..ec2f9fe5c5d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,7 +81,7 @@ name = "atty" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)", ] @@ -97,7 +97,7 @@ dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "mio-named-pipes 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -119,7 +119,7 @@ dependencies = [ "foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -135,7 +135,7 @@ dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", @@ -149,7 +149,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)", ] @@ -160,7 +160,7 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -240,8 +240,8 @@ dependencies = [ "hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "which 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -358,7 +358,7 @@ version = "0.1.0" dependencies = [ "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "dogear 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "moz_task 0.1.0", "nserror 0.1.0", @@ -409,7 +409,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bzip2-sys 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -418,7 +418,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -477,7 +477,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -533,7 +533,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -549,7 +549,7 @@ dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -560,7 +560,7 @@ dependencies = [ "core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -726,11 +726,11 @@ dependencies = [ "itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "procedural-masquerade 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -809,43 +809,43 @@ dependencies = [ [[package]] name = "darling" -version = "0.8.1" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "darling_core 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "darling_macro 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "darling_core 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", + "darling_macro 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "darling_core" -version = "0.8.1" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "ident_case 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "darling_macro" -version = "0.8.1" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "darling_core 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "darling_core 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "derive_common" version = "0.0.1" dependencies = [ - "darling 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "darling 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -854,10 +854,10 @@ name = "derive_more" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -865,7 +865,7 @@ name = "devd-rs" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -895,7 +895,7 @@ name = "dirs" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "redox_users 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)", ] @@ -947,7 +947,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.88 (git+https://github.com/servo/serde?branch=deserialize_from_enums10)", "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)", @@ -1024,9 +1024,9 @@ name = "euclid_macros" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1043,9 +1043,9 @@ name = "failure_derive" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1081,7 +1081,7 @@ name = "flate2" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "miniz_oxide_c_api 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1100,7 +1100,7 @@ name = "freetype" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1108,7 +1108,7 @@ name = "fs2" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)", ] @@ -1182,7 +1182,7 @@ dependencies = [ "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.25.3 (registry+https://github.com/rust-lang/crates.io-index)", "cstr 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "malloc_size_of 0.0.1", "nsstring 0.1.0", @@ -1348,7 +1348,7 @@ dependencies = [ name = "hashglobe" version = "0.1.0" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1424,7 +1424,7 @@ name = "iovec" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1450,7 +1450,7 @@ dependencies = [ "env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mozjs_sys 0.0.0", "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1492,7 +1492,7 @@ dependencies = [ "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "lmdb-rkv 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "moz_task 0.1.0", @@ -1572,7 +1572,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.43" +version = "0.2.51" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1589,7 +1589,7 @@ name = "libudev" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "libudev-sys 0.1.3", ] @@ -1598,7 +1598,7 @@ name = "libudev-sys" version = "0.1.3" dependencies = [ "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1607,7 +1607,7 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1623,7 +1623,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "lmdb-rkv-sys 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1633,7 +1633,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1683,8 +1683,8 @@ name = "malloc_size_of_derive" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1698,7 +1698,7 @@ name = "memchr" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1706,7 +1706,7 @@ name = "memchr" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1716,7 +1716,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1725,7 +1725,7 @@ name = "memmap" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)", ] @@ -1740,7 +1740,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "adler32 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1750,7 +1750,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", "crc 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "miniz_oxide 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1764,7 +1764,7 @@ dependencies = [ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1789,7 +1789,7 @@ name = "mio-uds" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1813,7 +1813,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "moz_task" version = "0.1.0" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "nserror 0.1.0", "nsstring 0.1.0", @@ -1829,7 +1829,7 @@ dependencies = [ "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.88 (git+https://github.com/servo/serde?branch=deserialize_from_enums10)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)", ] @@ -1839,7 +1839,7 @@ name = "mozjs_sys" version = "0.0.0" dependencies = [ "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1927,7 +1927,7 @@ version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)", ] @@ -1996,8 +1996,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2027,7 +2027,7 @@ name = "num_cpus" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2088,7 +2088,7 @@ name = "parking_lot_core" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)", @@ -2204,7 +2204,7 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "0.4.24" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2237,7 +2237,7 @@ dependencies = [ name = "pulse-ffi" version = "0.1.0" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2255,10 +2255,10 @@ dependencies = [ [[package]] name = "quote" -version = "0.6.10" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2267,7 +2267,7 @@ version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2277,7 +2277,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)", ] @@ -2297,7 +2297,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2401,7 +2401,7 @@ dependencies = [ name = "rsdparsa_capi" version = "0.1.0" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "nserror 0.1.0", "rsdparsa 0.1.0", @@ -2477,9 +2477,9 @@ name = "scroll_derive" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2544,9 +2544,9 @@ name = "serde_derive" version = "1.0.88" source = "git+https://github.com/servo/serde?branch=deserialize_from_enums10#84b2795d2a7b5312125a99b1ef11c67fd8d17c35" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2636,7 +2636,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "storage" version = "0.1.0" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "nserror 0.1.0", "nsstring 0.1.0", "storage_variant 0.1.0", @@ -2647,7 +2647,7 @@ dependencies = [ name = "storage_variant" version = "0.1.0" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "nserror 0.1.0", "nsstring 0.1.0", "xpcom 0.1.0", @@ -2679,8 +2679,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2757,11 +2757,11 @@ dependencies = [ name = "style_derive" version = "0.0.1" dependencies = [ - "darling 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "darling 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", "derive_common 0.0.1", - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2790,7 +2790,7 @@ dependencies = [ "cstr 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "geckoservo 0.0.1", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "malloc_size_of 0.0.1", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2817,18 +2817,18 @@ name = "syn" version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "syn" -version = "0.15.24" +version = "0.15.30" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2837,9 +2837,9 @@ name = "synstructure" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2876,7 +2876,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2893,7 +2893,7 @@ name = "termion" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2917,7 +2917,7 @@ name = "thin-vec" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2944,7 +2944,7 @@ name = "time" version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)", ] @@ -2964,11 +2964,11 @@ dependencies = [ name = "to_shmem_derive" version = "0.0.1" dependencies = [ - "darling 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "darling 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", "derive_common 0.0.1", - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3115,7 +3115,7 @@ dependencies = [ "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", "mio-uds 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3149,7 +3149,7 @@ dependencies = [ "boxfnonce 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "devd-rs 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "libudev 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3321,7 +3321,7 @@ dependencies = [ "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "malloc_size_of_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3392,7 +3392,7 @@ name = "which" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3466,7 +3466,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "xpcom" version = "0.1.0" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "nserror 0.1.0", "nsstring 0.1.0", "thin-vec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3587,9 +3587,9 @@ dependencies = [ "checksum cubeb-backend 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "442cd5cfb980ff62730525278ce320d9b2ff635b725857ad3176832664262fec" "checksum cubeb-core 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0161f9327864922ba7a172c90bd86bc9094938433eca415e2c75629954045022" "checksum cubeb-sys 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3ba7540c17b90159cf7d7854da370998ff0560d9b90e2c9290bb588afa0edf95" -"checksum darling 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f593353cad5af2df6d54810de2b61aa8acba5b5fbc70b0d75e7cc5bdd80aca73" -"checksum darling_core 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "168c246e87e727d58575d9b4595491010627f0cdc910e3e6ea3b36db2b9a9d9a" -"checksum darling_macro 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "99c4eff4bcbeaf6a22578012ff79c95910338668278d1901e528bd34a22f575d" +"checksum darling 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9158d690bc62a3a57c3e45b85e4d50de2008b39345592c64efd79345c7e24be0" +"checksum darling_core 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d2a368589465391e127e10c9e3a08efc8df66fd49b87dc8524c764bbe7f2ef82" +"checksum darling_macro 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "244e8987bd4e174385240cde20a3657f607fb0797563c28255c353b5819a07b1" "checksum derive_more 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3f57d78cf3bd45270dad4e70c21ec77a960b36c7a841ff9db76aaa775a8fb871" "checksum devd-rs 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e7c9ac481c38baf400d3b732e4a06850dfaa491d1b6379a249d9d40d14c2434c" "checksum diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3c2b69f912779fbb121ceb775d74d51e915af17aaebc38d28a592843a2dd0a3a" @@ -3652,7 +3652,7 @@ dependencies = [ "checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1" "checksum lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce12306c4739d86ee97c23139f3a34ddf0387bbf181bc7929d287025a8c3ef6b" "checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef" -"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" +"checksum libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)" = "bedcc7a809076656486ffe045abeeac163da1b558e963a31e29fbfbeba916917" "checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2" "checksum libudev 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea626d3bdf40a1c5aee3bcd4f40826970cae8d80a8fec934c82a63840094dcfe" "checksum libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "3fdd64ef8ee652185674455c1d450b83cbc8ad895625d543b5324d923f82e4d8" @@ -3710,11 +3710,11 @@ dependencies = [ "checksum podio 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e5422a1ee1bc57cc47ae717b0137314258138f38fd5f3cea083f43a9725383a0" "checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" "checksum proc-macro2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "77997c53ae6edd6d187fec07ec41b207063b5ee6f33680e9fa86d405cdd313d4" -"checksum proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "77619697826f31a02ae974457af0b29b723e5619e113e9397b8b82c6bd253f09" +"checksum proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915" "checksum procedural-masquerade 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9f566249236c6ca4340f7ca78968271f0ed2b0f234007a61b66f9ecd0af09260" "checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4" "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" -"checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c" +"checksum quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "cdd8e04bd9c52e0342b406469d494fcb033be4bdbe5c606016defbb1681411e1" "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" "checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" "checksum rayon 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "485541959c8ecc49865526fe6c4de9653dd6e60d829d6edf0be228167b60372d" @@ -3764,7 +3764,7 @@ dependencies = [ "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "91b52877572087400e83d24b9178488541e3d535259e04ff17a63df1e5ceff59" "checksum syn 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4e4b5274d4a0a3d2749d5c158dc64d3403e60554dc61194648787ada5212473d" -"checksum syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)" = "734ecc29cd36e8123850d9bf21dfd62ef8300aaa8f879aabaa899721808be37c" +"checksum syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)" = "66c8865bf5a7cbb662d8b011950060b3c8743dca141b054bf7195b20d314d8e2" "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum target-lexicon 0.2.0 (git+https://github.com/glandium/target-lexicon?branch=thumbv7neon-v0.2)" = "" "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" diff --git a/browser/extensions/pdfjs/README.mozilla b/browser/extensions/pdfjs/README.mozilla index c09cef55e8e3..f9b9c10b11bd 100644 --- a/browser/extensions/pdfjs/README.mozilla +++ b/browser/extensions/pdfjs/README.mozilla @@ -1,5 +1,5 @@ This is the PDF.js project output, https://github.com/mozilla/pdf.js -Current extension version is: 2.2.100 +Current extension version is: 2.2.117 -Taken from upstream commit: f9c58115 +Taken from upstream commit: 57abddc9 diff --git a/browser/extensions/pdfjs/content/PdfStreamConverter.jsm b/browser/extensions/pdfjs/content/PdfStreamConverter.jsm index 5bc482e0e34a..a9d493270564 100644 --- a/browser/extensions/pdfjs/content/PdfStreamConverter.jsm +++ b/browser/extensions/pdfjs/content/PdfStreamConverter.jsm @@ -173,6 +173,9 @@ PdfDataListener.prototype = { } return combinedArray; }, + get isDone() { + return !!this.isDataReady; + }, finish: function PdfDataListener_finish() { this.isDataReady = true; if (this.oncompleteCallback) { @@ -606,14 +609,16 @@ class RangedChromeActions extends ChromeActions { } initPassiveLoading() { - var data; + let data, done; if (!this.streamingEnabled) { this.originalRequest.cancel(Cr.NS_BINDING_ABORTED); this.originalRequest = null; data = this.dataListener.readData(); + done = this.dataListener.isDone; this.dataListener = null; } else { data = this.dataListener.readData(); + done = this.dataListener.isDone; this.dataListener.onprogress = (loaded, total) => { this.domWindow.postMessage({ @@ -624,6 +629,11 @@ class RangedChromeActions extends ChromeActions { }, PDF_VIEWER_ORIGIN); }; this.dataListener.oncomplete = () => { + if (!done && this.dataListener.isDone) { + this.domWindow.postMessage({ + pdfjsLoadAction: "progressiveDone", + }, PDF_VIEWER_ORIGIN); + } this.dataListener = null; }; } @@ -635,6 +645,7 @@ class RangedChromeActions extends ChromeActions { pdfUrl: this.pdfUrl, length: this.contentLength, data, + done, }, PDF_VIEWER_ORIGIN); return true; diff --git a/browser/extensions/pdfjs/content/build/pdf.js b/browser/extensions/pdfjs/content/build/pdf.js index ac167d693aaf..95ec071bc733 100644 --- a/browser/extensions/pdfjs/content/build/pdf.js +++ b/browser/extensions/pdfjs/content/build/pdf.js @@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; -var pdfjsVersion = '2.2.100'; -var pdfjsBuild = 'f9c58115'; +var pdfjsVersion = '2.2.117'; +var pdfjsBuild = '57abddc9'; var pdfjsSharedUtil = __w_pdfjs_require__(1); @@ -1264,6 +1264,7 @@ function getDocument(src) { networkStream = new _transport_stream.PDFDataTransportStream({ length: params.length, initialData: params.initialData, + progressiveDone: params.progressiveDone, disableRange: params.disableRange, disableStream: params.disableStream }, rangeTransport); @@ -1297,11 +1298,12 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { if (pdfDataRangeTransport) { source.length = pdfDataRangeTransport.length; source.initialData = pdfDataRangeTransport.initialData; + source.progressiveDone = pdfDataRangeTransport.progressiveDone; } return worker.messageHandler.sendWithPromise('GetDocRequest', { docId, - apiVersion: '2.2.100', + apiVersion: '2.2.117', source: { data: source.data, url: source.url, @@ -1371,12 +1373,14 @@ const PDFDocumentLoadingTask = function PDFDocumentLoadingTaskClosure() { }(); class PDFDataRangeTransport { - constructor(length, initialData) { + constructor(length, initialData, progressiveDone = false) { this.length = length; this.initialData = initialData; + this.progressiveDone = progressiveDone; this._rangeListeners = []; this._progressListeners = []; this._progressiveReadListeners = []; + this._progressiveDoneListeners = []; this._readyCapability = (0, _util.createPromiseCapability)(); } @@ -1392,6 +1396,10 @@ class PDFDataRangeTransport { this._progressiveReadListeners.push(listener); } + addProgressiveDoneListener(listener) { + this._progressiveDoneListeners.push(listener); + } + onDataRange(begin, chunk) { for (const listener of this._rangeListeners) { listener(begin, chunk); @@ -1414,6 +1422,14 @@ class PDFDataRangeTransport { }); } + onDataProgressiveDone() { + this._readyCapability.promise.then(() => { + for (const listener of this._progressiveDoneListeners) { + listener(); + } + }); + } + transportReady() { this._readyCapability.resolve(); } @@ -3059,9 +3075,9 @@ const InternalRenderTask = function InternalRenderTaskClosure() { return InternalRenderTask; }(); -const version = '2.2.100'; +const version = '2.2.117'; exports.version = version; -const build = 'f9c58115'; +const build = '57abddc9'; exports.build = build; /***/ }), @@ -6149,42 +6165,42 @@ var TilingPattern = function TilingPatternClosure() { y0 = bbox[1], x1 = bbox[2], y1 = bbox[3]; - var topLeft = [x0, y0]; - var botRight = [x0 + xstep, y0 + ystep]; - var width = botRight[0] - topLeft[0]; - var height = botRight[1] - topLeft[1]; var matrixScale = _util.Util.singularValueDecompose2dScale(this.matrix); var curMatrixScale = _util.Util.singularValueDecompose2dScale(this.baseTransform); var combinedScale = [matrixScale[0] * curMatrixScale[0], matrixScale[1] * curMatrixScale[1]]; - width = Math.min(Math.ceil(Math.abs(width * combinedScale[0])), MAX_PATTERN_SIZE); - height = Math.min(Math.ceil(Math.abs(height * combinedScale[1])), MAX_PATTERN_SIZE); - var tmpCanvas = owner.cachedCanvases.getCanvas('pattern', width, height, true); + var dimx = this.getSizeAndScale(xstep, this.ctx.canvas.width, combinedScale[0]); + var dimy = this.getSizeAndScale(ystep, this.ctx.canvas.height, combinedScale[1]); + var tmpCanvas = owner.cachedCanvases.getCanvas('pattern', dimx.size, dimy.size, true); var tmpCtx = tmpCanvas.context; var graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx); graphics.groupLevel = owner.groupLevel; this.setFillAndStrokeStyleToContext(graphics, paintType, color); - this.setScale(width, height, xstep, ystep); - this.transformToScale(graphics); - var tmpTranslate = [1, 0, 0, 1, -topLeft[0], -topLeft[1]]; - graphics.transform.apply(graphics, tmpTranslate); + graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0); + graphics.transform(1, 0, 0, 1, -x0, -y0); this.clipBbox(graphics, bbox, x0, y0, x1, y1); graphics.executeOperatorList(operatorList); + this.ctx.transform(1, 0, 0, 1, x0, y0); + this.ctx.scale(1 / dimx.scale, 1 / dimy.scale); return tmpCanvas.canvas; }, - setScale: function TilingPattern_setScale(width, height, xstep, ystep) { - this.scale = [width / xstep, height / ystep]; - }, - transformToScale: function TilingPattern_transformToScale(graphics) { - var scale = this.scale; - var tmpScale = [scale[0], 0, 0, scale[1], 0, 0]; - graphics.transform.apply(graphics, tmpScale); - }, - scaleToContext: function TilingPattern_scaleToContext() { - var scale = this.scale; - this.ctx.scale(1 / scale[0], 1 / scale[1]); + getSizeAndScale: function TilingPattern_getSizeAndScale(step, realOutputSize, scale) { + step = Math.abs(step); + var maxSize = Math.max(MAX_PATTERN_SIZE, realOutputSize); + var size = Math.ceil(step * scale); + + if (size >= maxSize) { + size = maxSize; + } else { + scale = size / step; + } + + return { + scale, + size + }; }, clipBbox: function clipBbox(graphics, bbox, x0, y0, x1, y1) { if (Array.isArray(bbox) && bbox.length === 4) { @@ -6222,11 +6238,10 @@ var TilingPattern = function TilingPatternClosure() { } }, getPattern: function TilingPattern_getPattern(ctx, owner) { - var temporaryPatternCanvas = this.createPatternCanvas(owner); ctx = this.ctx; ctx.setTransform.apply(ctx, this.baseTransform); ctx.transform.apply(ctx, this.matrix); - this.scaleToContext(); + var temporaryPatternCanvas = this.createPatternCanvas(owner); return ctx.createPattern(temporaryPatternCanvas, 'repeat'); } }; @@ -7299,7 +7314,8 @@ var PDFDataTransportStream = function PDFDataTransportStreamClosure() { function PDFDataTransportStream(params, pdfDataRangeTransport) { (0, _util.assert)(pdfDataRangeTransport); this._queuedChunks = []; - var initialData = params.initialData; + this._progressiveDone = params.progressiveDone || false; + const initialData = params.initialData; if (initialData && initialData.length > 0) { let buffer = new Uint8Array(initialData).buffer; @@ -7333,6 +7349,10 @@ var PDFDataTransportStream = function PDFDataTransportStreamClosure() { }); }); + this._pdfDataRangeTransport.addProgressiveDoneListener(() => { + this._onProgressiveDone(); + }); + this._pdfDataRangeTransport.transportReady(); } @@ -7371,6 +7391,15 @@ var PDFDataTransportStream = function PDFDataTransportStreamClosure() { } } }, + + _onProgressiveDone() { + if (this._fullRequestReader) { + this._fullRequestReader.progressiveDone(); + } + + this._progressiveDone = true; + }, + _removeRangeReader: function PDFDataTransportStream_removeRangeReader(reader) { var i = this._rangeReaders.indexOf(reader); @@ -7382,7 +7411,7 @@ var PDFDataTransportStream = function PDFDataTransportStreamClosure() { (0, _util.assert)(!this._fullRequestReader); var queuedChunks = this._queuedChunks; this._queuedChunks = null; - return new PDFDataTransportStreamReader(this, queuedChunks); + return new PDFDataTransportStreamReader(this, queuedChunks, this._progressiveDone); }, getRangeReader: function PDFDataTransportStream_getRangeReader(begin, end) { var reader = new PDFDataTransportStreamRangeReader(this, begin, end); @@ -7408,9 +7437,9 @@ var PDFDataTransportStream = function PDFDataTransportStreamClosure() { } }; - function PDFDataTransportStreamReader(stream, queuedChunks) { + function PDFDataTransportStreamReader(stream, queuedChunks, progressiveDone = false) { this._stream = stream; - this._done = false; + this._done = progressiveDone || false; this._filename = null; this._queuedChunks = queuedChunks || []; this._requests = []; @@ -7493,7 +7522,16 @@ var PDFDataTransportStream = function PDFDataTransportStreamClosure() { }); this._requests = []; + }, + + progressiveDone() { + if (this._done) { + return; + } + + this._done = true; } + }; function PDFDataTransportStreamRangeReader(stream, begin, end) { diff --git a/browser/extensions/pdfjs/content/build/pdf.worker.js b/browser/extensions/pdfjs/content/build/pdf.worker.js index 682d74d96477..7268779243d0 100644 --- a/browser/extensions/pdfjs/content/build/pdf.worker.js +++ b/browser/extensions/pdfjs/content/build/pdf.worker.js @@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; -const pdfjsVersion = '2.2.100'; -const pdfjsBuild = 'f9c58115'; +const pdfjsVersion = '2.2.117'; +const pdfjsBuild = '57abddc9'; const pdfjsCoreWorker = __w_pdfjs_require__(1); @@ -378,7 +378,7 @@ var WorkerMessageHandler = { var WorkerTasks = []; const verbosity = (0, _util.getVerbosityLevel)(); let apiVersion = docParams.apiVersion; - let workerVersion = '2.2.100'; + let workerVersion = '2.2.117'; if (apiVersion !== workerVersion) { throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); diff --git a/browser/extensions/pdfjs/content/web/viewer.js b/browser/extensions/pdfjs/content/web/viewer.js index ec009c56287c..31000c880eff 100644 --- a/browser/extensions/pdfjs/content/web/viewer.js +++ b/browser/extensions/pdfjs/content/web/viewer.js @@ -11391,7 +11391,7 @@ _app.PDFViewerApplication.externalServices = { switch (args.pdfjsLoadAction) { case 'supportsRangedLoading': - pdfDataRangeTransport = new FirefoxComDataRangeTransport(args.length, args.data); + pdfDataRangeTransport = new FirefoxComDataRangeTransport(args.length, args.data, args.done); callbacks.onOpenWithTransport(args.pdfUrl, args.length, pdfDataRangeTransport); break; @@ -11407,6 +11407,13 @@ _app.PDFViewerApplication.externalServices = { pdfDataRangeTransport.onDataProgressiveRead(args.chunk); break; + case 'progressiveDone': + if (pdfDataRangeTransport) { + pdfDataRangeTransport.onDataProgressiveDone(); + } + + break; + case 'progress': callbacks.onProgress(args.loaded, args.total); break; diff --git a/browser/extensions/pdfjs/moz.yaml b/browser/extensions/pdfjs/moz.yaml index 56dab419d3ed..1856197c301a 100644 --- a/browser/extensions/pdfjs/moz.yaml +++ b/browser/extensions/pdfjs/moz.yaml @@ -20,7 +20,7 @@ origin: # Human-readable identifier for this version/release # Generally "version NNN", "tag SSS", "bookmark SSS" - release: version 2.2.100 + release: version 2.2.117 # The package's license, where possible using the mnemonic from # https://spdx.org/licenses/ diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index b87cd08aa29b..aac38fdd9c95 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -1129,22 +1129,9 @@ void Document::SelectorCache::NotifyExpired(SelectorCacheKey* aSelector) { delete aSelector; } -struct Document::FrameRequest { - FrameRequest(FrameRequestCallback& aCallback, int32_t aHandle) - : mCallback(&aCallback), mHandle(aHandle) {} - - // Conversion operator so that we can append these to a - // FrameRequestCallbackList - operator const RefPtr&() const { return mCallback; } - - // Comparator operators to allow RemoveElementSorted with an - // integer argument on arrays of FrameRequest - bool operator==(int32_t aHandle) const { return mHandle == aHandle; } - bool operator<(int32_t aHandle) const { return mHandle < aHandle; } - - RefPtr mCallback; - int32_t mHandle; -}; +Document::FrameRequest::FrameRequest(FrameRequestCallback& aCallback, + int32_t aHandle) + : mCallback(&aCallback), mHandle(aHandle) {} // ================================================================== // = @@ -3744,9 +3731,10 @@ void Document::UpdateFrameRequestCallbackSchedulingState( mFrameRequestCallbacksScheduled = shouldBeScheduled; } -void Document::TakeFrameRequestCallbacks(FrameRequestCallbackList& aCallbacks) { - aCallbacks.AppendElements(mFrameRequestCallbacks); - mFrameRequestCallbacks.Clear(); +void Document::TakeFrameRequestCallbacks(nsTArray& aCallbacks) { + MOZ_ASSERT(aCallbacks.IsEmpty()); + aCallbacks.SwapElements(mFrameRequestCallbacks); + mCanceledFrameRequestCallbacks.clear(); // No need to manually remove ourselves from the refresh driver; it will // handle that part. But we do have to update our state. mFrameRequestCallbacksScheduled = false; @@ -9162,9 +9150,16 @@ void Document::CancelFrameRequestCallback(int32_t aHandle) { // mFrameRequestCallbacks is stored sorted by handle if (mFrameRequestCallbacks.RemoveElementSorted(aHandle)) { UpdateFrameRequestCallbackSchedulingState(); + } else { + Unused << mCanceledFrameRequestCallbacks.put(aHandle); } } +bool Document::IsCanceledFrameRequestCallback(int32_t aHandle) const { + return !mCanceledFrameRequestCallbacks.empty() && + mCanceledFrameRequestCallbacks.has(aHandle); +} + nsresult Document::GetStateObject(nsIVariant** aState) { // Get the document's current state object. This is the object backing both // history.state and popStateEvent.state. @@ -12627,19 +12622,20 @@ already_AddRefed Document::RequestStorageAccess( AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor( NodePrincipal(), inner, AntiTrackingCommon::eStorageAccessAPI, performFinalChecks) - ->Then(GetCurrentThreadSerialEventTarget(), __func__, - [outer, promise] { - // Step 10. Grant the document access to cookies and store - // that fact for - // the purposes of future calls to - // hasStorageAccess() and requestStorageAccess(). - outer->SetHasStorageAccess(true); - promise->MaybeResolveWithUndefined(); - }, - [outer, promise] { - outer->SetHasStorageAccess(false); - promise->MaybeRejectWithUndefined(); - }); + ->Then( + GetCurrentThreadSerialEventTarget(), __func__, + [outer, promise] { + // Step 10. Grant the document access to cookies and store + // that fact for + // the purposes of future calls to + // hasStorageAccess() and requestStorageAccess(). + outer->SetHasStorageAccess(true); + promise->MaybeResolveWithUndefined(); + }, + [outer, promise] { + outer->SetHasStorageAccess(false); + promise->MaybeRejectWithUndefined(); + }); return promise.forget(); } diff --git a/dom/base/Document.h b/dom/base/Document.h index 0ccb34f5b4dd..8ec2ca5e9011 100644 --- a/dom/base/Document.h +++ b/dom/base/Document.h @@ -54,6 +54,7 @@ #include "mozilla/dom/ContentBlockingLog.h" #include "mozilla/dom/DispatcherTrait.h" #include "mozilla/dom/DocumentOrShadowRoot.h" +#include "mozilla/HashTable.h" #include "mozilla/LinkedList.h" #include "mozilla/NotNull.h" #include "mozilla/SegmentedVector.h" @@ -2950,16 +2951,34 @@ class Document : public nsINode, SVGSVGElement* GetSVGRootElement() const; + struct FrameRequest { + FrameRequest(FrameRequestCallback& aCallback, int32_t aHandle); + + // Comparator operators to allow RemoveElementSorted with an + // integer argument on arrays of FrameRequest + bool operator==(int32_t aHandle) const { return mHandle == aHandle; } + bool operator<(int32_t aHandle) const { return mHandle < aHandle; } + + RefPtr mCallback; + int32_t mHandle; + }; + nsresult ScheduleFrameRequestCallback(FrameRequestCallback& aCallback, int32_t* aHandle); void CancelFrameRequestCallback(int32_t aHandle); - typedef nsTArray> FrameRequestCallbackList; + /** + * Returns true if the handle refers to a callback that was canceled that + * we did not find in our list of callbacks (e.g. because it is one of those + * in the set of callbacks currently queued to be run). + */ + bool IsCanceledFrameRequestCallback(int32_t aHandle) const; + /** * Put this document's frame request callbacks into the provided * list, and forget about them. */ - void TakeFrameRequestCallbacks(FrameRequestCallbackList& aCallbacks); + void TakeFrameRequestCallbacks(nsTArray& aCallbacks); /** * @return true if this document's frame request callbacks should be @@ -4417,10 +4436,12 @@ class Document : public nsINode, nsCOMPtr mCachedEncoder; - struct FrameRequest; - nsTArray mFrameRequestCallbacks; + // The set of frame request callbacks that were canceled but which we failed + // to find in mFrameRequestCallbacks. + HashSet mCanceledFrameRequestCallbacks; + // This object allows us to evict ourself from the back/forward cache. The // pointer is non-null iff we're currently in the bfcache. nsIBFCacheEntry* mBFCacheEntry; diff --git a/dom/base/nsAttrValue.cpp b/dom/base/nsAttrValue.cpp index a315ee898b49..70a862597d37 100644 --- a/dom/base/nsAttrValue.cpp +++ b/dom/base/nsAttrValue.cpp @@ -400,11 +400,12 @@ void nsAttrValue::SetToSerialized(const nsAttrValue& aOther) { } } -void nsAttrValue::SetTo(const SVGOrient& aValue, const nsAString* aSerialized) { +void nsAttrValue::SetTo(const SVGAnimatedOrient& aValue, + const nsAString* aSerialized) { SetSVGType(eSVGOrient, &aValue, aSerialized); } -void nsAttrValue::SetTo(const SVGIntegerPair& aValue, +void nsAttrValue::SetTo(const SVGAnimatedIntegerPair& aValue, const nsAString* aSerialized) { SetSVGType(eSVGIntegerPair, &aValue, aSerialized); } @@ -434,7 +435,7 @@ void nsAttrValue::SetTo(const SVGNumberList& aValue, SetSVGType(eSVGNumberList, &aValue, aSerialized); } -void nsAttrValue::SetTo(const SVGNumberPair& aValue, +void nsAttrValue::SetTo(const SVGAnimatedNumberPair& aValue, const nsAString* aSerialized) { SetSVGType(eSVGNumberPair, &aValue, aSerialized); } @@ -484,7 +485,7 @@ void nsAttrValue::SetTo(const SVGTransformList& aValue, SetSVGType(eSVGTransformList, &aValue, aSerialized); } -void nsAttrValue::SetTo(const SVGViewBox& aValue, +void nsAttrValue::SetTo(const SVGAnimatedViewBox& aValue, const nsAString* aSerialized) { SetSVGType(eSVGViewBox, &aValue, aSerialized); } @@ -566,13 +567,13 @@ void nsAttrValue::ToString(nsAString& aResult) const { break; } case eSVGIntegerPair: { - SVGAttrValueWrapper::ToString(GetMiscContainer()->mValue.mSVGIntegerPair, - aResult); + SVGAttrValueWrapper::ToString( + GetMiscContainer()->mValue.mSVGAnimatedIntegerPair, aResult); break; } case eSVGOrient: { - SVGAttrValueWrapper::ToString(GetMiscContainer()->mValue.mSVGOrient, - aResult); + SVGAttrValueWrapper::ToString( + GetMiscContainer()->mValue.mSVGAnimatedOrient, aResult); break; } case eSVGLength: { @@ -591,8 +592,8 @@ void nsAttrValue::ToString(nsAString& aResult) const { break; } case eSVGNumberPair: { - SVGAttrValueWrapper::ToString(GetMiscContainer()->mValue.mSVGNumberPair, - aResult); + SVGAttrValueWrapper::ToString( + GetMiscContainer()->mValue.mSVGAnimatedNumberPair, aResult); break; } case eSVGPathData: { @@ -607,7 +608,7 @@ void nsAttrValue::ToString(nsAString& aResult) const { } case eSVGPreserveAspectRatio: { SVGAttrValueWrapper::ToString( - GetMiscContainer()->mValue.mSVGPreserveAspectRatio, aResult); + GetMiscContainer()->mValue.mSVGAnimatedPreserveAspectRatio, aResult); break; } case eSVGStringList: { @@ -621,8 +622,8 @@ void nsAttrValue::ToString(nsAString& aResult) const { break; } case eSVGViewBox: { - SVGAttrValueWrapper::ToString(GetMiscContainer()->mValue.mSVGViewBox, - aResult); + SVGAttrValueWrapper::ToString( + GetMiscContainer()->mValue.mSVGAnimatedViewBox, aResult); break; } default: { diff --git a/dom/base/nsAttrValue.h b/dom/base/nsAttrValue.h index 682a4279eca5..36a7a996a683 100644 --- a/dom/base/nsAttrValue.h +++ b/dom/base/nsAttrValue.h @@ -151,25 +151,27 @@ class nsAttrValue { const nsAString* aSerialized); void SetTo(nsIURI* aValue, const nsAString* aSerialized); void SetTo(const nsIntMargin& aValue); - void SetTo(const mozilla::SVGOrient& aValue, const nsAString* aSerialized); - void SetTo(const mozilla::SVGIntegerPair& aValue, + void SetTo(const mozilla::SVGAnimatedIntegerPair& aValue, const nsAString* aSerialized); void SetTo(const nsSVGLength2& aValue, const nsAString* aSerialized); + void SetTo(const mozilla::SVGAnimatedNumberPair& aValue, + const nsAString* aSerialized); + void SetTo(const mozilla::SVGAnimatedOrient& aValue, + const nsAString* aSerialized); + void SetTo(const mozilla::SVGAnimatedPreserveAspectRatio& aValue, + const nsAString* aSerialized); + void SetTo(const mozilla::SVGAnimatedViewBox& aValue, + const nsAString* aSerialized); void SetTo(const mozilla::SVGLengthList& aValue, const nsAString* aSerialized); void SetTo(const mozilla::SVGNumberList& aValue, const nsAString* aSerialized); - void SetTo(const mozilla::SVGNumberPair& aValue, - const nsAString* aSerialized); void SetTo(const mozilla::SVGPathData& aValue, const nsAString* aSerialized); void SetTo(const mozilla::SVGPointList& aValue, const nsAString* aSerialized); - void SetTo(const mozilla::SVGAnimatedPreserveAspectRatio& aValue, - const nsAString* aSerialized); void SetTo(const mozilla::SVGStringList& aValue, const nsAString* aSerialized); void SetTo(const mozilla::SVGTransformList& aValue, const nsAString* aSerialized); - void SetTo(const mozilla::SVGViewBox& aValue, const nsAString* aSerialized); /** * Sets this object with the string or atom representation of aValue. diff --git a/dom/base/nsAttrValueInlines.h b/dom/base/nsAttrValueInlines.h index 94005efe9466..fd29f6d62dfe 100644 --- a/dom/base/nsAttrValueInlines.h +++ b/dom/base/nsAttrValueInlines.h @@ -44,18 +44,19 @@ struct MiscContainer final { nsIURI* mURL; mozilla::AtomArray* mAtomArray; nsIntMargin* mIntMargin; - const mozilla::SVGIntegerPair* mSVGIntegerPair; + const mozilla::SVGAnimatedIntegerPair* mSVGAnimatedIntegerPair; + const mozilla::SVGAnimatedPreserveAspectRatio* + mSVGAnimatedPreserveAspectRatio; + const mozilla::SVGAnimatedNumberPair* mSVGAnimatedNumberPair; + const mozilla::SVGAnimatedOrient* mSVGAnimatedOrient; const nsSVGLength2* mSVGLength; + const mozilla::SVGAnimatedViewBox* mSVGAnimatedViewBox; const mozilla::SVGLengthList* mSVGLengthList; const mozilla::SVGNumberList* mSVGNumberList; - const mozilla::SVGNumberPair* mSVGNumberPair; - const mozilla::SVGOrient* mSVGOrient; const mozilla::SVGPathData* mSVGPathData; const mozilla::SVGPointList* mSVGPointList; - const mozilla::SVGAnimatedPreserveAspectRatio* mSVGPreserveAspectRatio; const mozilla::SVGStringList* mSVGStringList; const mozilla::SVGTransformList* mSVGTransformList; - const mozilla::SVGViewBox* mSVGViewBox; }; uint32_t mRefCount : 31; uint32_t mCached : 1; diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 40db902874ef..5ef978f248a0 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -21684,32 +21684,38 @@ void TransactionDatabaseOperationBase::SendPreprocessInfoOrResults( MOZ_ASSERT(mTransaction); if (NS_WARN_IF(IsActorDestroyed())) { - // Don't send any notifications if the actor was destroyed already. + // Normally we wouldn't need to send any notifications if the actor was + // already destroyed, but this can be a VersionChangeOp which needs to + // notify its parent operation (OpenDatabaseOp) about the failure. + // So SendFailureResult needs to be called even when the actor was + // destroyed. Normal operations redundantly check if the actor was + // destroyed in SendSuccessResult and SendFailureResult, therefore it's + // ok to call it in all cases here. if (NS_SUCCEEDED(mResultCode)) { IDB_REPORT_INTERNAL_ERR(); mResultCode = NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR; } - } else { - if (mTransaction->IsInvalidated() || mTransaction->IsAborted()) { - // Aborted transactions always see their requests fail with ABORT_ERR, - // even if the request succeeded or failed with another error. - mResultCode = NS_ERROR_DOM_INDEXEDDB_ABORT_ERR; - } else if (NS_SUCCEEDED(mResultCode)) { - if (aSendPreprocessInfo) { - // This should not release the IPDL reference. - mResultCode = SendPreprocessInfo(); - } else { - // This may release the IPDL reference. - mResultCode = SendSuccessResult(); - } - } + } else if (mTransaction->IsInvalidated() || mTransaction->IsAborted()) { + // Aborted transactions always see their requests fail with ABORT_ERR, + // even if the request succeeded or failed with another error. + mResultCode = NS_ERROR_DOM_INDEXEDDB_ABORT_ERR; + } - if (NS_FAILED(mResultCode)) { - // This should definitely release the IPDL reference. - if (!SendFailureResult(mResultCode)) { - // Abort the transaction. - mTransaction->Abort(mResultCode, /* aForce */ false); - } + if (NS_SUCCEEDED(mResultCode)) { + if (aSendPreprocessInfo) { + // This should not release the IPDL reference. + mResultCode = SendPreprocessInfo(); + } else { + // This may release the IPDL reference. + mResultCode = SendSuccessResult(); + } + } + + if (NS_FAILED(mResultCode)) { + // This should definitely release the IPDL reference. + if (!SendFailureResult(mResultCode)) { + // Abort the transaction. + mTransaction->Abort(mResultCode, /* aForce */ false); } } diff --git a/dom/localstorage/ActorsParent.cpp b/dom/localstorage/ActorsParent.cpp index aa2f74d1e86f..48e96e334afb 100644 --- a/dom/localstorage/ActorsParent.cpp +++ b/dom/localstorage/ActorsParent.cpp @@ -2958,6 +2958,29 @@ void ClientValidationPrefChangedCallback(const char* aPrefName, gClientValidation = Preferences::GetBool(aPrefName, kDefaultClientValidation); } +template +void RequestAllowToCloseIf(P aPredicate) { + AssertIsOnBackgroundThread(); + + if (!gLiveDatabases) { + return; + } + + nsTArray> databases; + + for (Database* database : *gLiveDatabases) { + if (aPredicate(database)) { + databases.AppendElement(database); + } + } + + for (Database* database : databases) { + database->RequestAllowToClose(); + } + + databases.Clear(); +} + } // namespace /******************************************************************************* @@ -5127,8 +5150,9 @@ void Database::RequestAllowToClose() { // child actor. Except the case when the actor was already destroyed. if (mActorDestroyed) { MOZ_ASSERT(mAllowedToClose); - } else { - Unused << SendRequestAllowToClose(); + } else if (NS_WARN_IF(!SendRequestAllowToClose())) { + // Allow to close immediately if sending failed. + AllowToClose(); } } @@ -7997,29 +8021,21 @@ void QuotaClient::AbortOperations(const nsACString& aOrigin) { } } - if (gLiveDatabases) { - for (Database* database : *gLiveDatabases) { - if (aOrigin.IsVoid() || database->Origin() == aOrigin) { - // TODO: This just allows the database to close, but we can actually - // set a flag to abort any existing operations, so we can - // eventually close faster. - - database->RequestAllowToClose(); - } - } + if (aOrigin.IsVoid()) { + RequestAllowToCloseIf([](const Database* const) { return true; }); + } else { + RequestAllowToCloseIf([&aOrigin](const Database* const aDatabase) { + return aDatabase->Origin() == aOrigin; + }); } } void QuotaClient::AbortOperationsForProcess(ContentParentId aContentParentId) { AssertIsOnBackgroundThread(); - if (gLiveDatabases) { - for (Database* database : *gLiveDatabases) { - if (database->IsOwnedByProcess(aContentParentId)) { - database->RequestAllowToClose(); - } - } - } + RequestAllowToCloseIf([aContentParentId](const Database* const aDatabase) { + return aDatabase->IsOwnedByProcess(aContentParentId); + }); } void QuotaClient::StartIdleMaintenance() { AssertIsOnBackgroundThread(); } @@ -8045,11 +8061,7 @@ void QuotaClient::ShutdownWorkThreads() { gPreparedDatastores = nullptr; } - if (gLiveDatabases) { - for (Database* database : *gLiveDatabases) { - database->RequestAllowToClose(); - } - } + RequestAllowToCloseIf([](const Database* const) { return true; }); if (gPreparedObsevers) { gPreparedObsevers->Clear(); diff --git a/dom/svg/DOMSVGAngle.cpp b/dom/svg/DOMSVGAngle.cpp index 55a807a852a7..556e80e5c328 100644 --- a/dom/svg/DOMSVGAngle.cpp +++ b/dom/svg/DOMSVGAngle.cpp @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "DOMSVGAngle.h" -#include "SVGOrient.h" +#include "SVGAnimatedOrient.h" #include "mozilla/dom/SVGAngleBinding.h" #include "mozilla/dom/SVGSVGElement.h" @@ -19,7 +19,7 @@ NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGAngle, Release) DOMSVGAngle::DOMSVGAngle(SVGSVGElement* aSVGElement) : mSVGElement(aSVGElement), mType(DOMSVGAngle::CreatedValue) { - mVal = new SVGOrient(); + mVal = new SVGAnimatedOrient(); mVal->Init(); } diff --git a/dom/svg/DOMSVGAngle.h b/dom/svg/DOMSVGAngle.h index fcfed6389059..67a41b756dc0 100644 --- a/dom/svg/DOMSVGAngle.h +++ b/dom/svg/DOMSVGAngle.h @@ -13,7 +13,7 @@ namespace mozilla { -class SVGOrient; +class SVGAnimatedOrient; namespace dom { class SVGSVGElement; @@ -28,7 +28,7 @@ class DOMSVGAngle final : public nsWrapperCache { /** * Generic ctor for DOMSVGAngle objects that are created for an attribute. */ - DOMSVGAngle(SVGOrient* aVal, SVGElement* aSVGElement, AngleType aType) + DOMSVGAngle(SVGAnimatedOrient* aVal, SVGElement* aSVGElement, AngleType aType) : mVal(aVal), mSVGElement(aSVGElement), mType(aType) {} /** @@ -54,8 +54,8 @@ class DOMSVGAngle final : public nsWrapperCache { protected: ~DOMSVGAngle(); - SVGOrient* mVal; // if mType is CreatedValue, we own the angle. Otherwise, - // the element does. + SVGAnimatedOrient* mVal; // if mType is CreatedValue, we own the angle. + // Otherwise, the element does. RefPtr mSVGElement; AngleType mType; }; diff --git a/dom/svg/DOMSVGAnimatedAngle.cpp b/dom/svg/DOMSVGAnimatedAngle.cpp index 43941a29e1f7..d2d9ae8be58f 100644 --- a/dom/svg/DOMSVGAnimatedAngle.cpp +++ b/dom/svg/DOMSVGAnimatedAngle.cpp @@ -6,7 +6,7 @@ #include "DOMSVGAnimatedAngle.h" -#include "SVGOrient.h" +#include "SVGAnimatedOrient.h" #include "mozilla/dom/SVGAnimatedAngleBinding.h" using namespace mozilla; diff --git a/dom/svg/DOMSVGAnimatedAngle.h b/dom/svg/DOMSVGAnimatedAngle.h index 206fabcf350e..d444bfe0d412 100644 --- a/dom/svg/DOMSVGAnimatedAngle.h +++ b/dom/svg/DOMSVGAnimatedAngle.h @@ -13,7 +13,7 @@ namespace mozilla { -class SVGOrient; +class SVGAnimatedOrient; namespace dom { @@ -24,7 +24,7 @@ class DOMSVGAnimatedAngle final : public nsWrapperCache { NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGAnimatedAngle) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGAnimatedAngle) - DOMSVGAnimatedAngle(SVGOrient* aVal, SVGElement* aSVGElement) + DOMSVGAnimatedAngle(SVGAnimatedOrient* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // WebIDL @@ -37,7 +37,7 @@ class DOMSVGAnimatedAngle final : public nsWrapperCache { protected: ~DOMSVGAnimatedAngle(); - SVGOrient* mVal; // kept alive because it belongs to content + SVGAnimatedOrient* mVal; // kept alive because it belongs to content RefPtr mSVGElement; }; diff --git a/dom/svg/DOMSVGAnimatedBoolean.h b/dom/svg/DOMSVGAnimatedBoolean.h index 47f641f8bb95..cfd3e2b66b5c 100644 --- a/dom/svg/DOMSVGAnimatedBoolean.h +++ b/dom/svg/DOMSVGAnimatedBoolean.h @@ -7,7 +7,7 @@ #ifndef mozilla_dom_DOMSVGAnimatedBoolean_h #define mozilla_dom_DOMSVGAnimatedBoolean_h -#include "SVGBoolean.h" +#include "SVGAnimatedBoolean.h" #include "nsWrapperCache.h" #include "mozilla/Attributes.h" #include "mozilla/dom/SVGElement.h" @@ -19,7 +19,7 @@ class DOMSVGAnimatedBoolean final : public nsWrapperCache { NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGAnimatedBoolean) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGAnimatedBoolean) - DOMSVGAnimatedBoolean(SVGBoolean* aVal, SVGElement* aSVGElement) + DOMSVGAnimatedBoolean(SVGAnimatedBoolean* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // WebIDL @@ -36,7 +36,7 @@ class DOMSVGAnimatedBoolean final : public nsWrapperCache { protected: ~DOMSVGAnimatedBoolean(); - SVGBoolean* mVal; // kept alive because it belongs to content + SVGAnimatedBoolean* mVal; // kept alive because it belongs to content RefPtr mSVGElement; }; diff --git a/dom/svg/SVGAElement.h b/dom/svg/SVGAElement.h index 7a4e7c1fd182..5403d8c27790 100644 --- a/dom/svg/SVGAElement.h +++ b/dom/svg/SVGAElement.h @@ -9,7 +9,7 @@ #include "Link.h" #include "nsDOMTokenList.h" -#include "SVGString.h" +#include "SVGAnimatedString.h" #include "mozilla/dom/SVGGraphicsElement.h" nsresult NS_NewSVGAElement( @@ -98,7 +98,7 @@ class SVGAElement final : public SVGAElementBase, public Link { virtual StringAttributesInfo GetStringInfo() override; enum { HREF, XLINK_HREF, TARGET }; - SVGString mStringAttributes[3]; + SVGAnimatedString mStringAttributes[3]; static StringInfo sStringInfo[3]; RefPtr mRelList; diff --git a/dom/svg/SVGBoolean.cpp b/dom/svg/SVGAnimatedBoolean.cpp similarity index 78% rename from dom/svg/SVGBoolean.cpp rename to dom/svg/SVGAnimatedBoolean.cpp index b89cbd55e307..91999696189e 100644 --- a/dom/svg/SVGBoolean.cpp +++ b/dom/svg/SVGAnimatedBoolean.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "SVGBoolean.h" +#include "SVGAnimatedBoolean.h" #include "DOMSVGAnimatedBoolean.h" #include "nsError.h" @@ -18,9 +18,9 @@ namespace mozilla { /* Implementation */ -static inline SVGAttrTearoffTable& +static inline SVGAttrTearoffTable& SVGAnimatedBooleanTearoffTable() { - static SVGAttrTearoffTable + static SVGAttrTearoffTable sSVGAnimatedBooleanTearoffTable; return sSVGAnimatedBooleanTearoffTable; } @@ -49,8 +49,8 @@ static nsresult GetValueFromAtom(const nsAtom* aValueAsAtom, bool* aValue) { return NS_ERROR_DOM_SYNTAX_ERR; } -nsresult SVGBoolean::SetBaseValueAtom(const nsAtom* aValue, - SVGElement* aSVGElement) { +nsresult SVGAnimatedBoolean::SetBaseValueAtom(const nsAtom* aValue, + SVGElement* aSVGElement) { bool val = false; nsresult rv = GetValueFromAtom(aValue, &val); @@ -71,11 +71,11 @@ nsresult SVGBoolean::SetBaseValueAtom(const nsAtom* aValue, return NS_OK; } -nsAtom* SVGBoolean::GetBaseValueAtom() const { +nsAtom* SVGAnimatedBoolean::GetBaseValueAtom() const { return mBaseVal ? nsGkAtoms::_true : nsGkAtoms::_false; } -void SVGBoolean::SetBaseValue(bool aValue, SVGElement* aSVGElement) { +void SVGAnimatedBoolean::SetBaseValue(bool aValue, SVGElement* aSVGElement) { if (aValue == mBaseVal) { return; } @@ -89,7 +89,7 @@ void SVGBoolean::SetBaseValue(bool aValue, SVGElement* aSVGElement) { aSVGElement->DidChangeBoolean(mAttrEnum); } -void SVGBoolean::SetAnimValue(bool aValue, SVGElement* aSVGElement) { +void SVGAnimatedBoolean::SetAnimValue(bool aValue, SVGElement* aSVGElement) { if (mIsAnimated && mAnimVal == aValue) { return; } @@ -98,8 +98,8 @@ void SVGBoolean::SetAnimValue(bool aValue, SVGElement* aSVGElement) { aSVGElement->DidAnimateBoolean(mAttrEnum); } -already_AddRefed SVGBoolean::ToDOMAnimatedBoolean( - SVGElement* aSVGElement) { +already_AddRefed +SVGAnimatedBoolean::ToDOMAnimatedBoolean(SVGElement* aSVGElement) { RefPtr domAnimatedBoolean = SVGAnimatedBooleanTearoffTable().GetTearoff(this); if (!domAnimatedBoolean) { @@ -114,11 +114,11 @@ DOMSVGAnimatedBoolean::~DOMSVGAnimatedBoolean() { SVGAnimatedBooleanTearoffTable().RemoveTearoff(mVal); } -UniquePtr SVGBoolean::ToSMILAttr(SVGElement* aSVGElement) { +UniquePtr SVGAnimatedBoolean::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } -nsresult SVGBoolean::SMILBool::ValueFromString( +nsresult SVGAnimatedBoolean::SMILBool::ValueFromString( const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/, SMILValue& aValue, bool& aPreventCachingOfSandwich) const { bool value; @@ -134,13 +134,13 @@ nsresult SVGBoolean::SMILBool::ValueFromString( return NS_OK; } -SMILValue SVGBoolean::SMILBool::GetBaseValue() const { +SMILValue SVGAnimatedBoolean::SMILBool::GetBaseValue() const { SMILValue val(SMILBoolType::Singleton()); val.mU.mBool = mVal->mBaseVal; return val; } -void SVGBoolean::SMILBool::ClearAnimValue() { +void SVGAnimatedBoolean::SMILBool::ClearAnimValue() { if (mVal->mIsAnimated) { mVal->mIsAnimated = false; mVal->mAnimVal = mVal->mBaseVal; @@ -148,7 +148,7 @@ void SVGBoolean::SMILBool::ClearAnimValue() { } } -nsresult SVGBoolean::SMILBool::SetAnimValue(const SMILValue& aValue) { +nsresult SVGAnimatedBoolean::SMILBool::SetAnimValue(const SMILValue& aValue) { NS_ASSERTION(aValue.mType == SMILBoolType::Singleton(), "Unexpected type to assign animated value"); if (aValue.mType == SMILBoolType::Singleton()) { diff --git a/dom/svg/SVGBoolean.h b/dom/svg/SVGAnimatedBoolean.h similarity index 95% rename from dom/svg/SVGBoolean.h rename to dom/svg/SVGAnimatedBoolean.h index 2ba583e8af3d..e2d8aac401a2 100644 --- a/dom/svg/SVGBoolean.h +++ b/dom/svg/SVGAnimatedBoolean.h @@ -25,7 +25,7 @@ class SVGAnimationElement; class SVGElement; } // namespace dom -class SVGBoolean { +class SVGAnimatedBoolean { public: typedef mozilla::dom::SVGElement SVGElement; @@ -57,13 +57,13 @@ class SVGBoolean { public: struct SMILBool : public SMILAttr { public: - SMILBool(SVGBoolean* aVal, SVGElement* aSVGElement) + SMILBool(SVGAnimatedBoolean* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a SMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. - SVGBoolean* mVal; + SVGAnimatedBoolean* mVal; SVGElement* mSVGElement; // SMILAttr methods diff --git a/dom/svg/SVGClass.cpp b/dom/svg/SVGAnimatedClass.cpp similarity index 75% rename from dom/svg/SVGClass.cpp rename to dom/svg/SVGAnimatedClass.cpp index 8b7bd9355447..3967ea257391 100644 --- a/dom/svg/SVGClass.cpp +++ b/dom/svg/SVGAnimatedClass.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "SVGClass.h" +#include "SVGAnimatedClass.h" #include "mozilla/dom/SVGElement.h" #include "mozilla/Move.h" @@ -16,15 +16,15 @@ namespace mozilla { namespace dom { // DOM wrapper class for the (DOM)SVGAnimatedString interface where the -// wrapped class is SVGClass. +// wrapped class is SVGAnimatedClass. struct DOMAnimatedString final : public DOMSVGAnimatedString { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMAnimatedString) - DOMAnimatedString(SVGClass* aVal, SVGElement* aSVGElement) + DOMAnimatedString(SVGAnimatedClass* aVal, SVGElement* aSVGElement) : DOMSVGAnimatedString(aSVGElement), mVal(aVal) {} - SVGClass* mVal; // kept alive because it belongs to content + SVGAnimatedClass* mVal; // kept alive because it belongs to content void GetBaseVal(nsAString& aResult) override { mVal->GetBaseValue(aResult, mSVGElement); @@ -50,7 +50,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMAnimatedString) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END -already_AddRefed SVGClass::ToDOMAnimatedString( +already_AddRefed SVGAnimatedClass::ToDOMAnimatedString( SVGElement* aSVGElement) { RefPtr result = new DOMAnimatedString(this, aSVGElement); return result.forget(); @@ -58,8 +58,8 @@ already_AddRefed SVGClass::ToDOMAnimatedString( /* Implementation */ -void SVGClass::SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement, - bool aDoSetAttr) { +void SVGAnimatedClass::SetBaseValue(const nsAString& aValue, + SVGElement* aSVGElement, bool aDoSetAttr) { NS_ASSERTION(aSVGElement, "Null element passed to SetBaseValue"); aSVGElement->SetMayHaveClass(); @@ -71,13 +71,13 @@ void SVGClass::SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement, } } -void SVGClass::GetBaseValue(nsAString& aValue, - const SVGElement* aSVGElement) const { +void SVGAnimatedClass::GetBaseValue(nsAString& aValue, + const SVGElement* aSVGElement) const { aSVGElement->GetAttr(kNameSpaceID_None, nsGkAtoms::_class, aValue); } -void SVGClass::GetAnimValue(nsAString& aResult, - const SVGElement* aSVGElement) const { +void SVGAnimatedClass::GetAnimValue(nsAString& aResult, + const SVGElement* aSVGElement) const { if (mAnimVal) { aResult = *mAnimVal; return; @@ -86,7 +86,8 @@ void SVGClass::GetAnimValue(nsAString& aResult, aSVGElement->GetAttr(kNameSpaceID_None, nsGkAtoms::_class, aResult); } -void SVGClass::SetAnimValue(const nsAString& aValue, SVGElement* aSVGElement) { +void SVGAnimatedClass::SetAnimValue(const nsAString& aValue, + SVGElement* aSVGElement) { if (mAnimVal && mAnimVal->Equals(aValue)) { return; } @@ -103,11 +104,11 @@ void DOMAnimatedString::GetAnimVal(nsAString& aResult) { mVal->GetAnimValue(aResult, mSVGElement); } -UniquePtr SVGClass::ToSMILAttr(SVGElement* aSVGElement) { +UniquePtr SVGAnimatedClass::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } -nsresult SVGClass::SMILString::ValueFromString( +nsresult SVGAnimatedClass::SMILString::ValueFromString( const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/, SMILValue& aValue, bool& aPreventCachingOfSandwich) const { SMILValue val(SMILStringType::Singleton()); @@ -118,21 +119,21 @@ nsresult SVGClass::SMILString::ValueFromString( return NS_OK; } -SMILValue SVGClass::SMILString::GetBaseValue() const { +SMILValue SVGAnimatedClass::SMILString::GetBaseValue() const { SMILValue val(SMILStringType::Singleton()); mSVGElement->GetAttr(kNameSpaceID_None, nsGkAtoms::_class, *static_cast(val.mU.mPtr)); return val; } -void SVGClass::SMILString::ClearAnimValue() { +void SVGAnimatedClass::SMILString::ClearAnimValue() { if (mVal->mAnimVal) { mVal->mAnimVal = nullptr; mSVGElement->DidAnimateClass(); } } -nsresult SVGClass::SMILString::SetAnimValue(const SMILValue& aValue) { +nsresult SVGAnimatedClass::SMILString::SetAnimValue(const SMILValue& aValue) { NS_ASSERTION(aValue.mType == SMILStringType::Singleton(), "Unexpected type to assign animated value"); if (aValue.mType == SMILStringType::Singleton()) { diff --git a/dom/svg/SVGClass.h b/dom/svg/SVGAnimatedClass.h similarity index 94% rename from dom/svg/SVGClass.h rename to dom/svg/SVGAnimatedClass.h index 8c7ea4d82736..caf7bac2723b 100644 --- a/dom/svg/SVGClass.h +++ b/dom/svg/SVGAnimatedClass.h @@ -23,7 +23,7 @@ namespace dom { class DOMSVGAnimatedString; class SVGElement; -class SVGClass { +class SVGAnimatedClass { public: typedef mozilla::dom::SVGElement SVGElement; @@ -48,13 +48,13 @@ class SVGClass { public: struct SMILString : public SMILAttr { public: - SMILString(SVGClass* aVal, SVGElement* aSVGElement) + SMILString(SVGAnimatedClass* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a SMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. - SVGClass* mVal; + SVGAnimatedClass* mVal; SVGElement* mSVGElement; // SMILAttr methods diff --git a/dom/svg/SVGEnum.cpp b/dom/svg/SVGAnimatedEnumeration.cpp similarity index 77% rename from dom/svg/SVGEnum.cpp rename to dom/svg/SVGAnimatedEnumeration.cpp index ddaab206035d..13fb205eca5e 100644 --- a/dom/svg/SVGEnum.cpp +++ b/dom/svg/SVGAnimatedEnumeration.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "mozilla/dom/SVGElement.h" #include "mozilla/SMILValue.h" @@ -17,10 +17,12 @@ using namespace mozilla::dom; namespace mozilla { -static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedEnumTearoffTable; -const SVGEnumMapping* SVGEnum::GetMapping(SVGElement* aSVGElement) { +const SVGEnumMapping* SVGAnimatedEnumeration::GetMapping( + SVGElement* aSVGElement) { SVGElement::EnumAttributesInfo info = aSVGElement->GetEnumInfo(); NS_ASSERTION(info.mEnumCount > 0 && mAttrEnum < info.mEnumCount, @@ -29,8 +31,8 @@ const SVGEnumMapping* SVGEnum::GetMapping(SVGElement* aSVGElement) { return info.mEnumInfo[mAttrEnum].mMapping; } -nsresult SVGEnum::SetBaseValueAtom(const nsAtom* aValue, - SVGElement* aSVGElement) { +nsresult SVGAnimatedEnumeration::SetBaseValueAtom(const nsAtom* aValue, + SVGElement* aSVGElement) { const SVGEnumMapping* mapping = GetMapping(aSVGElement); while (mapping && mapping->mKey) { @@ -55,7 +57,7 @@ nsresult SVGEnum::SetBaseValueAtom(const nsAtom* aValue, return NS_ERROR_DOM_TYPE_ERR; } -nsAtom* SVGEnum::GetBaseValueAtom(SVGElement* aSVGElement) { +nsAtom* SVGAnimatedEnumeration::GetBaseValueAtom(SVGElement* aSVGElement) { const SVGEnumMapping* mapping = GetMapping(aSVGElement); while (mapping && mapping->mKey) { @@ -68,7 +70,8 @@ nsAtom* SVGEnum::GetBaseValueAtom(SVGElement* aSVGElement) { return nsGkAtoms::_empty; } -nsresult SVGEnum::SetBaseValue(uint16_t aValue, SVGElement* aSVGElement) { +nsresult SVGAnimatedEnumeration::SetBaseValue(uint16_t aValue, + SVGElement* aSVGElement) { const SVGEnumMapping* mapping = GetMapping(aSVGElement); while (mapping && mapping->mKey) { @@ -90,7 +93,8 @@ nsresult SVGEnum::SetBaseValue(uint16_t aValue, SVGElement* aSVGElement) { return NS_ERROR_DOM_TYPE_ERR; } -void SVGEnum::SetAnimValue(uint16_t aValue, SVGElement* aSVGElement) { +void SVGAnimatedEnumeration::SetAnimValue(uint16_t aValue, + SVGElement* aSVGElement) { if (mIsAnimated && aValue == mAnimVal) { return; } @@ -99,8 +103,8 @@ void SVGEnum::SetAnimValue(uint16_t aValue, SVGElement* aSVGElement) { aSVGElement->DidAnimateEnum(mAttrEnum); } -already_AddRefed SVGEnum::ToDOMAnimatedEnum( - SVGElement* aSVGElement) { +already_AddRefed +SVGAnimatedEnumeration::ToDOMAnimatedEnum(SVGElement* aSVGElement) { RefPtr domAnimatedEnum = sSVGAnimatedEnumTearoffTable.GetTearoff(this); if (!domAnimatedEnum) { @@ -111,15 +115,16 @@ already_AddRefed SVGEnum::ToDOMAnimatedEnum( return domAnimatedEnum.forget(); } -SVGEnum::DOMAnimatedEnum::~DOMAnimatedEnum() { +SVGAnimatedEnumeration::DOMAnimatedEnum::~DOMAnimatedEnum() { sSVGAnimatedEnumTearoffTable.RemoveTearoff(mVal); } -UniquePtr SVGEnum::ToSMILAttr(SVGElement* aSVGElement) { +UniquePtr SVGAnimatedEnumeration::ToSMILAttr( + SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } -nsresult SVGEnum::SMILEnum::ValueFromString( +nsresult SVGAnimatedEnumeration::SMILEnum::ValueFromString( const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/, SMILValue& aValue, bool& aPreventCachingOfSandwich) const { nsAtom* valAtom = NS_GetStaticAtom(aStr); @@ -143,13 +148,13 @@ nsresult SVGEnum::SMILEnum::ValueFromString( return NS_ERROR_FAILURE; } -SMILValue SVGEnum::SMILEnum::GetBaseValue() const { +SMILValue SVGAnimatedEnumeration::SMILEnum::GetBaseValue() const { SMILValue val(SMILEnumType::Singleton()); val.mU.mUint = mVal->mBaseVal; return val; } -void SVGEnum::SMILEnum::ClearAnimValue() { +void SVGAnimatedEnumeration::SMILEnum::ClearAnimValue() { if (mVal->mIsAnimated) { mVal->mIsAnimated = false; mVal->mAnimVal = mVal->mBaseVal; @@ -157,7 +162,8 @@ void SVGEnum::SMILEnum::ClearAnimValue() { } } -nsresult SVGEnum::SMILEnum::SetAnimValue(const SMILValue& aValue) { +nsresult SVGAnimatedEnumeration::SMILEnum::SetAnimValue( + const SMILValue& aValue) { NS_ASSERTION(aValue.mType == SMILEnumType::Singleton(), "Unexpected type to assign animated value"); if (aValue.mType == SMILEnumType::Singleton()) { diff --git a/dom/svg/SVGEnum.h b/dom/svg/SVGAnimatedEnumeration.h similarity index 91% rename from dom/svg/SVGEnum.h rename to dom/svg/SVGAnimatedEnumeration.h index 2c1b665c6740..3f328dbc57cd 100644 --- a/dom/svg/SVGEnum.h +++ b/dom/svg/SVGAnimatedEnumeration.h @@ -32,7 +32,7 @@ struct SVGEnumMapping { const SVGEnumValue mVal; }; -class SVGEnum { +class SVGAnimatedEnumeration { public: typedef mozilla::dom::SVGElement SVGElement; @@ -68,14 +68,14 @@ class SVGEnum { public: // DOM wrapper class for the (DOM)SVGAnimatedEnumeration interface where the - // wrapped class is SVGEnum. + // wrapped class is SVGAnimatedEnumeration. struct DOMAnimatedEnum final : public mozilla::dom::DOMSVGAnimatedEnumeration { - DOMAnimatedEnum(SVGEnum* aVal, SVGElement* aSVGElement) + DOMAnimatedEnum(SVGAnimatedEnumeration* aVal, SVGElement* aSVGElement) : mozilla::dom::DOMSVGAnimatedEnumeration(aSVGElement), mVal(aVal) {} virtual ~DOMAnimatedEnum(); - SVGEnum* mVal; // kept alive because it belongs to content + SVGAnimatedEnumeration* mVal; // kept alive because it belongs to content using mozilla::dom::DOMSVGAnimatedEnumeration::SetBaseVal; virtual uint16_t BaseVal() override { return mVal->GetBaseValue(); } @@ -94,13 +94,13 @@ class SVGEnum { struct SMILEnum : public SMILAttr { public: - SMILEnum(SVGEnum* aVal, SVGElement* aSVGElement) + SMILEnum(SVGAnimatedEnumeration* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a SMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. - SVGEnum* mVal; + SVGAnimatedEnumeration* mVal; SVGElement* mSVGElement; // SMILAttr methods diff --git a/dom/svg/SVGInteger.cpp b/dom/svg/SVGAnimatedInteger.cpp similarity index 75% rename from dom/svg/SVGInteger.cpp rename to dom/svg/SVGAnimatedInteger.cpp index 9e8391f411e1..474e1beea6cf 100644 --- a/dom/svg/SVGInteger.cpp +++ b/dom/svg/SVGAnimatedInteger.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "SVGInteger.h" +#include "SVGAnimatedInteger.h" #include "nsError.h" #include "SMILIntegerType.h" @@ -18,11 +18,12 @@ namespace mozilla { /* Implementation */ -static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedIntegerTearoffTable; -nsresult SVGInteger::SetBaseValueString(const nsAString &aValueAsString, - SVGElement *aSVGElement) { +nsresult SVGAnimatedInteger::SetBaseValueString(const nsAString &aValueAsString, + SVGElement *aSVGElement) { bool success; auto token = SVGContentUtils::GetAndEnsureOneToken(aValueAsString, success); @@ -46,12 +47,12 @@ nsresult SVGInteger::SetBaseValueString(const nsAString &aValueAsString, return NS_OK; } -void SVGInteger::GetBaseValueString(nsAString &aValueAsString) { +void SVGAnimatedInteger::GetBaseValueString(nsAString &aValueAsString) { aValueAsString.Truncate(); aValueAsString.AppendInt(mBaseVal); } -void SVGInteger::SetBaseValue(int aValue, SVGElement *aSVGElement) { +void SVGAnimatedInteger::SetBaseValue(int aValue, SVGElement *aSVGElement) { // We can't just rely on SetParsedAttrValue (as called by DidChangeInteger) // detecting redundant changes since it will compare false if the existing // attribute value has an associated serialized version (a string value) even @@ -70,7 +71,7 @@ void SVGInteger::SetBaseValue(int aValue, SVGElement *aSVGElement) { aSVGElement->DidChangeInteger(mAttrEnum); } -void SVGInteger::SetAnimValue(int aValue, SVGElement *aSVGElement) { +void SVGAnimatedInteger::SetAnimValue(int aValue, SVGElement *aSVGElement) { if (mIsAnimated && aValue == mAnimVal) { return; } @@ -79,8 +80,8 @@ void SVGInteger::SetAnimValue(int aValue, SVGElement *aSVGElement) { aSVGElement->DidAnimateInteger(mAttrEnum); } -already_AddRefed SVGInteger::ToDOMAnimatedInteger( - SVGElement *aSVGElement) { +already_AddRefed +SVGAnimatedInteger::ToDOMAnimatedInteger(SVGElement *aSVGElement) { RefPtr domAnimatedInteger = sSVGAnimatedIntegerTearoffTable.GetTearoff(this); if (!domAnimatedInteger) { @@ -91,15 +92,15 @@ already_AddRefed SVGInteger::ToDOMAnimatedInteger( return domAnimatedInteger.forget(); } -SVGInteger::DOMAnimatedInteger::~DOMAnimatedInteger() { +SVGAnimatedInteger::DOMAnimatedInteger::~DOMAnimatedInteger() { sSVGAnimatedIntegerTearoffTable.RemoveTearoff(mVal); } -UniquePtr SVGInteger::ToSMILAttr(SVGElement *aSVGElement) { +UniquePtr SVGAnimatedInteger::ToSMILAttr(SVGElement *aSVGElement) { return MakeUnique(this, aSVGElement); } -nsresult SVGInteger::SMILInteger::ValueFromString( +nsresult SVGAnimatedInteger::SMILInteger::ValueFromString( const nsAString &aStr, const dom::SVGAnimationElement * /*aSrcElement*/, SMILValue &aValue, bool &aPreventCachingOfSandwich) const { int32_t val; @@ -115,13 +116,13 @@ nsresult SVGInteger::SMILInteger::ValueFromString( return NS_OK; } -SMILValue SVGInteger::SMILInteger::GetBaseValue() const { +SMILValue SVGAnimatedInteger::SMILInteger::GetBaseValue() const { SMILValue val(SMILIntegerType::Singleton()); val.mU.mInt = mVal->mBaseVal; return val; } -void SVGInteger::SMILInteger::ClearAnimValue() { +void SVGAnimatedInteger::SMILInteger::ClearAnimValue() { if (mVal->mIsAnimated) { mVal->mIsAnimated = false; mVal->mAnimVal = mVal->mBaseVal; @@ -129,7 +130,8 @@ void SVGInteger::SMILInteger::ClearAnimValue() { } } -nsresult SVGInteger::SMILInteger::SetAnimValue(const SMILValue &aValue) { +nsresult SVGAnimatedInteger::SMILInteger::SetAnimValue( + const SMILValue &aValue) { NS_ASSERTION(aValue.mType == SMILIntegerType::Singleton(), "Unexpected type to assign animated value"); if (aValue.mType == SMILIntegerType::Singleton()) { diff --git a/dom/svg/SVGInteger.h b/dom/svg/SVGAnimatedInteger.h similarity index 92% rename from dom/svg/SVGInteger.h rename to dom/svg/SVGAnimatedInteger.h index de496ce392f9..5e1f7c1b3905 100644 --- a/dom/svg/SVGInteger.h +++ b/dom/svg/SVGAnimatedInteger.h @@ -23,7 +23,7 @@ namespace dom { class SVGAnimationElement; } // namespace dom -class SVGInteger { +class SVGAnimatedInteger { public: typedef mozilla::dom::SVGElement SVGElement; @@ -63,11 +63,11 @@ class SVGInteger { public: struct DOMAnimatedInteger final : public mozilla::dom::DOMSVGAnimatedInteger { - DOMAnimatedInteger(SVGInteger* aVal, SVGElement* aSVGElement) + DOMAnimatedInteger(SVGAnimatedInteger* aVal, SVGElement* aSVGElement) : mozilla::dom::DOMSVGAnimatedInteger(aSVGElement), mVal(aVal) {} virtual ~DOMAnimatedInteger(); - SVGInteger* mVal; // kept alive because it belongs to content + SVGAnimatedInteger* mVal; // kept alive because it belongs to content virtual int32_t BaseVal() override { return mVal->GetBaseValue(); } virtual void SetBaseVal(int32_t aValue) override { @@ -84,13 +84,13 @@ class SVGInteger { struct SMILInteger : public SMILAttr { public: - SMILInteger(SVGInteger* aVal, SVGElement* aSVGElement) + SMILInteger(SVGAnimatedInteger* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a SMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. - SVGInteger* mVal; + SVGAnimatedInteger* mVal; SVGElement* mSVGElement; // SMILAttr methods diff --git a/dom/svg/SVGIntegerPair.cpp b/dom/svg/SVGAnimatedIntegerPair.cpp similarity index 77% rename from dom/svg/SVGIntegerPair.cpp rename to dom/svg/SVGAnimatedIntegerPair.cpp index 710e3ca7d6f3..5a364ca4ade4 100644 --- a/dom/svg/SVGIntegerPair.cpp +++ b/dom/svg/SVGAnimatedIntegerPair.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "SVGIntegerPair.h" +#include "SVGAnimatedIntegerPair.h" #include "nsCharSeparatedTokenizer.h" #include "nsError.h" @@ -18,9 +18,11 @@ using namespace mozilla::dom; namespace mozilla { -static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGFirstAnimatedIntegerTearoffTable; -static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGSecondAnimatedIntegerTearoffTable; /* Implementation */ @@ -48,8 +50,8 @@ static nsresult ParseIntegerOptionalInteger(const nsAString& aValue, return NS_OK; } -nsresult SVGIntegerPair::SetBaseValueString(const nsAString& aValueAsString, - SVGElement* aSVGElement) { +nsresult SVGAnimatedIntegerPair::SetBaseValueString( + const nsAString& aValueAsString, SVGElement* aSVGElement) { int32_t val[2]; nsresult rv = ParseIntegerOptionalInteger(aValueAsString, val); @@ -74,7 +76,8 @@ nsresult SVGIntegerPair::SetBaseValueString(const nsAString& aValueAsString, return NS_OK; } -void SVGIntegerPair::GetBaseValueString(nsAString& aValueAsString) const { +void SVGAnimatedIntegerPair::GetBaseValueString( + nsAString& aValueAsString) const { aValueAsString.Truncate(); aValueAsString.AppendInt(mBaseVal[0]); if (mBaseVal[0] != mBaseVal[1]) { @@ -83,8 +86,8 @@ void SVGIntegerPair::GetBaseValueString(nsAString& aValueAsString) const { } } -void SVGIntegerPair::SetBaseValue(int32_t aValue, PairIndex aPairIndex, - SVGElement* aSVGElement) { +void SVGAnimatedIntegerPair::SetBaseValue(int32_t aValue, PairIndex aPairIndex, + SVGElement* aSVGElement) { uint32_t index = (aPairIndex == eFirst ? 0 : 1); if (mIsBaseSet && mBaseVal[index] == aValue) { return; @@ -101,8 +104,8 @@ void SVGIntegerPair::SetBaseValue(int32_t aValue, PairIndex aPairIndex, aSVGElement->DidChangeIntegerPair(mAttrEnum, emptyOrOldValue); } -void SVGIntegerPair::SetBaseValues(int32_t aValue1, int32_t aValue2, - SVGElement* aSVGElement) { +void SVGAnimatedIntegerPair::SetBaseValues(int32_t aValue1, int32_t aValue2, + SVGElement* aSVGElement) { if (mIsBaseSet && mBaseVal[0] == aValue1 && mBaseVal[1] == aValue2) { return; } @@ -120,8 +123,8 @@ void SVGIntegerPair::SetBaseValues(int32_t aValue1, int32_t aValue2, aSVGElement->DidChangeIntegerPair(mAttrEnum, emptyOrOldValue); } -void SVGIntegerPair::SetAnimValue(const int32_t aValue[2], - SVGElement* aSVGElement) { +void SVGAnimatedIntegerPair::SetAnimValue(const int32_t aValue[2], + SVGElement* aSVGElement) { if (mIsAnimated && mAnimVal[0] == aValue[0] && mAnimVal[1] == aValue[1]) { return; } @@ -131,8 +134,9 @@ void SVGIntegerPair::SetAnimValue(const int32_t aValue[2], aSVGElement->DidAnimateIntegerPair(mAttrEnum); } -already_AddRefed SVGIntegerPair::ToDOMAnimatedInteger( - PairIndex aIndex, SVGElement* aSVGElement) { +already_AddRefed +SVGAnimatedIntegerPair::ToDOMAnimatedInteger(PairIndex aIndex, + SVGElement* aSVGElement) { RefPtr domAnimatedInteger = aIndex == eFirst ? sSVGFirstAnimatedIntegerTearoffTable.GetTearoff(this) : sSVGSecondAnimatedIntegerTearoffTable.GetTearoff(this); @@ -149,7 +153,7 @@ already_AddRefed SVGIntegerPair::ToDOMAnimatedInteger( return domAnimatedInteger.forget(); } -SVGIntegerPair::DOMAnimatedInteger::~DOMAnimatedInteger() { +SVGAnimatedIntegerPair::DOMAnimatedInteger::~DOMAnimatedInteger() { if (mIndex == eFirst) { sSVGFirstAnimatedIntegerTearoffTable.RemoveTearoff(mVal); } else { @@ -157,11 +161,12 @@ SVGIntegerPair::DOMAnimatedInteger::~DOMAnimatedInteger() { } } -UniquePtr SVGIntegerPair::ToSMILAttr(SVGElement* aSVGElement) { +UniquePtr SVGAnimatedIntegerPair::ToSMILAttr( + SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } -nsresult SVGIntegerPair::SMILIntegerPair::ValueFromString( +nsresult SVGAnimatedIntegerPair::SMILIntegerPair::ValueFromString( const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/, SMILValue& aValue, bool& aPreventCachingOfSandwich) const { int32_t values[2]; @@ -180,14 +185,14 @@ nsresult SVGIntegerPair::SMILIntegerPair::ValueFromString( return NS_OK; } -SMILValue SVGIntegerPair::SMILIntegerPair::GetBaseValue() const { +SMILValue SVGAnimatedIntegerPair::SMILIntegerPair::GetBaseValue() const { SMILValue val(SVGIntegerPairSMILType::Singleton()); val.mU.mIntPair[0] = mVal->mBaseVal[0]; val.mU.mIntPair[1] = mVal->mBaseVal[1]; return val; } -void SVGIntegerPair::SMILIntegerPair::ClearAnimValue() { +void SVGAnimatedIntegerPair::SMILIntegerPair::ClearAnimValue() { if (mVal->mIsAnimated) { mVal->mIsAnimated = false; mVal->mAnimVal[0] = mVal->mBaseVal[0]; @@ -196,7 +201,7 @@ void SVGIntegerPair::SMILIntegerPair::ClearAnimValue() { } } -nsresult SVGIntegerPair::SMILIntegerPair::SetAnimValue( +nsresult SVGAnimatedIntegerPair::SMILIntegerPair::SetAnimValue( const SMILValue& aValue) { NS_ASSERTION(aValue.mType == SVGIntegerPairSMILType::Singleton(), "Unexpected type to assign animated value"); diff --git a/dom/svg/SVGIntegerPair.h b/dom/svg/SVGAnimatedIntegerPair.h similarity index 93% rename from dom/svg/SVGIntegerPair.h rename to dom/svg/SVGAnimatedIntegerPair.h index 74aa76593955..30e9670ff9da 100644 --- a/dom/svg/SVGIntegerPair.h +++ b/dom/svg/SVGAnimatedIntegerPair.h @@ -23,7 +23,7 @@ class SVGAnimationElement; class SVGElement; } // namespace dom -class SVGIntegerPair { +class SVGAnimatedIntegerPair { public: typedef mozilla::dom::SVGElement SVGElement; @@ -71,14 +71,14 @@ class SVGIntegerPair { public: struct DOMAnimatedInteger final : public mozilla::dom::DOMSVGAnimatedInteger { - DOMAnimatedInteger(SVGIntegerPair* aVal, PairIndex aIndex, + DOMAnimatedInteger(SVGAnimatedIntegerPair* aVal, PairIndex aIndex, SVGElement* aSVGElement) : mozilla::dom::DOMSVGAnimatedInteger(aSVGElement), mVal(aVal), mIndex(aIndex) {} virtual ~DOMAnimatedInteger(); - SVGIntegerPair* mVal; // kept alive because it belongs to content + SVGAnimatedIntegerPair* mVal; // kept alive because it belongs to content PairIndex mIndex; // are we the first or second integer virtual int32_t BaseVal() override { return mVal->GetBaseValue(mIndex); } @@ -96,13 +96,13 @@ class SVGIntegerPair { struct SMILIntegerPair : public SMILAttr { public: - SMILIntegerPair(SVGIntegerPair* aVal, SVGElement* aSVGElement) + SMILIntegerPair(SVGAnimatedIntegerPair* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a SMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. - SVGIntegerPair* mVal; + SVGAnimatedIntegerPair* mVal; SVGElement* mSVGElement; // SMILAttr methods diff --git a/dom/svg/SVGNumberPair.cpp b/dom/svg/SVGAnimatedNumberPair.cpp similarity index 78% rename from dom/svg/SVGNumberPair.cpp rename to dom/svg/SVGAnimatedNumberPair.cpp index 17fd4c8c547e..aede1826add0 100644 --- a/dom/svg/SVGNumberPair.cpp +++ b/dom/svg/SVGAnimatedNumberPair.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "SVGNumberPair.h" +#include "SVGAnimatedNumberPair.h" #include "nsCharSeparatedTokenizer.h" #include "SVGAttrTearoffTable.h" @@ -16,9 +16,11 @@ using namespace mozilla::dom; namespace mozilla { -static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGFirstAnimatedNumberTearoffTable; -static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGSecondAnimatedNumberTearoffTable; static nsresult ParseNumberOptionalNumber(const nsAString& aValue, @@ -44,8 +46,8 @@ static nsresult ParseNumberOptionalNumber(const nsAString& aValue, return NS_OK; } -nsresult SVGNumberPair::SetBaseValueString(const nsAString& aValueAsString, - SVGElement* aSVGElement) { +nsresult SVGAnimatedNumberPair::SetBaseValueString( + const nsAString& aValueAsString, SVGElement* aSVGElement) { float val[2]; nsresult rv = ParseNumberOptionalNumber(aValueAsString, val); @@ -69,7 +71,8 @@ nsresult SVGNumberPair::SetBaseValueString(const nsAString& aValueAsString, return NS_OK; } -void SVGNumberPair::GetBaseValueString(nsAString& aValueAsString) const { +void SVGAnimatedNumberPair::GetBaseValueString( + nsAString& aValueAsString) const { aValueAsString.Truncate(); aValueAsString.AppendFloat(mBaseVal[0]); if (mBaseVal[0] != mBaseVal[1]) { @@ -78,8 +81,8 @@ void SVGNumberPair::GetBaseValueString(nsAString& aValueAsString) const { } } -void SVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex, - SVGElement* aSVGElement) { +void SVGAnimatedNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex, + SVGElement* aSVGElement) { uint32_t index = (aPairIndex == eFirst ? 0 : 1); if (mIsBaseSet && mBaseVal[index] == aValue) { return; @@ -95,8 +98,8 @@ void SVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex, aSVGElement->DidChangeNumberPair(mAttrEnum, emptyOrOldValue); } -void SVGNumberPair::SetBaseValues(float aValue1, float aValue2, - SVGElement* aSVGElement) { +void SVGAnimatedNumberPair::SetBaseValues(float aValue1, float aValue2, + SVGElement* aSVGElement) { if (mIsBaseSet && mBaseVal[0] == aValue1 && mBaseVal[1] == aValue2) { return; } @@ -113,8 +116,8 @@ void SVGNumberPair::SetBaseValues(float aValue1, float aValue2, aSVGElement->DidChangeNumberPair(mAttrEnum, emptyOrOldValue); } -void SVGNumberPair::SetAnimValue(const float aValue[2], - SVGElement* aSVGElement) { +void SVGAnimatedNumberPair::SetAnimValue(const float aValue[2], + SVGElement* aSVGElement) { if (mIsAnimated && mAnimVal[0] == aValue[0] && mAnimVal[1] == aValue[1]) { return; } @@ -124,8 +127,9 @@ void SVGNumberPair::SetAnimValue(const float aValue[2], aSVGElement->DidAnimateNumberPair(mAttrEnum); } -already_AddRefed SVGNumberPair::ToDOMAnimatedNumber( - PairIndex aIndex, SVGElement* aSVGElement) { +already_AddRefed +SVGAnimatedNumberPair::ToDOMAnimatedNumber(PairIndex aIndex, + SVGElement* aSVGElement) { RefPtr domAnimatedNumber = aIndex == eFirst ? sSVGFirstAnimatedNumberTearoffTable.GetTearoff(this) : sSVGSecondAnimatedNumberTearoffTable.GetTearoff(this); @@ -141,7 +145,7 @@ already_AddRefed SVGNumberPair::ToDOMAnimatedNumber( return domAnimatedNumber.forget(); } -SVGNumberPair::DOMAnimatedNumber::~DOMAnimatedNumber() { +SVGAnimatedNumberPair::DOMAnimatedNumber::~DOMAnimatedNumber() { if (mIndex == eFirst) { sSVGFirstAnimatedNumberTearoffTable.RemoveTearoff(mVal); } else { @@ -149,11 +153,11 @@ SVGNumberPair::DOMAnimatedNumber::~DOMAnimatedNumber() { } } -UniquePtr SVGNumberPair::ToSMILAttr(SVGElement* aSVGElement) { +UniquePtr SVGAnimatedNumberPair::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } -nsresult SVGNumberPair::SMILNumberPair::ValueFromString( +nsresult SVGAnimatedNumberPair::SMILNumberPair::ValueFromString( const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/, SMILValue& aValue, bool& aPreventCachingOfSandwich) const { float values[2]; @@ -172,14 +176,14 @@ nsresult SVGNumberPair::SMILNumberPair::ValueFromString( return NS_OK; } -SMILValue SVGNumberPair::SMILNumberPair::GetBaseValue() const { +SMILValue SVGAnimatedNumberPair::SMILNumberPair::GetBaseValue() const { SMILValue val(&SVGNumberPairSMILType::sSingleton); val.mU.mNumberPair[0] = mVal->mBaseVal[0]; val.mU.mNumberPair[1] = mVal->mBaseVal[1]; return val; } -void SVGNumberPair::SMILNumberPair::ClearAnimValue() { +void SVGAnimatedNumberPair::SMILNumberPair::ClearAnimValue() { if (mVal->mIsAnimated) { mVal->mIsAnimated = false; mVal->mAnimVal[0] = mVal->mBaseVal[0]; @@ -188,7 +192,8 @@ void SVGNumberPair::SMILNumberPair::ClearAnimValue() { } } -nsresult SVGNumberPair::SMILNumberPair::SetAnimValue(const SMILValue& aValue) { +nsresult SVGAnimatedNumberPair::SMILNumberPair::SetAnimValue( + const SMILValue& aValue) { NS_ASSERTION(aValue.mType == &SVGNumberPairSMILType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SVGNumberPairSMILType::sSingleton) { diff --git a/dom/svg/SVGNumberPair.h b/dom/svg/SVGAnimatedNumberPair.h similarity index 92% rename from dom/svg/SVGNumberPair.h rename to dom/svg/SVGAnimatedNumberPair.h index 2cf592a2c60c..24f1bf425ed4 100644 --- a/dom/svg/SVGNumberPair.h +++ b/dom/svg/SVGAnimatedNumberPair.h @@ -25,7 +25,7 @@ class SVGAnimationElement; class SVGElement; } // namespace dom -class SVGNumberPair { +class SVGAnimatedNumberPair { public: typedef mozilla::dom::SVGElement SVGElement; @@ -72,16 +72,16 @@ class SVGNumberPair { public: // DOM wrapper class for the (DOM)SVGAnimatedNumber interface where the - // wrapped class is SVGNumberPair. + // wrapped class is SVGAnimatedNumberPair. struct DOMAnimatedNumber final : public mozilla::dom::DOMSVGAnimatedNumber { - DOMAnimatedNumber(SVGNumberPair* aVal, PairIndex aIndex, + DOMAnimatedNumber(SVGAnimatedNumberPair* aVal, PairIndex aIndex, SVGElement* aSVGElement) : mozilla::dom::DOMSVGAnimatedNumber(aSVGElement), mVal(aVal), mIndex(aIndex) {} virtual ~DOMAnimatedNumber(); - SVGNumberPair* mVal; // kept alive because it belongs to content + SVGAnimatedNumberPair* mVal; // kept alive because it belongs to content PairIndex mIndex; // are we the first or second number virtual float BaseVal() override { return mVal->GetBaseValue(mIndex); } @@ -100,13 +100,13 @@ class SVGNumberPair { struct SMILNumberPair : public SMILAttr { public: - SMILNumberPair(SVGNumberPair* aVal, SVGElement* aSVGElement) + SMILNumberPair(SVGAnimatedNumberPair* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a SMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. - SVGNumberPair* mVal; + SVGAnimatedNumberPair* mVal; SVGElement* mSVGElement; // SMILAttr methods diff --git a/dom/svg/SVGOrient.cpp b/dom/svg/SVGAnimatedOrient.cpp similarity index 80% rename from dom/svg/SVGOrient.cpp rename to dom/svg/SVGAnimatedOrient.cpp index cabbf90506d0..bde7d4673304 100644 --- a/dom/svg/SVGOrient.cpp +++ b/dom/svg/SVGAnimatedOrient.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "SVGOrient.h" +#include "SVGAnimatedOrient.h" #include "mozilla/ArrayUtils.h" #include "mozilla/Move.h" @@ -28,12 +28,14 @@ static const nsStaticAtom* const angleUnitMap[] = { nullptr, /* SVG_ANGLETYPE_UNSPECIFIED */ nsGkAtoms::deg, nsGkAtoms::rad, nsGkAtoms::grad}; -static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedEnumTearoffTable; -static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedAngleTearoffTable; -static SVGAttrTearoffTable sBaseSVGAngleTearoffTable; -static SVGAttrTearoffTable sAnimSVGAngleTearoffTable; +static SVGAttrTearoffTable + sBaseSVGAngleTearoffTable; +static SVGAttrTearoffTable + sAnimSVGAngleTearoffTable; /* Helper functions */ @@ -44,7 +46,7 @@ static SVGAttrTearoffTable sAnimSVGAngleTearoffTable; class MOZ_RAII AutoChangeOrientNotifier { public: explicit AutoChangeOrientNotifier( - SVGOrient* aOrient, SVGElement* aSVGElement, + SVGAnimatedOrient* aOrient, SVGElement* aSVGElement, bool aDoSetAttr = true MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mOrient(aOrient), mSVGElement(aSVGElement), mDoSetAttr(aDoSetAttr) { MOZ_GUARD_OBJECT_NOTIFIER_INIT; @@ -66,7 +68,7 @@ class MOZ_RAII AutoChangeOrientNotifier { } private: - SVGOrient* const mOrient; + SVGAnimatedOrient* const mOrient; SVGElement* const mSVGElement; nsAttrValue mEmptyOrOldValue; bool mDoSetAttr; @@ -116,8 +118,8 @@ static void GetAngleValueString(nsAString& aValueAsString, float aValue, } /* static */ -bool SVGOrient::GetValueFromString(const nsAString& aString, float& aValue, - uint16_t* aUnitType) { +bool SVGAnimatedOrient::GetValueFromString(const nsAString& aString, + float& aValue, uint16_t* aUnitType) { bool success; auto token = SVGContentUtils::GetAndEnsureOneToken(aString, success); @@ -138,7 +140,7 @@ bool SVGOrient::GetValueFromString(const nsAString& aString, float& aValue, } /* static */ -float SVGOrient::GetDegreesPerUnit(uint8_t aUnit) { +float SVGAnimatedOrient::GetDegreesPerUnit(uint8_t aUnit) { switch (aUnit) { case SVG_ANGLETYPE_UNSPECIFIED: case SVG_ANGLETYPE_DEG: @@ -153,8 +155,8 @@ float SVGOrient::GetDegreesPerUnit(uint8_t aUnit) { } } -void SVGOrient::SetBaseValueInSpecifiedUnits(float aValue, - SVGElement* aSVGElement) { +void SVGAnimatedOrient::SetBaseValueInSpecifiedUnits(float aValue, + SVGElement* aSVGElement) { if (mBaseVal == aValue && mBaseType == SVG_MARKER_ORIENT_ANGLE) { return; } @@ -169,8 +171,8 @@ void SVGOrient::SetBaseValueInSpecifiedUnits(float aValue, } } -nsresult SVGOrient::ConvertToSpecifiedUnits(uint16_t unitType, - SVGElement* aSVGElement) { +nsresult SVGAnimatedOrient::ConvertToSpecifiedUnits(uint16_t unitType, + SVGElement* aSVGElement) { if (!IsValidAngleUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR; if (mBaseValUnit == uint8_t(unitType) && @@ -184,9 +186,9 @@ nsresult SVGOrient::ConvertToSpecifiedUnits(uint16_t unitType, return NS_OK; } -nsresult SVGOrient::NewValueSpecifiedUnits(uint16_t unitType, - float valueInSpecifiedUnits, - SVGElement* aSVGElement) { +nsresult SVGAnimatedOrient::NewValueSpecifiedUnits(uint16_t unitType, + float valueInSpecifiedUnits, + SVGElement* aSVGElement) { NS_ENSURE_FINITE(valueInSpecifiedUnits, NS_ERROR_ILLEGAL_VALUE); if (!IsValidAngleUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR; @@ -208,7 +210,8 @@ nsresult SVGOrient::NewValueSpecifiedUnits(uint16_t unitType, return NS_OK; } -already_AddRefed SVGOrient::ToDOMBaseVal(SVGElement* aSVGElement) { +already_AddRefed SVGAnimatedOrient::ToDOMBaseVal( + SVGElement* aSVGElement) { RefPtr domBaseVal = sBaseSVGAngleTearoffTable.GetTearoff(this); if (!domBaseVal) { domBaseVal = new DOMSVGAngle(this, aSVGElement, DOMSVGAngle::BaseValue); @@ -218,7 +221,8 @@ already_AddRefed SVGOrient::ToDOMBaseVal(SVGElement* aSVGElement) { return domBaseVal.forget(); } -already_AddRefed SVGOrient::ToDOMAnimVal(SVGElement* aSVGElement) { +already_AddRefed SVGAnimatedOrient::ToDOMAnimVal( + SVGElement* aSVGElement) { RefPtr domAnimVal = sAnimSVGAngleTearoffTable.GetTearoff(this); if (!domAnimVal) { domAnimVal = new DOMSVGAngle(this, aSVGElement, DOMSVGAngle::AnimValue); @@ -240,9 +244,9 @@ DOMSVGAngle::~DOMSVGAngle() { /* Implementation */ -nsresult SVGOrient::SetBaseValueString(const nsAString& aValueAsString, - SVGElement* aSVGElement, - bool aDoSetAttr) { +nsresult SVGAnimatedOrient::SetBaseValueString(const nsAString& aValueAsString, + SVGElement* aSVGElement, + bool aDoSetAttr) { uint8_t type; float value; uint16_t unitType; @@ -290,7 +294,7 @@ nsresult SVGOrient::SetBaseValueString(const nsAString& aValueAsString, return NS_OK; } -void SVGOrient::GetBaseValueString(nsAString& aValueAsString) const { +void SVGAnimatedOrient::GetBaseValueString(nsAString& aValueAsString) const { switch (mBaseType) { case SVG_MARKER_ORIENT_AUTO: aValueAsString.AssignLiteral("auto"); @@ -302,16 +306,18 @@ void SVGOrient::GetBaseValueString(nsAString& aValueAsString) const { GetAngleValueString(aValueAsString, mBaseVal, mBaseValUnit); } -void SVGOrient::GetBaseAngleValueString(nsAString& aValueAsString) const { +void SVGAnimatedOrient::GetBaseAngleValueString( + nsAString& aValueAsString) const { GetAngleValueString(aValueAsString, mBaseVal, mBaseValUnit); } -void SVGOrient::GetAnimAngleValueString(nsAString& aValueAsString) const { +void SVGAnimatedOrient::GetAnimAngleValueString( + nsAString& aValueAsString) const { GetAngleValueString(aValueAsString, mAnimVal, mAnimValUnit); } -void SVGOrient::SetBaseValue(float aValue, uint8_t aUnit, - SVGElement* aSVGElement, bool aDoSetAttr) { +void SVGAnimatedOrient::SetBaseValue(float aValue, uint8_t aUnit, + SVGElement* aSVGElement, bool aDoSetAttr) { float valueInSpecifiedUnits = aValue / GetDegreesPerUnit(aUnit); if (aUnit == mBaseValUnit && mBaseVal == valueInSpecifiedUnits && mBaseType == SVG_MARKER_ORIENT_ANGLE) { @@ -330,7 +336,8 @@ void SVGOrient::SetBaseValue(float aValue, uint8_t aUnit, } } -nsresult SVGOrient::SetBaseType(SVGEnumValue aValue, SVGElement* aSVGElement) { +nsresult SVGAnimatedOrient::SetBaseType(SVGEnumValue aValue, + SVGElement* aSVGElement) { if (mBaseType == aValue) { return NS_OK; } @@ -351,8 +358,8 @@ nsresult SVGOrient::SetBaseType(SVGEnumValue aValue, SVGElement* aSVGElement) { return NS_ERROR_DOM_TYPE_ERR; } -void SVGOrient::SetAnimValue(float aValue, uint8_t aUnit, - SVGElement* aSVGElement) { +void SVGAnimatedOrient::SetAnimValue(float aValue, uint8_t aUnit, + SVGElement* aSVGElement) { if (mIsAnimated && mAnimVal == aValue && mAnimValUnit == aUnit && mAnimType == SVG_MARKER_ORIENT_ANGLE) { return; @@ -364,7 +371,8 @@ void SVGOrient::SetAnimValue(float aValue, uint8_t aUnit, aSVGElement->DidAnimateOrient(); } -void SVGOrient::SetAnimType(SVGEnumValue aValue, SVGElement* aSVGElement) { +void SVGAnimatedOrient::SetAnimType(SVGEnumValue aValue, + SVGElement* aSVGElement) { if (mIsAnimated && mAnimType == aValue) { return; } @@ -375,7 +383,7 @@ void SVGOrient::SetAnimType(SVGEnumValue aValue, SVGElement* aSVGElement) { aSVGElement->DidAnimateOrient(); } -already_AddRefed SVGOrient::ToDOMAnimatedAngle( +already_AddRefed SVGAnimatedOrient::ToDOMAnimatedAngle( SVGElement* aSVGElement) { RefPtr domAnimatedAngle = sSVGAnimatedAngleTearoffTable.GetTearoff(this); @@ -387,8 +395,8 @@ already_AddRefed SVGOrient::ToDOMAnimatedAngle( return domAnimatedAngle.forget(); } -already_AddRefed SVGOrient::ToDOMAnimatedEnum( - SVGElement* aSVGElement) { +already_AddRefed +SVGAnimatedOrient::ToDOMAnimatedEnum(SVGElement* aSVGElement) { RefPtr domAnimatedEnum = sSVGAnimatedEnumTearoffTable.GetTearoff(this); if (!domAnimatedEnum) { @@ -403,19 +411,19 @@ DOMSVGAnimatedAngle::~DOMSVGAnimatedAngle() { sSVGAnimatedAngleTearoffTable.RemoveTearoff(mVal); } -SVGOrient::DOMAnimatedEnum::~DOMAnimatedEnum() { +SVGAnimatedOrient::DOMAnimatedEnum::~DOMAnimatedEnum() { sSVGAnimatedEnumTearoffTable.RemoveTearoff(mVal); } // we want to avoid exposing SVG_MARKER_ORIENT_AUTO_START_REVERSE to // Web content -uint16_t SVGOrient::DOMAnimatedEnum::Sanitize(uint16_t aValue) { +uint16_t SVGAnimatedOrient::DOMAnimatedEnum::Sanitize(uint16_t aValue) { return aValue == dom::SVG_MARKER_ORIENT_AUTO_START_REVERSE ? dom::SVGMarkerElement_Binding::SVG_MARKER_ORIENT_UNKNOWN : aValue; } -UniquePtr SVGOrient::ToSMILAttr(SVGElement* aSVGElement) { +UniquePtr SVGAnimatedOrient::ToSMILAttr(SVGElement* aSVGElement) { if (aSVGElement->NodeInfo()->Equals(nsGkAtoms::marker, kNameSpaceID_SVG)) { return MakeUnique(this, aSVGElement); } @@ -425,7 +433,7 @@ UniquePtr SVGOrient::ToSMILAttr(SVGElement* aSVGElement) { return nullptr; } -nsresult SVGOrient::SMILOrient::ValueFromString( +nsresult SVGAnimatedOrient::SMILOrient::ValueFromString( const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/, SMILValue& aValue, bool& aPreventCachingOfSandwich) const { SMILValue val(&SVGOrientSMILType::sSingleton); @@ -453,7 +461,7 @@ nsresult SVGOrient::SMILOrient::ValueFromString( return NS_OK; } -SMILValue SVGOrient::SMILOrient::GetBaseValue() const { +SMILValue SVGAnimatedOrient::SMILOrient::GetBaseValue() const { SMILValue val(&SVGOrientSMILType::sSingleton); val.mU.mOrient.mAngle = mOrient->GetBaseValInSpecifiedUnits(); val.mU.mOrient.mUnit = mOrient->GetBaseValueUnit(); @@ -461,7 +469,7 @@ SMILValue SVGOrient::SMILOrient::GetBaseValue() const { return val; } -void SVGOrient::SMILOrient::ClearAnimValue() { +void SVGAnimatedOrient::SMILOrient::ClearAnimValue() { if (mOrient->mIsAnimated) { mOrient->mIsAnimated = false; mOrient->mAnimVal = mOrient->mBaseVal; @@ -471,7 +479,7 @@ void SVGOrient::SMILOrient::ClearAnimValue() { } } -nsresult SVGOrient::SMILOrient::SetAnimValue(const SMILValue& aValue) { +nsresult SVGAnimatedOrient::SMILOrient::SetAnimValue(const SMILValue& aValue) { NS_ASSERTION(aValue.mType == &SVGOrientSMILType::sSingleton, "Unexpected type to assign animated value"); diff --git a/dom/svg/SVGOrient.h b/dom/svg/SVGAnimatedOrient.h similarity index 93% rename from dom/svg/SVGOrient.h rename to dom/svg/SVGAnimatedOrient.h index 1b89038654a6..c0305e36ba36 100644 --- a/dom/svg/SVGOrient.h +++ b/dom/svg/SVGAnimatedOrient.h @@ -9,7 +9,7 @@ #include "DOMSVGAnimatedEnumeration.h" #include "nsError.h" -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "mozilla/AlreadyAddRefed.h" #include "mozilla/Attributes.h" #include "mozilla/SMILAttr.h" @@ -30,7 +30,7 @@ class SVGAnimationElement; class SVGElement; } // namespace dom -class SVGOrient { +class SVGAnimatedOrient { friend class AutoChangeOrientNotifier; friend class mozilla::dom::DOMSVGAngle; friend class mozilla::dom::DOMSVGAnimatedAngle; @@ -100,13 +100,13 @@ class SVGOrient { public: // DOM wrapper class for the (DOM)SVGAnimatedEnumeration interface where the - // wrapped class is SVGOrient. + // wrapped class is SVGAnimatedOrient. struct DOMAnimatedEnum final : public dom::DOMSVGAnimatedEnumeration { - DOMAnimatedEnum(SVGOrient* aVal, SVGElement* aSVGElement) + DOMAnimatedEnum(SVGAnimatedOrient* aVal, SVGElement* aSVGElement) : DOMSVGAnimatedEnumeration(aSVGElement), mVal(aVal) {} ~DOMAnimatedEnum(); - SVGOrient* mVal; // kept alive because it belongs to content + SVGAnimatedOrient* mVal; // kept alive because it belongs to content using mozilla::dom::DOMSVGAnimatedEnumeration::SetBaseVal; uint16_t BaseVal() override { return Sanitize(mVal->mBaseType); } @@ -127,13 +127,13 @@ class SVGOrient { struct SMILOrient final : public SMILAttr { public: - SMILOrient(SVGOrient* aOrient, SVGElement* aSVGElement) + SMILOrient(SVGAnimatedOrient* aOrient, SVGElement* aSVGElement) : mOrient(aOrient), mSVGElement(aSVGElement) {} // These will stay alive because a SMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. - SVGOrient* mOrient; + SVGAnimatedOrient* mOrient; SVGElement* mSVGElement; // SMILAttr methods diff --git a/dom/svg/SVGAnimatedRect.cpp b/dom/svg/SVGAnimatedRect.cpp index be8b12e7a537..c7118bf41594 100644 --- a/dom/svg/SVGAnimatedRect.cpp +++ b/dom/svg/SVGAnimatedRect.cpp @@ -6,8 +6,8 @@ #include "SVGAnimatedRect.h" #include "mozilla/dom/SVGAnimatedRectBinding.h" -#include "SVGElement.h" -#include "SVGViewBox.h" +#include "mozilla/dom/SVGElement.h" +#include "SVGAnimatedViewBox.h" #include "SVGIRect.h" namespace mozilla { @@ -18,11 +18,12 @@ NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedRect, mSVGElement) NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(SVGAnimatedRect, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(SVGAnimatedRect, Release) -SVGAnimatedRect::SVGAnimatedRect(SVGViewBox* aVal, SVGElement* aSVGElement) +SVGAnimatedRect::SVGAnimatedRect(SVGAnimatedViewBox* aVal, + SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} SVGAnimatedRect::~SVGAnimatedRect() { - SVGViewBox::sSVGAnimatedRectTearoffTable.RemoveTearoff(mVal); + SVGAnimatedViewBox::sSVGAnimatedRectTearoffTable.RemoveTearoff(mVal); } already_AddRefed SVGAnimatedRect::GetBaseVal() { diff --git a/dom/svg/SVGAnimatedRect.h b/dom/svg/SVGAnimatedRect.h index 03093a57467f..2f8a532d5ef0 100644 --- a/dom/svg/SVGAnimatedRect.h +++ b/dom/svg/SVGAnimatedRect.h @@ -15,7 +15,7 @@ #include "nsWrapperCache.h" namespace mozilla { -class SVGViewBox; +class SVGAnimatedViewBox; namespace dom { class SVGAnimatedRect final : public nsWrapperCache { @@ -23,7 +23,7 @@ class SVGAnimatedRect final : public nsWrapperCache { NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGAnimatedRect) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGAnimatedRect) - SVGAnimatedRect(SVGViewBox* aVal, SVGElement* aSVGElement); + SVGAnimatedRect(SVGAnimatedViewBox* aVal, SVGElement* aSVGElement); SVGElement* GetParentObject() const { return mSVGElement; } @@ -37,7 +37,7 @@ class SVGAnimatedRect final : public nsWrapperCache { private: virtual ~SVGAnimatedRect(); - SVGViewBox* mVal; // kept alive because it belongs to content + SVGAnimatedViewBox* mVal; // kept alive because it belongs to content RefPtr mSVGElement; }; diff --git a/dom/svg/SVGString.cpp b/dom/svg/SVGAnimatedString.cpp similarity index 65% rename from dom/svg/SVGString.cpp rename to dom/svg/SVGAnimatedString.cpp index f7017b987ec7..f7615b978cfb 100644 --- a/dom/svg/SVGString.cpp +++ b/dom/svg/SVGAnimatedString.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "SVGString.h" +#include "SVGAnimatedString.h" #include "mozilla/Move.h" #include "mozilla/SMILValue.h" @@ -15,28 +15,30 @@ using namespace mozilla::dom; namespace mozilla { -NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGString::DOMAnimatedString, - mSVGElement) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED( + SVGAnimatedString::DOMAnimatedString, mSVGElement) -NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGString::DOMAnimatedString) -NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGString::DOMAnimatedString) +NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedString::DOMAnimatedString) +NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedString::DOMAnimatedString) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGString::DOMAnimatedString) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimatedString::DOMAnimatedString) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END -static inline SVGAttrTearoffTable& +static inline SVGAttrTearoffTable& SVGAnimatedStringTearoffTable() { - static SVGAttrTearoffTable + static SVGAttrTearoffTable sSVGAnimatedStringTearoffTable; return sSVGAnimatedStringTearoffTable; } /* Implementation */ -void SVGString::SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement, - bool aDoSetAttr) { +void SVGAnimatedString::SetBaseValue(const nsAString& aValue, + SVGElement* aSVGElement, bool aDoSetAttr) { NS_ASSERTION(aSVGElement, "Null element passed to SetBaseValue"); mIsBaseSet = true; @@ -50,8 +52,8 @@ void SVGString::SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement, aSVGElement->DidChangeString(mAttrEnum); } -void SVGString::GetAnimValue(nsAString& aResult, - const SVGElement* aSVGElement) const { +void SVGAnimatedString::GetAnimValue(nsAString& aResult, + const SVGElement* aSVGElement) const { if (mAnimVal) { aResult = *mAnimVal; return; @@ -60,7 +62,8 @@ void SVGString::GetAnimValue(nsAString& aResult, aSVGElement->GetStringBaseValue(mAttrEnum, aResult); } -void SVGString::SetAnimValue(const nsAString& aValue, SVGElement* aSVGElement) { +void SVGAnimatedString::SetAnimValue(const nsAString& aValue, + SVGElement* aSVGElement) { if (aSVGElement->IsStringAnimatable(mAttrEnum)) { if (mAnimVal && mAnimVal->Equals(aValue)) { return; @@ -73,7 +76,7 @@ void SVGString::SetAnimValue(const nsAString& aValue, SVGElement* aSVGElement) { } } -already_AddRefed SVGString::ToDOMAnimatedString( +already_AddRefed SVGAnimatedString::ToDOMAnimatedString( SVGElement* aSVGElement) { RefPtr domAnimatedString = SVGAnimatedStringTearoffTable().GetTearoff(this); @@ -85,15 +88,15 @@ already_AddRefed SVGString::ToDOMAnimatedString( return domAnimatedString.forget(); } -SVGString::DOMAnimatedString::~DOMAnimatedString() { +SVGAnimatedString::DOMAnimatedString::~DOMAnimatedString() { SVGAnimatedStringTearoffTable().RemoveTearoff(mVal); } -UniquePtr SVGString::ToSMILAttr(SVGElement* aSVGElement) { +UniquePtr SVGAnimatedString::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } -nsresult SVGString::SMILString::ValueFromString( +nsresult SVGAnimatedString::SMILString::ValueFromString( const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/, SMILValue& aValue, bool& aPreventCachingOfSandwich) const { SMILValue val(SMILStringType::Singleton()); @@ -104,21 +107,21 @@ nsresult SVGString::SMILString::ValueFromString( return NS_OK; } -SMILValue SVGString::SMILString::GetBaseValue() const { +SMILValue SVGAnimatedString::SMILString::GetBaseValue() const { SMILValue val(SMILStringType::Singleton()); mSVGElement->GetStringBaseValue(mVal->mAttrEnum, *static_cast(val.mU.mPtr)); return val; } -void SVGString::SMILString::ClearAnimValue() { +void SVGAnimatedString::SMILString::ClearAnimValue() { if (mVal->mAnimVal) { mVal->mAnimVal = nullptr; mSVGElement->DidAnimateString(mVal->mAttrEnum); } } -nsresult SVGString::SMILString::SetAnimValue(const SMILValue& aValue) { +nsresult SVGAnimatedString::SMILString::SetAnimValue(const SMILValue& aValue) { NS_ASSERTION(aValue.mType == SMILStringType::Singleton(), "Unexpected type to assign animated value"); if (aValue.mType == SMILStringType::Singleton()) { diff --git a/dom/svg/SVGString.h b/dom/svg/SVGAnimatedString.h similarity index 91% rename from dom/svg/SVGString.h rename to dom/svg/SVGAnimatedString.h index 8262cbe2b8dd..c7153e74a327 100644 --- a/dom/svg/SVGString.h +++ b/dom/svg/SVGAnimatedString.h @@ -21,7 +21,7 @@ namespace dom { class SVGElement; } -class SVGString { +class SVGAnimatedString { public: typedef mozilla::dom::SVGElement SVGElement; @@ -59,15 +59,15 @@ class SVGString { public: // DOM wrapper class for the (DOM)SVGAnimatedString interface where the - // wrapped class is SVGString. + // wrapped class is SVGAnimatedString. struct DOMAnimatedString final : public mozilla::dom::DOMSVGAnimatedString { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMAnimatedString) - DOMAnimatedString(SVGString* aVal, SVGElement* aSVGElement) + DOMAnimatedString(SVGAnimatedString* aVal, SVGElement* aSVGElement) : mozilla::dom::DOMSVGAnimatedString(aSVGElement), mVal(aVal) {} - SVGString* mVal; // kept alive because it belongs to content + SVGAnimatedString* mVal; // kept alive because it belongs to content void GetBaseVal(nsAString& aResult) override { mVal->GetBaseValue(aResult, mSVGElement); @@ -87,13 +87,13 @@ class SVGString { }; struct SMILString : public SMILAttr { public: - SMILString(SVGString* aVal, SVGElement* aSVGElement) + SMILString(SVGAnimatedString* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a SMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. - SVGString* mVal; + SVGAnimatedString* mVal; SVGElement* mSVGElement; // SMILAttr methods diff --git a/dom/svg/SVGViewBox.cpp b/dom/svg/SVGAnimatedViewBox.cpp similarity index 73% rename from dom/svg/SVGViewBox.cpp rename to dom/svg/SVGAnimatedViewBox.cpp index 10d31b9a33b8..1c4ffef3d7fb 100644 --- a/dom/svg/SVGViewBox.cpp +++ b/dom/svg/SVGAnimatedViewBox.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "SVGViewBox.h" +#include "SVGAnimatedViewBox.h" #include "mozilla/Move.h" #include "mozilla/SMILValue.h" @@ -62,39 +62,39 @@ nsresult SVGViewBoxRect::FromString(const nsAString& aStr, return NS_OK; } -/* Cycle collection macros for SVGViewBox */ +/* Cycle collection macros for SVGAnimatedViewBox */ -NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGViewBox::DOMBaseVal, +NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedViewBox::DOMBaseVal, mSVGElement) -NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGViewBox::DOMAnimVal, +NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedViewBox::DOMAnimVal, mSVGElement) -NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGViewBox::DOMBaseVal) -NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGViewBox::DOMBaseVal) +NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedViewBox::DOMBaseVal) +NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedViewBox::DOMBaseVal) -NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGViewBox::DOMAnimVal) -NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGViewBox::DOMAnimVal) +NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedViewBox::DOMAnimVal) +NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedViewBox::DOMAnimVal) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGViewBox::DOMBaseVal) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimatedViewBox::DOMBaseVal) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGViewBox::DOMAnimVal) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimatedViewBox::DOMAnimVal) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END -static SVGAttrTearoffTable +static SVGAttrTearoffTable sBaseSVGViewBoxTearoffTable; -static SVGAttrTearoffTable +static SVGAttrTearoffTable sAnimSVGViewBoxTearoffTable; -SVGAttrTearoffTable - SVGViewBox::sSVGAnimatedRectTearoffTable; +SVGAttrTearoffTable + SVGAnimatedViewBox::sSVGAnimatedRectTearoffTable; -/* Implementation of SVGViewBox methods */ +/* Implementation of SVGAnimatedViewBox methods */ -void SVGViewBox::Init() { +void SVGAnimatedViewBox::Init() { mHasBaseVal = false; // We shouldn't use mBaseVal for rendering (its usages should be guarded with // "mHasBaseVal" checks), but just in case we do by accident, this will @@ -104,7 +104,7 @@ void SVGViewBox::Init() { mAnimVal = nullptr; } -bool SVGViewBox::HasRect() const { +bool SVGAnimatedViewBox::HasRect() const { // Check mAnimVal if we have one; otherwise, check mBaseVal if we have one; // otherwise, just return false (we clearly do not have a rect). const SVGViewBoxRect* rect = mAnimVal; @@ -119,8 +119,8 @@ bool SVGViewBox::HasRect() const { return !rect->none && rect->width >= 0 && rect->height >= 0; } -void SVGViewBox::SetAnimValue(const SVGViewBoxRect& aRect, - SVGElement* aSVGElement) { +void SVGAnimatedViewBox::SetAnimValue(const SVGViewBoxRect& aRect, + SVGElement* aSVGElement) { if (!mAnimVal) { // it's okay if allocation fails - and no point in reporting that mAnimVal = new SVGViewBoxRect(aRect); @@ -133,8 +133,8 @@ void SVGViewBox::SetAnimValue(const SVGViewBoxRect& aRect, aSVGElement->DidAnimateViewBox(); } -void SVGViewBox::SetBaseValue(const SVGViewBoxRect& aRect, - SVGElement* aSVGElement) { +void SVGAnimatedViewBox::SetBaseValue(const SVGViewBoxRect& aRect, + SVGElement* aSVGElement) { if (!mHasBaseVal || mBaseVal == aRect) { // This method is used to set a single x, y, width // or height value. It can't create a base value @@ -155,9 +155,9 @@ void SVGViewBox::SetBaseValue(const SVGViewBoxRect& aRect, } } -nsresult SVGViewBox::SetBaseValueString(const nsAString& aValue, - SVGElement* aSVGElement, - bool aDoSetAttr) { +nsresult SVGAnimatedViewBox::SetBaseValueString(const nsAString& aValue, + SVGElement* aSVGElement, + bool aDoSetAttr) { SVGViewBoxRect viewBox; nsresult rv = SVGViewBoxRect::FromString(aValue, &viewBox); @@ -185,7 +185,7 @@ nsresult SVGViewBox::SetBaseValueString(const nsAString& aValue, return NS_OK; } -void SVGViewBox::GetBaseValueString(nsAString& aValue) const { +void SVGAnimatedViewBox::GetBaseValueString(nsAString& aValue) const { if (mBaseVal.none) { aValue.AssignLiteral("none"); return; @@ -195,7 +195,7 @@ void SVGViewBox::GetBaseValueString(nsAString& aValue) const { (double)mBaseVal.height); } -already_AddRefed SVGViewBox::ToSVGAnimatedRect( +already_AddRefed SVGAnimatedViewBox::ToSVGAnimatedRect( SVGElement* aSVGElement) { RefPtr domAnimatedRect = sSVGAnimatedRectTearoffTable.GetTearoff(this); @@ -207,7 +207,8 @@ already_AddRefed SVGViewBox::ToSVGAnimatedRect( return domAnimatedRect.forget(); } -already_AddRefed SVGViewBox::ToDOMBaseVal(SVGElement* aSVGElement) { +already_AddRefed SVGAnimatedViewBox::ToDOMBaseVal( + SVGElement* aSVGElement) { if (!mHasBaseVal || mBaseVal.none) { return nullptr; } @@ -221,11 +222,12 @@ already_AddRefed SVGViewBox::ToDOMBaseVal(SVGElement* aSVGElement) { return domBaseVal.forget(); } -SVGViewBox::DOMBaseVal::~DOMBaseVal() { +SVGAnimatedViewBox::DOMBaseVal::~DOMBaseVal() { sBaseSVGViewBoxTearoffTable.RemoveTearoff(mVal); } -already_AddRefed SVGViewBox::ToDOMAnimVal(SVGElement* aSVGElement) { +already_AddRefed SVGAnimatedViewBox::ToDOMAnimVal( + SVGElement* aSVGElement) { if ((mAnimVal && mAnimVal->none) || (!mAnimVal && (!mHasBaseVal || mBaseVal.none))) { return nullptr; @@ -240,39 +242,40 @@ already_AddRefed SVGViewBox::ToDOMAnimVal(SVGElement* aSVGElement) { return domAnimVal.forget(); } -SVGViewBox::DOMAnimVal::~DOMAnimVal() { +SVGAnimatedViewBox::DOMAnimVal::~DOMAnimVal() { sAnimSVGViewBoxTearoffTable.RemoveTearoff(mVal); } -void SVGViewBox::DOMBaseVal::SetX(float aX, ErrorResult& aRv) { +void SVGAnimatedViewBox::DOMBaseVal::SetX(float aX, ErrorResult& aRv) { SVGViewBoxRect rect = mVal->GetBaseValue(); rect.x = aX; mVal->SetBaseValue(rect, mSVGElement); } -void SVGViewBox::DOMBaseVal::SetY(float aY, ErrorResult& aRv) { +void SVGAnimatedViewBox::DOMBaseVal::SetY(float aY, ErrorResult& aRv) { SVGViewBoxRect rect = mVal->GetBaseValue(); rect.y = aY; mVal->SetBaseValue(rect, mSVGElement); } -void SVGViewBox::DOMBaseVal::SetWidth(float aWidth, ErrorResult& aRv) { +void SVGAnimatedViewBox::DOMBaseVal::SetWidth(float aWidth, ErrorResult& aRv) { SVGViewBoxRect rect = mVal->GetBaseValue(); rect.width = aWidth; mVal->SetBaseValue(rect, mSVGElement); } -void SVGViewBox::DOMBaseVal::SetHeight(float aHeight, ErrorResult& aRv) { +void SVGAnimatedViewBox::DOMBaseVal::SetHeight(float aHeight, + ErrorResult& aRv) { SVGViewBoxRect rect = mVal->GetBaseValue(); rect.height = aHeight; mVal->SetBaseValue(rect, mSVGElement); } -UniquePtr SVGViewBox::ToSMILAttr(SVGElement* aSVGElement) { +UniquePtr SVGAnimatedViewBox::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } -nsresult SVGViewBox::SMILViewBox ::ValueFromString( +nsresult SVGAnimatedViewBox::SMILViewBox ::ValueFromString( const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/, SMILValue& aValue, bool& aPreventCachingOfSandwich) const { SVGViewBoxRect viewBox; @@ -288,20 +291,21 @@ nsresult SVGViewBox::SMILViewBox ::ValueFromString( return NS_OK; } -SMILValue SVGViewBox::SMILViewBox::GetBaseValue() const { +SMILValue SVGAnimatedViewBox::SMILViewBox::GetBaseValue() const { SMILValue val(&SVGViewBoxSMILType::sSingleton); *static_cast(val.mU.mPtr) = mVal->mBaseVal; return val; } -void SVGViewBox::SMILViewBox::ClearAnimValue() { +void SVGAnimatedViewBox::SMILViewBox::ClearAnimValue() { if (mVal->mAnimVal) { mVal->mAnimVal = nullptr; mSVGElement->DidAnimateViewBox(); } } -nsresult SVGViewBox::SMILViewBox::SetAnimValue(const SMILValue& aValue) { +nsresult SVGAnimatedViewBox::SMILViewBox::SetAnimValue( + const SMILValue& aValue) { NS_ASSERTION(aValue.mType == &SVGViewBoxSMILType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SVGViewBoxSMILType::sSingleton) { diff --git a/dom/svg/SVGViewBox.h b/dom/svg/SVGAnimatedViewBox.h similarity index 92% rename from dom/svg/SVGViewBox.h rename to dom/svg/SVGAnimatedViewBox.h index 097731cca5b8..681b0c7c6e02 100644 --- a/dom/svg/SVGViewBox.h +++ b/dom/svg/SVGAnimatedViewBox.h @@ -45,7 +45,7 @@ struct SVGViewBoxRect { static nsresult FromString(const nsAString& aStr, SVGViewBoxRect* aViewBox); }; -class SVGViewBox { +class SVGAnimatedViewBox { public: typedef mozilla::dom::SVGElement SVGElement; @@ -104,10 +104,10 @@ class SVGViewBox { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMBaseVal) - DOMBaseVal(SVGViewBox* aVal, SVGElement* aSVGElement) + DOMBaseVal(SVGAnimatedViewBox* aVal, SVGElement* aSVGElement) : mozilla::dom::SVGIRect(), mVal(aVal), mSVGElement(aSVGElement) {} - SVGViewBox* mVal; // kept alive because it belongs to content + SVGAnimatedViewBox* mVal; // kept alive because it belongs to content RefPtr mSVGElement; float X() const final { return mVal->GetBaseValue().x; } @@ -133,10 +133,10 @@ class SVGViewBox { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMAnimVal) - DOMAnimVal(SVGViewBox* aVal, SVGElement* aSVGElement) + DOMAnimVal(SVGAnimatedViewBox* aVal, SVGElement* aSVGElement) : mozilla::dom::SVGIRect(), mVal(aVal), mSVGElement(aSVGElement) {} - SVGViewBox* mVal; // kept alive because it belongs to content + SVGAnimatedViewBox* mVal; // kept alive because it belongs to content RefPtr mSVGElement; // Script may have modified animation parameters or timeline -- DOM getters @@ -185,13 +185,13 @@ class SVGViewBox { struct SMILViewBox : public SMILAttr { public: - SMILViewBox(SVGViewBox* aVal, SVGElement* aSVGElement) + SMILViewBox(SVGAnimatedViewBox* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a SMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. - SVGViewBox* mVal; + SVGAnimatedViewBox* mVal; SVGElement* mSVGElement; // SMILAttr methods @@ -204,7 +204,7 @@ class SVGViewBox { virtual nsresult SetAnimValue(const SMILValue& aValue) override; }; - static SVGAttrTearoffTable + static SVGAttrTearoffTable sSVGAnimatedRectTearoffTable; }; diff --git a/dom/svg/SVGAttrValueWrapper.cpp b/dom/svg/SVGAttrValueWrapper.cpp index dd91b56c501f..022f77925ee3 100644 --- a/dom/svg/SVGAttrValueWrapper.cpp +++ b/dom/svg/SVGAttrValueWrapper.cpp @@ -7,28 +7,28 @@ #include "SVGAttrValueWrapper.h" #include "SVGAnimatedPreserveAspectRatio.h" -#include "SVGIntegerPair.h" +#include "SVGAnimatedIntegerPair.h" #include "nsSVGLength2.h" #include "SVGLengthList.h" -#include "SVGNumberPair.h" +#include "SVGAnimatedNumberPair.h" #include "SVGNumberList.h" -#include "SVGOrient.h" +#include "SVGAnimatedOrient.h" +#include "SVGAnimatedViewBox.h" #include "SVGPathData.h" #include "SVGPointList.h" #include "SVGStringList.h" #include "SVGTransformList.h" -#include "SVGViewBox.h" namespace mozilla { /*static*/ -void SVGAttrValueWrapper::ToString(const SVGOrient* aOrient, +void SVGAttrValueWrapper::ToString(const SVGAnimatedOrient* aOrient, nsAString& aResult) { aOrient->GetBaseValueString(aResult); } /*static*/ -void SVGAttrValueWrapper::ToString(const SVGIntegerPair* aIntegerPair, +void SVGAttrValueWrapper::ToString(const SVGAnimatedIntegerPair* aIntegerPair, nsAString& aResult) { aIntegerPair->GetBaseValueString(aResult); } @@ -52,7 +52,7 @@ void SVGAttrValueWrapper::ToString(const SVGNumberList* aNumberList, } /*static*/ -void SVGAttrValueWrapper::ToString(const SVGNumberPair* aNumberPair, +void SVGAttrValueWrapper::ToString(const SVGAnimatedNumberPair* aNumberPair, nsAString& aResult) { aNumberPair->GetBaseValueString(aResult); } @@ -89,7 +89,7 @@ void SVGAttrValueWrapper::ToString(const SVGTransformList* aTransformList, } /*static*/ -void SVGAttrValueWrapper::ToString(const SVGViewBox* aViewBox, +void SVGAttrValueWrapper::ToString(const SVGAnimatedViewBox* aViewBox, nsAString& aResult) { aViewBox->GetBaseValueString(aResult); } diff --git a/dom/svg/SVGAttrValueWrapper.h b/dom/svg/SVGAttrValueWrapper.h index de2049f78024..0eb568a9fdfe 100644 --- a/dom/svg/SVGAttrValueWrapper.h +++ b/dom/svg/SVGAttrValueWrapper.h @@ -17,26 +17,29 @@ class nsSVGLength2; namespace mozilla { -class SVGIntegerPair; +class SVGAnimatedIntegerPair; +class SVGAnimatedNumberPair; +class SVGAnimatedOrient; +class SVGAnimatedPreserveAspectRatio; +class SVGAnimatedViewBox; class SVGLengthList; class SVGNumberList; -class SVGNumberPair; -class SVGOrient; class SVGPathData; class SVGPointList; -class SVGAnimatedPreserveAspectRatio; class SVGStringList; class SVGTransformList; -class SVGViewBox; class SVGAttrValueWrapper { public: - static void ToString(const SVGOrient* aAngle, nsAString& aResult); - static void ToString(const SVGIntegerPair* aIntegerPair, nsAString& aResult); + static void ToString(const SVGAnimatedIntegerPair* aIntegerPair, + nsAString& aResult); + static void ToString(const SVGAnimatedNumberPair* aNumberPair, + nsAString& aResult); + static void ToString(const SVGAnimatedOrient* aOrient, nsAString& aResult); static void ToString(const nsSVGLength2* aLength, nsAString& aResult); + static void ToString(const SVGAnimatedViewBox* aViewBox, nsAString& aResult); static void ToString(const SVGLengthList* aLengthList, nsAString& aResult); static void ToString(const SVGNumberList* aNumberList, nsAString& aResult); - static void ToString(const SVGNumberPair* aNumberPair, nsAString& aResult); static void ToString(const SVGPathData* aPathData, nsAString& aResult); static void ToString(const SVGPointList* aPointList, nsAString& aResult); static void ToString( @@ -45,7 +48,6 @@ class SVGAttrValueWrapper { static void ToString(const SVGStringList* aStringList, nsAString& aResult); static void ToString(const SVGTransformList* aTransformList, nsAString& aResult); - static void ToString(const SVGViewBox* aViewBox, nsAString& aResult); }; } /* namespace mozilla */ diff --git a/dom/svg/SVGClipPathElement.h b/dom/svg/SVGClipPathElement.h index 9057d78d1146..d11c829277d4 100644 --- a/dom/svg/SVGClipPathElement.h +++ b/dom/svg/SVGClipPathElement.h @@ -7,7 +7,7 @@ #ifndef mozilla_dom_SVGClipPathElement_h #define mozilla_dom_SVGClipPathElement_h -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "mozilla/dom/SVGTransformableElement.h" class nsSVGClipPathFrame; @@ -44,7 +44,7 @@ class SVGClipPathElement final : public SVGClipPathElementBase { protected: enum { CLIPPATHUNITS }; - SVGEnum mEnumAttributes[1]; + SVGAnimatedEnumeration mEnumAttributes[1]; static EnumInfo sEnumInfo[1]; virtual EnumAttributesInfo GetEnumInfo() override; diff --git a/dom/svg/SVGComponentTransferFunctionElement.h b/dom/svg/SVGComponentTransferFunctionElement.h index e7034d03b544..d76efede2146 100644 --- a/dom/svg/SVGComponentTransferFunctionElement.h +++ b/dom/svg/SVGComponentTransferFunctionElement.h @@ -8,7 +8,7 @@ #define mozilla_dom_SVGComponentTransferFunctionElement_h #include "SVGAnimatedNumberList.h" -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "SVGFilters.h" #include "nsSVGNumber2.h" @@ -78,7 +78,7 @@ class SVGComponentTransferFunctionElement static NumberInfo sNumberInfo[5]; enum { TYPE }; - SVGEnum mEnumAttributes[1]; + SVGAnimatedEnumeration mEnumAttributes[1]; static SVGEnumMapping sTypeMap[]; static EnumInfo sEnumInfo[1]; }; diff --git a/dom/svg/SVGElement.cpp b/dom/svg/SVGElement.cpp index 7104b28f5fd8..636e591358f5 100644 --- a/dom/svg/SVGElement.cpp +++ b/dom/svg/SVGElement.cpp @@ -43,17 +43,17 @@ #include "SVGAnimatedPointList.h" #include "SVGAnimatedPathSegList.h" #include "SVGAnimatedTransformList.h" -#include "SVGBoolean.h" -#include "SVGEnum.h" -#include "SVGInteger.h" -#include "SVGIntegerPair.h" +#include "SVGAnimatedBoolean.h" +#include "SVGAnimatedEnumeration.h" +#include "SVGAnimatedInteger.h" +#include "SVGAnimatedIntegerPair.h" #include "nsSVGLength2.h" -#include "SVGMotionSMILAttr.h" #include "nsSVGNumber2.h" -#include "SVGNumberPair.h" -#include "SVGOrient.h" -#include "SVGString.h" -#include "SVGViewBox.h" +#include "SVGAnimatedNumberPair.h" +#include "SVGAnimatedOrient.h" +#include "SVGAnimatedString.h" +#include "SVGAnimatedViewBox.h" +#include "SVGMotionSMILAttr.h" #include // This is needed to ensure correct handling of calls to the @@ -173,13 +173,13 @@ nsresult SVGElement::Init() { enumInfo.Reset(i); } - SVGOrient* orient = GetOrient(); + SVGAnimatedOrient* orient = GetOrient(); if (orient) { orient->Init(); } - SVGViewBox* viewBox = GetViewBox(); + SVGAnimatedViewBox* viewBox = GetViewBox(); if (viewBox) { viewBox->Init(); @@ -408,7 +408,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, } if (!foundMatch) { - // Check for SVGNumberPair attribute + // Check for SVGAnimatedNumberPair attribute NumberPairAttributesInfo numberPairInfo = GetNumberPairInfo(); for (i = 0; i < numberPairInfo.mNumberPairCount; i++) { if (aAttribute == numberPairInfo.mNumberPairInfo[i].mName) { @@ -426,7 +426,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, } if (!foundMatch) { - // Check for SVGInteger attribute + // Check for SVGAnimatedInteger attribute IntegerAttributesInfo integerInfo = GetIntegerInfo(); for (i = 0; i < integerInfo.mIntegerCount; i++) { if (aAttribute == integerInfo.mIntegerInfo[i].mName) { @@ -444,7 +444,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, } if (!foundMatch) { - // Check for SVGIntegerPair attribute + // Check for SVGAnimatedIntegerPair attribute IntegerPairAttributesInfo integerPairInfo = GetIntegerPairInfo(); for (i = 0; i < integerPairInfo.mIntegerPairCount; i++) { if (aAttribute == integerPairInfo.mIntegerPairInfo[i].mName) { @@ -463,7 +463,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, } if (!foundMatch) { - // Check for SVGBoolean attribute + // Check for SVGAnimatedBoolean attribute BooleanAttributesInfo booleanInfo = GetBooleanInfo(); for (i = 0; i < booleanInfo.mBooleanCount; i++) { if (aAttribute == booleanInfo.mBooleanInfo[i].mName) { @@ -484,7 +484,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, } if (!foundMatch) { - // Check for SVGEnum attribute + // Check for SVGAnimatedEnumeration attribute EnumAttributesInfo enumInfo = GetEnumInfo(); for (i = 0; i < enumInfo.mEnumCount; i++) { if (aAttribute == enumInfo.mEnumInfo[i].mName) { @@ -532,7 +532,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, if (!foundMatch) { // Check for orient attribute if (aAttribute == nsGkAtoms::orient) { - SVGOrient* orient = GetOrient(); + SVGAnimatedOrient* orient = GetOrient(); if (orient) { rv = orient->SetBaseValueString(aValue, this, false); if (NS_FAILED(rv)) { @@ -543,9 +543,9 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, } foundMatch = true; } - // Check for SVGViewBox attribute + // Check for viewBox attribute } else if (aAttribute == nsGkAtoms::viewBox) { - SVGViewBox* viewBox = GetViewBox(); + SVGAnimatedViewBox* viewBox = GetViewBox(); if (viewBox) { rv = viewBox->SetBaseValueString(aValue, this, false); if (NS_FAILED(rv)) { @@ -556,7 +556,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, } foundMatch = true; } - // Check for SVGAnimatedPreserveAspectRatio attribute + // Check for preserveAspectRatio attribute } else if (aAttribute == nsGkAtoms::preserveAspectRatio) { SVGAnimatedPreserveAspectRatio* preserveAspectRatio = GetPreserveAspectRatio(); @@ -603,7 +603,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, } if (!foundMatch) { - // Check for SVGString attribute + // Check for SVGAnimatedString attribute StringAttributesInfo stringInfo = GetStringInfo(); for (uint32_t i = 0; i < stringInfo.mStringCount; i++) { if (aNamespaceID == stringInfo.mStringInfo[i].mNamespaceID && @@ -768,7 +768,7 @@ void SVGElement::UnsetAttrInternal(int32_t aNamespaceID, nsAtom* aName, // Check if this is an orient attribute going away if (aName == nsGkAtoms::orient) { - SVGOrient* orient = GetOrient(); + SVGAnimatedOrient* orient = GetOrient(); if (orient) { MaybeSerializeAttrBeforeRemoval(aName, aNotify); orient->Init(); @@ -778,7 +778,7 @@ void SVGElement::UnsetAttrInternal(int32_t aNamespaceID, nsAtom* aName, // Check if this is a viewBox attribute going away if (aName == nsGkAtoms::viewBox) { - SVGViewBox* viewBox = GetViewBox(); + SVGAnimatedViewBox* viewBox = GetViewBox(); if (viewBox) { MaybeSerializeAttrBeforeRemoval(aName, aNotify); viewBox->Init(); @@ -1885,14 +1885,14 @@ void SVGElement::DidAnimateEnum(uint8_t aAttrEnum) { } } -SVGOrient* SVGElement::GetOrient() { return nullptr; } +SVGAnimatedOrient* SVGElement::GetOrient() { return nullptr; } nsAttrValue SVGElement::WillChangeOrient() { return WillChangeValue(nsGkAtoms::orient); } void SVGElement::DidChangeOrient(const nsAttrValue& aEmptyOrOldValue) { - SVGOrient* orient = GetOrient(); + SVGAnimatedOrient* orient = GetOrient(); NS_ASSERTION(orient, "DidChangeOrient on element with no orient attrib"); @@ -1911,14 +1911,14 @@ void SVGElement::DidAnimateOrient() { } } -SVGViewBox* SVGElement::GetViewBox() { return nullptr; } +SVGAnimatedViewBox* SVGElement::GetViewBox() { return nullptr; } nsAttrValue SVGElement::WillChangeViewBox() { return WillChangeValue(nsGkAtoms::viewBox); } void SVGElement::DidChangeViewBox(const nsAttrValue& aEmptyOrOldValue) { - SVGViewBox* viewBox = GetViewBox(); + SVGAnimatedViewBox* viewBox = GetViewBox(); NS_ASSERTION(viewBox, "DidChangeViewBox on element with no viewBox attrib"); @@ -2222,13 +2222,13 @@ UniquePtr SVGElement::GetAnimatedAttr(int32_t aNamespaceID, // orient: if (aName == nsGkAtoms::orient) { - SVGOrient* orient = GetOrient(); + SVGAnimatedOrient* orient = GetOrient(); return orient ? orient->ToSMILAttr(this) : nullptr; } // viewBox: if (aName == nsGkAtoms::viewBox) { - SVGViewBox* viewBox = GetViewBox(); + SVGAnimatedViewBox* viewBox = GetViewBox(); return viewBox ? viewBox->ToSMILAttr(this) : nullptr; } diff --git a/dom/svg/SVGElement.h b/dom/svg/SVGElement.h index f010071777d4..8630b6c80bd2 100644 --- a/dom/svg/SVGElement.h +++ b/dom/svg/SVGElement.h @@ -17,7 +17,7 @@ #include "mozilla/SVGContentUtils.h" #include "mozilla/dom/DOMRect.h" #include "mozilla/dom/Element.h" -#include "mozilla/dom/SVGClass.h" +#include "mozilla/dom/SVGAnimatedClass.h" #include "mozilla/gfx/MatrixFwd.h" #include "nsAutoPtr.h" #include "nsChangeHint.h" @@ -36,24 +36,24 @@ nsresult NS_NewSVGElement(mozilla::dom::Element** aResult, namespace mozilla { class DeclarationBlock; +class DOMSVGStringList; +class SVGAnimatedBoolean; +class SVGAnimatedEnumeration; +class SVGAnimatedInteger; +class SVGAnimatedIntegerPair; +class SVGAnimatedLengthList; class SVGAnimatedNumberList; +class SVGAnimatedNumberPair; +class SVGAnimatedOrient; class SVGAnimatedPathSegList; class SVGAnimatedPointList; +class SVGAnimatedString; class SVGAnimatedPreserveAspectRatio; class SVGAnimatedTransformList; -class SVGAnimatedLengthList; -class SVGBoolean; -class SVGEnum; -class SVGUserUnitList; -class SVGInteger; -class SVGIntegerPair; +class SVGAnimatedViewBox; class SVGNumberList; -class SVGNumberPair; -class SVGOrient; -class SVGString; class SVGStringList; -class DOMSVGStringList; -class SVGViewBox; +class SVGUserUnitList; struct SVGEnumMapping; @@ -376,11 +376,11 @@ class SVGElement : public SVGElementBase // nsIContent }; struct NumberPairAttributesInfo { - SVGNumberPair* const mNumberPairs; + SVGAnimatedNumberPair* const mNumberPairs; const NumberPairInfo* const mNumberPairInfo; const uint32_t mNumberPairCount; - NumberPairAttributesInfo(SVGNumberPair* aNumberPairs, + NumberPairAttributesInfo(SVGAnimatedNumberPair* aNumberPairs, NumberPairInfo* aNumberPairInfo, uint32_t aNumberPairCount) : mNumberPairs(aNumberPairs), @@ -396,12 +396,12 @@ class SVGElement : public SVGElementBase // nsIContent }; struct IntegerAttributesInfo { - SVGInteger* const mIntegers; + SVGAnimatedInteger* const mIntegers; const IntegerInfo* const mIntegerInfo; const uint32_t mIntegerCount; - IntegerAttributesInfo(SVGInteger* aIntegers, IntegerInfo* aIntegerInfo, - uint32_t aIntegerCount) + IntegerAttributesInfo(SVGAnimatedInteger* aIntegers, + IntegerInfo* aIntegerInfo, uint32_t aIntegerCount) : mIntegers(aIntegers), mIntegerInfo(aIntegerInfo), mIntegerCount(aIntegerCount) {} @@ -416,11 +416,11 @@ class SVGElement : public SVGElementBase // nsIContent }; struct IntegerPairAttributesInfo { - SVGIntegerPair* const mIntegerPairs; + SVGAnimatedIntegerPair* const mIntegerPairs; const IntegerPairInfo* const mIntegerPairInfo; const uint32_t mIntegerPairCount; - IntegerPairAttributesInfo(SVGIntegerPair* aIntegerPairs, + IntegerPairAttributesInfo(SVGAnimatedIntegerPair* aIntegerPairs, IntegerPairInfo* aIntegerPairInfo, uint32_t aIntegerPairCount) : mIntegerPairs(aIntegerPairs), @@ -436,12 +436,12 @@ class SVGElement : public SVGElementBase // nsIContent }; struct BooleanAttributesInfo { - SVGBoolean* const mBooleans; + SVGAnimatedBoolean* const mBooleans; const BooleanInfo* const mBooleanInfo; const uint32_t mBooleanCount; - BooleanAttributesInfo(SVGBoolean* aBooleans, BooleanInfo* aBooleanInfo, - uint32_t aBooleanCount) + BooleanAttributesInfo(SVGAnimatedBoolean* aBooleans, + BooleanInfo* aBooleanInfo, uint32_t aBooleanCount) : mBooleans(aBooleans), mBooleanInfo(aBooleanInfo), mBooleanCount(aBooleanCount) {} @@ -449,7 +449,7 @@ class SVGElement : public SVGElementBase // nsIContent void Reset(uint8_t aAttrEnum); }; - friend class mozilla::SVGEnum; + friend class mozilla::SVGAnimatedEnumeration; struct EnumInfo { nsStaticAtom* const mName; @@ -458,11 +458,11 @@ class SVGElement : public SVGElementBase // nsIContent }; struct EnumAttributesInfo { - SVGEnum* const mEnums; + SVGAnimatedEnumeration* const mEnums; const EnumInfo* const mEnumInfo; const uint32_t mEnumCount; - EnumAttributesInfo(SVGEnum* aEnums, EnumInfo* aEnumInfo, + EnumAttributesInfo(SVGAnimatedEnumeration* aEnums, EnumInfo* aEnumInfo, uint32_t aEnumCount) : mEnums(aEnums), mEnumInfo(aEnumInfo), mEnumCount(aEnumCount) {} @@ -525,11 +525,11 @@ class SVGElement : public SVGElementBase // nsIContent }; struct StringAttributesInfo { - SVGString* const mStrings; + SVGAnimatedString* const mStrings; const StringInfo* const mStringInfo; const uint32_t mStringCount; - StringAttributesInfo(SVGString* aStrings, StringInfo* aStringInfo, + StringAttributesInfo(SVGAnimatedString* aStrings, StringInfo* aStringInfo, uint32_t aStringCount) : mStrings(aStrings), mStringInfo(aStringInfo), @@ -568,9 +568,9 @@ class SVGElement : public SVGElementBase // nsIContent virtual EnumAttributesInfo GetEnumInfo(); // We assume all orients, viewboxes and preserveAspectRatios are alike // so we don't need to wrap the class - virtual SVGOrient* GetOrient(); - virtual SVGViewBox* GetViewBox(); + virtual SVGAnimatedOrient* GetOrient(); virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio(); + virtual SVGAnimatedViewBox* GetViewBox(); virtual NumberListAttributesInfo GetNumberListInfo(); virtual LengthListAttributesInfo GetLengthListInfo(); virtual StringAttributesInfo GetStringInfo(); @@ -582,7 +582,7 @@ class SVGElement : public SVGElementBase // nsIContent void UnsetAttrInternal(int32_t aNameSpaceID, nsAtom* aAttribute, bool aNotify); - SVGClass mClassAttribute; + SVGAnimatedClass mClassAttribute; nsAutoPtr mClassAnimAttr; RefPtr mContentDeclarationBlock; }; diff --git a/dom/svg/SVGFEBlendElement.h b/dom/svg/SVGFEBlendElement.h index bf4b6351d929..dce996539a77 100644 --- a/dom/svg/SVGFEBlendElement.h +++ b/dom/svg/SVGFEBlendElement.h @@ -7,7 +7,7 @@ #ifndef mozilla_dom_SVGFEBlendElement_h #define mozilla_dom_SVGFEBlendElement_h -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "SVGFilters.h" nsresult NS_NewSVGFEBlendElement( @@ -36,7 +36,7 @@ class SVGFEBlendElement : public SVGFEBlendElementBase { nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -53,12 +53,12 @@ class SVGFEBlendElement : public SVGFEBlendElementBase { virtual StringAttributesInfo GetStringInfo() override; enum { MODE }; - SVGEnum mEnumAttributes[1]; + SVGAnimatedEnumeration mEnumAttributes[1]; static SVGEnumMapping sModeMap[]; static EnumInfo sEnumInfo[1]; enum { RESULT, IN1, IN2 }; - SVGString mStringAttributes[3]; + SVGAnimatedString mStringAttributes[3]; static StringInfo sStringInfo[3]; }; diff --git a/dom/svg/SVGFEColorMatrixElement.h b/dom/svg/SVGFEColorMatrixElement.h index ebb5facb4c98..ad325f6231b6 100644 --- a/dom/svg/SVGFEColorMatrixElement.h +++ b/dom/svg/SVGFEColorMatrixElement.h @@ -8,7 +8,7 @@ #define mozilla_dom_SVGFEColorMatrixElement_h #include "SVGAnimatedNumberList.h" -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "SVGFilters.h" nsresult NS_NewSVGFEColorMatrixElement( @@ -40,7 +40,7 @@ class SVGFEColorMatrixElement : public SVGFEColorMatrixElementBase { nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -58,12 +58,12 @@ class SVGFEColorMatrixElement : public SVGFEColorMatrixElementBase { virtual NumberListAttributesInfo GetNumberListInfo() override; enum { TYPE }; - SVGEnum mEnumAttributes[1]; + SVGAnimatedEnumeration mEnumAttributes[1]; static SVGEnumMapping sTypeMap[]; static EnumInfo sEnumInfo[1]; enum { RESULT, IN1 }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; enum { VALUES }; diff --git a/dom/svg/SVGFEComponentTransferElement.h b/dom/svg/SVGFEComponentTransferElement.h index 63d25e3d3ff5..21bf342b5ff0 100644 --- a/dom/svg/SVGFEComponentTransferElement.h +++ b/dom/svg/SVGFEComponentTransferElement.h @@ -36,7 +36,7 @@ class SVGFEComponentTransferElement : public SVGFEComponentTransferElementBase { nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -51,7 +51,7 @@ class SVGFEComponentTransferElement : public SVGFEComponentTransferElementBase { virtual StringAttributesInfo GetStringInfo() override; enum { RESULT, IN1 }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; }; diff --git a/dom/svg/SVGFECompositeElement.h b/dom/svg/SVGFECompositeElement.h index fc948aacf7b1..9ee73e0be400 100644 --- a/dom/svg/SVGFECompositeElement.h +++ b/dom/svg/SVGFECompositeElement.h @@ -7,7 +7,7 @@ #ifndef mozilla_dom_SVGFECompositeElement_h #define mozilla_dom_SVGFECompositeElement_h -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "SVGFilters.h" #include "nsSVGNumber2.h" @@ -38,7 +38,7 @@ class SVGFECompositeElement : public SVGFECompositeElementBase { nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -65,12 +65,12 @@ class SVGFECompositeElement : public SVGFECompositeElementBase { static NumberInfo sNumberInfo[4]; enum { OPERATOR }; - SVGEnum mEnumAttributes[1]; + SVGAnimatedEnumeration mEnumAttributes[1]; static SVGEnumMapping sOperatorMap[]; static EnumInfo sEnumInfo[1]; enum { RESULT, IN1, IN2 }; - SVGString mStringAttributes[3]; + SVGAnimatedString mStringAttributes[3]; static StringInfo sStringInfo[3]; }; diff --git a/dom/svg/SVGFEConvolveMatrixElement.cpp b/dom/svg/SVGFEConvolveMatrixElement.cpp index 5e7688ec6fd0..deba06bbf4a6 100644 --- a/dom/svg/SVGFEConvolveMatrixElement.cpp +++ b/dom/svg/SVGFEConvolveMatrixElement.cpp @@ -68,12 +68,12 @@ already_AddRefed SVGFEConvolveMatrixElement::In1() { already_AddRefed SVGFEConvolveMatrixElement::OrderX() { return mIntegerPairAttributes[ORDER].ToDOMAnimatedInteger( - SVGIntegerPair::eFirst, this); + SVGAnimatedIntegerPair::eFirst, this); } already_AddRefed SVGFEConvolveMatrixElement::OrderY() { return mIntegerPairAttributes[ORDER].ToDOMAnimatedInteger( - SVGIntegerPair::eSecond, this); + SVGAnimatedIntegerPair::eSecond, this); } already_AddRefed @@ -111,13 +111,13 @@ already_AddRefed SVGFEConvolveMatrixElement::Bias() { already_AddRefed SVGFEConvolveMatrixElement::KernelUnitLengthX() { return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber( - SVGNumberPair::eFirst, this); + SVGAnimatedNumberPair::eFirst, this); } already_AddRefed SVGFEConvolveMatrixElement::KernelUnitLengthY() { return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber( - SVGNumberPair::eSecond, this); + SVGAnimatedNumberPair::eSecond, this); } void SVGFEConvolveMatrixElement::GetSourceImageNames( @@ -135,10 +135,10 @@ FilterPrimitiveDescription SVGFEConvolveMatrixElement::GetPrimitiveDescription( mNumberListAttributes[KERNELMATRIX].GetAnimValue(); uint32_t kmLength = kernelMatrix.Length(); - int32_t orderX = - mIntegerPairAttributes[ORDER].GetAnimValue(SVGIntegerPair::eFirst); - int32_t orderY = - mIntegerPairAttributes[ORDER].GetAnimValue(SVGIntegerPair::eSecond); + int32_t orderX = mIntegerPairAttributes[ORDER].GetAnimValue( + SVGAnimatedIntegerPair::eFirst); + int32_t orderY = mIntegerPairAttributes[ORDER].GetAnimValue( + SVGAnimatedIntegerPair::eSecond); if (orderX <= 0 || orderY <= 0 || static_cast(orderX * orderY) != kmLength) { diff --git a/dom/svg/SVGFEConvolveMatrixElement.h b/dom/svg/SVGFEConvolveMatrixElement.h index a2fa8b352204..70a16c02495a 100644 --- a/dom/svg/SVGFEConvolveMatrixElement.h +++ b/dom/svg/SVGFEConvolveMatrixElement.h @@ -8,14 +8,15 @@ #define mozilla_dom_SVGFEConvolveMatrixElement_h #include "DOMSVGAnimatedNumberList.h" +#include "SVGAnimatedBoolean.h" +#include "SVGAnimatedEnumeration.h" +#include "SVGAnimatedInteger.h" +#include "SVGAnimatedIntegerPair.h" #include "SVGAnimatedNumberList.h" -#include "SVGBoolean.h" -#include "SVGEnum.h" -#include "SVGFilters.h" -#include "SVGInteger.h" -#include "SVGIntegerPair.h" #include "nsSVGNumber2.h" -#include "SVGString.h" +#include "SVGAnimatedString.h" +#include "SVGAnimatedNumberList.h" +#include "SVGFilters.h" nsresult NS_NewSVGFEConvolveMatrixElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); @@ -47,7 +48,7 @@ class SVGFEConvolveMatrixElement : public SVGFEConvolveMatrixElementBase { nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -83,28 +84,28 @@ class SVGFEConvolveMatrixElement : public SVGFEConvolveMatrixElementBase { static NumberInfo sNumberInfo[2]; enum { KERNEL_UNIT_LENGTH }; - SVGNumberPair mNumberPairAttributes[1]; + SVGAnimatedNumberPair mNumberPairAttributes[1]; static NumberPairInfo sNumberPairInfo[1]; enum { TARGET_X, TARGET_Y }; - SVGInteger mIntegerAttributes[2]; + SVGAnimatedInteger mIntegerAttributes[2]; static IntegerInfo sIntegerInfo[2]; enum { ORDER }; - SVGIntegerPair mIntegerPairAttributes[1]; + SVGAnimatedIntegerPair mIntegerPairAttributes[1]; static IntegerPairInfo sIntegerPairInfo[1]; enum { PRESERVEALPHA }; - SVGBoolean mBooleanAttributes[1]; + SVGAnimatedBoolean mBooleanAttributes[1]; static BooleanInfo sBooleanInfo[1]; enum { EDGEMODE }; - SVGEnum mEnumAttributes[1]; + SVGAnimatedEnumeration mEnumAttributes[1]; static SVGEnumMapping sEdgeModeMap[]; static EnumInfo sEnumInfo[1]; enum { RESULT, IN1 }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; enum { KERNELMATRIX }; diff --git a/dom/svg/SVGFEDiffuseLightingElement.cpp b/dom/svg/SVGFEDiffuseLightingElement.cpp index 40b209f6b587..296721837a18 100644 --- a/dom/svg/SVGFEDiffuseLightingElement.cpp +++ b/dom/svg/SVGFEDiffuseLightingElement.cpp @@ -45,13 +45,13 @@ SVGFEDiffuseLightingElement::DiffuseConstant() { already_AddRefed SVGFEDiffuseLightingElement::KernelUnitLengthX() { return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber( - SVGNumberPair::eFirst, this); + SVGAnimatedNumberPair::eFirst, this); } already_AddRefed SVGFEDiffuseLightingElement::KernelUnitLengthY() { return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber( - SVGNumberPair::eSecond, this); + SVGAnimatedNumberPair::eSecond, this); } FilterPrimitiveDescription SVGFEDiffuseLightingElement::GetPrimitiveDescription( diff --git a/dom/svg/SVGFEDisplacementMapElement.h b/dom/svg/SVGFEDisplacementMapElement.h index 967f7ea87587..77ca0f1c67bf 100644 --- a/dom/svg/SVGFEDisplacementMapElement.h +++ b/dom/svg/SVGFEDisplacementMapElement.h @@ -7,7 +7,7 @@ #ifndef mozilla_dom_SVGFEDisplacementMapElement_h #define mozilla_dom_SVGFEDisplacementMapElement_h -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "SVGFilters.h" nsresult NS_NewSVGFEDisplacementMapElement( @@ -36,7 +36,7 @@ class SVGFEDisplacementMapElement : public SVGFEDisplacementMapElementBase { nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -74,12 +74,12 @@ class SVGFEDisplacementMapElement : public SVGFEDisplacementMapElementBase { static NumberInfo sNumberInfo[1]; enum { CHANNEL_X, CHANNEL_Y }; - SVGEnum mEnumAttributes[2]; + SVGAnimatedEnumeration mEnumAttributes[2]; static SVGEnumMapping sChannelMap[]; static EnumInfo sEnumInfo[2]; enum { RESULT, IN1, IN2 }; - SVGString mStringAttributes[3]; + SVGAnimatedString mStringAttributes[3]; static StringInfo sStringInfo[3]; }; diff --git a/dom/svg/SVGFEDropShadowElement.cpp b/dom/svg/SVGFEDropShadowElement.cpp index 7fc27dbf05d8..b457da9d14be 100644 --- a/dom/svg/SVGFEDropShadowElement.cpp +++ b/dom/svg/SVGFEDropShadowElement.cpp @@ -52,12 +52,12 @@ already_AddRefed SVGFEDropShadowElement::Dy() { already_AddRefed SVGFEDropShadowElement::StdDeviationX() { return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber( - SVGNumberPair::eFirst, this); + SVGAnimatedNumberPair::eFirst, this); } already_AddRefed SVGFEDropShadowElement::StdDeviationY() { return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber( - SVGNumberPair::eSecond, this); + SVGAnimatedNumberPair::eSecond, this); } void SVGFEDropShadowElement::SetStdDeviation(float stdDeviationX, @@ -72,10 +72,10 @@ FilterPrimitiveDescription SVGFEDropShadowElement::GetPrimitiveDescription( nsTArray>& aInputImages) { float stdX = aInstance->GetPrimitiveNumber(SVGContentUtils::X, &mNumberPairAttributes[STD_DEV], - SVGNumberPair::eFirst); + SVGAnimatedNumberPair::eFirst); float stdY = aInstance->GetPrimitiveNumber(SVGContentUtils::Y, &mNumberPairAttributes[STD_DEV], - SVGNumberPair::eSecond); + SVGAnimatedNumberPair::eSecond); if (stdX < 0 || stdY < 0) { return FilterPrimitiveDescription(); } diff --git a/dom/svg/SVGFEDropShadowElement.h b/dom/svg/SVGFEDropShadowElement.h index f85cc7c01175..583fd28e45cb 100644 --- a/dom/svg/SVGFEDropShadowElement.h +++ b/dom/svg/SVGFEDropShadowElement.h @@ -7,10 +7,10 @@ #ifndef mozilla_dom_SVGFEDropShadowElement_h #define mozilla_dom_SVGFEDropShadowElement_h -#include "SVGFilters.h" #include "nsSVGNumber2.h" -#include "SVGNumberPair.h" -#include "SVGString.h" +#include "SVGAnimatedNumberPair.h" +#include "SVGAnimatedString.h" +#include "SVGFilters.h" nsresult NS_NewSVGFEDropShadowElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); @@ -39,7 +39,7 @@ class SVGFEDropShadowElement : public SVGFEDropShadowElementBase { nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -67,11 +67,11 @@ class SVGFEDropShadowElement : public SVGFEDropShadowElementBase { static NumberInfo sNumberInfo[2]; enum { STD_DEV }; - SVGNumberPair mNumberPairAttributes[1]; + SVGAnimatedNumberPair mNumberPairAttributes[1]; static NumberPairInfo sNumberPairInfo[1]; enum { RESULT, IN1 }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; }; diff --git a/dom/svg/SVGFEFloodElement.h b/dom/svg/SVGFEFloodElement.h index 1a2e2c9322fa..8eaf5d796723 100644 --- a/dom/svg/SVGFEFloodElement.h +++ b/dom/svg/SVGFEFloodElement.h @@ -36,7 +36,7 @@ class SVGFEFloodElement : public SVGFEFloodElementBase { nsSVGFilterInstance* aInstance, const IntRect& aFilterSubregion, const nsTArray& aInputsAreTainted, nsTArray>& aInputImages) override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } @@ -51,7 +51,7 @@ class SVGFEFloodElement : public SVGFEFloodElementBase { virtual StringAttributesInfo GetStringInfo() override; enum { RESULT }; - SVGString mStringAttributes[1]; + SVGAnimatedString mStringAttributes[1]; static StringInfo sStringInfo[1]; }; diff --git a/dom/svg/SVGFEGaussianBlurElement.cpp b/dom/svg/SVGFEGaussianBlurElement.cpp index 4700608e6ab4..9bd6b6b1d6fc 100644 --- a/dom/svg/SVGFEGaussianBlurElement.cpp +++ b/dom/svg/SVGFEGaussianBlurElement.cpp @@ -42,13 +42,13 @@ already_AddRefed SVGFEGaussianBlurElement::In1() { already_AddRefed SVGFEGaussianBlurElement::StdDeviationX() { return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber( - SVGNumberPair::eFirst, this); + SVGAnimatedNumberPair::eFirst, this); } already_AddRefed SVGFEGaussianBlurElement::StdDeviationY() { return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber( - SVGNumberPair::eSecond, this); + SVGAnimatedNumberPair::eSecond, this); } void SVGFEGaussianBlurElement::SetStdDeviation(float stdDeviationX, @@ -63,10 +63,10 @@ FilterPrimitiveDescription SVGFEGaussianBlurElement::GetPrimitiveDescription( nsTArray>& aInputImages) { float stdX = aInstance->GetPrimitiveNumber(SVGContentUtils::X, &mNumberPairAttributes[STD_DEV], - SVGNumberPair::eFirst); + SVGAnimatedNumberPair::eFirst); float stdY = aInstance->GetPrimitiveNumber(SVGContentUtils::Y, &mNumberPairAttributes[STD_DEV], - SVGNumberPair::eSecond); + SVGAnimatedNumberPair::eSecond); if (stdX < 0 || stdY < 0) { return FilterPrimitiveDescription(); } diff --git a/dom/svg/SVGFEGaussianBlurElement.h b/dom/svg/SVGFEGaussianBlurElement.h index f4a34a443f1a..6d5693c79033 100644 --- a/dom/svg/SVGFEGaussianBlurElement.h +++ b/dom/svg/SVGFEGaussianBlurElement.h @@ -7,9 +7,9 @@ #ifndef mozilla_dom_SVGFEGaussianBlurElement_h #define mozilla_dom_SVGFEGaussianBlurElement_h +#include "SVGAnimatedNumberPair.h" +#include "SVGAnimatedString.h" #include "SVGFilters.h" -#include "SVGNumberPair.h" -#include "SVGString.h" nsresult NS_NewSVGFEGaussianBlurElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); @@ -38,7 +38,7 @@ class SVGFEGaussianBlurElement : public SVGFEGaussianBlurElementBase { nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -56,11 +56,11 @@ class SVGFEGaussianBlurElement : public SVGFEGaussianBlurElementBase { virtual StringAttributesInfo GetStringInfo() override; enum { STD_DEV }; - SVGNumberPair mNumberPairAttributes[1]; + SVGAnimatedNumberPair mNumberPairAttributes[1]; static NumberPairInfo sNumberPairInfo[1]; enum { RESULT, IN1 }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; }; diff --git a/dom/svg/SVGFEImageElement.h b/dom/svg/SVGFEImageElement.h index 93babec3daf5..7a10990c76a3 100644 --- a/dom/svg/SVGFEImageElement.h +++ b/dom/svg/SVGFEImageElement.h @@ -49,7 +49,7 @@ class SVGFEImageElement final : public SVGFEImageElementBase, nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual bool OutputIsTainted(const nsTArray& aInputsAreTainted, @@ -95,7 +95,7 @@ class SVGFEImageElement final : public SVGFEImageElementBase, nsIContent* AsContent() override { return this; } enum { RESULT, HREF, XLINK_HREF }; - SVGString mStringAttributes[3]; + SVGAnimatedString mStringAttributes[3]; static StringInfo sStringInfo[3]; SVGAnimatedPreserveAspectRatio mPreserveAspectRatio; diff --git a/dom/svg/SVGFEMergeElement.h b/dom/svg/SVGFEMergeElement.h index 391a15dec7ea..6ddc49ba3554 100644 --- a/dom/svg/SVGFEMergeElement.h +++ b/dom/svg/SVGFEMergeElement.h @@ -34,7 +34,7 @@ class SVGFEMergeElement : public SVGFEMergeElementBase { nsSVGFilterInstance* aInstance, const IntRect& aFilterSubregion, const nsTArray& aInputsAreTainted, nsTArray>& aInputImages) override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -46,7 +46,7 @@ class SVGFEMergeElement : public SVGFEMergeElementBase { virtual StringAttributesInfo GetStringInfo() override; enum { RESULT }; - SVGString mStringAttributes[1]; + SVGAnimatedString mStringAttributes[1]; static StringInfo sStringInfo[1]; }; diff --git a/dom/svg/SVGFEMergeNodeElement.h b/dom/svg/SVGFEMergeNodeElement.h index 770e373f3dd0..b8f2369ef8d9 100644 --- a/dom/svg/SVGFEMergeNodeElement.h +++ b/dom/svg/SVGFEMergeNodeElement.h @@ -35,7 +35,7 @@ class SVGFEMergeNodeElement : public SVGFEMergeNodeElementBase { virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - const SVGString* GetIn1() { return &mStringAttributes[IN1]; } + const SVGAnimatedString* GetIn1() { return &mStringAttributes[IN1]; } // WebIDL already_AddRefed In1(); @@ -44,7 +44,7 @@ class SVGFEMergeNodeElement : public SVGFEMergeNodeElementBase { virtual StringAttributesInfo GetStringInfo() override; enum { IN1 }; - SVGString mStringAttributes[1]; + SVGAnimatedString mStringAttributes[1]; static StringInfo sStringInfo[1]; }; diff --git a/dom/svg/SVGFEMorphologyElement.cpp b/dom/svg/SVGFEMorphologyElement.cpp index cd90a4dc12e7..e734b311e40b 100644 --- a/dom/svg/SVGFEMorphologyElement.cpp +++ b/dom/svg/SVGFEMorphologyElement.cpp @@ -53,12 +53,12 @@ already_AddRefed SVGFEMorphologyElement::Operator() { already_AddRefed SVGFEMorphologyElement::RadiusX() { return mNumberPairAttributes[RADIUS].ToDOMAnimatedNumber( - SVGNumberPair::eFirst, this); + SVGAnimatedNumberPair::eFirst, this); } already_AddRefed SVGFEMorphologyElement::RadiusY() { return mNumberPairAttributes[RADIUS].ToDOMAnimatedNumber( - SVGNumberPair::eSecond, this); + SVGAnimatedNumberPair::eSecond, this); } void SVGFEMorphologyElement::SetRadius(float rx, float ry) { @@ -80,11 +80,11 @@ void SVGFEMorphologyElement::GetRXY(int32_t* aRX, int32_t* aRY, // issues. *aRX = NSToIntCeil(aInstance.GetPrimitiveNumber( SVGContentUtils::X, &mNumberPairAttributes[RADIUS], - SVGNumberPair::eFirst) - + SVGAnimatedNumberPair::eFirst) - MORPHOLOGY_EPSILON); *aRY = NSToIntCeil(aInstance.GetPrimitiveNumber( SVGContentUtils::Y, &mNumberPairAttributes[RADIUS], - SVGNumberPair::eSecond) - + SVGAnimatedNumberPair::eSecond) - MORPHOLOGY_EPSILON); } diff --git a/dom/svg/SVGFEMorphologyElement.h b/dom/svg/SVGFEMorphologyElement.h index 3ca958cc0c0e..71a2ff4cae38 100644 --- a/dom/svg/SVGFEMorphologyElement.h +++ b/dom/svg/SVGFEMorphologyElement.h @@ -7,10 +7,10 @@ #ifndef mozilla_dom_SVGFEMorphologyElement_h #define mozilla_dom_SVGFEMorphologyElement_h -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" +#include "SVGAnimatedNumberPair.h" +#include "SVGAnimatedString.h" #include "SVGFilters.h" -#include "SVGNumberPair.h" -#include "SVGString.h" nsresult NS_NewSVGFEMorphologyElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); @@ -39,7 +39,7 @@ class SVGFEMorphologyElement : public SVGFEMorphologyElementBase { nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -61,16 +61,16 @@ class SVGFEMorphologyElement : public SVGFEMorphologyElementBase { virtual StringAttributesInfo GetStringInfo() override; enum { RADIUS }; - SVGNumberPair mNumberPairAttributes[1]; + SVGAnimatedNumberPair mNumberPairAttributes[1]; static NumberPairInfo sNumberPairInfo[1]; enum { OPERATOR }; - SVGEnum mEnumAttributes[1]; + SVGAnimatedEnumeration mEnumAttributes[1]; static SVGEnumMapping sOperatorMap[]; static EnumInfo sEnumInfo[1]; enum { RESULT, IN1 }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; }; diff --git a/dom/svg/SVGFEOffsetElement.h b/dom/svg/SVGFEOffsetElement.h index b695b2ff6871..34a4f0b394f8 100644 --- a/dom/svg/SVGFEOffsetElement.h +++ b/dom/svg/SVGFEOffsetElement.h @@ -7,9 +7,9 @@ #ifndef mozilla_dom_SVGFEOffsetElement_h #define mozilla_dom_SVGFEOffsetElement_h -#include "SVGFilters.h" #include "nsSVGNumber2.h" -#include "SVGString.h" +#include "SVGAnimatedString.h" +#include "SVGFilters.h" nsresult NS_NewSVGFEOffsetElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); @@ -38,7 +38,7 @@ class SVGFEOffsetElement : public SVGFEOffsetElementBase { nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -59,7 +59,7 @@ class SVGFEOffsetElement : public SVGFEOffsetElementBase { static NumberInfo sNumberInfo[2]; enum { RESULT, IN1 }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; }; diff --git a/dom/svg/SVGFESpecularLightingElement.cpp b/dom/svg/SVGFESpecularLightingElement.cpp index 96c8ff6f816e..53f5e9050e0b 100644 --- a/dom/svg/SVGFESpecularLightingElement.cpp +++ b/dom/svg/SVGFESpecularLightingElement.cpp @@ -48,13 +48,13 @@ SVGFESpecularLightingElement::SpecularExponent() { already_AddRefed SVGFESpecularLightingElement::KernelUnitLengthX() { return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber( - SVGNumberPair::eFirst, this); + SVGAnimatedNumberPair::eFirst, this); } already_AddRefed SVGFESpecularLightingElement::KernelUnitLengthY() { return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber( - SVGNumberPair::eSecond, this); + SVGAnimatedNumberPair::eSecond, this); } //---------------------------------------------------------------------- diff --git a/dom/svg/SVGFETileElement.h b/dom/svg/SVGFETileElement.h index 62b2f5d219f6..c83d588a8ad4 100644 --- a/dom/svg/SVGFETileElement.h +++ b/dom/svg/SVGFETileElement.h @@ -38,7 +38,7 @@ class SVGFETileElement : public SVGFETileElementBase { nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -52,7 +52,7 @@ class SVGFETileElement : public SVGFETileElementBase { virtual StringAttributesInfo GetStringInfo() override; enum { RESULT, IN1 }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; }; diff --git a/dom/svg/SVGFETurbulenceElement.cpp b/dom/svg/SVGFETurbulenceElement.cpp index 01bf68157cba..c8368ae8a7e1 100644 --- a/dom/svg/SVGFETurbulenceElement.cpp +++ b/dom/svg/SVGFETurbulenceElement.cpp @@ -63,13 +63,13 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFETurbulenceElement) already_AddRefed SVGFETurbulenceElement::BaseFrequencyX() { return mNumberPairAttributes[BASE_FREQ].ToDOMAnimatedNumber( - SVGNumberPair::eFirst, this); + SVGAnimatedNumberPair::eFirst, this); } already_AddRefed SVGFETurbulenceElement::BaseFrequencyY() { return mNumberPairAttributes[BASE_FREQ].ToDOMAnimatedNumber( - SVGNumberPair::eSecond, this); + SVGAnimatedNumberPair::eSecond, this); } already_AddRefed SVGFETurbulenceElement::NumOctaves() { @@ -93,10 +93,10 @@ FilterPrimitiveDescription SVGFETurbulenceElement::GetPrimitiveDescription( nsSVGFilterInstance* aInstance, const IntRect& aFilterSubregion, const nsTArray& aInputsAreTainted, nsTArray>& aInputImages) { - float fX = - mNumberPairAttributes[BASE_FREQ].GetAnimValue(SVGNumberPair::eFirst); - float fY = - mNumberPairAttributes[BASE_FREQ].GetAnimValue(SVGNumberPair::eSecond); + float fX = mNumberPairAttributes[BASE_FREQ].GetAnimValue( + SVGAnimatedNumberPair::eFirst); + float fY = mNumberPairAttributes[BASE_FREQ].GetAnimValue( + SVGAnimatedNumberPair::eSecond); float seed = mNumberAttributes[OCTAVES].GetAnimValue(); uint32_t octaves = clamped(mIntegerAttributes[OCTAVES].GetAnimValue(), 0, MAX_OCTAVES); diff --git a/dom/svg/SVGFETurbulenceElement.h b/dom/svg/SVGFETurbulenceElement.h index d04d3f245dc5..d06db19304a9 100644 --- a/dom/svg/SVGFETurbulenceElement.h +++ b/dom/svg/SVGFETurbulenceElement.h @@ -7,11 +7,11 @@ #ifndef mozilla_dom_SVGFETurbulenceElement_h #define mozilla_dom_SVGFETurbulenceElement_h -#include "SVGEnum.h" -#include "SVGFilters.h" +#include "SVGAnimatedEnumeration.h" +#include "SVGAnimatedInteger.h" #include "nsSVGNumber2.h" -#include "SVGInteger.h" -#include "SVGString.h" +#include "SVGAnimatedString.h" +#include "SVGFilters.h" nsresult NS_NewSVGFETurbulenceElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); @@ -42,7 +42,7 @@ class SVGFETurbulenceElement : public SVGFETurbulenceElementBase { nsTArray>& aInputImages) override; virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } @@ -68,21 +68,21 @@ class SVGFETurbulenceElement : public SVGFETurbulenceElementBase { static NumberInfo sNumberInfo[1]; enum { BASE_FREQ }; - SVGNumberPair mNumberPairAttributes[1]; + SVGAnimatedNumberPair mNumberPairAttributes[1]; static NumberPairInfo sNumberPairInfo[1]; enum { OCTAVES }; - SVGInteger mIntegerAttributes[1]; + SVGAnimatedInteger mIntegerAttributes[1]; static IntegerInfo sIntegerInfo[1]; enum { TYPE, STITCHTILES }; - SVGEnum mEnumAttributes[2]; + SVGAnimatedEnumeration mEnumAttributes[2]; static SVGEnumMapping sTypeMap[]; static SVGEnumMapping sStitchTilesMap[]; static EnumInfo sEnumInfo[2]; enum { RESULT }; - SVGString mStringAttributes[1]; + SVGAnimatedString mStringAttributes[1]; static StringInfo sStringInfo[1]; }; diff --git a/dom/svg/SVGFilterElement.h b/dom/svg/SVGFilterElement.h index e8d1b1196146..8c1fa5be8fbd 100644 --- a/dom/svg/SVGFilterElement.h +++ b/dom/svg/SVGFilterElement.h @@ -7,9 +7,9 @@ #ifndef mozilla_dom_SVGFilterElement_h #define mozilla_dom_SVGFilterElement_h -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "nsSVGLength2.h" -#include "SVGString.h" +#include "SVGAnimatedString.h" #include "mozilla/dom/SVGElement.h" class nsSVGFilterFrame; @@ -64,11 +64,11 @@ class SVGFilterElement : public SVGFilterElementBase { static LengthInfo sLengthInfo[4]; enum { FILTERUNITS, PRIMITIVEUNITS }; - SVGEnum mEnumAttributes[2]; + SVGAnimatedEnumeration mEnumAttributes[2]; static EnumInfo sEnumInfo[2]; enum { HREF, XLINK_HREF }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; }; diff --git a/dom/svg/SVGFilters.cpp b/dom/svg/SVGFilters.cpp index 9d2156541707..0a1a8bf0f2b1 100644 --- a/dom/svg/SVGFilters.cpp +++ b/dom/svg/SVGFilters.cpp @@ -14,11 +14,11 @@ #include "nsCOMPtr.h" #include "nsIFrame.h" #include "nsLayoutUtils.h" -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" +#include "SVGAnimatedNumberPair.h" +#include "SVGAnimatedString.h" #include "nsSVGFilterInstance.h" #include "SVGNumberList.h" -#include "SVGNumberPair.h" -#include "SVGString.h" #include "mozilla/ArrayUtils.h" #include "mozilla/ComputedStyle.h" #include "mozilla/SVGContentUtils.h" @@ -144,15 +144,15 @@ bool SVGFE::HasValidDimensions() const { } Size SVGFE::GetKernelUnitLength(nsSVGFilterInstance* aInstance, - SVGNumberPair* aKernelUnitLength) { + SVGAnimatedNumberPair* aKernelUnitLength) { if (!aKernelUnitLength->IsExplicitlySet()) { return Size(1, 1); } float kernelX = aInstance->GetPrimitiveNumber( - SVGContentUtils::X, aKernelUnitLength, SVGNumberPair::eFirst); + SVGContentUtils::X, aKernelUnitLength, SVGAnimatedNumberPair::eFirst); float kernelY = aInstance->GetPrimitiveNumber( - SVGContentUtils::Y, aKernelUnitLength, SVGNumberPair::eSecond); + SVGContentUtils::Y, aKernelUnitLength, SVGAnimatedNumberPair::eSecond); return Size(kernelX, kernelY); } diff --git a/dom/svg/SVGFilters.h b/dom/svg/SVGFilters.h index 094b7cf00d05..b2557b6dd080 100644 --- a/dom/svg/SVGFilters.h +++ b/dom/svg/SVGFilters.h @@ -11,10 +11,10 @@ #include "mozilla/dom/SVGElement.h" #include "FilterSupport.h" #include "nsImageLoadingContent.h" +#include "SVGAnimatedString.h" #include "nsSVGLength2.h" -#include "SVGString.h" #include "nsSVGNumber2.h" -#include "SVGNumberPair.h" +#include "SVGAnimatedNumberPair.h" class nsSVGFilterInstance; @@ -22,10 +22,10 @@ namespace mozilla { namespace dom { struct SVGStringInfo { - SVGStringInfo(const SVGString* aString, SVGElement* aElement) + SVGStringInfo(const SVGAnimatedString* aString, SVGElement* aElement) : mString(aString), mElement(aElement) {} - const SVGString* mString; + const SVGAnimatedString* mString; SVGElement* mElement; }; @@ -95,7 +95,7 @@ class SVGFE : public SVGFEBase { return !(aFlags & ~eFILTER); } - virtual SVGString& GetResultImageName() = 0; + virtual SVGAnimatedString& GetResultImageName() = 0; // Return a list of all image names used as sources. Default is to // return no sources. virtual void GetSourceImageNames(nsTArray& aSources); @@ -146,7 +146,7 @@ class SVGFE : public SVGFEBase { virtual LengthAttributesInfo GetLengthInfo() override; Size GetKernelUnitLength(nsSVGFilterInstance* aInstance, - SVGNumberPair* aKernelUnitLength); + SVGAnimatedNumberPair* aKernelUnitLength); enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT }; nsSVGLength2 mLengthAttributes[4]; @@ -192,7 +192,7 @@ class SVGFELightingElement : public SVGFELightingElementBase { virtual bool AttributeAffectsRendering(int32_t aNameSpaceID, nsAtom* aAttribute) const override; - virtual SVGString& GetResultImageName() override { + virtual SVGAnimatedString& GetResultImageName() override { return mStringAttributes[RESULT]; } virtual void GetSourceImageNames(nsTArray& aSources) override; @@ -225,11 +225,11 @@ class SVGFELightingElement : public SVGFELightingElementBase { static NumberInfo sNumberInfo[4]; enum { KERNEL_UNIT_LENGTH }; - SVGNumberPair mNumberPairAttributes[1]; + SVGAnimatedNumberPair mNumberPairAttributes[1]; static NumberPairInfo sNumberPairInfo[1]; enum { RESULT, IN1 }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; }; diff --git a/dom/svg/SVGGradientElement.h b/dom/svg/SVGGradientElement.h index 42128cd79bff..d1239761c9fb 100644 --- a/dom/svg/SVGGradientElement.h +++ b/dom/svg/SVGGradientElement.h @@ -8,9 +8,9 @@ #define __NS_SVGGRADIENTELEMENT_H__ #include "nsAutoPtr.h" -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "nsSVGLength2.h" -#include "SVGString.h" +#include "SVGAnimatedString.h" #include "SVGAnimatedTransformList.h" #include "mozilla/dom/SVGElement.h" @@ -64,12 +64,12 @@ class SVGGradientElement : public SVGGradientElementBase { virtual StringAttributesInfo GetStringInfo() override; enum { GRADIENTUNITS, SPREADMETHOD }; - SVGEnum mEnumAttributes[2]; + SVGAnimatedEnumeration mEnumAttributes[2]; static SVGEnumMapping sSpreadMethodMap[]; static EnumInfo sEnumInfo[2]; enum { HREF, XLINK_HREF }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; // SVGGradientElement values diff --git a/dom/svg/SVGImageElement.h b/dom/svg/SVGImageElement.h index 989efcd2118b..2e6abd6f0b32 100644 --- a/dom/svg/SVGImageElement.h +++ b/dom/svg/SVGImageElement.h @@ -9,7 +9,7 @@ #include "nsImageLoadingContent.h" #include "nsSVGLength2.h" -#include "SVGString.h" +#include "SVGAnimatedString.h" #include "SVGGeometryElement.h" #include "SVGAnimatedPreserveAspectRatio.h" @@ -112,7 +112,7 @@ class SVGImageElement : public SVGImageElementBase, SVGAnimatedPreserveAspectRatio mPreserveAspectRatio; enum { HREF, XLINK_HREF }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; }; diff --git a/dom/svg/SVGMPathElement.h b/dom/svg/SVGMPathElement.h index b9e4ad7eae34..3db97816415d 100644 --- a/dom/svg/SVGMPathElement.h +++ b/dom/svg/SVGMPathElement.h @@ -8,9 +8,9 @@ #define mozilla_dom_SVGMPathElement_h #include "mozilla/dom/IDTracker.h" -#include "SVGElement.h" +#include "mozilla/dom/SVGElement.h" #include "nsStubMutationObserver.h" -#include "SVGString.h" +#include "SVGAnimatedString.h" nsresult NS_NewSVGMPathElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); @@ -110,7 +110,7 @@ class SVGMPathElement final : public SVGMPathElementBase, void NotifyParentOfMpathChange(nsIContent* aParent); enum { HREF, XLINK_HREF }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; PathElementTracker mPathTracker; }; diff --git a/dom/svg/SVGMarkerElement.cpp b/dom/svg/SVGMarkerElement.cpp index 2d51c051b822..2c65cceeb759 100644 --- a/dom/svg/SVGMarkerElement.cpp +++ b/dom/svg/SVGMarkerElement.cpp @@ -165,9 +165,9 @@ SVGElement::EnumAttributesInfo SVGMarkerElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -SVGOrient* SVGMarkerElement::GetOrient() { return &mOrient; } +SVGAnimatedOrient* SVGMarkerElement::GetOrient() { return &mOrient; } -SVGViewBox* SVGMarkerElement::GetViewBox() { return &mViewBox; } +SVGAnimatedViewBox* SVGMarkerElement::GetViewBox() { return &mViewBox; } SVGAnimatedPreserveAspectRatio* SVGMarkerElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; diff --git a/dom/svg/SVGMarkerElement.h b/dom/svg/SVGMarkerElement.h index f902d1937821..1c139539e658 100644 --- a/dom/svg/SVGMarkerElement.h +++ b/dom/svg/SVGMarkerElement.h @@ -10,11 +10,11 @@ #include "DOMSVGAnimatedAngle.h" #include "DOMSVGAnimatedEnumeration.h" #include "nsAutoPtr.h" -#include "SVGAnimatedPreserveAspectRatio.h" -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "nsSVGLength2.h" -#include "SVGOrient.h" -#include "SVGViewBox.h" +#include "SVGAnimatedOrient.h" +#include "SVGAnimatedPreserveAspectRatio.h" +#include "SVGAnimatedViewBox.h" #include "mozilla/Attributes.h" #include "mozilla/dom/SVGElement.h" #include "mozilla/dom/SVGMarkerElementBinding.h" @@ -79,21 +79,21 @@ class SVGMarkerElement : public SVGMarkerElementBase { virtual LengthAttributesInfo GetLengthInfo() override; virtual EnumAttributesInfo GetEnumInfo() override; - virtual SVGOrient* GetOrient() override; - virtual SVGViewBox* GetViewBox() override; + virtual SVGAnimatedOrient* GetOrient() override; virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override; + virtual SVGAnimatedViewBox* GetViewBox() override; enum { REFX, REFY, MARKERWIDTH, MARKERHEIGHT }; nsSVGLength2 mLengthAttributes[4]; static LengthInfo sLengthInfo[4]; enum { MARKERUNITS }; - SVGEnum mEnumAttributes[1]; + SVGAnimatedEnumeration mEnumAttributes[1]; static SVGEnumMapping sUnitsMap[]; static EnumInfo sEnumInfo[1]; - SVGOrient mOrient; - SVGViewBox mViewBox; + SVGAnimatedOrient mOrient; + SVGAnimatedViewBox mViewBox; SVGAnimatedPreserveAspectRatio mPreserveAspectRatio; SVGViewportElement* mCoordCtx; diff --git a/dom/svg/SVGMaskElement.h b/dom/svg/SVGMaskElement.h index 4ef9fb50a196..ad5d77f57310 100644 --- a/dom/svg/SVGMaskElement.h +++ b/dom/svg/SVGMaskElement.h @@ -7,7 +7,7 @@ #ifndef mozilla_dom_SVGMaskElement_h #define mozilla_dom_SVGMaskElement_h -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "nsSVGLength2.h" #include "mozilla/dom/SVGElement.h" @@ -59,7 +59,7 @@ class SVGMaskElement final : public SVGMaskElementBase { static LengthInfo sLengthInfo[4]; enum { MASKUNITS, MASKCONTENTUNITS }; - SVGEnum mEnumAttributes[2]; + SVGAnimatedEnumeration mEnumAttributes[2]; static EnumInfo sEnumInfo[2]; }; diff --git a/dom/svg/SVGMotionSMILAnimationFunction.cpp b/dom/svg/SVGMotionSMILAnimationFunction.cpp index f758648fe633..982c4c3f0d13 100644 --- a/dom/svg/SVGMotionSMILAnimationFunction.cpp +++ b/dom/svg/SVGMotionSMILAnimationFunction.cpp @@ -13,7 +13,7 @@ #include "mozilla/SMILParserUtils.h" #include "nsAttrValue.h" #include "nsAttrValueInlines.h" -#include "SVGOrient.h" +#include "SVGAnimatedOrient.h" #include "SVGMotionSMILPathUtils.h" #include "SVGMotionSMILType.h" #include "SVGPathDataParser.h" @@ -391,7 +391,8 @@ nsresult SVGMotionSMILAnimationFunction::SetRotate(const nsAString& aRotate, mRotateType = eRotateType_Explicit; uint16_t angleUnit; - if (!SVGOrient::GetValueFromString(aRotate, mRotateAngle, &angleUnit)) { + if (!SVGAnimatedOrient::GetValueFromString(aRotate, mRotateAngle, + &angleUnit)) { mRotateAngle = 0.0f; // set default rotate angle // XXX report to console? return NS_ERROR_DOM_SYNTAX_ERR; @@ -399,8 +400,8 @@ nsresult SVGMotionSMILAnimationFunction::SetRotate(const nsAString& aRotate, // Convert to radian units, if we're not already in radians. if (angleUnit != SVG_ANGLETYPE_RAD) { - mRotateAngle *= SVGOrient::GetDegreesPerUnit(angleUnit) / - SVGOrient::GetDegreesPerUnit(SVG_ANGLETYPE_RAD); + mRotateAngle *= SVGAnimatedOrient::GetDegreesPerUnit(angleUnit) / + SVGAnimatedOrient::GetDegreesPerUnit(SVG_ANGLETYPE_RAD); } } return NS_OK; diff --git a/dom/svg/SVGOrientSMILType.cpp b/dom/svg/SVGOrientSMILType.cpp index 479f16c20297..1050c7a7632e 100644 --- a/dom/svg/SVGOrientSMILType.cpp +++ b/dom/svg/SVGOrientSMILType.cpp @@ -9,7 +9,7 @@ #include "mozilla/SMILValue.h" #include "mozilla/dom/SVGMarkerElement.h" #include "nsDebug.h" -#include "SVGOrient.h" +#include "SVGAnimatedOrient.h" #include namespace mozilla { @@ -69,17 +69,19 @@ nsresult SVGOrientSMILType::Add(SMILValue& aDest, const SMILValue& aValueToAdd, // We may be dealing with two different angle units, so we normalize to // degrees for the add: - float currentAngle = aDest.mU.mOrient.mAngle * - SVGOrient::GetDegreesPerUnit(aDest.mU.mOrient.mUnit); + float currentAngle = + aDest.mU.mOrient.mAngle * + SVGAnimatedOrient::GetDegreesPerUnit(aDest.mU.mOrient.mUnit); float angleToAdd = aValueToAdd.mU.mOrient.mAngle * - SVGOrient::GetDegreesPerUnit(aValueToAdd.mU.mOrient.mUnit) * aCount; + SVGAnimatedOrient::GetDegreesPerUnit(aValueToAdd.mU.mOrient.mUnit) * + aCount; // And then we give the resulting animated value the same units as the value // that we're animating to/by (i.e. the same as aValueToAdd): aDest.mU.mOrient.mAngle = (currentAngle + angleToAdd) / - SVGOrient::GetDegreesPerUnit(aValueToAdd.mU.mOrient.mUnit); + SVGAnimatedOrient::GetDegreesPerUnit(aValueToAdd.mU.mOrient.mUnit); aDest.mU.mOrient.mUnit = aValueToAdd.mU.mOrient.mUnit; return NS_OK; @@ -99,9 +101,9 @@ nsresult SVGOrientSMILType::ComputeDistance(const SMILValue& aFrom, // Normalize both to degrees in case they're different angle units: double from = aFrom.mU.mOrient.mAngle * - SVGOrient::GetDegreesPerUnit(aFrom.mU.mOrient.mUnit); + SVGAnimatedOrient::GetDegreesPerUnit(aFrom.mU.mOrient.mUnit); double to = aTo.mU.mOrient.mAngle * - SVGOrient::GetDegreesPerUnit(aTo.mU.mOrient.mUnit); + SVGAnimatedOrient::GetDegreesPerUnit(aTo.mU.mOrient.mUnit); aDistance = fabs(to - from); @@ -123,15 +125,16 @@ nsresult SVGOrientSMILType::Interpolate(const SMILValue& aStartVal, return NS_ERROR_FAILURE; } - float start = aStartVal.mU.mOrient.mAngle * - SVGOrient::GetDegreesPerUnit(aStartVal.mU.mOrient.mUnit); + float start = + aStartVal.mU.mOrient.mAngle * + SVGAnimatedOrient::GetDegreesPerUnit(aStartVal.mU.mOrient.mUnit); float end = aEndVal.mU.mOrient.mAngle * - SVGOrient::GetDegreesPerUnit(aEndVal.mU.mOrient.mUnit); + SVGAnimatedOrient::GetDegreesPerUnit(aEndVal.mU.mOrient.mUnit); float result = (start + (end - start) * aUnitDistance); // Again, we use the unit of the to/by value for the result: aResult.mU.mOrient.mAngle = - result / SVGOrient::GetDegreesPerUnit(aEndVal.mU.mOrient.mUnit); + result / SVGAnimatedOrient::GetDegreesPerUnit(aEndVal.mU.mOrient.mUnit); aResult.mU.mOrient.mUnit = aEndVal.mU.mOrient.mUnit; return NS_OK; diff --git a/dom/svg/SVGPatternElement.cpp b/dom/svg/SVGPatternElement.cpp index 12b32bbef2eb..8835c97c8d2f 100644 --- a/dom/svg/SVGPatternElement.cpp +++ b/dom/svg/SVGPatternElement.cpp @@ -162,7 +162,7 @@ SVGElement::EnumAttributesInfo SVGPatternElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -SVGViewBox* SVGPatternElement::GetViewBox() { return &mViewBox; } +SVGAnimatedViewBox* SVGPatternElement::GetViewBox() { return &mViewBox; } SVGAnimatedPreserveAspectRatio* SVGPatternElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; diff --git a/dom/svg/SVGPatternElement.h b/dom/svg/SVGPatternElement.h index 98d43d89f201..6f4d38242893 100644 --- a/dom/svg/SVGPatternElement.h +++ b/dom/svg/SVGPatternElement.h @@ -8,12 +8,12 @@ #define mozilla_dom_SVGPatternElement_h #include "nsAutoPtr.h" -#include "SVGAnimatedPreserveAspectRatio.h" -#include "SVGAnimatedTransformList.h" -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "nsSVGLength2.h" -#include "SVGString.h" -#include "SVGViewBox.h" +#include "SVGAnimatedPreserveAspectRatio.h" +#include "SVGAnimatedString.h" +#include "SVGAnimatedTransformList.h" +#include "SVGAnimatedViewBox.h" #include "mozilla/dom/SVGElement.h" class nsSVGPatternFrame; @@ -72,26 +72,26 @@ class SVGPatternElement final : public SVGPatternElementBase { protected: virtual LengthAttributesInfo GetLengthInfo() override; virtual EnumAttributesInfo GetEnumInfo() override; - virtual SVGViewBox* GetViewBox() override; - virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override; virtual StringAttributesInfo GetStringInfo() override; + virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override; + virtual SVGAnimatedViewBox* GetViewBox() override; enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT }; nsSVGLength2 mLengthAttributes[4]; static LengthInfo sLengthInfo[4]; enum { PATTERNUNITS, PATTERNCONTENTUNITS }; - SVGEnum mEnumAttributes[2]; + SVGAnimatedEnumeration mEnumAttributes[2]; static EnumInfo sEnumInfo[2]; nsAutoPtr mPatternTransform; enum { HREF, XLINK_HREF }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; // SVGFitToViewbox properties - SVGViewBox mViewBox; + SVGAnimatedViewBox mViewBox; SVGAnimatedPreserveAspectRatio mPreserveAspectRatio; }; diff --git a/dom/svg/SVGSVGElement.cpp b/dom/svg/SVGSVGElement.cpp index eec0120241bb..901b02ce9b44 100644 --- a/dom/svg/SVGSVGElement.cpp +++ b/dom/svg/SVGSVGElement.cpp @@ -638,7 +638,7 @@ SVGViewElement* SVGSVGElement::GetCurrentViewElement() const { return nullptr; } -const SVGViewBox& SVGSVGElement::GetViewBoxInternal() const { +const SVGAnimatedViewBox& SVGSVGElement::GetViewBoxInternal() const { SVGViewElement* viewElement = GetCurrentViewElement(); if (viewElement && viewElement->mViewBox.HasRect()) { diff --git a/dom/svg/SVGSVGElement.h b/dom/svg/SVGSVGElement.h index e9316dc82872..e4c471dc264d 100644 --- a/dom/svg/SVGSVGElement.h +++ b/dom/svg/SVGSVGElement.h @@ -7,7 +7,7 @@ #ifndef mozilla_dom_SVGSVGElement_h #define mozilla_dom_SVGSVGElement_h -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "SVGViewportElement.h" nsresult NS_NewSVGSVGElement( @@ -33,8 +33,8 @@ class SVGView { public: SVGView(); - mozilla::SVGEnum mZoomAndPan; - SVGViewBox mViewBox; + SVGAnimatedEnumeration mZoomAndPan; + SVGAnimatedViewBox mViewBox; SVGAnimatedPreserveAspectRatio mPreserveAspectRatio; nsAutoPtr mTransforms; }; @@ -219,14 +219,14 @@ class SVGSVGElement final : public SVGSVGElementBase { } virtual float GetCurrentScale() const override { return mCurrentScale; } - virtual const SVGViewBox& GetViewBoxInternal() const override; + virtual const SVGAnimatedViewBox& GetViewBoxInternal() const override; virtual SVGAnimatedTransformList* GetTransformInternal() const override; virtual EnumAttributesInfo GetEnumInfo() override; enum { ZOOMANDPAN }; - mozilla::SVGEnum mEnumAttributes[1]; - static mozilla::SVGEnumMapping sZoomAndPanMap[]; + SVGAnimatedEnumeration mEnumAttributes[1]; + static SVGEnumMapping sZoomAndPanMap[]; static EnumInfo sEnumInfo[1]; // The time container for animations within this SVG document fragment. Set diff --git a/dom/svg/SVGScriptElement.h b/dom/svg/SVGScriptElement.h index 9c095ee839a7..c3dff79b70cf 100644 --- a/dom/svg/SVGScriptElement.h +++ b/dom/svg/SVGScriptElement.h @@ -7,10 +7,10 @@ #ifndef mozilla_dom_SVGScriptElement_h #define mozilla_dom_SVGScriptElement_h -#include "SVGElement.h" -#include "SVGString.h" +#include "SVGAnimatedString.h" #include "mozilla/AlreadyAddRefed.h" #include "mozilla/dom/ScriptElement.h" +#include "mozilla/dom/SVGElement.h" nsresult NS_NewSVGScriptElement( nsIContent** aResult, already_AddRefed&& aNodeInfo, @@ -81,7 +81,7 @@ class SVGScriptElement final : public SVGScriptElementBase, virtual bool GetAsyncState() override { return false; } enum { HREF, XLINK_HREF }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; }; diff --git a/dom/svg/SVGTSpanElement.h b/dom/svg/SVGTSpanElement.h index f80a2573edad..013e0e48c75e 100644 --- a/dom/svg/SVGTSpanElement.h +++ b/dom/svg/SVGTSpanElement.h @@ -37,8 +37,10 @@ class SVGTSpanElement final : public SVGTSpanElementBase { virtual EnumAttributesInfo GetEnumInfo() override; virtual LengthAttributesInfo GetLengthInfo() override; - SVGEnum mEnumAttributes[1]; - virtual SVGEnum* EnumAttributes() override { return mEnumAttributes; } + SVGAnimatedEnumeration mEnumAttributes[1]; + virtual SVGAnimatedEnumeration* EnumAttributes() override { + return mEnumAttributes; + } nsSVGLength2 mLengthAttributes[1]; virtual nsSVGLength2* LengthAttributes() override { diff --git a/dom/svg/SVGTextContentElement.h b/dom/svg/SVGTextContentElement.h index 50e36e361dd6..6fb9dc663d7d 100644 --- a/dom/svg/SVGTextContentElement.h +++ b/dom/svg/SVGTextContentElement.h @@ -9,7 +9,7 @@ #include "mozilla/dom/SVGGraphicsElement.h" #include "DOMSVGAnimatedEnumeration.h" -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "nsSVGLength2.h" class SVGTextFrame; @@ -60,7 +60,7 @@ class SVGTextContentElement : public SVGTextContentElementBase { GetNonLayoutDependentNumberOfChars(); enum { LENGTHADJUST }; - virtual SVGEnum* EnumAttributes() = 0; + virtual SVGAnimatedEnumeration* EnumAttributes() = 0; static SVGEnumMapping sLengthAdjustMap[]; static EnumInfo sEnumInfo[1]; diff --git a/dom/svg/SVGTextElement.h b/dom/svg/SVGTextElement.h index 419784f26cd6..1cdee6c55702 100644 --- a/dom/svg/SVGTextElement.h +++ b/dom/svg/SVGTextElement.h @@ -37,8 +37,10 @@ class SVGTextElement final : public SVGTextElementBase { virtual EnumAttributesInfo GetEnumInfo() override; virtual LengthAttributesInfo GetLengthInfo() override; - SVGEnum mEnumAttributes[1]; - virtual SVGEnum* EnumAttributes() override { return mEnumAttributes; } + SVGAnimatedEnumeration mEnumAttributes[1]; + virtual SVGAnimatedEnumeration* EnumAttributes() override { + return mEnumAttributes; + } nsSVGLength2 mLengthAttributes[1]; virtual nsSVGLength2* LengthAttributes() override { diff --git a/dom/svg/SVGTextPathElement.h b/dom/svg/SVGTextPathElement.h index 27a2c2a0692e..16033574b6bf 100644 --- a/dom/svg/SVGTextPathElement.h +++ b/dom/svg/SVGTextPathElement.h @@ -7,10 +7,10 @@ #ifndef mozilla_dom_SVGTextPathElement_h #define mozilla_dom_SVGTextPathElement_h -#include "SVGEnum.h" +#include "SVGAnimatedEnumeration.h" #include "nsSVGLength2.h" #include "SVGAnimatedPathSegList.h" -#include "SVGString.h" +#include "SVGAnimatedString.h" #include "mozilla/dom/SVGTextContentElement.h" class nsAtom; @@ -72,15 +72,17 @@ class SVGTextPathElement final : public SVGTextPathElementBase { static LengthInfo sLengthInfo[2]; enum { /* LENGTHADJUST, */ METHOD = 1, SPACING, SIDE }; - SVGEnum mEnumAttributes[4]; - virtual SVGEnum* EnumAttributes() override { return mEnumAttributes; } + SVGAnimatedEnumeration mEnumAttributes[4]; + virtual SVGAnimatedEnumeration* EnumAttributes() override { + return mEnumAttributes; + } static SVGEnumMapping sMethodMap[]; static SVGEnumMapping sSpacingMap[]; static SVGEnumMapping sSideMap[]; static EnumInfo sEnumInfo[4]; enum { HREF, XLINK_HREF }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; SVGAnimatedPathSegList mPath; diff --git a/dom/svg/SVGUseElement.h b/dom/svg/SVGUseElement.h index 8af82d72c6c2..61f1c09fc9f0 100644 --- a/dom/svg/SVGUseElement.h +++ b/dom/svg/SVGUseElement.h @@ -14,7 +14,7 @@ #include "nsCOMPtr.h" #include "nsStubMutationObserver.h" #include "nsSVGLength2.h" -#include "SVGString.h" +#include "SVGAnimatedString.h" #include "nsTArray.h" class nsIContent; @@ -144,7 +144,7 @@ class SVGUseElement final : public SVGUseElementBase, static LengthInfo sLengthInfo[4]; enum { HREF, XLINK_HREF }; - SVGString mStringAttributes[2]; + SVGAnimatedString mStringAttributes[2]; static StringInfo sStringInfo[2]; RefPtr mOriginal; // if we've been cloned, our "real" copy diff --git a/dom/svg/SVGViewBoxSMILType.cpp b/dom/svg/SVGViewBoxSMILType.cpp index 7d16d45837e5..754b13100f98 100644 --- a/dom/svg/SVGViewBoxSMILType.cpp +++ b/dom/svg/SVGViewBoxSMILType.cpp @@ -8,7 +8,7 @@ #include "mozilla/SMILValue.h" #include "nsDebug.h" -#include "SVGViewBox.h" +#include "SVGAnimatedViewBox.h" #include namespace mozilla { diff --git a/dom/svg/SVGViewElement.cpp b/dom/svg/SVGViewElement.cpp index cf19313264d7..aec1bcde006c 100644 --- a/dom/svg/SVGViewElement.cpp +++ b/dom/svg/SVGViewElement.cpp @@ -67,7 +67,7 @@ SVGElement::EnumAttributesInfo SVGViewElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -SVGViewBox* SVGViewElement::GetViewBox() { return &mViewBox; } +SVGAnimatedViewBox* SVGViewElement::GetViewBox() { return &mViewBox; } SVGAnimatedPreserveAspectRatio* SVGViewElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; diff --git a/dom/svg/SVGViewElement.h b/dom/svg/SVGViewElement.h index 19d80785bb85..94db68155694 100644 --- a/dom/svg/SVGViewElement.h +++ b/dom/svg/SVGViewElement.h @@ -7,10 +7,10 @@ #ifndef mozilla_dom_SVGViewElement_h #define mozilla_dom_SVGViewElement_h +#include "SVGAnimatedEnumeration.h" #include "SVGAnimatedPreserveAspectRatio.h" -#include "SVGEnum.h" +#include "SVGAnimatedViewBox.h" #include "SVGStringList.h" -#include "SVGViewBox.h" #include "mozilla/dom/SVGElement.h" class nsSVGOuterSVGFrame; @@ -54,14 +54,14 @@ class SVGViewElement : public SVGViewElementBase { virtual EnumAttributesInfo GetEnumInfo() override; enum { ZOOMANDPAN }; - SVGEnum mEnumAttributes[1]; + SVGAnimatedEnumeration mEnumAttributes[1]; static SVGEnumMapping sZoomAndPanMap[]; static EnumInfo sEnumInfo[1]; - virtual SVGViewBox* GetViewBox() override; + virtual SVGAnimatedViewBox* GetViewBox() override; virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override; - SVGViewBox mViewBox; + SVGAnimatedViewBox mViewBox; SVGAnimatedPreserveAspectRatio mPreserveAspectRatio; }; diff --git a/dom/svg/SVGViewportElement.cpp b/dom/svg/SVGViewportElement.cpp index 4271bf3c5834..81cc74a29b9d 100644 --- a/dom/svg/SVGViewportElement.cpp +++ b/dom/svg/SVGViewportElement.cpp @@ -310,7 +310,7 @@ bool SVGViewportElement::HasValidDimensions() const { mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0)); } -SVGViewBox* SVGViewportElement::GetViewBox() { return &mViewBox; } +SVGAnimatedViewBox* SVGViewportElement::GetViewBox() { return &mViewBox; } SVGAnimatedPreserveAspectRatio* SVGViewportElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; diff --git a/dom/svg/SVGViewportElement.h b/dom/svg/SVGViewportElement.h index c6fcfaadba51..296f6d7705a4 100644 --- a/dom/svg/SVGViewportElement.h +++ b/dom/svg/SVGViewportElement.h @@ -11,14 +11,14 @@ #include "mozilla/dom/FromParser.h" #include "nsAutoPtr.h" #include "nsIContentInlines.h" +#include "SVGAnimatedEnumeration.h" +#include "nsSVGLength2.h" #include "SVGAnimatedPreserveAspectRatio.h" -#include "SVGEnum.h" +#include "SVGAnimatedViewBox.h" #include "SVGGraphicsElement.h" #include "SVGImageContext.h" -#include "nsSVGLength2.h" #include "nsISVGPoint.h" #include "SVGPreserveAspectRatio.h" -#include "SVGViewBox.h" class nsSVGOuterSVGFrame; class nsSVGViewportFrame; @@ -126,7 +126,7 @@ class SVGViewportElement : public SVGGraphicsElement { // WebIDL already_AddRefed ViewBox(); already_AddRefed PreserveAspectRatio(); - virtual SVGViewBox* GetViewBox() override; + virtual SVGAnimatedViewBox* GetViewBox() override; protected: // implementation helpers: @@ -178,11 +178,13 @@ class SVGViewportElement : public SVGGraphicsElement { virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override; - virtual const SVGViewBox& GetViewBoxInternal() const { return mViewBox; } + virtual const SVGAnimatedViewBox& GetViewBoxInternal() const { + return mViewBox; + } virtual SVGAnimatedTransformList* GetTransformInternal() const { return mTransforms; } - SVGViewBox mViewBox; + SVGAnimatedViewBox mViewBox; SVGAnimatedPreserveAspectRatio mPreserveAspectRatio; // The size of the rectangular SVG viewport into which we render. This is diff --git a/dom/svg/moz.build b/dom/svg/moz.build index 9f30bafd2e7a..8bed4bae8913 100644 --- a/dom/svg/moz.build +++ b/dom/svg/moz.build @@ -19,13 +19,13 @@ EXPORTS.mozilla += [ EXPORTS.mozilla.dom += [ 'SVGAElement.h', + 'SVGAnimatedClass.h', 'SVGAnimatedRect.h', 'SVGAnimateElement.h', 'SVGAnimateMotionElement.h', 'SVGAnimateTransformElement.h', 'SVGAnimationElement.h', 'SVGCircleElement.h', - 'SVGClass.h', 'SVGClipPathElement.h', 'SVGComponentTransferFunctionElement.h', 'SVGDefsElement.h', @@ -123,21 +123,28 @@ UNIFIED_SOURCES += [ 'nsSVGLength2.cpp', 'nsSVGNumber2.cpp', 'SVGAElement.cpp', + 'SVGAnimatedBoolean.cpp', + 'SVGAnimatedClass.cpp', + 'SVGAnimatedEnumeration.cpp', + 'SVGAnimatedInteger.cpp', + 'SVGAnimatedIntegerPair.cpp', 'SVGAnimatedLengthList.cpp', 'SVGAnimatedNumberList.cpp', + 'SVGAnimatedNumberPair.cpp', + 'SVGAnimatedOrient.cpp', 'SVGAnimatedPathSegList.cpp', 'SVGAnimatedPointList.cpp', 'SVGAnimatedPreserveAspectRatio.cpp', 'SVGAnimatedRect.cpp', + 'SVGAnimatedString.cpp', 'SVGAnimatedTransformList.cpp', + 'SVGAnimatedViewBox.cpp', 'SVGAnimateElement.cpp', 'SVGAnimateMotionElement.cpp', 'SVGAnimateTransformElement.cpp', 'SVGAnimationElement.cpp', 'SVGAttrValueWrapper.cpp', - 'SVGBoolean.cpp', 'SVGCircleElement.cpp', - 'SVGClass.cpp', 'SVGClipPathElement.cpp', 'SVGContentUtils.cpp', 'SVGDataParser.cpp', @@ -147,7 +154,6 @@ UNIFIED_SOURCES += [ 'SVGElement.cpp', 'SVGElementFactory.cpp', 'SVGEllipseElement.cpp', - 'SVGEnum.cpp', 'SVGFEBlendElement.cpp', 'SVGFEColorMatrixElement.cpp', 'SVGFEComponentTransferElement.cpp', @@ -178,8 +184,6 @@ UNIFIED_SOURCES += [ 'SVGGradientElement.cpp', 'SVGGraphicsElement.cpp', 'SVGImageElement.cpp', - 'SVGInteger.cpp', - 'SVGIntegerPair.cpp', 'SVGIntegerPairSMILType.cpp', 'SVGLength.cpp', 'SVGLengthList.cpp', @@ -196,9 +200,7 @@ UNIFIED_SOURCES += [ 'SVGMPathElement.cpp', 'SVGNumberList.cpp', 'SVGNumberListSMILType.cpp', - 'SVGNumberPair.cpp', 'SVGNumberPairSMILType.cpp', - 'SVGOrient.cpp', 'SVGOrientSMILType.cpp', 'SVGPathData.cpp', 'SVGPathDataParser.cpp', @@ -217,7 +219,6 @@ UNIFIED_SOURCES += [ 'SVGScriptElement.cpp', 'SVGSetElement.cpp', 'SVGStopElement.cpp', - 'SVGString.cpp', 'SVGStringList.cpp', 'SVGStyleElement.cpp', 'SVGSVGElement.cpp', @@ -236,7 +237,6 @@ UNIFIED_SOURCES += [ 'SVGTransformListSMILType.cpp', 'SVGTSpanElement.cpp', 'SVGUseElement.cpp', - 'SVGViewBox.cpp', 'SVGViewBoxSMILType.cpp', 'SVGViewElement.cpp', 'SVGViewportElement.cpp', diff --git a/js/src/tests/non262/extensions/RegExp-error-message-skip-selfhosted-frames.js b/js/src/tests/non262/extensions/RegExp-error-message-skip-selfhosted-frames.js new file mode 100644 index 000000000000..fd4571747619 --- /dev/null +++ b/js/src/tests/non262/extensions/RegExp-error-message-skip-selfhosted-frames.js @@ -0,0 +1,11 @@ +for (let name of ["test", Symbol.match, Symbol.replace, Symbol.search]) { + try { + RegExp.prototype[name].call({}); + } catch (e) { + let methodName = typeof name === "symbol" ? `[${name.description}]` : name; + assertEq(e.message, `${methodName} method called on incompatible Object`); + } +} + +if (typeof reportCompare === "function") + reportCompare(true, true); diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index 1c9f60840281..4057b3cd5250 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -11,6 +11,9 @@ #include "mozilla/DebugOnly.h" #include "mozilla/Maybe.h" +#include +#include + #include "jsdate.h" #include "jsfriendapi.h" #include "selfhosted.out.h" @@ -1962,11 +1965,22 @@ bool js::ReportIncompatibleSelfHostedMethod(JSContext* cx, // called function instead. // Lookup the selfhosted method that was invoked. But skip over - // IsTypedArrayEnsuringArrayBuffer frames, because those are never the + // internal self-hosted function frames, because those are never the // actual self-hosted callee from external code. We can't just skip // self-hosted things until we find a non-self-hosted one because of cases // like array.sort(somethingSelfHosted), where we want to report the error // in the somethingSelfHosted, not in the sort() call. + + static const char* const internalNames[] = { + "IsTypedArrayEnsuringArrayBuffer", + "UnwrapAndCallRegExpBuiltinExec", + "RegExpBuiltinExec", + "RegExpExec", + "RegExpSearchSlowPath", + "RegExpReplaceSlowPath", + "RegExpMatchSlowPath", + }; + ScriptFrameIter iter(cx); MOZ_ASSERT(iter.isFunctionFrame()); @@ -1979,7 +1993,9 @@ bool js::ReportIncompatibleSelfHostedMethod(JSContext* cx, if (!funName) { return false; } - if (strcmp(funName, "IsTypedArrayEnsuringArrayBuffer") != 0) { + if (std::all_of( + std::begin(internalNames), std::end(internalNames), + [funName](auto* name) { return strcmp(funName, name) != 0; })) { JS_ReportErrorNumberUTF8(cx, GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_METHOD, funName, "method", InformalValueTypeName(args.thisv())); diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index a2ca6303206c..d1acc166504e 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -29,6 +29,7 @@ #include "mozilla/AnimationEventDispatcher.h" #include "mozilla/ArrayUtils.h" +#include "mozilla/Assertions.h" #include "mozilla/AutoRestore.h" #include "mozilla/DebugOnly.h" #include "mozilla/IntegerRange.h" @@ -1496,7 +1497,7 @@ struct DocumentFrameCallbacks { explicit DocumentFrameCallbacks(Document* aDocument) : mDocument(aDocument) {} RefPtr mDocument; - Document::FrameRequestCallbackList mCallbacks; + nsTArray mCallbacks; }; static nsDocShell* GetDocShell(nsPresContext* aPresContext) { @@ -1688,7 +1689,14 @@ void nsRefreshDriver::RunFrameRequestCallbacks(TimeStamp aNowTime) { // else window is partially torn down already } for (auto& callback : docCallbacks.mCallbacks) { - callback->Call(timeStamp); + if (docCallbacks.mDocument->IsCanceledFrameRequestCallback( + callback.mHandle)) { + continue; + } + // MOZ_KnownLive is OK, because the stack array frameRequestCallbacks + // keeps callback alive and the mCallback strong reference can't be + // mutated by the call. + MOZ_KnownLive(callback.mCallback)->Call(timeStamp); } } } diff --git a/layout/style/ServoBindings.toml b/layout/style/ServoBindings.toml index eb7aa2a4e83d..f5ae1804f432 100644 --- a/layout/style/ServoBindings.toml +++ b/layout/style/ServoBindings.toml @@ -348,7 +348,12 @@ opaque-types = [ "RefPtr_Proxy_member_function", "nsAutoPtr_Proxy", "nsAutoPtr_Proxy_member_function", + "mozilla::detail::HashTable", # <- We should be able to remove this and + # HashSet below once + # https://github.com/rust-lang/rust-bindgen/pull/1515 + # is available "mozilla::detail::PointerType", + "mozilla::HashSet", "mozilla::Pair", "mozilla::Pair_Base", "mozilla::SeenPtrs", diff --git a/layout/svg/nsSVGClipPathFrame.cpp b/layout/svg/nsSVGClipPathFrame.cpp index ca403d276e49..ed0e76fd58d2 100644 --- a/layout/svg/nsSVGClipPathFrame.cpp +++ b/layout/svg/nsSVGClipPathFrame.cpp @@ -428,7 +428,7 @@ gfxMatrix nsSVGClipPathFrame::GetClipPathTransform(nsIFrame* aClippedFrame) { gfxMatrix tm = content->PrependLocalTransformsTo(gfxMatrix()); - SVGEnum* clipPathUnits = + SVGAnimatedEnumeration* clipPathUnits = &content->mEnumAttributes[SVGClipPathElement::CLIPPATHUNITS]; uint32_t flags = nsSVGUtils::eBBoxIncludeFillGeometry | diff --git a/layout/svg/nsSVGFilterFrame.cpp b/layout/svg/nsSVGFilterFrame.cpp index 72cb5a4b1033..fb4d4654b5fb 100644 --- a/layout/svg/nsSVGFilterFrame.cpp +++ b/layout/svg/nsSVGFilterFrame.cpp @@ -31,7 +31,7 @@ nsIFrame* NS_NewSVGFilterFrame(nsIPresShell* aPresShell, NS_IMPL_FRAMEARENA_HELPERS(nsSVGFilterFrame) uint16_t nsSVGFilterFrame::GetEnumValue(uint32_t aIndex, nsIContent* aDefault) { - SVGEnum& thisEnum = + SVGAnimatedEnumeration& thisEnum = static_cast(GetContent())->mEnumAttributes[aIndex]; if (thisEnum.IsExplicitlySet()) { diff --git a/layout/svg/nsSVGFilterInstance.h b/layout/svg/nsSVGFilterInstance.h index 6bc2460cc699..c5b623e98f35 100644 --- a/layout/svg/nsSVGFilterInstance.h +++ b/layout/svg/nsSVGFilterInstance.h @@ -9,9 +9,9 @@ #include "gfxMatrix.h" #include "gfxRect.h" -#include "SVGFilters.h" #include "nsSVGNumber2.h" -#include "SVGNumberPair.h" +#include "SVGAnimatedNumberPair.h" +#include "SVGFilters.h" #include "nsTArray.h" class nsSVGFilterFrame; @@ -65,7 +65,7 @@ class SVGFilterElement; * "filter space point" = (20, 20) */ class nsSVGFilterInstance { - typedef mozilla::SVGNumberPair SVGNumberPair; + typedef mozilla::SVGAnimatedNumberPair SVGAnimatedNumberPair; typedef mozilla::gfx::Point3D Point3D; typedef mozilla::gfx::IntRect IntRect; typedef mozilla::gfx::SourceSurface SourceSurface; @@ -114,8 +114,9 @@ class nsSVGFilterInstance { const nsSVGNumber2* aNumber) const { return GetPrimitiveNumber(aCtxType, aNumber->GetAnimValue()); } - float GetPrimitiveNumber(uint8_t aCtxType, const SVGNumberPair* aNumberPair, - SVGNumberPair::PairIndex aIndex) const { + float GetPrimitiveNumber(uint8_t aCtxType, + const SVGAnimatedNumberPair* aNumberPair, + SVGAnimatedNumberPair::PairIndex aIndex) const { return GetPrimitiveNumber(aCtxType, aNumberPair->GetAnimValue(aIndex)); } diff --git a/layout/svg/nsSVGGradientFrame.cpp b/layout/svg/nsSVGGradientFrame.cpp index 1bbd5a76165c..527a164eaf03 100644 --- a/layout/svg/nsSVGGradientFrame.cpp +++ b/layout/svg/nsSVGGradientFrame.cpp @@ -66,8 +66,9 @@ nsresult nsSVGGradientFrame::AttributeChanged(int32_t aNameSpaceID, uint16_t nsSVGGradientFrame::GetEnumValue(uint32_t aIndex, nsIContent* aDefault) { - const SVGEnum& thisEnum = static_cast(GetContent()) - ->mEnumAttributes[aIndex]; + const SVGAnimatedEnumeration& thisEnum = + static_cast(GetContent()) + ->mEnumAttributes[aIndex]; if (thisEnum.IsExplicitlySet()) { return thisEnum.GetAnimValue(); diff --git a/layout/svg/nsSVGMaskFrame.cpp b/layout/svg/nsSVGMaskFrame.cpp index 18da14815405..879579620959 100644 --- a/layout/svg/nsSVGMaskFrame.cpp +++ b/layout/svg/nsSVGMaskFrame.cpp @@ -208,7 +208,7 @@ gfxMatrix nsSVGMaskFrame::GetCanvasTM() { return mMatrixForChildren; } gfxMatrix nsSVGMaskFrame::GetMaskTransform(nsIFrame* aMaskedFrame) { SVGMaskElement* content = static_cast(GetContent()); - SVGEnum* maskContentUnits = + SVGAnimatedEnumeration* maskContentUnits = &content->mEnumAttributes[SVGMaskElement::MASKCONTENTUNITS]; uint32_t flags = nsSVGUtils::eBBoxIncludeFillGeometry | diff --git a/layout/svg/nsSVGPatternFrame.cpp b/layout/svg/nsSVGPatternFrame.cpp index 779ac54889ae..66785d98dfcb 100644 --- a/layout/svg/nsSVGPatternFrame.cpp +++ b/layout/svg/nsSVGPatternFrame.cpp @@ -131,7 +131,7 @@ static float MaxExpansion(const Matrix &aMatrix) { // scale if the viewBox is specified and _patternUnits_ is set to or defaults to // objectBoundingBox though, since in that case the viewBox is relative to the // bbox -static bool IncludeBBoxScale(const SVGViewBox &aViewBox, +static bool IncludeBBoxScale(const SVGAnimatedViewBox &aViewBox, uint32_t aPatternContentUnits, uint32_t aPatternUnits) { return (!aViewBox.IsExplicitlySet() && @@ -163,7 +163,8 @@ static Matrix GetPatternMatrix(uint16_t aPatternUnits, return patternMatrix; } -static nsresult GetTargetGeometry(gfxRect *aBBox, const SVGViewBox &aViewBox, +static nsresult GetTargetGeometry(gfxRect *aBBox, + const SVGAnimatedViewBox &aViewBox, uint16_t aPatternContentUnits, uint16_t aPatternUnits, nsIFrame *aTarget, const Matrix &aContextMatrix, @@ -214,7 +215,7 @@ already_AddRefed nsSVGPatternFrame::PaintPattern( } nsIFrame *firstKid = patternWithChildren->mFrames.FirstChild(); - const SVGViewBox &viewBox = GetViewBox(); + const SVGAnimatedViewBox &viewBox = GetViewBox(); uint16_t patternContentUnits = GetEnumValue(SVGPatternElement::PATTERNCONTENTUNITS); @@ -411,7 +412,7 @@ nsSVGPatternFrame *nsSVGPatternFrame::GetPatternWithChildren() { uint16_t nsSVGPatternFrame::GetEnumValue(uint32_t aIndex, nsIContent *aDefault) { - SVGEnum &thisEnum = + SVGAnimatedEnumeration &thisEnum = static_cast(GetContent())->mEnumAttributes[aIndex]; if (thisEnum.IsExplicitlySet()) { @@ -472,8 +473,8 @@ gfxMatrix nsSVGPatternFrame::GetPatternTransform() { return animTransformList->GetAnimValue().GetConsolidationMatrix(); } -const SVGViewBox &nsSVGPatternFrame::GetViewBox(nsIContent *aDefault) { - const SVGViewBox &thisViewBox = +const SVGAnimatedViewBox &nsSVGPatternFrame::GetViewBox(nsIContent *aDefault) { + const SVGAnimatedViewBox &thisViewBox = static_cast(GetContent())->mViewBox; if (thisViewBox.IsExplicitlySet()) { @@ -611,7 +612,7 @@ gfxRect nsSVGPatternFrame::GetPatternRect(uint16_t aPatternUnits, return gfxRect(x, y, width, height); } -gfxMatrix nsSVGPatternFrame::ConstructCTM(const SVGViewBox &aViewBox, +gfxMatrix nsSVGPatternFrame::ConstructCTM(const SVGAnimatedViewBox &aViewBox, uint16_t aPatternContentUnits, uint16_t aPatternUnits, const gfxRect &callerBBox, diff --git a/layout/svg/nsSVGPatternFrame.h b/layout/svg/nsSVGPatternFrame.h index 18b9528bbc6f..0e4ed8a3a78e 100644 --- a/layout/svg/nsSVGPatternFrame.h +++ b/layout/svg/nsSVGPatternFrame.h @@ -20,8 +20,8 @@ class nsSVGLength2; namespace mozilla { class SVGAnimatedPreserveAspectRatio; class SVGAnimatedTransformList; +class SVGAnimatedViewBox; class SVGGeometryFrame; -class SVGViewBox; } // namespace mozilla class nsSVGPatternFrame final : public nsSVGPaintServerFrame { @@ -80,8 +80,8 @@ class nsSVGPatternFrame final : public nsSVGPaintServerFrame { mozilla::SVGAnimatedTransformList* GetPatternTransformList( nsIContent* aDefault); gfxMatrix GetPatternTransform(); - const SVGViewBox& GetViewBox(nsIContent* aDefault); - const SVGViewBox& GetViewBox() { return GetViewBox(mContent); } + const SVGAnimatedViewBox& GetViewBox(nsIContent* aDefault); + const SVGAnimatedViewBox& GetViewBox() { return GetViewBox(mContent); } const SVGAnimatedPreserveAspectRatio& GetPreserveAspectRatio( nsIContent* aDefault); const SVGAnimatedPreserveAspectRatio& GetPreserveAspectRatio() { @@ -110,7 +110,7 @@ class nsSVGPatternFrame final : public nsSVGPaintServerFrame { gfxRect GetPatternRect(uint16_t aPatternUnits, const gfxRect& bbox, const Matrix& callerCTM, nsIFrame* aTarget); - gfxMatrix ConstructCTM(const SVGViewBox& aViewBox, + gfxMatrix ConstructCTM(const SVGAnimatedViewBox& aViewBox, uint16_t aPatternContentUnits, uint16_t aPatternUnits, const gfxRect& callerBBox, const Matrix& callerCTM, nsIFrame* aTarget); diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index 532dd9feddd7..df42c8af842a 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -1206,8 +1206,8 @@ bool nsSVGUtils::CanOptimizeOpacity(nsIFrame* aFrame) { } gfxMatrix nsSVGUtils::AdjustMatrixForUnits(const gfxMatrix& aMatrix, - SVGEnum* aUnits, nsIFrame* aFrame, - uint32_t aFlags) { + SVGAnimatedEnumeration* aUnits, + nsIFrame* aFrame, uint32_t aFlags) { if (aFrame && aUnits->GetAnimValue() == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) { gfxRect bbox = GetBBox(aFrame, aFlags); gfxMatrix tm = aMatrix; diff --git a/layout/svg/nsSVGUtils.h b/layout/svg/nsSVGUtils.h index 0d1d70f91679..c658b85587d6 100644 --- a/layout/svg/nsSVGUtils.h +++ b/layout/svg/nsSVGUtils.h @@ -44,9 +44,9 @@ struct nsStyleSVG; struct nsRect; namespace mozilla { +class SVGAnimatedEnumeration; class SVGContextPaint; struct SVGContextPaintImpl; -class SVGEnum; class SVGGeometryFrame; namespace dom { class Element; @@ -344,7 +344,7 @@ class nsSVGUtils { * @param aFlags One or more of the BBoxFlags values defined below. */ static gfxMatrix AdjustMatrixForUnits(const gfxMatrix& aMatrix, - mozilla::SVGEnum* aUnits, + mozilla::SVGAnimatedEnumeration* aUnits, nsIFrame* aFrame, uint32_t aFlags); enum BBoxFlags { diff --git a/testing/web-platform/meta/html/webappapis/animation-frames/cancel-pending.html.ini b/testing/web-platform/meta/html/webappapis/animation-frames/cancel-pending.html.ini deleted file mode 100644 index 7ce817ba55f6..000000000000 --- a/testing/web-platform/meta/html/webappapis/animation-frames/cancel-pending.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[cancel-pending.html] - [cancelAnimationFrame cancels a pending animation frame callback] - expected: FAIL - diff --git a/third_party/rust/darling/.cargo-checksum.json b/third_party/rust/darling/.cargo-checksum.json index 25b465bc5b82..8090e3fc3eb4 100644 --- a/third_party/rust/darling/.cargo-checksum.json +++ b/third_party/rust/darling/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"06091817afa317ff86efb9aee3fa8d165358150a92c6369e4ab2958765c14af8","Cargo.toml":"3ec79fcbc682939731504a261f9f7a10afecdbbf298af8a10a9748abcb79172a","LICENSE":"8ea93490d74a5a1b1af3ff71d786271b3f1e5f0bea79ac16e02ec533cef040d6","README.md":"f70d772dd28cd14fc817c71d343b07ec8bfbe02dfe8d3e999a0185c6ef8731ec","examples/automatic_bounds.rs":"2716da31a5beed954da77866779ef77600686688a8890fefa7e23db628358104","examples/consume_fields.rs":"abcdd6a919a95a5c295e8d362db0367ab171fe3c8a80b23d83701765cd902d2d","examples/fallible_read.rs":"e06d5c045d3a47c0e00d3c77ed3aa1a1d5173d2c3f462dc1967379db3094af4c","examples/supports_struct.rs":"f2d84a4377e555ed7535e563c9593bd6a398a63b42f7da72381eea2fccec229f","publish.sh":"42795a155247c69402f8c4c917c9874a06dfde5a7606c8b59fc4e9ccd34233dd","src/lib.rs":"07da20edb52c4aba30f2b680b28ca96cf995859566b0db3b1d2e0ee967249a18","src/macros_public.rs":"3ed7eb99f309d9cd600d3a09ff4dcf5cc5d787fb49e8e5ead6bb00e31e5e6793","tests/accrue_errors.rs":"f873acf2a13dba88f508c3eb118d14e36515bf94b7ee914ddec2ae1eb55e381f","tests/computed_bound.rs":"2313da96a250b5948ca06bf86cb7158b55a59eba75334aa8ba27a46b28ede6b5","tests/custom_bound.rs":"4dd3e8fd76734d8f262e857773f53a820229ad6e10fe6fbbbe1f636c7da9eab0","tests/defaults.rs":"b544be90d18be26305a757e8468bf8735356889b59c167294d118e32ee7f82ea","tests/enums_newtype.rs":"723c761eab356f577e804a5e07f5efa244f70fb7525d20fceb1bc3852c8d742e","tests/enums_struct.rs":"e0097d7f947cf9e4612c9450c55ea5075c7f6fcbbf8cac7176449d92eebc9343","tests/enums_unit.rs":"8c075d5897b60b58cb71d6306e7fdd80851f5a147ae3010ba70ea100007364a3","tests/error.rs":"f989a43fad47d61d75da2bc78af6c51bac549f39f14f87a804eea226308ece32","tests/from_generics.rs":"79230ad21e8482cf6e6ceb0c74303bc0cdf77fbb951f46a6ba1006ecf1248fd5","tests/from_type_param.rs":"4369737a9d4c21cfa8595a9159cd5d98d02af3445d8b4085654ad4ce8e8bba3f","tests/from_type_param_default.rs":"a5ee72f22540004e755445c37dd4c425ef12beef496896d608695bae964afe7f","tests/from_variant.rs":"2e804326302a62b979eae963e88f0a2cdb6a21ee9667407c361d178f8c0aadba","tests/generics.rs":"3c0f43b39a8f319b8318e409d3836c7235892ae4f50f5986ea80f69b80a4080b","tests/happy_path.rs":"13cf6cd5f87920d90762fd08e45d9f0bb378563e1c92cf5ffb3ba78decdc4969","tests/multiple.rs":"b76172c396a89414b1669eec2bf854c79a7215fd3b6977123b81591ac6761670","tests/newtype.rs":"c45842fd764174a6a8177851e15445d344ab93bf2124b5f77213780d1306adea","tests/skip.rs":"fd936a5eff92c0a49b0a900e6fcda6b7a10a83dd4096ae2000201ccb3f66a738","tests/split_declaration.rs":"b191ed446bf7b8fdf1d41059354adb4b155523507f37b0d36aed3347617a2492","tests/supports.rs":"acb53d4d810dcd3e46763db13234e4fb42e425cfde2516d9bf5d7b690be72dcc"},"package":"f593353cad5af2df6d54810de2b61aa8acba5b5fbc70b0d75e7cc5bdd80aca73"} \ No newline at end of file +{"files":{"CHANGELOG.md":"111bee96e6baf82f8898ada5f5395888253832ed641fc6013ad803ac6afaeaf0","Cargo.toml":"66f4111240094e9fed78c1989fc56b30fb94a58f2465eb0eacbaf050cc027b81","LICENSE":"8ea93490d74a5a1b1af3ff71d786271b3f1e5f0bea79ac16e02ec533cef040d6","README.md":"05357355cb87aea0b5bda29ce9f6ef03331717cf351c6cf7554855f5d825756e","examples/automatic_bounds.rs":"dcac3391ed568475cea17ec64c324283f9771dce61adb0a0dd7b8a9ee0bf954d","examples/consume_fields.rs":"ebf4bd8baf4e54ccaa926f910957183d6a5b1decaa87ab5ebcca6c8d38b6c6b3","examples/fallible_read.rs":"aa9d1e0aaba8f3eb4580e94e133839f7eb77fca61beed254f3d5e0f6d6981f00","examples/supports_struct.rs":"d69124e09d3d6b8e04a3af07a6af96c5df7cbd3d6953a51657b39088cc2c2de7","src/lib.rs":"07da20edb52c4aba30f2b680b28ca96cf995859566b0db3b1d2e0ee967249a18","src/macros_public.rs":"3ed7eb99f309d9cd600d3a09ff4dcf5cc5d787fb49e8e5ead6bb00e31e5e6793","tests/accrue_errors.rs":"f5ac2d8cb0a12284a845d25b9472c4605aa5e8c1cd66a6dd6ad64f1c749b2caf","tests/computed_bound.rs":"2313da96a250b5948ca06bf86cb7158b55a59eba75334aa8ba27a46b28ede6b5","tests/custom_bound.rs":"4dd3e8fd76734d8f262e857773f53a820229ad6e10fe6fbbbe1f636c7da9eab0","tests/defaults.rs":"b544be90d18be26305a757e8468bf8735356889b59c167294d118e32ee7f82ea","tests/enums_newtype.rs":"a09af70072e566bee1f6cad91675f3553c47333e51a0e389ebb47ae82de776a8","tests/enums_struct.rs":"e0097d7f947cf9e4612c9450c55ea5075c7f6fcbbf8cac7176449d92eebc9343","tests/enums_unit.rs":"8c075d5897b60b58cb71d6306e7fdd80851f5a147ae3010ba70ea100007364a3","tests/error.rs":"465f7634fa23f0076c93a9c5fc16ccde16119b874d64c8dabaf275b6b7ae61f2","tests/from_generics.rs":"79230ad21e8482cf6e6ceb0c74303bc0cdf77fbb951f46a6ba1006ecf1248fd5","tests/from_type_param.rs":"7c97745cdcea18a2d6f51e4da7426055a078287bf9f2c93d487057195efa2b30","tests/from_type_param_default.rs":"80787ef6527e7f76c2aac93b1f35a006a9c5e0df8deed61698eaac1127278021","tests/from_variant.rs":"2e804326302a62b979eae963e88f0a2cdb6a21ee9667407c361d178f8c0aadba","tests/generics.rs":"e08aea8a8de8f03e3c243bde650e250defbe340cef3e4c06935b2b3e46d2a376","tests/happy_path.rs":"c32daa68e2becdc2d6204985a19b437cfb49d7f1680e890578f0760dc9749b77","tests/multiple.rs":"0391be49bab07771d7e37d35fe17f6d9bf1aa6dc57e2c0e5c0912ab8e043128f","tests/newtype.rs":"3f029724467abc7a33aaf7b6a1feb7b6898eba578576afff338e73deb9fd2b3b","tests/skip.rs":"604861aa4d1dfdc4e5f38f8261be19b7240c650eb493b64ce0178f54c24a8d2d","tests/split_declaration.rs":"f509390f88549164af9218f1e5b07564b169a4481a20b738432ffb03c517b599","tests/suggestions.rs":"0afb756949be876aaae76974f119be811c783fb134a54978ff0453c537ff3174","tests/supports.rs":"3b096c3d893bf8e76f70219bc276cbfe04529091e9e8652af140f0f1b3a91270"},"package":"9158d690bc62a3a57c3e45b85e4d50de2008b39345592c64efd79345c7e24be0"} \ No newline at end of file diff --git a/third_party/rust/darling/CHANGELOG.md b/third_party/rust/darling/CHANGELOG.md index 2ec5d8675b2b..7f91819becf9 100644 --- a/third_party/rust/darling/CHANGELOG.md +++ b/third_party/rust/darling/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## v0.8.6 (March 18, 2019) +- Added "did you mean" suggestions for unknown fields behind the `suggestions` flag [#60](https://github.com/TedDriggs/issues/60) +- Added `Error::unknown_field_with_alts` to support the suggestion use-case. +- Added `ast::Fields::len` and `ast::Fields::is_empty` methods. + +## v0.8.5 (February 4, 2019) +- Accept unquoted positive numeric literals [#52](https://github.com/TedDriggs/issues/52) +- Add `FromMeta` to the `syn::Lit` enum and its variants +- Improve error message for unexpected literal formats to not say "other" + +## v0.8.4 (February 4, 2019) +- Use `syn::Error` to provide precise errors before `proc_macro::Diagnostic` is available +- Add `diagnostics` feature flag to toggle between stable and unstable error backends +- Attach error information in more contexts +- Add `allow_unknown_fields` to support parsing the same attribute multiple times for different macros [#51](https://github.com/darling/issues/51) +- Proc-macro authors will now see better errors in `darling` attributes + +## v0.8.3 (January 21, 2019) +- Attach spans to errors in generated trait impls [#37](https://github.com/darling/issues/37) +- Attach spans to errors for types with provided bespoke implementations +- Deprecate `set_span` from 0.8.2, as spans should never be broadened after being initially set + +## v0.8.2 (January 17, 2019) +- Add spans to errors to make quality warnings and errors easy in darling. This is blocked on diagnostics stabilizing. +- Add `darling::util::SpannedValue` so proc-macro authors can remember position information alongside parsed values. + ## v0.8.0 - Update dependency on `syn` to 0.15 [#44](https://github.com/darling/pull/44). Thanks to @hcpl diff --git a/third_party/rust/darling/Cargo.toml b/third_party/rust/darling/Cargo.toml index 9a88e2393b49..0d9a0c2613ad 100644 --- a/third_party/rust/darling/Cargo.toml +++ b/third_party/rust/darling/Cargo.toml @@ -12,18 +12,19 @@ [package] name = "darling" -version = "0.8.1" +version = "0.8.6" authors = ["Ted Driggs "] +exclude = ["/.travis.yml", "/publish.sh"] description = "A proc-macro library for reading attributes into structs when\nimplementing custom derives.\n" -documentation = "https://docs.rs/darling/0.8.1" +documentation = "https://docs.rs/darling/0.8.6" readme = "README.md" license = "MIT" repository = "https://github.com/TedDriggs/darling" [dependencies.darling_core] -version = "=0.8.1" +version = "=0.8.6" [dependencies.darling_macro] -version = "=0.8.1" +version = "=0.8.6" [dev-dependencies.proc-macro2] version = "0.4" @@ -31,6 +32,10 @@ version = "0.4" version = "0.6" [dev-dependencies.syn] -version = "0.15" +version = "0.15.26" + +[features] +diagnostics = ["darling_core/diagnostics"] +suggestions = ["darling_core/suggestions"] [badges.travis-ci] repository = "TedDriggs/darling" diff --git a/third_party/rust/darling/README.md b/third_party/rust/darling/README.md index 9919e722236b..28d07cf43914 100644 --- a/third_party/rust/darling/README.md +++ b/third_party/rust/darling/README.md @@ -10,8 +10,9 @@ Darling `darling` provides a set of traits which can be derived or manually implemented. 1. `FromMeta` is used to extract values from a meta-item in an attribute. Implementations are likely reusable for many libraries, much like `FromStr` or `serde::Deserialize`. Trait implementations are provided for primitives, some std types, and some `syn` types. -1. `FromDeriveInput` is implemented or derived by each proc-macro crate which depends on `darling`. This is the root for input parsing; it gets access to the identity, generics, and visibility of the target type, and can specify which attribute names should be parsed or forwarded from the input AST. -1. `FromField` is implemented or derived by each proc-macro crate which depends on `darling`. Structs deriving this trait will get access to the identity (if it exists), type, and visibility of the field. +2. `FromDeriveInput` is implemented or derived by each proc-macro crate which depends on `darling`. This is the root for input parsing; it gets access to the identity, generics, and visibility of the target type, and can specify which attribute names should be parsed or forwarded from the input AST. +3. `FromField` is implemented or derived by each proc-macro crate which depends on `darling`. Structs deriving this trait will get access to the identity (if it exists), type, and visibility of the field. +4. `FromVariant` is implemented or derived by each proc-macro crate which depends on `darling`. Structs deriving this trait will get access to the identity and contents of the variant, which can be transformed the same as any other `darling` input. # Example @@ -46,6 +47,49 @@ The above code will then be able to parse this input: pub struct ConsumingType; ``` +# Attribute Macros +Non-derive attribute macros are supported. +To parse arguments for attribute macros, derive `FromMeta` on the argument receiver type, then pass `&syn::AttributeArgs` to the `from_list` method. +This will produce a normal `darling::Result` that can be used the same as a result from parsing a `DeriveInput`. + +## Macro Code +```rust,ignore +use darling::FromMeta; +use syn::{AttributeArgs, ItemFn}; +use proc_macro::TokenStream; + +#[derive(Debug, FromMeta)] +pub struct MacroArgs { + #[darling(default)] + timeout_ms: Option, + path: String, +} + +#[proc_macro_attribute] +fn your_attr(args: TokenStream, input: TokenStream) -> TokenStream { + let attr_args = parse_macro_input!(args as AttributeArgs); + let _input = parse_macro_input!(input as ItemFn); + + let _args = match MacroArgs::from_list(&attr_args) { + Ok(v) => v, + Err(e) => { return e.write_errors(); } + }; + + // do things with `args` + unimplemented!() +} +``` + +## Consuming Code +```rust,ignore +use your_crate::your_attr; + +#[your_attr(path = "hello", timeout_ms = 15)] +fn do_stuff() { + println!("Hello"); +} +``` + # Features Darling's features are built to work well for real-world projects. @@ -55,3 +99,4 @@ Darling's features are built to work well for real-world projects. * **Mapping function**: Use `#[darling(map="path")]` to specify a function that runs on the result of parsing a meta-item field. This can change the return type, which enables you to parse to an intermediate form and convert that to the type you need in your struct. * **Skip fields**: Use `#[darling(skip)]` to mark a field that shouldn't be read from attribute meta-items. * **Multiple-occurrence fields**: Use `#[darling(multiple)]` on a `Vec` field to allow that field to appear multiple times in the meta-item. Each occurrence will be pushed into the `Vec`. +* **Span access**: Use `darling::util::SpannedValue` in a struct to get access to that meta item's source code span. This can be used to emit warnings that point at a specific field from your proc macro. In addition, you can use `darling::Error::write_errors` to automatically get precise error location details in most cases. diff --git a/third_party/rust/darling/examples/automatic_bounds.rs b/third_party/rust/darling/examples/automatic_bounds.rs index 06263f147f71..0b9aec484f46 100644 --- a/third_party/rust/darling/examples/automatic_bounds.rs +++ b/third_party/rust/darling/examples/automatic_bounds.rs @@ -68,7 +68,8 @@ fn main() { Div(String) } "#, - ).unwrap(); + ) + .unwrap(); let parsed: SpeakingOptions = FromDeriveInput::from_derive_input(&derive_input).unwrap(); diff --git a/third_party/rust/darling/examples/consume_fields.rs b/third_party/rust/darling/examples/consume_fields.rs index d5602f303fec..4b0703f50764 100644 --- a/third_party/rust/darling/examples/consume_fields.rs +++ b/third_party/rust/darling/examples/consume_fields.rs @@ -64,7 +64,8 @@ impl ToTokens for MyInputReceiver { } = *self; let (imp, ty, wher) = generics.split_for_impl(); - let fields = data.as_ref() + let fields = data + .as_ref() .take_struct() .expect("Should never be enum") .fields; diff --git a/third_party/rust/darling/examples/fallible_read.rs b/third_party/rust/darling/examples/fallible_read.rs index 04d573cefa2f..c487854336ed 100644 --- a/third_party/rust/darling/examples/fallible_read.rs +++ b/third_party/rust/darling/examples/fallible_read.rs @@ -4,7 +4,6 @@ //! 1. Using `darling::Result` as a carrier to preserve the error for later display //! 1. Using `Result` to attempt a recovery in imperative code //! 1. Using the `map` darling meta-item to post-process the receiver before returning. - #[macro_use] extern crate darling; @@ -58,8 +57,8 @@ impl MyInputReceiver { }; Self { - name: name, - frequency: frequency, + name, + frequency, amplitude: Ok(amplitude), } } diff --git a/third_party/rust/darling/examples/supports_struct.rs b/third_party/rust/darling/examples/supports_struct.rs index b76b4b707dab..dbf8238a9db9 100644 --- a/third_party/rust/darling/examples/supports_struct.rs +++ b/third_party/rust/darling/examples/supports_struct.rs @@ -37,8 +37,7 @@ pub struct Foo { let parsed = syn::parse_str(good_input).unwrap(); let receiver = Lorem::from_derive_input(&parsed).unwrap(); let wrong_shape_parsed = syn::parse_str(bad_input).unwrap(); - let wrong_shape = Lorem::from_derive_input(&wrong_shape_parsed) - .expect_err("Shape was wrong"); + let wrong_shape = Lorem::from_derive_input(&wrong_shape_parsed).expect_err("Shape was wrong"); println!( r#" diff --git a/third_party/rust/darling/publish.sh b/third_party/rust/darling/publish.sh deleted file mode 100755 index 6531b7039287..000000000000 --- a/third_party/rust/darling/publish.sh +++ /dev/null @@ -1,3 +0,0 @@ -cargo publish --manifest-path core/Cargo.toml; -cargo publish --manifest-path macro/Cargo.toml; -cargo publish; \ No newline at end of file diff --git a/third_party/rust/darling/tests/accrue_errors.rs b/third_party/rust/darling/tests/accrue_errors.rs index 44ba7d908ddb..9ae8212765b8 100644 --- a/third_party/rust/darling/tests/accrue_errors.rs +++ b/third_party/rust/darling/tests/accrue_errors.rs @@ -3,7 +3,10 @@ #[macro_use] extern crate darling; +#[macro_use] extern crate syn; +#[macro_use] +extern crate quote; use darling::ast; use darling::FromDeriveInput; @@ -30,17 +33,14 @@ struct LoremField { #[test] fn bad_type_and_missing_fields() { - let input = syn::parse_str( - r#" - #[accrue(ipsum = true, dolor(amet = "Hi"))] - pub struct NonConforming { - foo: () - } - "#, - ).unwrap(); + let input = parse_quote! { + #[accrue(ipsum = true, dolor(amet = "Hi"))] + pub struct NonConforming { + foo: () + } + }; let s_result: ::darling::Error = Lorem::from_derive_input(&input).unwrap_err(); - //assert_eq!(3, s_result.len()); let err = s_result.flatten(); println!("{}", err); assert_eq!(3, err.len()); @@ -48,17 +48,15 @@ fn bad_type_and_missing_fields() { #[test] fn body_only_issues() { - let input = syn::parse_str( - r#" - #[accrue(ipsum = "Hello", dolor(sit))] - pub struct NonConforming { - foo: (), - bar: bool, - } - "#, - ).unwrap(); + let input = parse_quote! { + #[accrue(ipsum = "Hello", dolor(sit))] + pub struct NonConforming { + foo: (), + bar: bool, + } + }; - let s_err: ::darling::Error = Lorem::from_derive_input(&input).unwrap_err(); + let s_err = Lorem::from_derive_input(&input).unwrap_err(); println!("{:?}", s_err); assert_eq!(2, s_err.len()); } @@ -78,17 +76,15 @@ struct Month { #[test] fn error_in_enum_fields() { - let input = syn::parse_str( - r#" - #[accrue(schedule(tuesday(morning = "yes")))] - pub struct NonConforming { - foo: (), - bar: bool, - } - "#, - ).unwrap(); + let input = parse_quote! { + #[accrue(schedule(tuesday(morning = "yes")))] + pub struct NonConforming { + foo: (), + bar: bool, + } + }; - let s_err: ::darling::Error = Month::from_derive_input(&input).unwrap_err(); + let s_err = Month::from_derive_input(&input).unwrap_err(); assert_eq!(2, s_err.len()); let err = s_err.flatten(); // TODO add tests to check location path is correct @@ -97,17 +93,15 @@ fn error_in_enum_fields() { #[test] fn error_in_newtype_variant() { - let input = syn::parse_str( - r#" - #[accrue(schedule(wednesday(sit = "yes")))] - pub struct NonConforming { - foo: (), - bar: bool, - } - "#, - ).unwrap(); + let input = parse_quote! { + #[accrue(schedule(wednesday(sit = "yes")))] + pub struct NonConforming { + foo: (), + bar: bool, + } + }; - let s_err: ::darling::Error = Month::from_derive_input(&input).unwrap_err(); + let s_err = Month::from_derive_input(&input).unwrap_err(); assert_eq!(1, s_err.len()); println!("{}", s_err); println!("{}", s_err.flatten()); diff --git a/third_party/rust/darling/tests/enums_newtype.rs b/third_party/rust/darling/tests/enums_newtype.rs index f17d33e5654b..0fd12f03fc77 100644 --- a/third_party/rust/darling/tests/enums_newtype.rs +++ b/third_party/rust/darling/tests/enums_newtype.rs @@ -1,10 +1,12 @@ #[macro_use] extern crate darling; +#[macro_use] +extern crate syn; +#[macro_use] +extern crate quote; use darling::FromDeriveInput; -extern crate syn; - #[derive(Debug, Default, PartialEq, Eq, FromMeta)] #[darling(default)] pub struct Amet { @@ -34,12 +36,10 @@ impl PartialEq for Holder { #[test] fn bool_word() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[hello(lorem(ipsum))] pub struct Bar; - "#, - ).unwrap(); + }; let pr = Holder::from_derive_input(&di).unwrap(); assert_eq!(pr, Lorem::Ipsum(true)); @@ -47,12 +47,10 @@ fn bool_word() { #[test] fn bool_literal() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[hello(lorem(ipsum = false))] pub struct Bar; - "#, - ).unwrap(); + }; let pr = Holder::from_derive_input(&di).unwrap(); assert_eq!(pr, Lorem::Ipsum(false)); @@ -60,12 +58,10 @@ fn bool_literal() { #[test] fn string_literal() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[hello(lorem(dolor = "Hello"))] pub struct Bar; - "#, - ).unwrap(); + }; let pr = Holder::from_derive_input(&di).unwrap(); assert_eq!(pr, Lorem::Dolor("Hello".to_string())); @@ -73,12 +69,10 @@ fn string_literal() { #[test] fn struct_nested() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[hello(lorem(sit(world = "Hello", hello = false)))] pub struct Bar; - "#, - ).unwrap(); + }; let pr = Holder::from_derive_input(&di).unwrap(); assert_eq!( @@ -93,12 +87,10 @@ fn struct_nested() { #[test] #[should_panic] fn format_mismatch() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[hello(lorem(dolor(world = "Hello", hello = false)))] pub struct Bar; - "#, - ).unwrap(); + }; Holder::from_derive_input(&di).unwrap(); } diff --git a/third_party/rust/darling/tests/error.rs b/third_party/rust/darling/tests/error.rs index 6da666951fb7..edd72eb1dd97 100644 --- a/third_party/rust/darling/tests/error.rs +++ b/third_party/rust/darling/tests/error.rs @@ -1,7 +1,10 @@ //! In case of bad input, parsing should fail. The error should have locations set in derived implementations. #[macro_use] extern crate darling; +#[macro_use] extern crate syn; +#[macro_use] +extern crate quote; use darling::FromDeriveInput; @@ -33,24 +36,20 @@ impl From for Lorem { #[test] fn parsing_fail() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[hello(ipsum(amet = "yes", world = false))] pub struct Foo; - "#, - ).unwrap(); + }; println!("{}", Lorem::from_derive_input(&di).unwrap_err()); } #[test] fn missing_field() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[hello(ipsum(amet = true))] pub struct Foo; - "#, - ).unwrap(); + }; println!("{}", Lorem::from_derive_input(&di).unwrap_err()); } diff --git a/third_party/rust/darling/tests/from_type_param.rs b/third_party/rust/darling/tests/from_type_param.rs index ebd7e3e269ba..adaf34dd3868 100644 --- a/third_party/rust/darling/tests/from_type_param.rs +++ b/third_party/rust/darling/tests/from_type_param.rs @@ -1,6 +1,9 @@ #[macro_use] extern crate darling; +#[macro_use] extern crate syn; +#[macro_use] +extern crate quote; use darling::FromTypeParam; use syn::{DeriveInput, GenericParam, Ident, TypeParam}; @@ -34,14 +37,13 @@ fn extract_type(param: &GenericParam) -> &TypeParam { #[test] fn expand_many() { - let di: DeriveInput = syn::parse_str( - r#" + let di: DeriveInput = parse_quote! { struct Baz< #[lorem(foo)] T, #[lorem(bar = "x")] U: Eq + ?Sized >(T, U); - "#, - ).unwrap(); + }; + let params = di.generics.params; { diff --git a/third_party/rust/darling/tests/from_type_param_default.rs b/third_party/rust/darling/tests/from_type_param_default.rs index df24de08892a..eb0ecc766cca 100644 --- a/third_party/rust/darling/tests/from_type_param_default.rs +++ b/third_party/rust/darling/tests/from_type_param_default.rs @@ -1,6 +1,9 @@ #[macro_use] extern crate darling; +#[macro_use] extern crate syn; +#[macro_use] +extern crate quote; use darling::FromTypeParam; use syn::{DeriveInput, GenericParam, TypeParam}; @@ -22,15 +25,13 @@ fn extract_type(param: &GenericParam) -> &TypeParam { #[test] fn expand_many() { - let di: DeriveInput = syn::parse_str( - r#" + let di: DeriveInput = parse_quote! { struct Baz< #[lorem(foo)] T, #[lorem(bar = "x")] U: Eq + ?Sized, #[lorem(foo = false)] V = (), >(T, U, V); - "#, - ).unwrap(); + }; let params = di.generics.params; { diff --git a/third_party/rust/darling/tests/generics.rs b/third_party/rust/darling/tests/generics.rs index c268f56c0f6b..a83d03e284b7 100644 --- a/third_party/rust/darling/tests/generics.rs +++ b/third_party/rust/darling/tests/generics.rs @@ -1,6 +1,9 @@ #[macro_use] extern crate darling; +#[macro_use] extern crate syn; +#[macro_use] +extern crate quote; use darling::FromDeriveInput; @@ -15,12 +18,10 @@ struct Foo { #[test] fn expansion() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[hello(lorem = "Hello")] pub struct Foo; - "#, - ).unwrap(); + }; - let _parsed = Foo::::from_derive_input(&di).unwrap(); + Foo::::from_derive_input(&di).unwrap(); } diff --git a/third_party/rust/darling/tests/happy_path.rs b/third_party/rust/darling/tests/happy_path.rs index d5d7b54fb9fa..df1bfadd754f 100644 --- a/third_party/rust/darling/tests/happy_path.rs +++ b/third_party/rust/darling/tests/happy_path.rs @@ -1,6 +1,5 @@ #[macro_use] extern crate darling; - #[macro_use] extern crate syn; #[macro_use] @@ -34,13 +33,11 @@ struct TraitCore { #[test] fn simple() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[derive(Foo)] #[darling_demo(lorem(ipsum))] pub struct Bar; - "#, - ).unwrap(); + }; assert_eq!( Core::from_derive_input(&di).unwrap(), @@ -58,13 +55,11 @@ fn simple() { #[test] fn trait_type() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[derive(Foo)] #[darling_demo(lorem(dolor = "hello"))] pub struct Bar; - "#, - ).unwrap(); + }; assert_eq!( TraitCore::from_derive_input(&di).unwrap(), diff --git a/third_party/rust/darling/tests/multiple.rs b/third_party/rust/darling/tests/multiple.rs index 111c1f402a6b..e70528063352 100644 --- a/third_party/rust/darling/tests/multiple.rs +++ b/third_party/rust/darling/tests/multiple.rs @@ -1,6 +1,9 @@ #[macro_use] extern crate darling; +#[macro_use] extern crate syn; +#[macro_use] +extern crate quote; use darling::FromDeriveInput; @@ -20,12 +23,10 @@ struct Ipsum { #[test] fn expand_many() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[hello(ipsum(dolor = "Hello", dolor = "World"))] pub struct Baz; - "#, - ).unwrap(); + }; let lorem: Lorem = Lorem::from_derive_input(&di).unwrap(); assert_eq!( diff --git a/third_party/rust/darling/tests/newtype.rs b/third_party/rust/darling/tests/newtype.rs index 16cb95994b0f..5219d9ad93e0 100644 --- a/third_party/rust/darling/tests/newtype.rs +++ b/third_party/rust/darling/tests/newtype.rs @@ -2,8 +2,10 @@ #[macro_use] extern crate darling; - +#[macro_use] extern crate syn; +#[macro_use] +extern crate quote; use darling::FromDeriveInput; @@ -18,13 +20,11 @@ struct DemoContainer { #[test] fn generated() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[derive(Baz)] #[newtype(lorem = false)] pub struct Foo; - "#, - ).unwrap(); + }; let c = DemoContainer::from_derive_input(&di).unwrap(); diff --git a/third_party/rust/darling/tests/skip.rs b/third_party/rust/darling/tests/skip.rs index a46dbfdda21b..b4e0f64dc13a 100644 --- a/third_party/rust/darling/tests/skip.rs +++ b/third_party/rust/darling/tests/skip.rs @@ -2,7 +2,10 @@ #[macro_use] extern crate darling; +#[macro_use] extern crate syn; +#[macro_use] +extern crate quote; use darling::FromDeriveInput; @@ -34,12 +37,10 @@ pub enum Sit { #[test] fn verify_skipped_field_not_required() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[skip_test(ipsum = "Hello")] struct Baz; - "#, - ).unwrap(); + }; assert_eq!( Lorem::from_derive_input(&di).unwrap(), diff --git a/third_party/rust/darling/tests/split_declaration.rs b/third_party/rust/darling/tests/split_declaration.rs index 5eb492a34aae..23d458d17371 100644 --- a/third_party/rust/darling/tests/split_declaration.rs +++ b/third_party/rust/darling/tests/split_declaration.rs @@ -3,7 +3,10 @@ #[macro_use] extern crate darling; +#[macro_use] extern crate syn; +#[macro_use] +extern crate quote; use std::string::ToString; @@ -18,13 +21,11 @@ struct Lorem { #[test] fn split_attributes_accrue_to_instance() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[split(foo = "Hello")] #[split(bar)] pub struct Foo; - "#, - ).unwrap(); + }; let parsed = Lorem::from_derive_input(&di).unwrap(); assert_eq!( @@ -38,39 +39,37 @@ fn split_attributes_accrue_to_instance() { #[test] fn duplicates_across_split_attrs_error() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[split(foo = "Hello")] #[split(foo = "World", bar)] pub struct Foo; - "#, - ).unwrap(); + }; - let pr = Lorem::from_derive_input(&di); + let pr = Lorem::from_derive_input(&di).unwrap_err(); + assert!(pr.has_span()); assert_eq!( - pr.unwrap_err().to_string(), + pr.to_string(), Error::duplicate_field("foo").to_string() ); } #[test] fn multiple_errors_accrue_to_instance() { - let di = syn::parse_str( - r#" + let di = parse_quote! { #[split(foo = "Hello")] #[split(foo = "World")] pub struct Foo; - "#, - ).unwrap(); + }; let pr = Lorem::from_derive_input(&di); let err: Error = pr.unwrap_err(); assert_eq!(2, err.len()); - let mut errs = err.into_iter(); + let mut errs = err.into_iter().peekable(); assert_eq!( - errs.next().unwrap().to_string(), + errs.peek().unwrap().to_string(), Error::duplicate_field("foo").to_string() ); + assert!(errs.next().unwrap().has_span()); assert_eq!( errs.next().unwrap().to_string(), Error::missing_field("bar").to_string() diff --git a/third_party/rust/darling/tests/suggestions.rs b/third_party/rust/darling/tests/suggestions.rs new file mode 100644 index 000000000000..3499e9ed9ad6 --- /dev/null +++ b/third_party/rust/darling/tests/suggestions.rs @@ -0,0 +1,34 @@ +#![cfg(feature = "suggestions")] + +#[macro_use] +extern crate darling; +#[macro_use] +extern crate syn; +#[macro_use] +extern crate quote; + +use darling::FromDeriveInput; + +#[derive(Debug, FromDeriveInput)] +#[darling(attributes(suggest))] +struct Lorem { + ipsum: String, + dolor: Dolor, +} + +#[derive(Debug, FromMeta)] +struct Dolor { + sit: bool, +} + +#[test] +fn suggest_dolor() { + let input: syn::DeriveInput = parse_quote! { + #[suggest(ipsum = "Hello", dolorr(sit))] + pub struct Foo; + }; + + let result = Lorem::from_derive_input(&input).unwrap_err(); + assert_eq!(2, result.len()); + assert!(format!("{}", result).contains("Did you mean")); +} diff --git a/third_party/rust/darling/tests/supports.rs b/third_party/rust/darling/tests/supports.rs index 0681a5f7b42a..9408a49da8dc 100644 --- a/third_party/rust/darling/tests/supports.rs +++ b/third_party/rust/darling/tests/supports.rs @@ -1,6 +1,9 @@ #[macro_use] extern crate darling; +#[macro_use] extern crate syn; +#[macro_use] +extern crate quote; use darling::ast; use darling::FromDeriveInput; @@ -28,41 +31,35 @@ mod source { use syn::{self, DeriveInput}; pub fn newtype_enum() -> DeriveInput { - syn::parse_str( - r#" - enum Hello { - World(bool), - String(String), + parse_quote!{ + enum Hello { + World(bool), + String(String), + } } - "#, - ).unwrap() } pub fn named_field_enum() -> DeriveInput { - syn::parse_str( - r#" - enum Hello { - Foo(u16), - World { - name: String - }, + parse_quote! { + enum Hello { + Foo(u16), + World { + name: String + }, + } } - "#, - ).unwrap() } pub fn named_struct() -> DeriveInput { - syn::parse_str( - r#" - struct Hello { - world: bool, + parse_quote! { + struct Hello { + world: bool, + } } - "#, - ).unwrap() } pub fn tuple_struct() -> DeriveInput { - syn::parse_str("struct Hello(String, bool);").unwrap() + parse_quote! { struct Hello(String, bool); } } } diff --git a/third_party/rust/darling_core/.cargo-checksum.json b/third_party/rust/darling_core/.cargo-checksum.json index bb0f5aa9cd8c..dd18c0525ced 100644 --- a/third_party/rust/darling_core/.cargo-checksum.json +++ b/third_party/rust/darling_core/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"b24c1abec4095a1afce8e302bc39f9de6027b55b0c308fb6b8bc4d684f6c2577","src/ast/data.rs":"c95e469d870f7918e77707da0e9e5e945e205e640bf34637355ef863b6efb28f","src/ast/generics.rs":"3bdfe1abdbee64f5aaa9b189dc5c58e222568f196ed206e9d6d91ea5f29673e7","src/ast/mod.rs":"58a58eeb1db7682e5994732cc8eb04088f6ca662805460ef443cf089e5c24e2c","src/codegen/attr_extractor.rs":"d13a3ba16f3a93f4a540421bb9df54a8f74cc6ee0e9e769b78b6c8045f285408","src/codegen/default_expr.rs":"60f23b77ddf80da70ec92fd0d8cb5a97143535df85eafa0e47943ac797ec46d2","src/codegen/error.rs":"50d0a1a2a392560ca10d3eb622ba745612761bf18846404742bd30caf2436228","src/codegen/field.rs":"d8b20dd1dda2c5591f5dcd4a2e5b8442ffae3daa23378323a81a682637080ea1","src/codegen/from_derive_impl.rs":"2a1e331d205db9334218b800760afcb64539fa2b25b0b2b014586b49b5b25882","src/codegen/from_field.rs":"af6f848ed7c6d2274e15d6307b011a1b8bcba66172ef68b0e665c9b4ae85157d","src/codegen/from_meta_impl.rs":"a937808b081e5d8bd16020fea8da0461e7e45872516cc0ee9e8a8cc957858a76","src/codegen/from_type_param.rs":"48493227f4a81fe1a533bd958b89207d56b1c70f754a2a28fb0e9eb9114a9aeb","src/codegen/from_variant_impl.rs":"3d9b10d60e3eb969946bbd210ce93a43375b9c8d3ffa827c7e87ab9235e2c3f3","src/codegen/mod.rs":"2dc3ee7f18177b2ef9c27c4f0cabc5bbd49f970abdba28a0539d81c70d81b6e2","src/codegen/outer_from_impl.rs":"059c3c05e4d6c7ba3876d23855ccbffa9e6158e7af7f6dc619b4d9770587f161","src/codegen/trait_impl.rs":"0e479f9e5b7253a3da2f77fd0bd63ea44a08a27dba2bd7dd992f05dc40b1d2a2","src/codegen/variant.rs":"3bc37ceb0e3dbf7eb02d7b66178adb3b165a24e92afa3295c012cf2f091d7328","src/codegen/variant_data.rs":"2467651663bfbb0ab35370b421d456948b053c26d0a23581a6c91ae7789b2db3","src/error.rs":"77436dc9a30172e94c434bdb61e3620ce37b2d64848a4fa19daba6e9c9329c95","src/from_derive_input.rs":"b2a04fefa4e14684061c819387ea0384297c67c7f50d5d0959aa69ab19075e76","src/from_field.rs":"f667924422ab4ab8d8b16ebfd42f61e74864cfaa80e96b49de5d1e1287e3d1d3","src/from_generic_param.rs":"49c5a8335eb0a9010998c5600c95c89440f7febe03265afb625d818dbc883d92","src/from_generics.rs":"7285b0fd213507e87c1da413cd1bc9eeada485d4a8f9d19630848d02a4d41c4a","src/from_meta.rs":"daa3d9a82b2f659147572f7d0e7fdef38139583e61e8319986098a4a73106453","src/from_type_param.rs":"9b611f276871002ade78146266fde3b6f9101b360082681a2fa2dafc16431f84","src/from_variant.rs":"70a23b5b4cb93c7e5a498fe9d16420b9b93bd69c1376d7703bc7cefd9417d159","src/lib.rs":"ea8f2d28793e4c0e367c4905e55e405417fbee9eb7ef0577f883b91aee1b5a57","src/macros_private.rs":"ef249cd9ca593aac423b4242df1c39c31610438da094c21562d74a7e5823c700","src/macros_public.rs":"3ed7eb99f309d9cd600d3a09ff4dcf5cc5d787fb49e8e5ead6bb00e31e5e6793","src/options/core.rs":"2dfb29a85a68d5ed6dccc46fe521c46ea8483bcd5d73cf21dbf21a7163ec318a","src/options/forward_attrs.rs":"89d8294a2204d6c32e5f58b797c23f4b035a8ff424bcf1b1c7db973ada89a4bc","src/options/from_derive.rs":"c8e41d2779e570dadd76c28b9cc9dd9cee57d8ef027766b4b5f39460a29df5d1","src/options/from_field.rs":"0b06590092a5c13d5c8eedf4e2d0518d869206813f828a06c65605d6cb8decc4","src/options/from_meta.rs":"ef268f78480f1d3df4e56cbc630aa4013ab5128cbb4471c4e85e9ff5a3980e7b","src/options/from_type_param.rs":"80d1fa60bac5bb31d0895e321faf1b8af99e407d9594028a01704b424be1dd4c","src/options/from_variant.rs":"99d4b60e48f8feef9c1fc2414ac0a420e66551c14e40c4a718668cca8e1f8cb5","src/options/input_field.rs":"f5e2529cfef4255710b9596c10422d7e7161978de93693cd25966eaebd7b5aee","src/options/input_variant.rs":"e0878260b04260a982f1de2de25159a38a338e67285f47da5e3eb8de2f60b68e","src/options/mod.rs":"30aefb531716954bad2b484c321baa333ef1d7d07ca55a0430df26bf4c1afb15","src/options/outer_from.rs":"e60196f2b9ea3ae014eaf3444607c6cf2a227c8d8aa4a5d64f59454602a0a5e6","src/options/shape.rs":"841e5cacfc40df74cd34c1dfc6895a99a21df79f48375de539d06bc15aec2248","src/usage/generics_ext.rs":"340774fe43033680e6b494c76dd4f558ada7ca4f09e91f9e4d076f125a729fc2","src/usage/ident_set.rs":"30edb2f0a599284967e3c6b579da31e5f9b15f3dd67bc9a82d6335eb44133df0","src/usage/lifetimes.rs":"19a63490660eb416bbccd4be9c060079a630dd15d5fd23c39e3c6c8c5498e369","src/usage/mod.rs":"bcf0ffb2257aed3b7b2cdad91c0136743384f39ff8f61f25c195c73b8fcdf144","src/usage/options.rs":"0491c995aad0d55783b24cce8a4e40f0f4435988c54ce2ded34763ac9b199fcf","src/usage/type_params.rs":"5aecf7f89c4b0623010e4717f5b32388b06d15e8511fde7b72f1d72e88fd3cb0","src/util/ident_list.rs":"fb6314436435547c111539213b209abd8d2593c28331560b84468a03b52d7c44","src/util/ident_string.rs":"06441e502d3bad342e292e42d083aff9070735a93d45f204aee5ef5f0144fdd0","src/util/ignored.rs":"7c979fbef880498ff64efda7396e759d80bf77fb1c7df0313bed8e533a16c0e0","src/util/mod.rs":"027793775e7079ea425f45b9bdad8b8fa309defcee02bf8ee6b6c556ec016342","src/util/over_ride.rs":"e90b3aeb41dd3364753f3ee6f8c6bbd85bf51d51569bf048396ec6e7735c569f","src/util/with_original.rs":"a545b38ba9d624fdc939eb844f001b7fc4102717b1d3683b4cbd0aae00fa7ef2"},"package":"168c246e87e727d58575d9b4595491010627f0cdc910e3e6ea3b36db2b9a9d9a"} \ No newline at end of file +{"files":{"Cargo.toml":"1b000960f407d3a318f55d3dd742f2ca5ddb7f7b3b1cb370023970bdc3072e64","LICENSE":"8ea93490d74a5a1b1af3ff71d786271b3f1e5f0bea79ac16e02ec533cef040d6","src/ast/data.rs":"560a0b89a93b7839317abb2e7e3bc0af93f40ce476c4a8a706ae0ad0fd240bb8","src/ast/generics.rs":"3bdfe1abdbee64f5aaa9b189dc5c58e222568f196ed206e9d6d91ea5f29673e7","src/ast/mod.rs":"58a58eeb1db7682e5994732cc8eb04088f6ca662805460ef443cf089e5c24e2c","src/codegen/attr_extractor.rs":"439950febbf04b139b578eb75ad70e1529a2bd6e5480f936e08770e9e354d9ac","src/codegen/default_expr.rs":"60f23b77ddf80da70ec92fd0d8cb5a97143535df85eafa0e47943ac797ec46d2","src/codegen/error.rs":"1a415136f93adde7458e39cab91413adc9a64243b718c7b74fdeba748959b5af","src/codegen/field.rs":"82104df8f3e733b23764fd6683e60d24ce62912b8b29a22dadbbc55d6a42f158","src/codegen/from_derive_impl.rs":"2a1e331d205db9334218b800760afcb64539fa2b25b0b2b014586b49b5b25882","src/codegen/from_field.rs":"af6f848ed7c6d2274e15d6307b011a1b8bcba66172ef68b0e665c9b4ae85157d","src/codegen/from_meta_impl.rs":"f769e1288aaa218303c987a2fba9286b93a104106fba63277e134ce19cd1047c","src/codegen/from_type_param.rs":"48493227f4a81fe1a533bd958b89207d56b1c70f754a2a28fb0e9eb9114a9aeb","src/codegen/from_variant_impl.rs":"3d9b10d60e3eb969946bbd210ce93a43375b9c8d3ffa827c7e87ab9235e2c3f3","src/codegen/mod.rs":"2dc3ee7f18177b2ef9c27c4f0cabc5bbd49f970abdba28a0539d81c70d81b6e2","src/codegen/outer_from_impl.rs":"9a91e67986787df1e0249559dd287e87b6fbfd757bd5f2632f43777b14a7d690","src/codegen/trait_impl.rs":"48080df3d025be7782604e883c46d53bcd62ea301dac379a36b27ce7e270e56c","src/codegen/variant.rs":"69ee861a63e31feb158611e93d0a355fdd94d6c8f3adc6c550864b7f5906d0ba","src/codegen/variant_data.rs":"2baa4328f01f6cdff008538a1492eb9fb5af2a88883a816ae6da7db3dc67b39e","src/derive.rs":"89180c13798b61510a6d266781e065114b75ca0be27e172a24656347b9baf1d3","src/error/kind.rs":"877f025ff72839ede46b8c7460331dac32ec56a7539816820179110381f8d0fb","src/error/mod.rs":"9908925c5798d81f34961c17aef8838d0730d825105bb9a8fa95e3958f25eda5","src/from_derive_input.rs":"b2a04fefa4e14684061c819387ea0384297c67c7f50d5d0959aa69ab19075e76","src/from_field.rs":"f667924422ab4ab8d8b16ebfd42f61e74864cfaa80e96b49de5d1e1287e3d1d3","src/from_generic_param.rs":"49c5a8335eb0a9010998c5600c95c89440f7febe03265afb625d818dbc883d92","src/from_generics.rs":"7285b0fd213507e87c1da413cd1bc9eeada485d4a8f9d19630848d02a4d41c4a","src/from_meta.rs":"d3847786280239d5e4260e2b88cb9986cb6feaaa1d3a2e2fb0678956eb936363","src/from_type_param.rs":"9b611f276871002ade78146266fde3b6f9101b360082681a2fa2dafc16431f84","src/from_variant.rs":"70a23b5b4cb93c7e5a498fe9d16420b9b93bd69c1376d7703bc7cefd9417d159","src/lib.rs":"ff9d4957c48641e9a63f18fe83d1153ea01994ebad93d1d905cc76d5fa58d3c9","src/macros_private.rs":"ef249cd9ca593aac423b4242df1c39c31610438da094c21562d74a7e5823c700","src/macros_public.rs":"3ed7eb99f309d9cd600d3a09ff4dcf5cc5d787fb49e8e5ead6bb00e31e5e6793","src/options/core.rs":"925a95513f7a6b9121f63998b1195f52f3bb9d76341ffa7544520443c77d9fe4","src/options/forward_attrs.rs":"89d8294a2204d6c32e5f58b797c23f4b035a8ff424bcf1b1c7db973ada89a4bc","src/options/from_derive.rs":"a53c5c991b5e25fdff47e9cb3f3f5aa48020e931546e7851bbd0711f98e9084c","src/options/from_field.rs":"67f338df3ffc270b3baf08b35cbe985802a65c1360c4e540cc5b937f6f08f915","src/options/from_meta.rs":"81a2ae765d390f64fbcbb1d30d40e895d77f8cd4f4c5f7167b1eacb48e066195","src/options/from_type_param.rs":"d3c8add6c8f5f7ee3d4a487c53e1f85002a2da43b943c03d4ce856fa6e7c8453","src/options/from_variant.rs":"84bd6294ebefe128c755f4cce1ef10117535435d4a2f631125b8d59170677cb4","src/options/input_field.rs":"094ef2865bbfba00e6894463f3440f523c3d1c53f938a414b23f9c78f7b1e01d","src/options/input_variant.rs":"6760a47a1d415b29c54202255a3937dd743e9e247cd8fe31767124b8b01d06db","src/options/mod.rs":"8fe5c94c3999d210cb024c6f6b181da92a0cc1a4a862e5d46ec49904c6692e11","src/options/outer_from.rs":"e60196f2b9ea3ae014eaf3444607c6cf2a227c8d8aa4a5d64f59454602a0a5e6","src/options/shape.rs":"c177cabcbee698351af6f7f3f9e848381197e041ed1628f0324e5cf52fd218f5","src/usage/generics_ext.rs":"340774fe43033680e6b494c76dd4f558ada7ca4f09e91f9e4d076f125a729fc2","src/usage/ident_set.rs":"30edb2f0a599284967e3c6b579da31e5f9b15f3dd67bc9a82d6335eb44133df0","src/usage/lifetimes.rs":"6ac25eb43b291414c274785d26912b0213e0b1d0d29d722cd4ffd915d4a58709","src/usage/mod.rs":"bcf0ffb2257aed3b7b2cdad91c0136743384f39ff8f61f25c195c73b8fcdf144","src/usage/options.rs":"0491c995aad0d55783b24cce8a4e40f0f4435988c54ce2ded34763ac9b199fcf","src/usage/type_params.rs":"0f4376ee9322d2c319ae15f41223595c72cb8a453a097879c2a0ee7f602c2f8c","src/util/ident_list.rs":"ea5f0419d7cb7fe6eb517ed2d3d2e0b00e1c7203be690157641f451a772355f1","src/util/ident_string.rs":"2b7fdbe9664c2e306114ffa830fde9710d849a0240029636cbb244457795b13f","src/util/ignored.rs":"7c979fbef880498ff64efda7396e759d80bf77fb1c7df0313bed8e533a16c0e0","src/util/mod.rs":"32b6df88e22444e44662ad745bb199df22964795194d2860c67c8b91a9a61a06","src/util/over_ride.rs":"e90b3aeb41dd3364753f3ee6f8c6bbd85bf51d51569bf048396ec6e7735c569f","src/util/spanned_value.rs":"3938cfc5169237cde1f19d65b653e1da8699663d1abfcf005359d48bbcee7d0b","src/util/with_original.rs":"a545b38ba9d624fdc939eb844f001b7fc4102717b1d3683b4cbd0aae00fa7ef2"},"package":"d2a368589465391e127e10c9e3a08efc8df66fd49b87dc8524c764bbe7f2ef82"} \ No newline at end of file diff --git a/third_party/rust/darling_core/Cargo.toml b/third_party/rust/darling_core/Cargo.toml index af5a8dfd2b0c..713366c1ace8 100644 --- a/third_party/rust/darling_core/Cargo.toml +++ b/third_party/rust/darling_core/Cargo.toml @@ -12,7 +12,7 @@ [package] name = "darling_core" -version = "0.8.1" +version = "0.8.6" authors = ["Ted Driggs "] description = "Helper crate for proc-macro library for reading attributes into structs when\nimplementing custom derives. Use https://crates.io/crates/darling in your code.\n" license = "MIT" @@ -24,14 +24,20 @@ version = "1.0.6" version = "1.0.0" [dependencies.proc-macro2] -version = "0.4.2" +version = "0.4.26" [dependencies.quote] version = "0.6" +[dependencies.strsim] +version = "0.8.0" +optional = true + [dependencies.syn] -version = "0.15" +version = "0.15.26" features = ["extra-traits"] [features] default = ["syn/full"] +diagnostics = [] +suggestions = ["strsim"] diff --git a/third_party/rust/darling_core/LICENSE b/third_party/rust/darling_core/LICENSE new file mode 100644 index 000000000000..0b48eadc9d03 --- /dev/null +++ b/third_party/rust/darling_core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Ted Driggs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/third_party/rust/darling_core/src/ast/data.rs b/third_party/rust/darling_core/src/ast/data.rs index 1c2cd798fbcf..8ea42bd36c87 100644 --- a/third_party/rust/darling_core/src/ast/data.rs +++ b/third_party/rust/darling_core/src/ast/data.rs @@ -1,4 +1,4 @@ -use std::slice; +use std::{slice, vec}; use syn; @@ -16,7 +16,7 @@ pub enum Data { Struct(Fields), } -#[deprecated(since = "0.3", note = "this has been renamed to Data")] +#[deprecated(since = "0.3.0", note = "this has been renamed to Data")] pub type Body = Data; impl Data { @@ -32,7 +32,7 @@ impl Data { /// Creates a new `Data<&'a V, &'a F>` instance from `Data`. pub fn as_ref<'a>(&'a self) -> Data<&'a V, &'a F> { match *self { - Data::Enum(ref variants) => Data::Enum(variants.into_iter().collect()), + Data::Enum(ref variants) => Data::Enum(variants.iter().collect()), Data::Struct(ref data) => Data::Struct(data.as_ref()), } } @@ -107,11 +107,7 @@ impl Data { syn::Data::Enum(ref data) => { let mut items = Vec::with_capacity(data.variants.len()); let mut errors = Vec::new(); - for v_result in data.variants - .clone() - .into_iter() - .map(|v| FromVariant::from_variant(&v)) - { + for v_result in data.variants.iter().map(FromVariant::from_variant) { match v_result { Ok(val) => items.push(val), Err(err) => errors.push(err), @@ -156,13 +152,14 @@ impl UsesLifetimes for Data { } } +/// Equivalent to `syn::Fields`, but replaces the AST element with a generic. #[derive(Debug, Clone, PartialEq, Eq)] pub struct Fields { pub style: Style, pub fields: Vec, } -#[deprecated(since = "0.3", note = "this has been renamed to Fields")] +#[deprecated(since = "0.3.0", note = "this has been renamed to Fields")] pub type VariantData = Fields; impl Fields { @@ -181,7 +178,7 @@ impl Fields { /// Returns true if this variant's data makes it a newtype. pub fn is_newtype(&self) -> bool { - self.style == Style::Tuple && self.fields.len() == 1 + self.style == Style::Tuple && self.len() == 1 } pub fn is_unit(&self) -> bool { @@ -216,6 +213,16 @@ impl Fields { pub fn iter(&self) -> slice::Iter { self.fields.iter() } + + /// Returns the number of fields in the structure. + pub fn len(&self) -> usize { + self.fields.len() + } + + /// Returns `true` if the `Fields` contains no fields. + pub fn is_empty(&self) -> bool { + self.fields.is_empty() + } } impl Fields { @@ -226,8 +233,7 @@ impl Fields { let mut errors = Vec::new(); for field in &fields.named { - let f_result = FromField::from_field(field); - match f_result { + match FromField::from_field(field) { Ok(val) => items.push(val), Err(err) => errors.push(if let Some(ref ident) = field.ident { err.at(ident) @@ -244,8 +250,7 @@ impl Fields { let mut errors = Vec::new(); for field in &fields.unnamed { - let f_result = FromField::from_field(field); - match f_result { + match FromField::from_field(field) { Ok(val) => items.push(val), Err(err) => errors.push(if let Some(ref ident) = field.ident { err.at(ident) @@ -271,6 +276,15 @@ impl Fields { } } +impl IntoIterator for Fields { + type Item = T; + type IntoIter = vec::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.fields.into_iter() + } +} + impl From