diff options
232 files changed, 18172 insertions, 25865 deletions
diff --git a/Cargo.lock b/Cargo.lock index 92cc78bcb9a..7b40353a4f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,8 +38,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "angle" -version = "0.2.0" -source = "git+https://github.com/servo/angle?branch=servo#a1371e8a160128677af863d1d73f150862ba42b2" +version = "0.4.0" +source = "git+https://github.com/servo/angle?branch=servo#bf8c7e19b4a28c40e1ef1374ab39a3aea24a79e0" dependencies = [ "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -56,7 +56,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "app_units" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -172,13 +172,13 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.26.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "clang-sys 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clang-sys 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -382,10 +382,10 @@ dependencies = [ [[package]] name = "clang-sys" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", "libloading 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -982,6 +982,14 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "gamma-lut" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1040,7 +1048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "gfx" version = "0.0.1" dependencies = [ - "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1439,7 +1447,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "layout" version = "0.0.1" dependencies = [ - "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "canvas_traits 0.0.1", @@ -1489,7 +1497,7 @@ dependencies = [ name = "layout_thread" version = "0.0.1" dependencies = [ - "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1520,6 +1528,7 @@ dependencies = [ "servo_geometry 0.0.1", "servo_url 0.0.1", "style 0.0.1", + "style_traits 0.0.1", "webrender_api 0.48.0 (git+https://github.com/servo/webrender)", ] @@ -1669,9 +1678,9 @@ dependencies = [ "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tendril 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2447,8 +2456,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "script" version = "0.0.1" dependencies = [ - "angle 0.2.0 (git+https://github.com/servo/angle?branch=servo)", - "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "angle 0.4.0 (git+https://github.com/servo/angle?branch=servo)", + "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "audio-video-metadata 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2528,7 +2537,7 @@ dependencies = [ name = "script_layout_interface" version = "0.0.1" dependencies = [ - "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "canvas_traits 0.0.1", "cssparser 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2805,7 +2814,7 @@ dependencies = [ name = "servo_atoms" version = "0.0.1" dependencies = [ - "string_cache 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2839,7 +2848,7 @@ dependencies = [ name = "servo_geometry" version = "0.0.1" dependencies = [ - "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2957,7 +2966,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "string_cache" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "debug_unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2995,11 +3004,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "style" version = "0.0.1" dependencies = [ - "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "arraydeque 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bindgen 0.26.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bindgen 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3011,6 +3020,7 @@ dependencies = [ "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3056,7 +3066,7 @@ dependencies = [ name = "style_tests" version = "0.0.1" dependencies = [ - "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3078,7 +3088,7 @@ dependencies = [ name = "style_traits" version = "0.0.1" dependencies = [ - "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3086,6 +3096,8 @@ dependencies = [ "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.19.0", "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "servo_atoms 0.0.1", + "webrender_api 0.48.0 (git+https://github.com/servo/webrender)", ] [[package]] @@ -3199,7 +3211,7 @@ dependencies = [ [[package]] name = "tendril" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futf 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3465,9 +3477,9 @@ dependencies = [ [[package]] name = "webrender" version = "0.48.0" -source = "git+https://github.com/servo/webrender#8fd634882111415a65da67e947f26eb170234f2f" +source = "git+https://github.com/servo/webrender#6dd3ddb0453697d3271f52133d88c182aa2f3b08" dependencies = [ - "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3476,8 +3488,8 @@ dependencies = [ "core-text 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "dwrote 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "freetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "gamma-lut 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3494,9 +3506,9 @@ dependencies = [ [[package]] name = "webrender_api" version = "0.48.0" -source = "git+https://github.com/servo/webrender#8fd634882111415a65da67e947f26eb170234f2f" +source = "git+https://github.com/servo/webrender#6dd3ddb0453697d3271f52133d88c182aa2f3b08" dependencies = [ - "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3630,10 +3642,10 @@ dependencies = [ "checksum alloc-no-stdlib 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b21f6ad9c9957eb5d70c3dee16d31c092b3cab339628f821766b05e6833d72b8" "checksum android_glue 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d8289e9637439939cc92b1995b0972117905be88bc28116c86b64d6e589bcd38" "checksum android_injected_glue 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ec08bc5e100186b5223a24dcfe5655d1488aed9eafeb44fb9a0f67a4f53d0fc" -"checksum angle 0.2.0 (git+https://github.com/servo/angle?branch=servo)" = "<none>" +"checksum angle 0.4.0 (git+https://github.com/servo/angle?branch=servo)" = "<none>" "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" "checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" -"checksum app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "99f3af85d0c7c054d95da6405117b523284a97484494b44a6dec58b9617eabf6" +"checksum app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "813ec2cdca52df57e839c4f4083b47cd7b2c2ae5409cee26f50a020144a8e631" "checksum arraydeque 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "96e774cadb24c2245225280c6799793f9802b918a58a79615e9490607489a717" "checksum arrayvec 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "699e63a93b79d717e8c3b5eb1b28b7780d0d6d9e59a72eb769291c83b0c8dc67" "checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0" @@ -3645,7 +3657,7 @@ dependencies = [ "checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" "checksum binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88ceb0d16c4fd0e42876e298d7d3ce3780dd9ebdcbe4199816a32c77e08597ff" "checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" -"checksum bindgen 0.26.1 (registry+https://github.com/rust-lang/crates.io-index)" = "04488a91af8f15eec4d88eb59e2c4e982c03ff31582acf2f5623e2e6d8ae9e0b" +"checksum bindgen 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c338079dafc81bef7d581f494b906603d12359c4306979eae6ca081925a4984" "checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c" "checksum bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5b97c2c8e8bbb4251754f559df8af22fb264853c7d009084a576cdf12565089d" "checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" @@ -3667,7 +3679,7 @@ dependencies = [ "checksum cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "393a5f0088efbe41f9d1fcd062f24e83c278608420e62109feb2c8abee07de7d" "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" "checksum cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "86765cb42c2a2c497e142af72517c1b4d7ae5bb2f25dfa77a5c69642f2342d89" -"checksum clang-sys 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff7c2d1502c65748c7221f43ce670b3ba5c697acebfeb85a580827daca6975fc" +"checksum clang-sys 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "611ec2e3a7623afd8a8c0d027887b6b55759d894abbf5fe11b9dc11b50d5b49a" "checksum clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7db281b0520e97fbd15cd615dcd8f8bcad0c26f5f7d5effe705f090f39e9a758" "checksum clipboard 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd3a9a938558f33ec1baaa6ca631a69c104aafaacbc66868d9ad28cf5f30564f" "checksum clipboard-win 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "693b1280c514045382dfdbb78d1594b1b03cdb66320aeb7ebd2bd38d49bae959" @@ -3718,6 +3730,7 @@ dependencies = [ "checksum freetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fde23272c687e4570aefec06cb71174ec0f5284b725deac4e77ba2665d635faf" "checksum futf 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "51f93f3de6ba1794dcd5810b3546d004600a59a98266487c8407bc4b24e398f3" "checksum futures 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "55f0008e13fc853f79ea8fc86e931486860d4c4c156cdffb59fa5f7fa833660a" +"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" "checksum gamma-lut 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "41f72af1e933f296b827361eb9e70d0267abf8ad0de9ec7fa667bbe67177b297" "checksum gaol 0.0.1 (git+https://github.com/servo/gaol)" = "<none>" "checksum gcc 0.3.47 (registry+https://github.com/rust-lang/crates.io-index)" = "5773372df827453bc38d4fd8efe425c7f28b1f54468816183fc8716cfb90bd30" @@ -3860,7 +3873,7 @@ dependencies = [ "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" "checksum smallvec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e40af10aafe98b4d8294ae8388d8a5cd0707c65d364872efe72d063ec44bee0" "checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b" -"checksum string_cache 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23429a3aca80e7cc7f0060853a97fbba9a90e30ef36b29d13e22559cd7f3dc54" +"checksum string_cache 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "413fc7852aeeb5472f1986ef755f561ddf0c789d3d796e65f0b6fe293ecd4ef8" "checksum string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "479cde50c3539481f33906a387f2bd17c8e87cb848c35b6021d41fb81ff9b4d7" "checksum string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1884d1bc09741d466d9b14e6d37ac89d6909cbcac41dd9ae982d4d063bbedfc" "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" @@ -3873,7 +3886,7 @@ dependencies = [ "checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047" "checksum syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791" "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" -"checksum tendril 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "01576be96a211e017bf90b1603b1272baf9fe93a1bf9b4845257c4ba09c9b25f" +"checksum tendril 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1b72f8e2f5b73b65c315b1a70c730f24b9d7a25f39e98de8acbe2bb795caea" "checksum term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d168af3930b369cfe245132550579d47dfd873d69470755a19c2c6568dbbd989" "checksum term_size 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "07b6c1ac5b3fffd75073276bca1ceed01f67a28537097a2a9539e116e50fb21a" "checksum thread-id 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8df7875b676fddfadffd96deea3b1124e5ede707d4884248931077518cf1f773" diff --git a/components/atoms/Cargo.toml b/components/atoms/Cargo.toml index 449f627fe1f..ff149db72ab 100644 --- a/components/atoms/Cargo.toml +++ b/components/atoms/Cargo.toml @@ -5,7 +5,6 @@ authors = ["The Servo Project Developers"] license = "MPL-2.0" publish = false build = "build.rs" -workspace = "../.." [lib] path = "lib.rs" diff --git a/components/canvas/canvas_paint_thread.rs b/components/canvas/canvas_paint_thread.rs index c285f3aa63d..b3433e62b50 100644 --- a/components/canvas/canvas_paint_thread.rs +++ b/components/canvas/canvas_paint_thread.rs @@ -80,13 +80,7 @@ struct CanvasPaintState<'a> { } impl<'a> CanvasPaintState<'a> { - fn new(antialias: bool) -> CanvasPaintState<'a> { - let antialias = if antialias { - AntialiasMode::Default - } else { - AntialiasMode::None - }; - + fn new(antialias: AntialiasMode) -> CanvasPaintState<'a> { CanvasPaintState { draw_options: DrawOptions::new(1.0, CompositionOp::Over, antialias), fill_style: Pattern::Color(ColorPattern::new(Color::black())), @@ -104,7 +98,7 @@ impl<'a> CanvasPaintState<'a> { impl<'a> CanvasPaintThread<'a> { fn new(size: Size2D<i32>, webrender_api_sender: webrender_api::RenderApiSender, - antialias: bool) -> CanvasPaintThread<'a> { + antialias: AntialiasMode) -> CanvasPaintThread<'a> { let draw_target = CanvasPaintThread::create(size); let path_builder = draw_target.create_path_builder(); let webrender_api = webrender_api_sender.create_api(); @@ -127,6 +121,11 @@ impl<'a> CanvasPaintThread<'a> { antialias: bool) -> IpcSender<CanvasMsg> { let (sender, receiver) = ipc::channel::<CanvasMsg>().unwrap(); + let antialias = if antialias { + AntialiasMode::Default + } else { + AntialiasMode::None + }; thread::Builder::new().name("CanvasThread".to_owned()).spawn(move || { let mut painter = CanvasPaintThread::new(size, webrender_api_sender, antialias); loop { @@ -549,10 +548,15 @@ impl<'a> CanvasPaintThread<'a> { } fn recreate(&mut self, size: Size2D<i32>) { + // TODO: clear the thread state. https://github.com/servo/servo/issues/17533 self.drawtarget = CanvasPaintThread::create(size); - self.state = CanvasPaintState::new(self.state.draw_options.antialias == AntialiasMode::Default); + self.state = CanvasPaintState::new(self.state.draw_options.antialias); self.saved_states.clear(); // Webrender doesn't let images change size, so we clear the webrender image key. + // TODO: there is an annying race condition here: the display list builder + // might still be using the old image key. Really, we should be scheduling the image + // for later deletion, not deleting it immediately. + // https://github.com/servo/servo/issues/17534 if let Some(image_key) = self.image_key.take() { // If this executes, then we are in a new epoch since we last recreated the canvas, // so `old_image_key` must be `None`. @@ -583,6 +587,7 @@ impl<'a> CanvasPaintThread<'a> { match self.image_key { Some(image_key) => { + debug!("Updating image {:?}.", image_key); self.webrender_api.update_image(image_key, descriptor, data, @@ -590,6 +595,7 @@ impl<'a> CanvasPaintThread<'a> { } None => { self.image_key = Some(self.webrender_api.generate_image_key()); + debug!("New image {:?}.", self.image_key); self.webrender_api.add_image(self.image_key.unwrap(), descriptor, data, diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 051454400ca..4dd167fa925 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -6,7 +6,7 @@ use CompositionPipeline; use SendableFrameTree; use compositor_thread::{CompositorProxy, CompositorReceiver}; use compositor_thread::{InitialCompositorState, Msg, RenderListener}; -use euclid::{Point2D, TypedPoint2D, TypedVector2D, TypedRect, ScaleFactor, TypedSize2D}; +use euclid::{Point2D, TypedPoint2D, TypedVector2D, ScaleFactor}; use gfx_traits::Epoch; use gleam::gl; use image::{DynamicImage, ImageFormat, RgbImage}; @@ -34,7 +34,8 @@ use style_traits::viewport::ViewportConstraints; use time::{precise_time_ns, precise_time_s}; use touch::{TouchHandler, TouchAction}; use webrender; -use webrender_api::{self, ClipId, LayoutPoint, LayoutVector2D, ScrollEventPhase, ScrollLocation, ScrollClamping}; +use webrender_api::{self, ClipId, DeviceUintRect, DeviceUintSize, LayoutPoint, LayoutVector2D}; +use webrender_api::{ScrollEventPhase, ScrollLocation, ScrollClamping}; use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods}; #[derive(Debug, PartialEq)] @@ -110,10 +111,10 @@ pub struct IOCompositor<Window: WindowMethods> { scale: ScaleFactor<f32, LayerPixel, DevicePixel>, /// The size of the rendering area. - frame_size: TypedSize2D<u32, DevicePixel>, + frame_size: DeviceUintSize, /// The position and size of the window within the rendering area. - window_rect: TypedRect<u32, DevicePixel>, + window_rect: DeviceUintRect, /// "Mobile-style" zoom that does not reflow the page. viewport_zoom: PinchZoomFactor, @@ -179,6 +180,9 @@ pub struct IOCompositor<Window: WindowMethods> { /// The webrender renderer. webrender: webrender::Renderer, + /// The active webrender document. + webrender_document: webrender_api::DocumentId, + /// The webrender interface, if enabled. webrender_api: webrender_api::RenderApi, @@ -378,7 +382,8 @@ impl<Window: WindowMethods> IOCompositor<Window> { scroll_in_progress: false, in_scroll_transaction: None, webrender: state.webrender, - webrender_api: state.webrender_api_sender.create_api(), + webrender_document: state.webrender_document, + webrender_api: state.webrender_api, } } @@ -675,8 +680,8 @@ impl<Window: WindowMethods> IOCompositor<Window> { self.root_pipeline = Some(frame_tree.pipeline.clone()); let pipeline_id = frame_tree.pipeline.id.to_webrender(); - self.webrender_api.set_root_pipeline(pipeline_id); - self.webrender_api.generate_frame(None); + self.webrender_api.set_root_pipeline(self.webrender_document, pipeline_id); + self.webrender_api.generate_frame(self.webrender_document, None); self.create_pipeline_details_for_frame_tree(&frame_tree); @@ -700,14 +705,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { fn send_window_size(&self, size_type: WindowSizeType) { let dppx = self.page_zoom * self.hidpi_factor(); - let window_rect = { - let offset = webrender_api::DeviceUintPoint::new(self.window_rect.origin.x, self.window_rect.origin.y); - let size = webrender_api::DeviceUintSize::new(self.window_rect.size.width, self.window_rect.size.height); - webrender_api::DeviceUintRect::new(offset, size) - }; - - let frame_size = webrender_api::DeviceUintSize::new(self.frame_size.width, self.frame_size.height); - self.webrender_api.set_window_parameters(frame_size, window_rect); + self.webrender_api.set_window_parameters(self.webrender_document, self.frame_size, self.window_rect); let initial_viewport = self.window_rect.size.to_f32() / dppx; @@ -727,7 +725,9 @@ impl<Window: WindowMethods> IOCompositor<Window> { } fn scroll_fragment_to_point(&mut self, id: ClipId, point: Point2D<f32>) { - self.webrender_api.scroll_node_with_id(LayoutPoint::from_untyped(&point), id, + self.webrender_api.scroll_node_with_id(self.webrender_document, + LayoutPoint::from_untyped(&point), + id, ScrollClamping::ToContentBounds); } @@ -821,12 +821,12 @@ impl<Window: WindowMethods> IOCompositor<Window> { WindowEvent::ToggleWebRenderProfiler => { let profiler_enabled = self.webrender.get_profiler_enabled(); self.webrender.set_profiler_enabled(!profiler_enabled); - self.webrender_api.generate_frame(None); + self.webrender_api.generate_frame(self.webrender_document, None); } } } - fn on_resize_window_event(&mut self, new_size: TypedSize2D<u32, DevicePixel>) { + fn on_resize_window_event(&mut self, new_size: DeviceUintSize) { debug!("compositor resizing to {:?}", new_size.to_untyped()); // A size change could also mean a resolution change. @@ -1123,7 +1123,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { (combined_event.cursor.to_f32() / self.scale).to_untyped(); let location = webrender_api::ScrollLocation::Delta(delta); let cursor = webrender_api::WorldPoint::from_untyped(&cursor); - self.webrender_api.scroll(location, cursor, combined_event.phase); + self.webrender_api.scroll(self.webrender_document, location, cursor, combined_event.phase); last_combined_event = None } } @@ -1179,7 +1179,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { }; let cursor = (combined_event.cursor.to_f32() / self.scale).to_untyped(); let cursor = webrender_api::WorldPoint::from_untyped(&cursor); - self.webrender_api.scroll(scroll_location, cursor, combined_event.phase); + self.webrender_api.scroll(self.webrender_document, scroll_location, cursor, combined_event.phase); self.waiting_for_results_of_scroll = true } @@ -1277,7 +1277,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { fn update_page_zoom_for_webrender(&mut self) { let page_zoom = webrender_api::ZoomFactor::new(self.page_zoom.get()); - self.webrender_api.set_page_zoom(page_zoom); + self.webrender_api.set_page_zoom(self.webrender_document, page_zoom); } /// Simulate a pinch zoom @@ -1315,7 +1315,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { fn send_viewport_rects(&self) { let mut scroll_states_per_pipeline = HashMap::new(); - for scroll_layer_state in self.webrender_api.get_scroll_node_state() { + for scroll_layer_state in self.webrender_api.get_scroll_node_state(self.webrender_document) { if scroll_layer_state.id.external_id().is_none() && !scroll_layer_state.id.is_root_scroll_node() { continue; @@ -1464,8 +1464,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { debug!("compositor: compositing"); // Paint the scene. - let size = webrender_api::DeviceUintSize::from_untyped(&self.frame_size.to_untyped()); - self.webrender.render(size); + self.webrender.render(self.frame_size); }); let rv = match target { @@ -1565,7 +1564,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { } if self.webrender.layers_are_bouncing_back() { - self.webrender_api.tick_scrolling_bounce_animations(); + self.webrender_api.tick_scrolling_bounce_animations(self.webrender_document); self.send_viewport_rects() } } diff --git a/components/compositing/compositor_thread.rs b/components/compositing/compositor_thread.rs index 5ceb7054d9e..8ca12300676 100644 --- a/components/compositing/compositor_thread.rs +++ b/components/compositing/compositor_thread.rs @@ -194,5 +194,6 @@ pub struct InitialCompositorState { pub mem_profiler_chan: mem::ProfilerChan, /// Instance of webrender API pub webrender: webrender::Renderer, - pub webrender_api_sender: webrender_api::RenderApiSender, + pub webrender_document: webrender_api::DocumentId, + pub webrender_api: webrender_api::RenderApi, } diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index 65ab7cc1bf0..4c018997645 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -6,7 +6,7 @@ use compositor_thread::EventLoopWaker; use euclid::{Point2D, Size2D}; -use euclid::{TypedPoint2D, TypedRect, ScaleFactor, TypedSize2D}; +use euclid::{ScaleFactor, TypedPoint2D, TypedSize2D}; use gleam::gl; use ipc_channel::ipc::IpcSender; use msg::constellation_msg::{Key, KeyModifiers, KeyState, TraversalDirection}; @@ -18,7 +18,7 @@ use std::fmt::{Debug, Error, Formatter}; use std::rc::Rc; use style_traits::DevicePixel; use style_traits::cursor::Cursor; -use webrender_api::ScrollLocation; +use webrender_api::{DeviceUintSize, DeviceUintRect, ScrollLocation}; #[derive(Clone)] pub enum MouseWindowEvent { @@ -41,7 +41,7 @@ pub enum WindowEvent { /// message, the window must make the same GL context as in `PrepareRenderingEvent` current. Refresh, /// Sent when the window is resized. - Resize(TypedSize2D<u32, DevicePixel>), + Resize(DeviceUintSize), /// Touchpad Pressure TouchpadPressure(TypedPoint2D<f32, DevicePixel>, f32, TouchpadPressurePhase), /// Sent when a new URL is to be loaded. @@ -105,9 +105,9 @@ pub enum AnimationState { pub trait WindowMethods { /// Returns the rendering area size in hardware pixels. - fn framebuffer_size(&self) -> TypedSize2D<u32, DevicePixel>; + fn framebuffer_size(&self) -> DeviceUintSize; /// Returns the position and size of the window within the rendering area. - fn window_rect(&self) -> TypedRect<u32, DevicePixel>; + fn window_rect(&self) -> DeviceUintRect; /// Returns the size of the window in density-independent "px" units. fn size(&self) -> TypedSize2D<f32, DeviceIndependentPixel>; /// Presents the window to the screen (perhaps by page flipping). diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index b9719c64f19..bccc351becd 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -228,8 +228,11 @@ pub struct Constellation<Message, LTF, STF> { /// timer thread. scheduler_chan: IpcSender<TimerSchedulerMsg>, + /// A single WebRender document the constellation operates on. + webrender_document: webrender_api::DocumentId, + /// A channel for the constellation to send messages to the - /// Webrender thread. + /// WebRender thread. webrender_api_sender: webrender_api::RenderApiSender, /// The set of all event loops in the browser. We generate a new @@ -325,6 +328,9 @@ pub struct InitialConstellationState { /// A channel to the memory profiler thread. pub mem_profiler_chan: mem::ProfilerChan, + /// Webrender document ID. + pub webrender_document: webrender_api::DocumentId, + /// Webrender API. pub webrender_api_sender: webrender_api::RenderApiSender, @@ -561,6 +567,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> webdriver: WebDriverData::new(), scheduler_chan: TimerScheduler::start(), document_states: HashMap::new(), + webrender_document: state.webrender_document, webrender_api_sender: state.webrender_api_sender, shutting_down: false, handled_warnings: VecDeque::new(), @@ -664,9 +671,9 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> let result = Pipeline::spawn::<Message, LTF, STF>(InitialPipelineState { id: pipeline_id, - browsing_context_id: browsing_context_id, - top_level_browsing_context_id: top_level_browsing_context_id, - parent_info: parent_info, + browsing_context_id, + top_level_browsing_context_id, + parent_info, constellation_chan: self.script_sender.clone(), layout_to_constellation_chan: self.layout_sender.clone(), scheduler_chan: self.scheduler_chan.clone(), @@ -675,17 +682,18 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> bluetooth_thread: self.bluetooth_thread.clone(), swmanager_thread: self.swmanager_sender.clone(), font_cache_thread: self.font_cache_thread.clone(), - resource_threads: resource_threads, + resource_threads, time_profiler_chan: self.time_profiler_chan.clone(), mem_profiler_chan: self.mem_profiler_chan.clone(), window_size: initial_window_size, - event_loop: event_loop, - load_data: load_data, + event_loop, + load_data, device_pixel_ratio: self.window_size.device_pixel_ratio, pipeline_namespace_id: self.next_pipeline_namespace_id(), - prev_visibility: prev_visibility, + prev_visibility, webrender_api_sender: self.webrender_api_sender.clone(), - is_private: is_private, + webrender_document: self.webrender_document, + is_private, webvr_thread: self.webvr_thread.clone() }); diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index 8c3b2f3edbc..74530cfa664 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -156,6 +156,7 @@ pub struct InitialPipelineState { /// Information about the page to load. pub load_data: LoadData, + /// The ID of the pipeline namespace for this script thread. pub pipeline_namespace_id: PipelineNamespaceId, @@ -165,6 +166,9 @@ pub struct InitialPipelineState { /// Webrender api. pub webrender_api_sender: webrender_api::RenderApiSender, + /// The ID of the document processed by this script thread. + pub webrender_document: webrender_api::DocumentId, + /// Whether this pipeline is considered private. pub is_private: bool, /// A channel to the webvr thread. @@ -265,6 +269,7 @@ impl Pipeline { script_content_process_shutdown_chan: script_content_process_shutdown_chan, script_content_process_shutdown_port: script_content_process_shutdown_port, webrender_api_sender: state.webrender_api_sender, + webrender_document: state.webrender_document, webvr_thread: state.webvr_thread, }; @@ -464,6 +469,7 @@ pub struct UnprivilegedPipelineContent { script_content_process_shutdown_chan: IpcSender<()>, script_content_process_shutdown_port: IpcReceiver<()>, webrender_api_sender: webrender_api::RenderApiSender, + webrender_document: webrender_api::DocumentId, webvr_thread: Option<IpcSender<WebVRMsg>>, } @@ -510,6 +516,7 @@ impl UnprivilegedPipelineContent { self.mem_profiler_chan, Some(self.layout_content_process_shutdown_chan), self.webrender_api_sender, + self.webrender_document, self.prefs.get("layout.threads").expect("exists").value() .as_u64().expect("count") as usize, paint_time_metrics); diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index 22d37d05cc3..8fa0c33df49 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -33,8 +33,8 @@ use style::values::computed::Filter; use style_traits::cursor::Cursor; use text::TextRun; use text::glyph::ByteIndex; -use webrender_api::{self, ClipId, ColorF, GradientStop, LocalClip, MixBlendMode, ScrollPolicy}; -use webrender_api::{TransformStyle, WebGLContextId}; +use webrender_api::{self, ClipAndScrollInfo, ClipId, ColorF, GradientStop, LocalClip}; +use webrender_api::{MixBlendMode, ScrollPolicy, ScrollSensitivity, TransformStyle, WebGLContextId}; pub use style::dom::OpaqueNode; @@ -152,7 +152,7 @@ impl DisplayList { match item { &DisplayItem::PushStackingContext(ref context_item) => { self.text_index_stacking_context(&context_item.stacking_context, - item.base().scroll_root_id, + item.scroll_node_id(), node, traversal, point, @@ -229,7 +229,7 @@ impl DisplayList { match item { &DisplayItem::PushStackingContext(ref context_item) => { self.hit_test_stacking_context(&context_item.stacking_context, - item.base().scroll_root_id, + item.scroll_node_id(), traversal, point, offset_lookup, @@ -286,10 +286,10 @@ impl DisplayList { pub fn print_with_tree(&self, print_tree: &mut PrintTree) { print_tree.new_level("Items".to_owned()); for item in &self.list { - print_tree.add_item(format!("{:?} StackingContext: {:?} ScrollRoot: {:?}", + print_tree.add_item(format!("{:?} StackingContext: {:?} {:?}", item, item.base().stacking_context_id, - item.scroll_root_id())); + item.clip_and_scroll_info())); } print_tree.end_level(); } @@ -438,8 +438,8 @@ pub struct StackingContext { /// The scroll policy of this layer. pub scroll_policy: ScrollPolicy, - /// The id of the parent scrolling area that contains this StackingContext. - pub parent_scroll_id: ClipId, + /// The clip and scroll info for this StackingContext. + pub parent_clip_and_scroll_info: ClipAndScrollInfo, } impl StackingContext { @@ -456,7 +456,7 @@ impl StackingContext { transform_style: TransformStyle, perspective: Option<Transform3D<f32>>, scroll_policy: ScrollPolicy, - parent_scroll_id: ClipId) + parent_clip_and_scroll_info: ClipAndScrollInfo) -> StackingContext { StackingContext { id: id, @@ -470,7 +470,7 @@ impl StackingContext { transform_style: transform_style, perspective: perspective, scroll_policy: scroll_policy, - parent_scroll_id: parent_scroll_id, + parent_clip_and_scroll_info: parent_clip_and_scroll_info, } } @@ -487,13 +487,13 @@ impl StackingContext { TransformStyle::Flat, None, ScrollPolicy::Scrollable, - pipeline_id.root_scroll_node()) + pipeline_id.root_clip_and_scroll_info()) } pub fn to_display_list_items(self, pipeline_id: PipelineId) -> (DisplayItem, DisplayItem) { let mut base_item = BaseDisplayItem::empty(pipeline_id); base_item.stacking_context_id = self.id; - base_item.scroll_root_id = self.parent_scroll_id; + base_item.clip_and_scroll_info = self.parent_clip_and_scroll_info; let pop_item = DisplayItem::PopStackingContext(Box::new( PopStackingContextItem { @@ -559,7 +559,7 @@ impl fmt::Debug for StackingContext { #[derive(Clone, Debug, HeapSizeOf, Deserialize, Serialize)] pub enum ScrollRootType { - ScrollFrame, + ScrollFrame(ScrollSensitivity), Clip, } @@ -631,8 +631,8 @@ pub struct BaseDisplayItem { /// The id of the stacking context this item belongs to. pub stacking_context_id: StackingContextId, - /// The id of the scroll root this item belongs to. - pub scroll_root_id: ClipId, + /// The clip and scroll info for this item. + pub clip_and_scroll_info: ClipAndScrollInfo, } impl BaseDisplayItem { @@ -642,7 +642,7 @@ impl BaseDisplayItem { local_clip: LocalClip, section: DisplayListSection, stacking_context_id: StackingContextId, - scroll_root_id: ClipId) + clip_and_scroll_info: ClipAndScrollInfo) -> BaseDisplayItem { BaseDisplayItem { bounds: *bounds, @@ -650,7 +650,7 @@ impl BaseDisplayItem { local_clip: local_clip, section: section, stacking_context_id: stacking_context_id, - scroll_root_id: scroll_root_id, + clip_and_scroll_info: clip_and_scroll_info, } } @@ -665,7 +665,7 @@ impl BaseDisplayItem { local_clip: LocalClip::from(max_rect().to_rectf()), section: DisplayListSection::Content, stacking_context_id: StackingContextId::root(), - scroll_root_id: pipeline_id.root_scroll_node(), + clip_and_scroll_info: pipeline_id.root_clip_and_scroll_info(), } } } @@ -1265,8 +1265,12 @@ impl DisplayItem { } } - pub fn scroll_root_id(&self) -> ClipId { - self.base().scroll_root_id + pub fn scroll_node_id(&self) -> ClipId { + self.base().clip_and_scroll_info.scroll_node_id + } + + pub fn clip_and_scroll_info(&self) -> ClipAndScrollInfo { + self.base().clip_and_scroll_info } pub fn stacking_context_id(&self) -> StackingContextId { @@ -1297,7 +1301,7 @@ impl DisplayItem { // test elements with `border-radius`, for example. let base_item = self.base(); - let scroll_offset = offset_lookup.full_offset_for_scroll_root(&base_item.scroll_root_id); + let scroll_offset = offset_lookup.full_offset_for_scroll_root(&self.scroll_node_id()); let point = Point2D::new(point.x - Au::from_f32_px(scroll_offset.x), point.y - Au::from_f32_px(scroll_offset.y)); diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs index 289939ee9d5..67214cf5e40 100644 --- a/components/gfx/font_context.rs +++ b/components/gfx/font_context.rs @@ -116,7 +116,7 @@ impl FontContext { let layout_font_group_cache_key = LayoutFontGroupCacheKey { pointer: style.clone(), - size: style.font_size, + size: style.font_size.0, }; if let Some(ref cached_font_group) = self.layout_font_group_cache.get( &layout_font_group_cache_key) { @@ -146,7 +146,7 @@ impl FontContext { Some(ref cached_font_ref) => { let cached_font = (*cached_font_ref).borrow(); if cached_font.descriptor == desc && - cached_font.requested_pt_size == style.font_size && + cached_font.requested_pt_size == style.font_size.0 && cached_font.variant == style.font_variant_caps { fonts.push((*cached_font_ref).clone()); cache_hit = true; @@ -164,7 +164,7 @@ impl FontContext { Some(template_info) => { let layout_font = self.create_layout_font(template_info.font_template, desc.clone(), - style.font_size, + style.font_size.0, style.font_variant_caps, template_info.font_key .expect("No font key present!")); @@ -198,7 +198,7 @@ impl FontContext { for cached_font_entry in &self.fallback_font_cache { let cached_font = cached_font_entry.font.borrow(); if cached_font.descriptor == desc && - cached_font.requested_pt_size == style.font_size && + cached_font.requested_pt_size == style.font_size.0 && cached_font.variant == style.font_variant_caps { fonts.push(cached_font_entry.font.clone()); cache_hit = true; @@ -210,7 +210,7 @@ impl FontContext { let template_info = self.font_cache_thread.last_resort_font_template(desc.clone()); let layout_font = self.create_layout_font(template_info.font_template, desc.clone(), - style.font_size, + style.font_size.0, style.font_variant_caps, template_info.font_key.expect("No font key present!")); match layout_font { diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs index 19827c2b191..ce61dd30c0e 100644 --- a/components/gfx/text/shaping/harfbuzz.rs +++ b/components/gfx/text/shaping/harfbuzz.rs @@ -421,7 +421,7 @@ lazy_static! { hb_font_funcs_set_glyph_h_kerning_func( hb_funcs, Some(glyph_h_kerning_func), ptr::null_mut(), None); - ptr::Unique::new(hb_funcs) + ptr::Unique::new_unchecked(hb_funcs) }; } diff --git a/components/gfx_traits/lib.rs b/components/gfx_traits/lib.rs index f035df15f1b..b83dc08c52d 100644 --- a/components/gfx_traits/lib.rs +++ b/components/gfx_traits/lib.rs @@ -32,7 +32,7 @@ impl Epoch { pub struct StackingContextId( /// The identifier for this StackingContext, derived from the Flow's memory address /// and fragment type. As a space optimization, these are combined into a single word. - u64 + pub u64 ); impl StackingContextId { diff --git a/components/layout/construct.rs b/components/layout/construct.rs index c863219941e..c1643c9f92c 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -1860,10 +1860,10 @@ impl ComputedValueUtils for ComputedValues { !padding.padding_right.is_definitely_zero() || !padding.padding_bottom.is_definitely_zero() || !padding.padding_left.is_definitely_zero() || - border.border_top_width != Au(0) || - border.border_right_width != Au(0) || - border.border_bottom_width != Au(0) || - border.border_left_width != Au(0) + border.border_top_width.0 != Au(0) || + border.border_right_width.0 != Au(0) || + border.border_bottom_width.0 != Au(0) || + border.border_left_width.0 != Au(0) } } diff --git a/components/layout/context.rs b/components/layout/context.rs index cda3811421a..76d32eebca9 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -4,7 +4,6 @@ //! Data needed by the layout thread. -use fnv::FnvHashMap; use fnv::FnvHasher; use gfx::display_list::{WebRenderImageInfo, OpaqueNode}; use gfx::font_cache_thread::FontCacheThread; @@ -25,8 +24,8 @@ use std::collections::HashMap; use std::hash::BuildHasherDefault; use std::sync::{Arc, Mutex}; use std::thread; +use style::context::RegisteredSpeculativePainter; use style::context::SharedStyleContext; -use style::properties::PropertyId; thread_local!(static FONT_CONTEXT_KEY: RefCell<Option<FontContext>> = RefCell::new(None)); @@ -73,7 +72,7 @@ pub struct LayoutContext<'a> { BuildHasherDefault<FnvHasher>>>>, /// Paint worklets - pub registered_painters: Arc<RwLock<FnvHashMap<Atom, RegisteredPainter>>>, + pub registered_painters: &'a RegisteredPainters, /// A list of in-progress image loads to be shared with the script thread. /// A None value means that this layout was not initiated by the script thread. @@ -179,9 +178,11 @@ impl<'a> LayoutContext<'a> { } } -/// A registered paint worklet. -pub struct RegisteredPainter { - pub name: Atom, - pub properties: FnvHashMap<Atom, PropertyId>, - pub painter: Arc<Painter>, +/// A registered painter +pub trait RegisteredPainter: RegisteredSpeculativePainter + Painter {} + +/// A set of registered painters +pub trait RegisteredPainters: Sync { + /// Look up a painter + fn get(&self, name: &Atom) -> Option<&RegisteredPainter>; } diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 32daca0525c..d3954ad8990 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -68,10 +68,11 @@ use style::values::generics::image::{Image, ShapeExtent}; use style::values::generics::image::PaintWorklet; use style::values::specified::position::{X, Y}; use style_traits::CSSPixel; +use style_traits::ToCss; use style_traits::cursor::Cursor; use table_cell::CollapsedBordersForCell; -use webrender_api::{ClipId, ColorF, ComplexClipRegion, GradientStop, LocalClip, RepeatMode}; -use webrender_api::{LineStyle, ScrollPolicy, TransformStyle}; +use webrender_api::{ClipAndScrollInfo, ClipId, ColorF, ComplexClipRegion, GradientStop, LineStyle}; +use webrender_api::{LocalClip, RepeatMode, ScrollPolicy, ScrollSensitivity, TransformStyle}; use webrender_helpers::{ToBorderRadius, ToMixBlendMode, ToRectF, ToTransformStyle}; trait ResolvePercentage { @@ -168,14 +169,14 @@ pub struct DisplayListBuildState<'a> { /// recursively building and processing the display list. pub current_stacking_context_id: StackingContextId, - /// The current scroll root id, used to keep track of state when + /// The current clip and scroll info, used to keep track of state when /// recursively building and processing the display list. - pub current_scroll_root_id: ClipId, + pub current_clip_and_scroll_info: ClipAndScrollInfo, - /// The scroll root id of the first ancestor which defines a containing block. + /// The clip and scroll info of the first ancestor which defines a containing block. /// This is necessary because absolutely positioned items should be clipped /// by their containing block's scroll root. - pub containing_block_scroll_root_id: ClipId, + pub containing_block_clip_and_scroll_info: ClipAndScrollInfo, /// Vector containing iframe sizes, used to inform the constellation about /// new iframe sizes @@ -195,6 +196,7 @@ pub struct DisplayListBuildState<'a> { impl<'a> DisplayListBuildState<'a> { pub fn new(layout_context: &'a LayoutContext) -> DisplayListBuildState<'a> { + let root_clip_info = ClipAndScrollInfo::simple(layout_context.id.root_scroll_node()); DisplayListBuildState { layout_context: layout_context, root_stacking_context: StackingContext::root(layout_context.id), @@ -203,8 +205,8 @@ impl<'a> DisplayListBuildState<'a> { scroll_root_parents: HashMap::new(), processing_scroll_root_element: false, current_stacking_context_id: StackingContextId::root(), - current_scroll_root_id: layout_context.id.root_scroll_node(), - containing_block_scroll_root_id: layout_context.id.root_scroll_node(), + current_clip_and_scroll_info: root_clip_info, + containing_block_clip_and_scroll_info: root_clip_info, iframe_sizes: Vec::new(), clip_stack: Vec::new(), containing_block_clip_stack: Vec::new(), @@ -248,6 +250,12 @@ impl<'a> DisplayListBuildState<'a> { *self.scroll_root_parents.get(&scroll_root_id).unwrap() } + fn is_background_or_border_of_scroll_root(&self, section: DisplayListSection) -> bool { + (section == DisplayListSection::BackgroundAndBorders || + section == DisplayListSection::BlockBackgroundsAndBorders) && + self.processing_scroll_root_element + } + fn create_base_display_item(&self, bounds: &Rect<Au>, clip: LocalClip, @@ -255,12 +263,10 @@ impl<'a> DisplayListBuildState<'a> { cursor: Option<Cursor>, section: DisplayListSection) -> BaseDisplayItem { - let scroll_root_id = if (section == DisplayListSection::BackgroundAndBorders || - section == DisplayListSection::BlockBackgroundsAndBorders) && - self.processing_scroll_root_element { - self.parent_scroll_root_id(self.current_scroll_root_id) + let clip_and_scroll_info = if self.is_background_or_border_of_scroll_root(section) { + ClipAndScrollInfo::simple(self.parent_scroll_root_id(self.current_clip_and_scroll_info.scroll_node_id)) } else { - self.current_scroll_root_id + self.current_clip_and_scroll_info }; BaseDisplayItem::new(&bounds, @@ -271,7 +277,7 @@ impl<'a> DisplayListBuildState<'a> { clip, section, self.current_stacking_context_id, - scroll_root_id) + clip_and_scroll_info) } pub fn to_display_list(mut self) -> DisplayList { @@ -547,7 +553,7 @@ pub trait FragmentDisplayListBuilding { base_flow: &BaseFlow, scroll_policy: ScrollPolicy, mode: StackingContextCreationMode, - parent_scroll_id: ClipId) + parent_clip_and_scroll_info: ClipAndScrollInfo) -> StackingContext; @@ -1183,25 +1189,25 @@ impl FragmentDisplayListBuilding for Fragment { _ => unbordered_box_size_in_au, }; let size_in_px = TypedSize2D::new(size_in_au.width.to_f32_px(), size_in_au.height.to_f32_px()); - let name = paint_worklet.name.clone(); - // Get the painter, and the computed values for its properties. - let (properties, painter) = match state.layout_context.registered_painters.read().get(&name) { - Some(registered_painter) => ( - registered_painter.properties - .iter() + // TODO: less copying. + let name = paint_worklet.name.clone(); + let arguments = paint_worklet.arguments.iter() + .map(|argument| argument.to_css_string()) + .collect(); + + let mut draw_result = match state.layout_context.registered_painters.get(&name) { + Some(painter) => { + debug!("Drawing a paint image {}({},{}).", name, size_in_px.width, size_in_px.height); + let properties = painter.properties().iter() .filter_map(|(name, id)| id.as_shorthand().err().map(|id| (name, id))) .map(|(name, id)| (name.clone(), style.computed_value_to_string(id))) - .collect(), - registered_painter.painter.clone() - ), + .collect(); + painter.draw_a_paint_image(size_in_px, device_pixel_ratio, properties, arguments) + }, None => return debug!("Worklet {} called before registration.", name), }; - // TODO: add a one-place cache to avoid drawing the paint image every time. - // https://github.com/servo/servo/issues/17369 - debug!("Drawing a paint image {}({},{}).", name, size_in_px.width, size_in_px.height); - let mut draw_result = painter.draw_a_paint_image(size_in_px, device_pixel_ratio, properties); let webrender_image = WebRenderImageInfo { width: draw_result.width, height: draw_result.height, @@ -1397,7 +1403,7 @@ impl FragmentDisplayListBuilding for Fragment { box_shadow.base.horizontal, box_shadow.base.vertical, )), - box_shadow.base.blur, + box_shadow.base.blur.0, box_shadow.spread, ); @@ -1412,7 +1418,7 @@ impl FragmentDisplayListBuilding for Fragment { box_bounds: *absolute_bounds, color: style.resolve_color(box_shadow.base.color).to_gfx_color(), offset: Vector2D::new(box_shadow.base.horizontal, box_shadow.base.vertical), - blur_radius: box_shadow.base.blur, + blur_radius: box_shadow.base.blur.0, spread_radius: box_shadow.spread, border_radius: model::specified_border_radius(style.get_border() .border_top_left_radius, @@ -1581,7 +1587,7 @@ impl FragmentDisplayListBuilding for Fragment { clip: &Rect<Au>) { use style::values::Either; - let width = style.get_outline().outline_width; + let width = style.get_outline().outline_width.0; if width == Au(0) { return } @@ -2038,7 +2044,7 @@ impl FragmentDisplayListBuilding for Fragment { base_flow: &BaseFlow, scroll_policy: ScrollPolicy, mode: StackingContextCreationMode, - parent_scroll_id: ClipId) + parent_clip_and_scroll_info: ClipAndScrollInfo) -> StackingContext { let border_box = self.stacking_relative_border_box(&base_flow.stacking_relative_position, @@ -2058,7 +2064,7 @@ impl FragmentDisplayListBuilding for Fragment { let effects = self.style().get_effects(); let mut filters = effects.filter.0.clone(); if effects.opacity != 1.0 { - filters.push(Filter::Opacity(effects.opacity)) + filters.push(Filter::Opacity(effects.opacity.into())) } let context_type = match mode { @@ -2078,7 +2084,7 @@ impl FragmentDisplayListBuilding for Fragment { self.style().get_used_transform_style().to_transform_style(), self.perspective_matrix(&border_box), scroll_policy, - parent_scroll_id) + parent_clip_and_scroll_info) } fn build_display_list_for_text_fragment(&self, @@ -2133,7 +2139,7 @@ impl FragmentDisplayListBuilding for Fragment { for shadow in text_shadows.iter().rev() { state.add_display_item(DisplayItem::PushTextShadow(box PushTextShadowDisplayItem { base: base.clone(), - blur_radius: shadow.blur, + blur_radius: shadow.blur.0, offset: Vector2D::new(shadow.horizontal, shadow.vertical), color: self.style().resolve_color(shadow.color).to_gfx_color(), })); @@ -2264,10 +2270,9 @@ pub trait BlockFlowDisplayListBuilding { state: &mut DisplayListBuildState, preserved_state: &mut PreservedDisplayListState, stacking_context_type: BlockStackingContextType) - -> ClipId; + -> ClipAndScrollInfo; fn setup_scroll_root_for_overflow(&mut self, state: &mut DisplayListBuildState, - preserved_state: &mut PreservedDisplayListState, border_box: &Rect<Au>); fn setup_scroll_root_for_css_clip(&mut self, state: &mut DisplayListBuildState, @@ -2275,11 +2280,11 @@ pub trait BlockFlowDisplayListBuilding { stacking_relative_border_box: &Rect<Au>); fn create_pseudo_stacking_context_for_block(&mut self, parent_stacking_context_id: StackingContextId, - parent_scroll_root_id: ClipId, + parent_clip_and_scroll_info: ClipAndScrollInfo, state: &mut DisplayListBuildState); fn create_real_stacking_context_for_block(&mut self, parent_stacking_context_id: StackingContextId, - parent_scroll_root_id: ClipId, + parent_clip_and_scroll_info: ClipAndScrollInfo, state: &mut DisplayListBuildState); fn build_display_list_for_block(&mut self, state: &mut DisplayListBuildState, @@ -2293,8 +2298,8 @@ pub trait BlockFlowDisplayListBuilding { /// TODO(mrobinson): It would be nice to use RAII here to avoid having to call restore. pub struct PreservedDisplayListState { stacking_context_id: StackingContextId, - scroll_root_id: ClipId, - containing_block_scroll_root_id: ClipId, + clip_and_scroll_info: ClipAndScrollInfo, + containing_block_clip_and_scroll_info: ClipAndScrollInfo, clips_pushed: usize, containing_block_clips_pushed: usize, transform_style: TransformStyle, @@ -2304,8 +2309,8 @@ impl PreservedDisplayListState { fn new(state: &mut DisplayListBuildState) -> PreservedDisplayListState { PreservedDisplayListState { stacking_context_id: state.current_stacking_context_id, - scroll_root_id: state.current_scroll_root_id, - containing_block_scroll_root_id: state.containing_block_scroll_root_id, + clip_and_scroll_info: state.current_clip_and_scroll_info, + containing_block_clip_and_scroll_info: state.containing_block_clip_and_scroll_info, clips_pushed: 0, containing_block_clips_pushed: 0, transform_style: state.current_transform_style, @@ -2320,8 +2325,8 @@ impl PreservedDisplayListState { fn restore(self, state: &mut DisplayListBuildState) { state.current_stacking_context_id = self.stacking_context_id; - state.current_scroll_root_id = self.scroll_root_id; - state.containing_block_scroll_root_id = self.containing_block_scroll_root_id; + state.current_clip_and_scroll_info = self.clip_and_scroll_info; + state.containing_block_clip_and_scroll_info = self.containing_block_clip_and_scroll_info; let truncate_length = state.clip_stack.len() - self.clips_pushed; state.clip_stack.truncate(truncate_length); @@ -2427,14 +2432,12 @@ impl BlockFlowDisplayListBuilding for BlockFlow { // We are getting the id of the scroll root that contains us here, not the id of // any scroll root that we create. If we create a scroll root, its id will be - // stored in state.current_scroll_root_id. If we should create a stacking context, - // we don't want it to be clipped by its own scroll root. - let containing_scroll_root_id = self.setup_clipping_for_block(state, - &mut preserved_state, - block_stacking_context_type); - + // stored in state.current_clip_and_scroll_info. If we create a stacking context, + // we don't want it to be contained by its own scroll root. + let containing_clip_and_scroll_info = + self.setup_clipping_for_block(state, &mut preserved_state, block_stacking_context_type); if establishes_containing_block_for_absolute(self.positioning()) { - state.containing_block_scroll_root_id = state.current_scroll_root_id; + state.containing_block_clip_and_scroll_info = state.current_clip_and_scroll_info; } match block_stacking_context_type { @@ -2443,12 +2446,12 @@ impl BlockFlowDisplayListBuilding for BlockFlow { } BlockStackingContextType::PseudoStackingContext => { self.create_pseudo_stacking_context_for_block(preserved_state.stacking_context_id, - containing_scroll_root_id, + containing_clip_and_scroll_info, state); } BlockStackingContextType::StackingContext => { self.create_real_stacking_context_for_block(preserved_state.stacking_context_id, - containing_scroll_root_id, + containing_clip_and_scroll_info, state); } } @@ -2460,22 +2463,22 @@ impl BlockFlowDisplayListBuilding for BlockFlow { state: &mut DisplayListBuildState, preserved_state: &mut PreservedDisplayListState, stacking_context_type: BlockStackingContextType) - -> ClipId { + -> ClipAndScrollInfo { // If this block is absolutely positioned, we should be clipped and positioned by // the scroll root of our nearest ancestor that establishes a containing block. - let containing_scroll_root_id = match self.positioning() { + let containing_clip_and_scroll_info = match self.positioning() { position::T::absolute => { preserved_state.switch_to_containing_block_clip(state); - state.current_scroll_root_id = state.containing_block_scroll_root_id; - state.containing_block_scroll_root_id + state.current_clip_and_scroll_info = state.containing_block_clip_and_scroll_info; + state.containing_block_clip_and_scroll_info } position::T::fixed => { preserved_state.push_clip(state, &max_rect(), position::T::fixed); - state.current_scroll_root_id + state.current_clip_and_scroll_info } - _ => state.current_scroll_root_id, + _ => state.current_clip_and_scroll_info, }; - self.base.scroll_root_id = Some(containing_scroll_root_id); + self.base.clip_and_scroll_info = Some(containing_clip_and_scroll_info); let coordinate_system = if self.fragment.establishes_stacking_context() { CoordinateSystem::Own @@ -2493,22 +2496,21 @@ impl BlockFlowDisplayListBuilding for BlockFlow { self.transform_clip_to_coordinate_space(state, preserved_state); } - self.setup_scroll_root_for_overflow(state, preserved_state, &stacking_relative_border_box); + self.setup_scroll_root_for_overflow(state, &stacking_relative_border_box); self.setup_scroll_root_for_css_clip(state, preserved_state, &stacking_relative_border_box); self.base.clip = state.clip_stack.last().cloned().unwrap_or_else(max_rect); match self.positioning() { position::T::absolute | position::T::relative | position::T::fixed => - state.containing_block_scroll_root_id = state.current_scroll_root_id, + state.containing_block_clip_and_scroll_info = state.current_clip_and_scroll_info, _ => {} } - containing_scroll_root_id + containing_clip_and_scroll_info } fn setup_scroll_root_for_overflow(&mut self, state: &mut DisplayListBuildState, - preserved_state: &mut PreservedDisplayListState, border_box: &Rect<Au>) { if !self.overflow_style_may_require_scroll_root() { return; @@ -2536,27 +2538,12 @@ impl BlockFlowDisplayListBuilding for BlockFlow { return; } - let overflow_x = self.fragment.style.get_box().overflow_x; - let overflow_y = self.fragment.style.get_box().overflow_y; - - let content_size = self.base.overflow.scroll.origin + self.base.overflow.scroll.size; - let mut content_size = Size2D::new(content_size.x, content_size.y); - if overflow_x::T::hidden == overflow_x { - content_size.width = content_box.size.width; - } - - if overflow_x::T::hidden == overflow_y { - content_size.height = content_box.size.height; - } - - if overflow_x::T::hidden == overflow_y || overflow_x::T::hidden == overflow_x { - preserved_state.push_clip(state, &border_box, self.positioning()); - } - - let mut root_type = ScrollRootType::ScrollFrame; - if overflow_x::T::hidden == overflow_y && overflow_x::T::hidden == overflow_x { - root_type = ScrollRootType::Clip; - } + let sensitivity = if overflow_x::T::hidden == self.fragment.style.get_box().overflow_x && + overflow_x::T::hidden == self.fragment.style.get_box().overflow_y { + ScrollSensitivity::Script + } else { + ScrollSensitivity::ScriptAndInputEvents + }; let clip_rect = build_inner_border_box_for_border_rect(&border_box, &self.fragment.style); let mut clip = ClippingRegion::from_rect(&clip_rect); @@ -2565,20 +2552,24 @@ impl BlockFlowDisplayListBuilding for BlockFlow { clip.intersect_with_rounded_rect(&clip_rect, &radii) } - let parent_id = self.scroll_root_id(state.layout_context.id); + let content_size = self.base.overflow.scroll.origin + self.base.overflow.scroll.size; + let content_size = Size2D::new(content_size.x, content_size.y); + + let parent_id = self.clip_and_scroll_info(state.layout_context.id).scroll_node_id; state.add_scroll_root( ScrollRoot { id: new_scroll_root_id, parent_id: parent_id, clip: clip, content_rect: Rect::new(content_box.origin, content_size), - root_type, + root_type: ScrollRootType::ScrollFrame(sensitivity), }, self.base.stacking_context_id ); - self.base.scroll_root_id = Some(new_scroll_root_id); - state.current_scroll_root_id = new_scroll_root_id; + let new_clip_and_scroll_info = ClipAndScrollInfo::simple(new_scroll_root_id); + self.base.clip_and_scroll_info = Some(new_clip_and_scroll_info); + state.current_clip_and_scroll_info = new_clip_and_scroll_info; } /// Adds a scroll root for a block to take the `clip` property into account @@ -2593,6 +2584,13 @@ impl BlockFlowDisplayListBuilding for BlockFlow { _ => return, }; + // CSS `clip` should only apply to position:absolute or positione:fixed elements. + // CSS Masking Appendix A: "Applies to: Absolutely positioned elements." + match self.positioning() { + position::T::absolute | position::T::fixed => {} + _ => return, + } + let clip_origin = Point2D::new(stacking_relative_border_box.origin.x + style_clip_rect.left.unwrap_or(Au(0)), stacking_relative_border_box.origin.y + @@ -2618,7 +2616,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow { let clip_rect = Rect::new(clip_origin, clip_size); preserved_state.push_clip(state, &clip_rect, self.positioning()); - let parent_id = self.scroll_root_id(state.layout_context.id); + let parent_id = self.clip_and_scroll_info(state.layout_context.id).scroll_node_id; state.add_scroll_root( ScrollRoot { id: new_scroll_root_id, @@ -2630,13 +2628,14 @@ impl BlockFlowDisplayListBuilding for BlockFlow { self.base.stacking_context_id ); - self.base.scroll_root_id = Some(new_scroll_root_id); - state.current_scroll_root_id = new_scroll_root_id; + let new_clip_and_scroll_info = ClipAndScrollInfo::new(new_scroll_root_id, new_scroll_root_id); + self.base.clip_and_scroll_info = Some(new_clip_and_scroll_info); + state.current_clip_and_scroll_info = new_clip_and_scroll_info; } fn create_pseudo_stacking_context_for_block(&mut self, parent_stacking_context_id: StackingContextId, - parent_scroll_root_id: ClipId, + parent_clip_and_scroll_info: ClipAndScrollInfo, state: &mut DisplayListBuildState) { let creation_mode = if self.base.flags.contains(IS_ABSOLUTELY_POSITIONED) || self.fragment.style.get_box().position != position::T::static_ { @@ -2650,7 +2649,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow { &self.base, ScrollPolicy::Scrollable, creation_mode, - parent_scroll_root_id); + parent_clip_and_scroll_info); state.add_stacking_context(parent_stacking_context_id, new_context); self.base.collect_stacking_contexts_for_children(state); @@ -2670,7 +2669,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow { fn create_real_stacking_context_for_block(&mut self, parent_stacking_context_id: StackingContextId, - parent_scroll_root_id: ClipId, + parent_clip_and_scroll_info: ClipAndScrollInfo, state: &mut DisplayListBuildState) { let scroll_policy = if self.is_fixed() { ScrollPolicy::Fixed @@ -2683,7 +2682,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow { &self.base, scroll_policy, StackingContextCreationMode::Normal, - parent_scroll_root_id); + parent_clip_and_scroll_info); state.add_stacking_context(parent_stacking_context_id, stacking_context); self.base.collect_stacking_contexts_for_children(state); @@ -2738,13 +2737,13 @@ pub trait InlineFlowDisplayListBuilding { impl InlineFlowDisplayListBuilding for InlineFlow { fn collect_stacking_contexts_for_inline(&mut self, state: &mut DisplayListBuildState) { self.base.stacking_context_id = state.current_stacking_context_id; - self.base.scroll_root_id = Some(state.current_scroll_root_id); + self.base.clip_and_scroll_info = Some(state.current_clip_and_scroll_info); self.base.clip = state.clip_stack.last().cloned().unwrap_or_else(max_rect); for mut fragment in self.fragments.fragments.iter_mut() { - let previous_containing_block_scroll_root_id = state.containing_block_scroll_root_id; + let previous_cb_clip_scroll_info = state.containing_block_clip_and_scroll_info; if establishes_containing_block_for_absolute(fragment.style.get_box().position) { - state.containing_block_scroll_root_id = state.current_scroll_root_id; + state.containing_block_clip_and_scroll_info = state.current_clip_and_scroll_info; } match fragment.specific { @@ -2768,14 +2767,14 @@ impl InlineFlowDisplayListBuilding for InlineFlow { &self.base, ScrollPolicy::Scrollable, StackingContextCreationMode::Normal, - state.current_scroll_root_id); + state.current_clip_and_scroll_info); state.add_stacking_context(current_stacking_context_id, stacking_context); } _ => fragment.stacking_context_id = state.current_stacking_context_id, } - state.containing_block_scroll_root_id = previous_containing_block_scroll_root_id; + state.containing_block_clip_and_scroll_info = previous_cb_clip_scroll_info; } } diff --git a/components/layout/flex.rs b/components/layout/flex.rs index 353c939f58b..577e9a167de 100644 --- a/components/layout/flex.rs +++ b/components/layout/flex.rs @@ -137,8 +137,8 @@ impl FlexItem { min_size: Au(0), max_size: MAX_AU, index: index, - flex_grow: flex_grow, - flex_shrink: flex_shrink, + flex_grow: flex_grow.into(), + flex_shrink: flex_shrink.into(), order: order, is_frozen: false, is_strut: false diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 846b7be8326..3ce36ad1a7c 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -63,7 +63,7 @@ use table_colgroup::TableColGroupFlow; use table_row::TableRowFlow; use table_rowgroup::TableRowGroupFlow; use table_wrapper::TableWrapperFlow; -use webrender_api::ClipId; +use webrender_api::ClipAndScrollInfo; /// Virtual methods that make up a float context. /// @@ -431,12 +431,12 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static { /// children of this flow. fn print_extra_flow_children(&self, _: &mut PrintTree) { } - fn scroll_root_id(&self, pipeline_id: PipelineId) -> ClipId { - match base(self).scroll_root_id { - Some(id) => id, + fn clip_and_scroll_info(&self, pipeline_id: PipelineId) -> ClipAndScrollInfo { + match base(self).clip_and_scroll_info { + Some(info) => info, None => { - warn!("Tried to access scroll root id on Flow before assignment"); - pipeline_id.root_scroll_node() + debug_assert!(false, "Tried to access scroll root id on Flow before assignment"); + pipeline_id.root_clip_and_scroll_info() } } } @@ -969,7 +969,7 @@ pub struct BaseFlow { /// list construction. pub stacking_context_id: StackingContextId, - pub scroll_root_id: Option<ClipId>, + pub clip_and_scroll_info: Option<ClipAndScrollInfo>, } impl fmt::Debug for BaseFlow { @@ -1111,7 +1111,7 @@ impl BaseFlow { writing_mode: writing_mode, thread_id: 0, stacking_context_id: StackingContextId::root(), - scroll_root_id: None, + clip_and_scroll_info: None, } } diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index bd7d06be627..fd2d5698efd 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -2570,13 +2570,13 @@ impl Fragment { // Box shadows cause us to draw outside our border box. for box_shadow in &self.style().get_effects().box_shadow.0 { let offset = Vector2D::new(box_shadow.base.horizontal, box_shadow.base.vertical); - let inflation = box_shadow.spread + box_shadow.base.blur * BLUR_INFLATION_FACTOR; + let inflation = box_shadow.spread + box_shadow.base.blur.0 * BLUR_INFLATION_FACTOR; overflow.paint = overflow.paint.union(&border_box.translate(&offset) .inflate(inflation, inflation)) } // Outlines cause us to draw outside our border box. - let outline_width = self.style.get_outline().outline_width; + let outline_width = self.style.get_outline().outline_width.0; if outline_width != Au(0) { overflow.paint = overflow.paint.union(&border_box.inflate(outline_width, outline_width)) diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs index 3321faae926..8a1b3bee6ee 100644 --- a/components/layout/multicol.rs +++ b/components/layout/multicol.rs @@ -98,20 +98,20 @@ impl Flow for MulticolFlow { let column_style = self.block_flow.fragment.style.get_column(); let column_gap = match column_style.column_gap { - Either::First(len) => len, - Either::Second(_normal) => self.block_flow.fragment.style.get_font().font_size, + Either::First(len) => len.0, + Either::Second(_normal) => self.block_flow.fragment.style.get_font().font_size.0, }; let mut column_count; if let Either::First(column_width) = column_style.column_width { column_count = - max(1, (content_inline_size + column_gap).0 / (column_width + column_gap).0); + max(1, (content_inline_size + column_gap).0 / (column_width.0 + column_gap).0); if let Either::First(specified_column_count) = column_style.column_count { - column_count = min(column_count, specified_column_count as i32); + column_count = min(column_count, specified_column_count.0 as i32); } } else { column_count = match column_style.column_count { - Either::First(n) => n, + Either::First(n) => n.0, _ => unreachable!(), } } diff --git a/components/layout/query.rs b/components/layout/query.rs index 252071e9bcd..5803a247e19 100644 --- a/components/layout/query.rs +++ b/components/layout/query.rs @@ -450,10 +450,10 @@ impl FragmentBorderBoxIterator for FragmentLocatingFragmentIterator { border_left_width: left_width, .. } = *fragment.style.get_border(); - self.client_rect.origin.y = top_width.to_px(); - self.client_rect.origin.x = left_width.to_px(); - self.client_rect.size.width = (border_box.size.width - left_width - right_width).to_px(); - self.client_rect.size.height = (border_box.size.height - top_width - bottom_width).to_px(); + self.client_rect.origin.y = top_width.0.to_px(); + self.client_rect.origin.x = left_width.0.to_px(); + self.client_rect.size.width = (border_box.size.width - left_width.0 - right_width.0).to_px(); + self.client_rect.size.height = (border_box.size.height - top_width.0 - bottom_width.0).to_px(); } fn should_process(&mut self, fragment: &Fragment) -> bool { @@ -476,10 +476,10 @@ impl FragmentBorderBoxIterator for UnioningFragmentScrollAreaIterator { border_left_width: left_border, .. } = *fragment.style.get_border(); - let right_padding = (border_box.size.width - right_border - left_border).to_px(); - let bottom_padding = (border_box.size.height - bottom_border - top_border).to_px(); - let top_padding = top_border.to_px(); - let left_padding = left_border.to_px(); + let right_padding = (border_box.size.width - right_border.0 - left_border.0).to_px(); + let bottom_padding = (border_box.size.height - bottom_border.0 - top_border.0).to_px(); + let top_padding = top_border.0.to_px(); + let left_padding = left_border.0.to_px(); match self.level { Some(start_level) if level <= start_level => { self.is_child = false; } @@ -702,7 +702,7 @@ pub fn process_resolved_style_request<'a, N>(context: &LayoutContext, thread_local: &mut tlc, }; - let styles = resolve_style(&mut context, element, RuleInclusion::All); + let styles = resolve_style(&mut context, element, RuleInclusion::All, false); let style = styles.primary(); let longhand_id = match *property { PropertyId::Longhand(id) => id, diff --git a/components/layout/table.rs b/components/layout/table.rs index 7010acf1b87..dea2b590b27 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -27,7 +27,7 @@ use style::logical_geometry::LogicalSize; use style::properties::ComputedValues; use style::servo::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW}; use style::values::CSSFloat; -use style::values::computed::LengthOrPercentageOrAuto; +use style::values::computed::{LengthOrPercentageOrAuto, NonNegativeAu}; use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance}; use table_row::TableRowFlow; use table_wrapper::TableLayout; @@ -190,8 +190,8 @@ impl TableFlow { border_collapse::T::separate => style.get_inheritedtable().border_spacing, border_collapse::T::collapse => { border_spacing::T { - horizontal: Au(0), - vertical: Au(0), + horizontal: NonNegativeAu::zero(), + vertical: NonNegativeAu::zero(), } } } @@ -202,7 +202,7 @@ impl TableFlow { if num_columns == 0 { return Au(0); } - self.spacing().horizontal * (num_columns as i32 + 1) + self.spacing().horizontal.0 * (num_columns as i32 + 1) } } @@ -469,7 +469,7 @@ impl Flow for TableFlow { fn assign_block_size(&mut self, _: &LayoutContext) { debug!("assign_block_size: assigning block_size for table"); - let vertical_spacing = self.spacing().vertical; + let vertical_spacing = self.spacing().vertical.0; self.block_flow.assign_block_size_for_table_like_flow(vertical_spacing) } diff --git a/components/layout/table_colgroup.rs b/components/layout/table_colgroup.rs index 44519a3bbab..10a87903403 100644 --- a/components/layout/table_colgroup.rs +++ b/components/layout/table_colgroup.rs @@ -92,7 +92,10 @@ impl Flow for TableColGroupFlow { // Table columns are invisible. fn build_display_list(&mut self, _: &mut DisplayListBuildState) { } - fn collect_stacking_contexts(&mut self, _: &mut DisplayListBuildState) {} + fn collect_stacking_contexts(&mut self, state: &mut DisplayListBuildState) { + self.base.stacking_context_id = state.current_stacking_context_id; + self.base.clip_and_scroll_info = Some(state.current_clip_and_scroll_info); + } fn repair_style(&mut self, _: &::ServoArc<ComputedValues>) {} diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs index e960290bdd2..06040446ddc 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -25,7 +25,7 @@ use style::computed_values::{border_collapse, border_spacing, border_top_style}; use style::logical_geometry::{LogicalSize, PhysicalSide, WritingMode}; use style::properties::ComputedValues; use style::servo::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW}; -use style::values::computed::{Color, LengthOrPercentageOrAuto}; +use style::values::computed::{Color, LengthOrPercentageOrAuto, NonNegativeAu}; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt}; use table_cell::{CollapsedBordersForCell, TableCellFlow}; @@ -93,8 +93,8 @@ impl TableRowFlow { column_computed_inline_sizes: Vec::new(), incoming_rowspan: Vec::new(), spacing: border_spacing::T { - horizontal: Au(0), - vertical: Au(0), + horizontal: NonNegativeAu::zero(), + vertical: NonNegativeAu::zero(), }, table_writing_mode: writing_mode, preliminary_collapsed_borders: CollapsedBordersForRow::new(), @@ -395,7 +395,7 @@ impl Flow for TableRowFlow { None => break, }; column_computed_inline_size.size = column_computed_inline_size.size + - extra_column_computed_inline_size.size + self.spacing.horizontal; + extra_column_computed_inline_size.size + self.spacing.horizontal.0; col += 1; } @@ -616,7 +616,7 @@ impl CollapsedBorder { -> CollapsedBorder { CollapsedBorder { style: css_style.get_border().border_top_style, - width: css_style.get_border().border_top_width, + width: css_style.get_border().border_top_width.0, color: css_style.get_border().border_top_color, provenance: provenance, } @@ -628,7 +628,7 @@ impl CollapsedBorder { -> CollapsedBorder { CollapsedBorder { style: css_style.get_border().border_right_style, - width: css_style.get_border().border_right_width, + width: css_style.get_border().border_right_width.0, color: css_style.get_border().border_right_color, provenance: provenance, } @@ -640,7 +640,7 @@ impl CollapsedBorder { -> CollapsedBorder { CollapsedBorder { style: css_style.get_border().border_bottom_style, - width: css_style.get_border().border_bottom_width, + width: css_style.get_border().border_bottom_width.0, color: css_style.get_border().border_bottom_color, provenance: provenance, } @@ -652,7 +652,7 @@ impl CollapsedBorder { -> CollapsedBorder { CollapsedBorder { style: css_style.get_border().border_left_style, - width: css_style.get_border().border_left_width, + width: css_style.get_border().border_left_width.0, color: css_style.get_border().border_left_color, provenance: provenance, } @@ -818,7 +818,7 @@ fn set_inline_position_of_child_flow( let column_inline_size = column_computed_inline_sizes[*column_index].size; let border_inline_size = match *border_collapse_info { Some(_) => Au(0), // FIXME: Make collapsed borders account for colspan/rowspan. - None => border_spacing.horizontal, + None => border_spacing.horizontal.0, }; if reverse_column_order { *inline_end_margin_edge += column_inline_size + border_inline_size; @@ -873,9 +873,9 @@ fn set_inline_position_of_child_flow( None => { // Take spacing into account. if reverse_column_order { - *inline_end_margin_edge += border_spacing.horizontal; + *inline_end_margin_edge += border_spacing.horizontal.0; } else { - *inline_start_margin_edge += border_spacing.horizontal; + *inline_start_margin_edge += border_spacing.horizontal.0; } } } diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs index b609276f7a2..02c1b49da2b 100644 --- a/components/layout/table_rowgroup.rs +++ b/components/layout/table_rowgroup.rs @@ -21,6 +21,7 @@ use std::iter::{IntoIterator, Iterator, Peekable}; use style::computed_values::{border_collapse, border_spacing}; use style::logical_geometry::LogicalSize; use style::properties::ComputedValues; +use style::values::computed::NonNegativeAu; use table::{ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow}; /// A table formatting context. @@ -55,8 +56,8 @@ impl TableRowGroupFlow { block_flow: BlockFlow::from_fragment(fragment), column_intrinsic_inline_sizes: Vec::new(), spacing: border_spacing::T { - horizontal: Au(0), - vertical: Au(0), + horizontal: NonNegativeAu::zero(), + vertical: NonNegativeAu::zero(), }, collapsed_inline_direction_border_widths_for_table: Vec::new(), collapsed_block_direction_border_widths_for_table: Vec::new(), @@ -161,7 +162,7 @@ impl Flow for TableRowGroupFlow { fn assign_block_size(&mut self, _: &LayoutContext) { debug!("assign_block_size: assigning block_size for table_rowgroup"); - self.block_flow.assign_block_size_for_table_like_flow(self.spacing.vertical) + self.block_flow.assign_block_size_for_table_like_flow(self.spacing.vertical.0) } fn compute_absolute_position(&mut self, layout_context: &LayoutContext) { diff --git a/components/layout/text.rs b/components/layout/text.rs index 6e1c7b2a43a..f1c7d40515d 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -446,11 +446,11 @@ pub fn font_metrics_for_style(font_context: &mut FontContext, font_style: ::Serv /// Returns the line block-size needed by the given computed style and font size. pub fn line_height_from_style(style: &ComputedValues, metrics: &FontMetrics) -> Au { - let font_size = style.get_font().font_size; + let font_size = style.get_font().font_size.0; match style.get_inheritedtext().line_height { LineHeight::Normal => metrics.line_gap, - LineHeight::Number(l) => font_size.scale_by(l), - LineHeight::Length(l) => l + LineHeight::Number(l) => font_size.scale_by(l.0), + LineHeight::Length(l) => l.0 } } diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs index f821b4a2806..7ca56d22f9a 100644 --- a/components/layout/traversal.rs +++ b/components/layout/traversal.rs @@ -222,8 +222,9 @@ impl<'a> BuildDisplayList<'a> { let parent_stacking_context_id = self.state.current_stacking_context_id; self.state.current_stacking_context_id = flow::base(flow).stacking_context_id; - let parent_scroll_root_id = self.state.current_scroll_root_id; - self.state.current_scroll_root_id = flow.scroll_root_id(self.state.layout_context.id); + let parent_clip_and_scroll_info = self.state.current_clip_and_scroll_info; + self.state.current_clip_and_scroll_info = + flow.clip_and_scroll_info(self.state.layout_context.id); if self.should_process() { flow.build_display_list(&mut self.state); @@ -235,7 +236,7 @@ impl<'a> BuildDisplayList<'a> { } self.state.current_stacking_context_id = parent_stacking_context_id; - self.state.current_scroll_root_id = parent_scroll_root_id; + self.state.current_clip_and_scroll_info = parent_clip_and_scroll_info; } #[inline] diff --git a/components/layout/webrender_helpers.rs b/components/layout/webrender_helpers.rs index 889ee087b0b..6b8b334d52d 100644 --- a/components/layout/webrender_helpers.rs +++ b/components/layout/webrender_helpers.rs @@ -16,8 +16,8 @@ use msg::constellation_msg::PipelineId; use style::computed_values::{image_rendering, mix_blend_mode, transform_style}; use style::values::computed::{BorderStyle, Filter}; use style::values::generics::effects::Filter as GenericFilter; -use webrender_api::{self, ComplexClipRegion, DisplayListBuilder, ExtendMode}; -use webrender_api::{LayoutTransform, ClipId}; +use webrender_api::{self, ClipAndScrollInfo, ComplexClipRegion, DisplayListBuilder}; +use webrender_api::{ExtendMode, LayoutTransform}; pub trait WebRenderDisplayListConverter { fn convert_to_webrender(&self, pipeline_id: PipelineId) -> DisplayListBuilder; @@ -26,7 +26,7 @@ pub trait WebRenderDisplayListConverter { trait WebRenderDisplayItemConverter { fn convert_to_webrender(&self, builder: &mut DisplayListBuilder, - current_scroll_root_id: &mut ClipId); + current_clip_and_scroll_info: &mut ClipAndScrollInfo); } trait ToBorderStyle { @@ -190,15 +190,15 @@ impl ToFilterOps for Vec<Filter> { let mut result = Vec::with_capacity(self.len()); for filter in self.iter() { match *filter { - GenericFilter::Blur(radius) => result.push(webrender_api::FilterOp::Blur(radius)), - GenericFilter::Brightness(amount) => result.push(webrender_api::FilterOp::Brightness(amount)), - GenericFilter::Contrast(amount) => result.push(webrender_api::FilterOp::Contrast(amount)), - GenericFilter::Grayscale(amount) => result.push(webrender_api::FilterOp::Grayscale(amount)), + GenericFilter::Blur(radius) => result.push(webrender_api::FilterOp::Blur(radius.0.to_f32_px())), + GenericFilter::Brightness(amount) => result.push(webrender_api::FilterOp::Brightness(amount.0)), + GenericFilter::Contrast(amount) => result.push(webrender_api::FilterOp::Contrast(amount.0)), + GenericFilter::Grayscale(amount) => result.push(webrender_api::FilterOp::Grayscale(amount.0)), GenericFilter::HueRotate(angle) => result.push(webrender_api::FilterOp::HueRotate(angle.radians())), - GenericFilter::Invert(amount) => result.push(webrender_api::FilterOp::Invert(amount)), - GenericFilter::Opacity(amount) => result.push(webrender_api::FilterOp::Opacity(amount.into())), - GenericFilter::Saturate(amount) => result.push(webrender_api::FilterOp::Saturate(amount)), - GenericFilter::Sepia(amount) => result.push(webrender_api::FilterOp::Sepia(amount)), + GenericFilter::Invert(amount) => result.push(webrender_api::FilterOp::Invert(amount.0)), + GenericFilter::Opacity(amount) => result.push(webrender_api::FilterOp::Opacity(amount.0.into())), + GenericFilter::Saturate(amount) => result.push(webrender_api::FilterOp::Saturate(amount.0)), + GenericFilter::Sepia(amount) => result.push(webrender_api::FilterOp::Sepia(amount.0)), GenericFilter::DropShadow(ref shadow) => match *shadow {}, } } @@ -222,16 +222,15 @@ impl ToTransformStyle for transform_style::T { impl WebRenderDisplayListConverter for DisplayList { fn convert_to_webrender(&self, pipeline_id: PipelineId) -> DisplayListBuilder { let traversal = DisplayListTraversal::new(self); - let webrender_pipeline_id = pipeline_id.to_webrender(); - let mut builder = DisplayListBuilder::with_capacity(webrender_pipeline_id, + let mut builder = DisplayListBuilder::with_capacity(pipeline_id.to_webrender(), self.bounds().size.to_sizef(), 1024 * 1024); // 1 MB of space - let mut current_scroll_root_id = ClipId::root_scroll_node(webrender_pipeline_id); - builder.push_clip_id(current_scroll_root_id); + let mut current_clip_and_scroll_info = pipeline_id.root_clip_and_scroll_info(); + builder.push_clip_and_scroll_info(current_clip_and_scroll_info); for item in traversal { - item.convert_to_webrender(&mut builder, &mut current_scroll_root_id); + item.convert_to_webrender(&mut builder, &mut current_clip_and_scroll_info); } builder } @@ -240,12 +239,12 @@ impl WebRenderDisplayListConverter for DisplayList { impl WebRenderDisplayItemConverter for DisplayItem { fn convert_to_webrender(&self, builder: &mut DisplayListBuilder, - current_scroll_root_id: &mut ClipId) { - let scroll_root_id = self.base().scroll_root_id; - if scroll_root_id != *current_scroll_root_id { + current_clip_and_scroll_info: &mut ClipAndScrollInfo) { + let clip_and_scroll_info = self.base().clip_and_scroll_info; + if clip_and_scroll_info != *current_clip_and_scroll_info { builder.pop_clip_id(); - builder.push_clip_id(scroll_root_id); - *current_scroll_root_id = scroll_root_id; + builder.push_clip_and_scroll_info(clip_and_scroll_info); + *current_clip_and_scroll_info = clip_and_scroll_info; } match *self { @@ -506,12 +505,13 @@ impl WebRenderDisplayItemConverter for DisplayItem { item.scroll_root.clip.get_complex_clips(), None) } - ScrollRootType::ScrollFrame => { + ScrollRootType::ScrollFrame(scroll_sensitivity) => { builder.define_scroll_frame(Some(our_id), item.scroll_root.content_rect.to_rectf(), item.scroll_root.clip.main.to_rectf(), item.scroll_root.clip.get_complex_clips(), - None) + None, + scroll_sensitivity) } }; debug_assert!(our_id == webrender_id); diff --git a/components/layout_thread/Cargo.toml b/components/layout_thread/Cargo.toml index de3fd19e224..5513521c743 100644 --- a/components/layout_thread/Cargo.toml +++ b/components/layout_thread/Cargo.toml @@ -41,4 +41,5 @@ servo_config = {path = "../config"} servo_geometry = {path = "../geometry"} servo_url = {path = "../url"} style = {path = "../style"} +style_traits = {path = "../style_traits"} webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/components/layout_thread/dom_wrapper.rs b/components/layout_thread/dom_wrapper.rs index 667e087c69c..0981ec42ce2 100644 --- a/components/layout_thread/dom_wrapper.rs +++ b/components/layout_thread/dom_wrapper.rs @@ -256,7 +256,7 @@ impl<'ln> LayoutNode for ServoLayoutNode<'ln> { let ptr: *mut StyleAndLayoutData = Box::into_raw(Box::new(StyleAndLayoutData::new())); let opaque = OpaqueStyleAndLayoutData { - ptr: NonZero::new(ptr as *mut StyleData), + ptr: NonZero::new_unchecked(ptr as *mut StyleData), }; self.init_style_and_layout_data(opaque); }; diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 576588abda8..ecfa17ff1d2 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -46,6 +46,7 @@ extern crate servo_config; extern crate servo_geometry; extern crate servo_url; extern crate style; +extern crate style_traits; extern crate webrender_api; mod dom_wrapper; @@ -53,7 +54,7 @@ mod dom_wrapper; use app_units::Au; use dom_wrapper::{ServoLayoutElement, ServoLayoutDocument, ServoLayoutNode}; use dom_wrapper::drop_style_and_layout_data; -use euclid::{Point2D, Rect, Size2D, ScaleFactor}; +use euclid::{Point2D, Rect, Size2D, ScaleFactor, TypedSize2D}; use fnv::FnvHashMap; use gfx::display_list::{OpaqueNode, WebRenderImageInfo}; use gfx::font; @@ -67,6 +68,7 @@ use layout::animation; use layout::construct::ConstructionResult; use layout::context::LayoutContext; use layout::context::RegisteredPainter; +use layout::context::RegisteredPainters; use layout::context::heap_size_of_persistent_local_context; use layout::display_list_builder::ToGfxColor; use layout::flow::{self, Flow, ImmutableFlowUtils, MutableFlowUtils, MutableOwnedFlowUtils}; @@ -99,6 +101,8 @@ use script_layout_interface::rpc::TextIndexResponse; use script_layout_interface::wrapper_traits::LayoutNode; use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg}; use script_traits::{ScrollState, UntrustedNodeAddress}; +use script_traits::DrawAPaintImageResult; +use script_traits::Painter; use selectors::Element; use servo_arc::Arc as ServoArc; use servo_atoms::Atom; @@ -122,6 +126,8 @@ use std::thread; use style::animation::Animation; use style::context::{QuirksMode, ReflowGoal, SharedStyleContext}; use style::context::{StyleSystemOptions, ThreadLocalStyleContextCreationInfo}; +use style::context::RegisteredSpeculativePainter; +use style::context::RegisteredSpeculativePainters; use style::dom::{ShowSubtree, ShowSubtreeDataAndPrimaryValues, TElement, TNode}; use style::error_reporting::{NullReporter, RustLogReporter}; use style::invalidation::element::restyle_hints::RestyleHint; @@ -135,7 +141,11 @@ use style::stylesheets::{Origin, Stylesheet, StylesheetInDocument, UserAgentStyl use style::stylist::{ExtraStyleData, Stylist}; use style::thread_state; use style::timer::Timer; -use style::traversal::{DomTraversal, TraversalDriver, TraversalFlags}; +use style::traversal::{DomTraversal, TraversalDriver}; +use style::traversal_flags::TraversalFlags; +use style_traits::CSSPixel; +use style_traits::DevicePixel; +use style_traits::SpeculativePainter; /// Information needed by the layout thread. pub struct LayoutThread { @@ -234,13 +244,16 @@ pub struct LayoutThread { webrender_image_cache: Arc<RwLock<FnvHashMap<(ServoUrl, UsePlaceholder), WebRenderImageInfo>>>, - /// The executor for paint worklets. - /// Will be None if the script thread hasn't added any paint worklet modules. - registered_painters: Arc<RwLock<FnvHashMap<Atom, RegisteredPainter>>>, + + /// The executors for paint worklets. + registered_painters: RegisteredPaintersImpl, /// Webrender interface. webrender_api: webrender_api::RenderApi, + /// Webrender document. + webrender_document: webrender_api::DocumentId, + /// The timer object to control the timing of the animations. This should /// only be a test-mode timer during testing for animations. timer: Timer, @@ -274,6 +287,7 @@ impl LayoutThreadFactory for LayoutThread { mem_profiler_chan: mem::ProfilerChan, content_process_shutdown_chan: Option<IpcSender<()>>, webrender_api_sender: webrender_api::RenderApiSender, + webrender_document: webrender_api::DocumentId, layout_threads: usize, paint_time_metrics: PaintTimeMetrics) { thread::Builder::new().name(format!("LayoutThread {:?}", id)).spawn(move || { @@ -297,6 +311,7 @@ impl LayoutThreadFactory for LayoutThread { time_profiler_chan, mem_profiler_chan.clone(), webrender_api_sender, + webrender_document, layout_threads, paint_time_metrics); @@ -459,6 +474,7 @@ impl LayoutThread { time_profiler_chan: time::ProfilerChan, mem_profiler_chan: mem::ProfilerChan, webrender_api_sender: webrender_api::RenderApiSender, + webrender_document: webrender_api::DocumentId, layout_threads: usize, paint_time_metrics: PaintTimeMetrics) -> LayoutThread { @@ -513,7 +529,7 @@ impl LayoutThread { constellation_chan: constellation_chan.clone(), time_profiler_chan: time_profiler_chan, mem_profiler_chan: mem_profiler_chan, - registered_painters: Arc::new(RwLock::new(FnvHashMap::default())), + registered_painters: RegisteredPaintersImpl(FnvHashMap::default()), image_cache: image_cache.clone(), font_cache_thread: font_cache_thread, first_reflow: Cell::new(true), @@ -532,6 +548,7 @@ impl LayoutThread { epoch: Cell::new(Epoch(0)), viewport_size: Size2D::new(Au(0), Au(0)), webrender_api: webrender_api_sender.create_api(), + webrender_document, stylist: stylist, rw_data: Arc::new(Mutex::new( LayoutThreadData { @@ -597,6 +614,7 @@ impl LayoutThread { visited_styles_enabled: false, running_animations: self.running_animations.clone(), expired_animations: self.expired_animations.clone(), + registered_speculative_painters: &self.registered_painters, local_context_creation_data: Mutex::new(thread_local_style_context_creation_data), timer: self.timer.clone(), quirks_mode: self.quirks_mode.unwrap(), @@ -608,7 +626,7 @@ impl LayoutThread { webrender_image_cache: self.webrender_image_cache.clone(), pending_images: if script_initiated_layout { Some(Mutex::new(vec![])) } else { None }, newly_transitioning_nodes: if script_initiated_layout { Some(Mutex::new(vec![])) } else { None }, - registered_painters: self.registered_painters.clone(), + registered_painters: &self.registered_painters, } } @@ -730,13 +748,12 @@ impl LayoutThread { .filter_map(|name| PropertyId::parse(&*name).ok().map(|id| (name.clone(), id))) .filter(|&(_, ref id)| id.as_shorthand().is_err()) .collect(); - let registered_painter = RegisteredPainter { + let registered_painter = RegisteredPainterImpl { name: name.clone(), properties: properties, painter: painter, }; - self.registered_painters.write() - .insert(name, registered_painter); + self.registered_painters.0.insert(name, registered_painter); }, Msg::PrepareToExit(response_chan) => { self.prepare_to_exit(response_chan); @@ -801,6 +818,7 @@ impl LayoutThread { self.mem_profiler_chan.clone(), info.content_process_shutdown_chan, self.webrender_api.clone_sender(), + self.webrender_document, info.layout_threads, info.paint_time_metrics); } @@ -1044,12 +1062,13 @@ impl LayoutThread { self.paint_time_metrics.maybe_set_first_contentful_paint(self, &display_list); self.webrender_api.set_display_list( - Some(get_root_flow_background_color(layout_root)), + self.webrender_document, webrender_api::Epoch(epoch.0), + Some(get_root_flow_background_color(layout_root)), viewport_size, builder.finalize(), true); - self.webrender_api.generate_frame(None); + self.webrender_api.generate_frame(self.webrender_document, None); }); } @@ -1780,3 +1799,52 @@ lazy_static! { } }; } + +struct RegisteredPainterImpl { + painter: Box<Painter>, + name: Atom, + properties: FnvHashMap<Atom, PropertyId>, +} + +impl SpeculativePainter for RegisteredPainterImpl { + fn speculatively_draw_a_paint_image(&self, properties: Vec<(Atom, String)>, arguments: Vec<String>) { + self.painter.speculatively_draw_a_paint_image(properties, arguments); + } +} + +impl RegisteredSpeculativePainter for RegisteredPainterImpl { + fn properties(&self) -> &FnvHashMap<Atom, PropertyId> { + &self.properties + } + fn name(&self) -> Atom { + self.name.clone() + } +} + +impl Painter for RegisteredPainterImpl { + fn draw_a_paint_image(&self, + size: TypedSize2D<f32, CSSPixel>, + device_pixel_ratio: ScaleFactor<f32, CSSPixel, DevicePixel>, + properties: Vec<(Atom, String)>, + arguments: Vec<String>) + -> DrawAPaintImageResult + { + self.painter.draw_a_paint_image(size, device_pixel_ratio, properties, arguments) + } +} + +impl RegisteredPainter for RegisteredPainterImpl {} + +struct RegisteredPaintersImpl(FnvHashMap<Atom, RegisteredPainterImpl>); + +impl RegisteredSpeculativePainters for RegisteredPaintersImpl { + fn get(&self, name: &Atom) -> Option<&RegisteredSpeculativePainter> { + self.0.get(&name).map(|painter| painter as &RegisteredSpeculativePainter) + } +} + +impl RegisteredPainters for RegisteredPaintersImpl { + fn get(&self, name: &Atom) -> Option<&RegisteredPainter> { + self.0.get(&name).map(|painter| painter as &RegisteredPainter) + } +} diff --git a/components/layout_traits/lib.rs b/components/layout_traits/lib.rs index 4b906e4c1c5..fe432604556 100644 --- a/components/layout_traits/lib.rs +++ b/components/layout_traits/lib.rs @@ -50,6 +50,7 @@ pub trait LayoutThreadFactory { mem_profiler_chan: mem::ProfilerChan, content_process_shutdown_chan: Option<IpcSender<()>>, webrender_api_sender: webrender_api::RenderApiSender, + webrender_document: webrender_api::DocumentId, layout_threads: usize, paint_time_metrics: PaintTimeMetrics); } diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index 5522a324b08..0d7c10786d1 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -248,6 +248,10 @@ impl PipelineId { pub fn root_scroll_node(&self) -> webrender_api::ClipId { webrender_api::ClipId::root_scroll_node(self.to_webrender()) } + + pub fn root_clip_and_scroll_info(&self) -> webrender_api::ClipAndScrollInfo { + webrender_api::ClipAndScrollInfo::simple(self.root_scroll_node()) + } } impl fmt::Display for PipelineId { diff --git a/components/net/fetch/methods.rs b/components/net/fetch/methods.rs index b6b5d80231c..59da722fb03 100644 --- a/components/net/fetch/methods.rs +++ b/components/net/fetch/methods.rs @@ -21,6 +21,7 @@ use net_traits::request::{Referrer, Request, RequestMode, ResponseTainting}; use net_traits::request::{Type, Origin, Window}; use net_traits::response::{Response, ResponseBody, ResponseType}; use servo_url::ServoUrl; +use std::ascii::AsciiExt; use std::borrow::Cow; use std::fmt; use std::fs::File; @@ -514,9 +515,10 @@ pub fn should_be_blocked_due_to_nosniff(request_type: Type, response_headers: &H fn parse_header(raw: &[Vec<u8>]) -> HyperResult<Self> { raw.first() .and_then(|v| str::from_utf8(v).ok()) - .and_then(|s| match s.trim().to_lowercase().as_str() { - "nosniff" => Some(XContentTypeOptions), - _ => None + .and_then(|s| if s.trim().eq_ignore_ascii_case("nosniff") { + Some(XContentTypeOptions) + } else { + None }) .ok_or(Error::Header) } diff --git a/components/remutex/lib.rs b/components/remutex/lib.rs index d10378d86bd..d913687c777 100644 --- a/components/remutex/lib.rs +++ b/components/remutex/lib.rs @@ -35,7 +35,7 @@ impl ThreadId { #[allow(unsafe_code)] fn new() -> ThreadId { let number = THREAD_COUNT.fetch_add(1, Ordering::SeqCst); - ThreadId(unsafe { NonZero::new(number) }) + ThreadId(NonZero::new(number).unwrap()) } pub fn current() -> ThreadId { THREAD_ID.with(|tls| tls.clone()) @@ -59,13 +59,13 @@ impl AtomicOptThreadId { #[allow(unsafe_code)] pub fn load(&self, ordering: Ordering) -> Option<ThreadId> { let number = self.0.load(ordering); - if number == 0 { None } else { Some(ThreadId(unsafe { NonZero::new(number) })) } + NonZero::new(number).map(ThreadId) } #[allow(unsafe_code)] pub fn swap(&self, value: Option<ThreadId>, ordering: Ordering) -> Option<ThreadId> { let number = value.map(|id| id.0.get()).unwrap_or(0); let number = self.0.swap(number, ordering); - if number == 0 { None } else { Some(ThreadId(unsafe { NonZero::new(number) })) } + NonZero::new(number).map(ThreadId) } } diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index efb39208b44..482b713e10c 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -1848,7 +1848,8 @@ class CGImports(CGWrapper): """ Generates the appropriate import/use statements. """ - def __init__(self, child, descriptors, callbacks, dictionaries, enums, imports, config, ignored_warnings=None): + def __init__(self, child, descriptors, callbacks, dictionaries, enums, typedefs, imports, config, + ignored_warnings=None): """ Adds a set of imports. """ @@ -1937,6 +1938,11 @@ class CGImports(CGWrapper): for d in dictionaries: types += componentTypes(d) + # Import the type names used in the typedefs that are being defined. + for t in typedefs: + if not t.innerType.isCallback(): + types += componentTypes(t.innerType) + # Normalize the types we've collected and remove any ones which can't be imported. types = removeWrapperAndNullableTypes(types) @@ -2292,6 +2298,7 @@ def UnionTypes(descriptors, dictionaries, callbacks, typedefs, config): callbacks=[], dictionaries=[], enums=[], + typedefs=[], imports=imports, config=config, ignored_warnings=[]) @@ -5507,15 +5514,17 @@ class CGWeakReferenceableTrait(CGThing): return self.code -def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries=None, enums=None): +def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries=None, enums=None, typedefs=None): if not callbacks: callbacks = [] if not dictionaries: dictionaries = [] if not enums: enums = [] + if not typedefs: + typedefs = [] - return CGImports(cgthings, descriptors, callbacks, dictionaries, enums, [ + return CGImports(cgthings, descriptors, callbacks, dictionaries, enums, typedefs, [ 'core::nonzero::NonZero', 'js', 'js::JSCLASS_GLOBAL_SLOT_COUNT', @@ -6220,7 +6229,7 @@ class CGBindingRoot(CGThing): # Do codegen for all the enums. cgthings = [CGEnum(e) for e in enums] - # Do codegen for all the typdefs + # Do codegen for all the typedefs for t in typedefs: typeName = getRetvalDeclarationForType(t.innerType, config.getDescriptorProvider()) substs = { @@ -6258,7 +6267,7 @@ class CGBindingRoot(CGThing): # Add imports curr = generate_imports(config, curr, callbackDescriptors, mainCallbacks, - dictionaries, enums) + dictionaries, enums, typedefs) # Add the auto-generated comment. curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT) @@ -7060,7 +7069,7 @@ class GlobalGenRoots(): CGRegisterProxyHandlers(config), ], "\n") - return CGImports(code, descriptors=[], callbacks=[], dictionaries=[], enums=[], imports=[ + return CGImports(code, descriptors=[], callbacks=[], dictionaries=[], enums=[], typedefs=[], imports=[ 'dom::bindings::codegen::Bindings', 'dom::bindings::codegen::PrototypeList::Proxies', 'libc', diff --git a/components/script/dom/bindings/iterable.rs b/components/script/dom/bindings/iterable.rs index 845ecbaa8cd..15fdd04f2a8 100644 --- a/components/script/dom/bindings/iterable.rs +++ b/components/script/dom/bindings/iterable.rs @@ -106,7 +106,7 @@ impl<T: DomObject + JSTraceable + Iterable> IterableIterator<T> { self.index.set(index + 1); result.map(|_| { assert!(!rval.is_null()); - unsafe { NonZero::new(rval.get()) } + unsafe { NonZero::new_unchecked(rval.get()) } }) } } diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index 292324f04d0..975ddeda13b 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -81,7 +81,7 @@ impl<T: DomObject> JS<T> { pub fn from_ref(obj: &T) -> JS<T> { debug_assert!(thread_state::get().is_script()); JS { - ptr: unsafe { NonZero::new(&*obj) }, + ptr: unsafe { NonZero::new_unchecked(&*obj) }, } } } @@ -135,7 +135,7 @@ impl<T: Castable> LayoutJS<T> { debug_assert!(thread_state::get().is_layout()); let ptr: *const T = self.ptr.get(); LayoutJS { - ptr: unsafe { NonZero::new(ptr as *const U) }, + ptr: unsafe { NonZero::new_unchecked(ptr as *const U) }, } } @@ -148,7 +148,7 @@ impl<T: Castable> LayoutJS<T> { if (*self.unsafe_get()).is::<U>() { let ptr: *const T = self.ptr.get(); Some(LayoutJS { - ptr: NonZero::new(ptr as *const U), + ptr: NonZero::new_unchecked(ptr as *const U), }) } else { None @@ -223,7 +223,7 @@ impl LayoutJS<Node> { debug_assert!(thread_state::get().is_layout()); let TrustedNodeAddress(addr) = inner; LayoutJS { - ptr: NonZero::new(addr as *const Node), + ptr: NonZero::new_unchecked(addr as *const Node), } } } @@ -554,7 +554,7 @@ impl<T: DomObject> Root<T> { /// Generate a new root from a reference pub fn from_ref(unrooted: &T) -> Root<T> { - Root::new(unsafe { NonZero::new(unrooted) }) + Root::new(unsafe { NonZero::new_unchecked(unrooted) }) } } diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs index db3215fbdd1..bbac02288fc 100644 --- a/components/script/dom/bindings/refcounted.rs +++ b/components/script/dom/bindings/refcounted.rs @@ -200,7 +200,7 @@ impl<T: DomObject> Trusted<T> { self.owner_thread == (&*live_references) as *const _ as *const libc::c_void })); unsafe { - Root::new(NonZero::new(self.refcount.0 as *const T)) + Root::new(NonZero::new_unchecked(self.refcount.0 as *const T)) } } } diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 6ddeb49acf7..e16cd4dc571 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -43,7 +43,7 @@ use dom::bindings::str::{DOMString, USVString}; use dom::bindings::utils::WindowProxyHandler; use dom::document::PendingRestyle; use encoding::types::EncodingRef; -use euclid::{Transform2D, Transform3D, Point2D, Vector2D, Rect, Size2D, ScaleFactor}; +use euclid::{Transform2D, Transform3D, Point2D, Vector2D, Rect, TypedSize2D, ScaleFactor}; use euclid::Length as EuclidLength; use html5ever::{Prefix, LocalName, Namespace, QualName}; use html5ever::buffer_queue::BufferQueue; @@ -75,6 +75,7 @@ use script_layout_interface::reporter::CSSErrorReporter; use script_layout_interface::rpc::LayoutRPC; use script_traits::{DocumentActivity, TimerEventId, TimerSource, TouchpadPressurePhase}; use script_traits::{UntrustedNodeAddress, WindowSizeData, WindowSizeType}; +use script_traits::DrawAPaintImageResult; use selectors::matching::ElementSelectorFlags; use serde::{Deserialize, Serialize}; use servo_arc::Arc as ServoArc; @@ -389,6 +390,7 @@ unsafe_no_jsmanaged_fields!(RelativePos); unsafe_no_jsmanaged_fields!(OpaqueStyleAndLayoutData); unsafe_no_jsmanaged_fields!(PathBuf); unsafe_no_jsmanaged_fields!(CSSErrorReporter); +unsafe_no_jsmanaged_fields!(DrawAPaintImageResult); unsafe_no_jsmanaged_fields!(WebGLBufferId); unsafe_no_jsmanaged_fields!(WebGLFramebufferId); unsafe_no_jsmanaged_fields!(WebGLProgramId); @@ -519,7 +521,14 @@ unsafe impl JSTraceable for Rect<f32> { } } -unsafe impl JSTraceable for Size2D<i32> { +unsafe impl<U> JSTraceable for TypedSize2D<i32, U> { + #[inline] + unsafe fn trace(&self, _trc: *mut JSTracer) { + // Do nothing + } +} + +unsafe impl<U> JSTraceable for TypedSize2D<f32, U> { #[inline] unsafe fn trace(&self, _trc: *mut JSTracer) { // Do nothing diff --git a/components/script/dom/bindings/weakref.rs b/components/script/dom/bindings/weakref.rs index c6ba99ba680..7291405e5f6 100644 --- a/components/script/dom/bindings/weakref.rs +++ b/components/script/dom/bindings/weakref.rs @@ -58,7 +58,7 @@ pub trait WeakReferenceable: DomObject + Sized { trace!("Creating new WeakBox holder for {:p}.", self); ptr = Box::into_raw(box WeakBox { count: Cell::new(1), - value: Cell::new(Some(NonZero::new(self))), + value: Cell::new(Some(NonZero::new_unchecked(self))), }); JS_SetReservedSlot(object, DOM_WEAK_SLOT, PrivateValue(ptr as *const c_void)); } @@ -70,7 +70,7 @@ pub trait WeakReferenceable: DomObject + Sized { new_count); box_.count.set(new_count); WeakRef { - ptr: NonZero::new(ptr), + ptr: NonZero::new_unchecked(ptr), } } } diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index ddf14fc8096..191ea6f84f7 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -16,6 +16,7 @@ use ipc_channel::ipc; use net_traits::{CoreResourceMsg, IpcSend}; use net_traits::blob_url_store::{BlobBuf, get_blob_origin}; use net_traits::filemanager_thread::{FileManagerThreadMsg, ReadFileProgress, RelativePos}; +use std::ascii::AsciiExt; use std::mem; use std::ops::Index; use std::path::PathBuf; @@ -381,7 +382,7 @@ impl BlobMethods for Blob { /// see https://github.com/w3c/FileAPI/issues/43 fn normalize_type_string(s: &str) -> String { if is_ascii_printable(s) { - let s_lower = s.to_lowercase(); + let s_lower = s.to_ascii_lowercase(); // match s_lower.parse() as Result<Mime, ()> { // Ok(_) => s_lower, // Err(_) => "".to_string() diff --git a/components/script/dom/characterdata.rs b/components/script/dom/characterdata.rs index 9db34a49f8c..747589ada5d 100644 --- a/components/script/dom/characterdata.rs +++ b/components/script/dom/characterdata.rs @@ -91,7 +91,7 @@ impl CharacterDataMethods for CharacterData { // If this is a Text node, we might need to re-parse (say, if our parent // is a <style> element.) We don't need to if this is a Comment or // ProcessingInstruction. - if let Some(_) = self.downcast::<Text>() { + if self.is::<Text>() { if let Some(parent_node) = node.GetParentNode() { let mutation = ChildrenMutation::ChangeText; vtable_for(&parent_node).children_changed(&mutation); diff --git a/components/script/dom/crypto.rs b/components/script/dom/crypto.rs index fc71faa660a..986e1b0ab09 100644 --- a/components/script/dom/crypto.rs +++ b/components/script/dom/crypto.rs @@ -65,7 +65,7 @@ impl CryptoMethods for Crypto { self.rng.borrow_mut().fill_bytes(&mut data); - Ok(NonZero::new(input)) + Ok(NonZero::new_unchecked(input)) } } diff --git a/components/script/dom/cssrule.rs b/components/script/dom/cssrule.rs index 32e6ad05471..40bd087899b 100644 --- a/components/script/dom/cssrule.rs +++ b/components/script/dom/cssrule.rs @@ -78,6 +78,7 @@ impl CSSRule { StyleCssRule::Import(s) => Root::upcast(CSSImportRule::new(window, parent_stylesheet, s)), StyleCssRule::Style(s) => Root::upcast(CSSStyleRule::new(window, parent_stylesheet, s)), StyleCssRule::FontFace(s) => Root::upcast(CSSFontFaceRule::new(window, parent_stylesheet, s)), + StyleCssRule::FontFeatureValues(_) => unimplemented!(), StyleCssRule::CounterStyle(_) => unimplemented!(), StyleCssRule::Keyframes(s) => Root::upcast(CSSKeyframesRule::new(window, parent_stylesheet, s)), StyleCssRule::Media(s) => Root::upcast(CSSMediaRule::new(window, parent_stylesheet, s)), diff --git a/components/script/dom/cssstylerule.rs b/components/script/dom/cssstylerule.rs index ea121ef900a..a45e0ad20c8 100644 --- a/components/script/dom/cssstylerule.rs +++ b/components/script/dom/cssstylerule.rs @@ -93,6 +93,7 @@ impl CSSStyleRuleMethods for CSSStyleRule { let parser = SelectorParser { stylesheet_origin: Origin::Author, namespaces: &namespaces, + url_data: None, }; let mut css_parser = CssParserInput::new(&*value); let mut css_parser = CssParser::new(&mut css_parser); diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index dd708529f88..c63295a0674 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -3498,7 +3498,7 @@ impl DocumentMethods for Document { if elements.peek().is_none() { // TODO: Step 2. // Step 3. - return Some(NonZero::new(first.reflector().get_jsobject().get())); + return Some(NonZero::new_unchecked(first.reflector().get_jsobject().get())); } } else { return None; @@ -3509,7 +3509,7 @@ impl DocumentMethods for Document { name: name, }; let collection = HTMLCollection::create(self.window(), root, box filter); - Some(NonZero::new(collection.reflector().get_jsobject().get())) + Some(NonZero::new_unchecked(collection.reflector().get_jsobject().get())) } // https://html.spec.whatwg.org/multipage/#dom-tree-accessors:supported-property-names @@ -3875,8 +3875,7 @@ fn update_with_current_time_ms(marker: &Cell<u64>) { /// https://w3c.github.io/webappsec-referrer-policy/#determine-policy-for-token pub fn determine_policy_for_token(token: &str) -> Option<ReferrerPolicy> { - let lower = token.to_lowercase(); - return match lower.as_ref() { + match_ignore_ascii_case! { token, "never" | "no-referrer" => Some(ReferrerPolicy::NoReferrer), "default" | "no-referrer-when-downgrade" => Some(ReferrerPolicy::NoReferrerWhenDowngrade), "origin" => Some(ReferrerPolicy::Origin), diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 59db577c4eb..328dd76e822 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -548,7 +548,7 @@ impl LayoutElementHelpers for LayoutJS<Element> { shared_lock, PropertyDeclaration::BorderSpacing( Box::new(border_spacing::SpecifiedValue { - horizontal: width_value, + horizontal: width_value.into(), vertical: None, })))); } diff --git a/components/script/dom/gamepad.rs b/components/script/dom/gamepad.rs index a7f65050941..bee219bbbcd 100644 --- a/components/script/dom/gamepad.rs +++ b/components/script/dom/gamepad.rs @@ -128,7 +128,7 @@ impl GamepadMethods for Gamepad { #[allow(unsafe_code)] // https://w3c.github.io/gamepad/#dom-gamepad-axes unsafe fn Axes(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> { - NonZero::new(self.axes.get()) + NonZero::new_unchecked(self.axes.get()) } // https://w3c.github.io/gamepad/#dom-gamepad-buttons diff --git a/components/script/dom/htmlareaelement.rs b/components/script/dom/htmlareaelement.rs index 0e3c26155fe..4e227491d01 100644 --- a/components/script/dom/htmlareaelement.rs +++ b/components/script/dom/htmlareaelement.rs @@ -240,7 +240,7 @@ impl HTMLAreaElement { pub fn get_shape_from_coords(&self) -> Option<Area> { let elem = self.upcast::<Element>(); let shape = elem.get_string_attribute(&"shape".into()); - let shp: Shape = match shape.to_lowercase().as_ref() { + let shp: Shape = match_ignore_ascii_case! { &shape, "circle" => Shape::Circle, "circ" => Shape::Circle, "rectangle" => Shape::Rectangle, diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index 59846595166..05683653fa1 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -32,7 +32,6 @@ use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; use html5ever::{LocalName, Prefix}; use std::ascii::AsciiExt; -use std::borrow::ToOwned; use std::default::Default; use std::rc::Rc; use style::attr::AttrValue; @@ -374,12 +373,16 @@ impl HTMLElementMethods for HTMLElement { // https://html.spec.whatwg.org/multipage/#attr-data-* +static DATA_PREFIX: &str = "data-"; +static DATA_HYPHEN_SEPARATOR: char = '\x2d'; + fn to_snake_case(name: DOMString) -> DOMString { - let mut attr_name = "data-".to_owned(); + let mut attr_name = String::with_capacity(name.len() + DATA_PREFIX.len()); + attr_name.push_str(DATA_PREFIX); for ch in name.chars() { - if ch.is_uppercase() { - attr_name.push('\x2d'); - attr_name.extend(ch.to_lowercase()); + if ch.is_ascii_uppercase() { + attr_name.push(DATA_HYPHEN_SEPARATOR); + attr_name.push(ch.to_ascii_lowercase()); } else { attr_name.push(ch); } @@ -394,23 +397,21 @@ fn to_snake_case(name: DOMString) -> DOMString { // without the data prefix. fn to_camel_case(name: &str) -> Option<DOMString> { - if !name.starts_with("data-") { + if !name.starts_with(DATA_PREFIX) { return None; } let name = &name[5..]; - let has_uppercase = name.chars().any(|curr_char| { - curr_char.is_ascii() && curr_char.is_uppercase() - }); + let has_uppercase = name.chars().any(|curr_char| curr_char.is_ascii_uppercase()); if has_uppercase { return None; } - let mut result = "".to_owned(); + let mut result = String::with_capacity(name.len().saturating_sub(DATA_PREFIX.len())); let mut name_chars = name.chars(); while let Some(curr_char) = name_chars.next() { //check for hyphen followed by character - if curr_char == '\x2d' { + if curr_char == DATA_HYPHEN_SEPARATOR { if let Some(next_char) = name_chars.next() { - if next_char.is_ascii() && next_char.is_lowercase() { + if next_char.is_ascii_lowercase() { result.push(next_char.to_ascii_uppercase()); } else { result.push(curr_char); diff --git a/components/script/dom/imagedata.rs b/components/script/dom/imagedata.rs index 70f6d8ea992..30e0e3d6dae 100644 --- a/components/script/dom/imagedata.rs +++ b/components/script/dom/imagedata.rs @@ -161,6 +161,6 @@ impl ImageDataMethods for ImageData { // https://html.spec.whatwg.org/multipage/#dom-imagedata-data unsafe fn Data(&self, _: *mut JSContext) -> NonZero<*mut JSObject> { assert!(!self.data.get().is_null()); - NonZero::new(self.data.get()) + NonZero::new_unchecked(self.data.get()) } } diff --git a/components/script/dom/paintworkletglobalscope.rs b/components/script/dom/paintworkletglobalscope.rs index 2b66452e9f2..b0a43cbf25d 100644 --- a/components/script/dom/paintworkletglobalscope.rs +++ b/components/script/dom/paintworkletglobalscope.rs @@ -17,6 +17,7 @@ use dom::bindings::js::JS; use dom::bindings::js::Root; use dom::bindings::reflector::DomObject; use dom::bindings::str::DOMString; +use dom::cssstylevalue::CSSStyleValue; use dom::paintrenderingcontext2d::PaintRenderingContext2D; use dom::paintsize::PaintSize; use dom::stylepropertymapreadonly::StylePropertyMapReadOnly; @@ -38,6 +39,7 @@ use js::jsapi::IsConstructor; use js::jsapi::JSAutoCompartment; use js::jsapi::JS_ClearPendingException; use js::jsapi::JS_IsExceptionPending; +use js::jsapi::JS_NewArrayObject; use js::jsval::JSVal; use js::jsval::ObjectValue; use js::jsval::UndefinedValue; @@ -61,6 +63,7 @@ use std::sync::mpsc; use std::sync::mpsc::Sender; use style_traits::CSSPixel; use style_traits::DevicePixel; +use style_traits::SpeculativePainter; /// https://drafts.css-houdini.org/css-paint-api/#paintworkletglobalscope #[dom_struct] @@ -74,6 +77,18 @@ pub struct PaintWorkletGlobalScope { paint_definitions: DOMRefCell<HashMap<Atom, Box<PaintDefinition>>>, /// https://drafts.css-houdini.org/css-paint-api/#paint-class-instances paint_class_instances: DOMRefCell<HashMap<Atom, Box<Heap<JSVal>>>>, + /// The most recent name the worklet was called with + cached_name: DOMRefCell<Atom>, + /// The most recent size the worklet was drawn at + cached_size: Cell<TypedSize2D<f32, CSSPixel>>, + /// The most recent device pixel ratio the worklet was drawn at + cached_device_pixel_ratio: Cell<ScaleFactor<f32, CSSPixel, DevicePixel>>, + /// The most recent properties the worklet was drawn at + cached_properties: DOMRefCell<Vec<(Atom, String)>>, + /// The most recent arguments the worklet was drawn at + cached_arguments: DOMRefCell<Vec<String>>, + /// The most recent result + cached_result: DOMRefCell<DrawAPaintImageResult>, } impl PaintWorkletGlobalScope { @@ -90,6 +105,18 @@ impl PaintWorkletGlobalScope { image_cache: init.image_cache.clone(), paint_definitions: Default::default(), paint_class_instances: Default::default(), + cached_name: DOMRefCell::new(Atom::from("")), + cached_size: Cell::new(TypedSize2D::zero()), + cached_device_pixel_ratio: Cell::new(ScaleFactor::new(1.0)), + cached_properties: Default::default(), + cached_arguments: Default::default(), + cached_result: DOMRefCell::new(DrawAPaintImageResult { + width: 0, + height: 0, + format: PixelFormat::BGRA8, + image_key: None, + missing_image_urls: Vec::new(), + }), }; unsafe { PaintWorkletGlobalScopeBinding::Wrap(runtime.cx(), global) } } @@ -100,37 +127,80 @@ impl PaintWorkletGlobalScope { pub fn perform_a_worklet_task(&self, task: PaintWorkletTask) { match task { - PaintWorkletTask::DrawAPaintImage(name, size_in_px, device_pixel_ratio, properties, sender) => { - let properties = StylePropertyMapReadOnly::from_iter(self.upcast(), properties); - let result = self.draw_a_paint_image(name, size_in_px, device_pixel_ratio, &*properties); + PaintWorkletTask::DrawAPaintImage(name, size, device_pixel_ratio, properties, arguments, sender) => { + let cache_hit = (&*self.cached_name.borrow() == &name) && + (self.cached_size.get() == size) && + (self.cached_device_pixel_ratio.get() == device_pixel_ratio) && + (&*self.cached_properties.borrow() == &properties) && + (&*self.cached_arguments.borrow() == &arguments); + let result = if cache_hit { + debug!("Cache hit on paint worklet {}!", name); + self.cached_result.borrow().clone() + } else { + debug!("Cache miss on paint worklet {}!", name); + let map = StylePropertyMapReadOnly::from_iter(self.upcast(), properties.iter().cloned()); + let result = self.draw_a_paint_image(&name, size, device_pixel_ratio, &*map, &*arguments); + if (result.image_key.is_some()) && (result.missing_image_urls.is_empty()) { + *self.cached_name.borrow_mut() = name; + self.cached_size.set(size); + self.cached_device_pixel_ratio.set(device_pixel_ratio); + *self.cached_properties.borrow_mut() = properties; + *self.cached_arguments.borrow_mut() = arguments; + *self.cached_result.borrow_mut() = result.clone(); + } + result + }; let _ = sender.send(result); } + PaintWorkletTask::SpeculativelyDrawAPaintImage(name, properties, arguments) => { + let should_speculate = (&*self.cached_name.borrow() != &name) || + (&*self.cached_properties.borrow() != &properties) || + (&*self.cached_arguments.borrow() != &arguments); + if should_speculate { + let size = self.cached_size.get(); + let device_pixel_ratio = self.cached_device_pixel_ratio.get(); + let map = StylePropertyMapReadOnly::from_iter(self.upcast(), properties.iter().cloned()); + let result = self.draw_a_paint_image(&name, size, device_pixel_ratio, &*map, &*arguments); + if (result.image_key.is_some()) && (result.missing_image_urls.is_empty()) { + *self.cached_name.borrow_mut() = name; + *self.cached_properties.borrow_mut() = properties; + *self.cached_arguments.borrow_mut() = arguments; + *self.cached_result.borrow_mut() = result; + } + } + } } } /// https://drafts.css-houdini.org/css-paint-api/#draw-a-paint-image fn draw_a_paint_image(&self, - name: Atom, + name: &Atom, size_in_px: TypedSize2D<f32, CSSPixel>, device_pixel_ratio: ScaleFactor<f32, CSSPixel, DevicePixel>, - properties: &StylePropertyMapReadOnly) + properties: &StylePropertyMapReadOnly, + arguments: &[String]) -> DrawAPaintImageResult { + let size_in_dpx = size_in_px * device_pixel_ratio; + let size_in_dpx = TypedSize2D::new(size_in_dpx.width.abs() as u32, size_in_dpx.height.abs() as u32); + + // TODO: Steps 1-5. + // TODO: document paint definitions. - self.invoke_a_paint_callback(name, size_in_px, device_pixel_ratio, properties) + self.invoke_a_paint_callback(name, size_in_px, size_in_dpx, device_pixel_ratio, properties, arguments) } /// https://drafts.css-houdini.org/css-paint-api/#invoke-a-paint-callback #[allow(unsafe_code)] fn invoke_a_paint_callback(&self, - name: Atom, + name: &Atom, size_in_px: TypedSize2D<f32, CSSPixel>, + size_in_dpx: TypedSize2D<u32, DevicePixel>, device_pixel_ratio: ScaleFactor<f32, CSSPixel, DevicePixel>, - properties: &StylePropertyMapReadOnly) + properties: &StylePropertyMapReadOnly, + arguments: &[String]) -> DrawAPaintImageResult { - let size_in_dpx = size_in_px * device_pixel_ratio; - let size_in_dpx = TypedSize2D::new(size_in_dpx.width.abs() as u32, size_in_dpx.height.abs() as u32); debug!("Invoking a paint callback {}({},{}) at {}.", name, size_in_px.width, size_in_px.height, device_pixel_ratio); @@ -141,7 +211,7 @@ impl PaintWorkletGlobalScope { // Step 2.2-5.1. rooted!(in(cx) let mut class_constructor = UndefinedValue()); rooted!(in(cx) let mut paint_function = UndefinedValue()); - let rendering_context = match self.paint_definitions.borrow().get(&name) { + let rendering_context = match self.paint_definitions.borrow().get(name) { None => { // Step 2.2. warn!("Drawing un-registered paint definition {}.", name); @@ -176,7 +246,7 @@ impl PaintWorkletGlobalScope { if unsafe { JS_IsExceptionPending(cx) } { debug!("Paint constructor threw an exception {}.", name); unsafe { JS_ClearPendingException(cx); } - self.paint_definitions.borrow_mut().get_mut(&name) + self.paint_definitions.borrow_mut().get_mut(name) .expect("Vanishing paint definition.") .constructor_valid_flag.set(false); return self.invalid_image(size_in_dpx, vec![]); @@ -198,10 +268,19 @@ impl PaintWorkletGlobalScope { // TODO: Step 10 // Steps 11-12 debug!("Invoking paint function {}.", name); + rooted_vec!(let arguments_values <- arguments.iter().cloned() + .map(|argument| CSSStyleValue::new(self.upcast(), argument))); + let arguments_value_vec: Vec<JSVal> = arguments_values.iter() + .map(|argument| ObjectValue(argument.reflector().get_jsobject().get())) + .collect(); + let arguments_value_array = unsafe { HandleValueArray::from_rooted_slice(&*arguments_value_vec) }; + rooted!(in(cx) let argument_object = unsafe { JS_NewArrayObject(cx, &arguments_value_array) }); + let args_slice = [ ObjectValue(rendering_context.reflector().get_jsobject().get()), ObjectValue(paint_size.reflector().get_jsobject().get()), ObjectValue(properties.reflector().get_jsobject().get()), + ObjectValue(argument_object.get()), ]; let args = unsafe { HandleValueArray::from_rooted_slice(&args_slice) }; @@ -245,25 +324,46 @@ impl PaintWorkletGlobalScope { } } - fn painter(&self, name: Atom) -> Arc<Painter> { + fn painter(&self, name: Atom) -> Box<Painter> { // Rather annoyingly we have to use a mutex here to make the painter Sync. - struct WorkletPainter(Atom, Mutex<WorkletExecutor>); + struct WorkletPainter { + name: Atom, + executor: Mutex<WorkletExecutor>, + } + impl SpeculativePainter for WorkletPainter { + fn speculatively_draw_a_paint_image(&self, + properties: Vec<(Atom, String)>, + arguments: Vec<String>) { + let name = self.name.clone(); + let task = PaintWorkletTask::SpeculativelyDrawAPaintImage(name, properties, arguments); + self.executor.lock().expect("Locking a painter.") + .schedule_a_worklet_task(WorkletTask::Paint(task)); + } + } impl Painter for WorkletPainter { fn draw_a_paint_image(&self, size: TypedSize2D<f32, CSSPixel>, device_pixel_ratio: ScaleFactor<f32, CSSPixel, DevicePixel>, - properties: Vec<(Atom, String)>) - -> DrawAPaintImageResult - { - let name = self.0.clone(); + properties: Vec<(Atom, String)>, + arguments: Vec<String>) + -> DrawAPaintImageResult { + let name = self.name.clone(); let (sender, receiver) = mpsc::channel(); - let task = PaintWorkletTask::DrawAPaintImage(name, size, device_pixel_ratio, properties, sender); - self.1.lock().expect("Locking a painter.") + let task = PaintWorkletTask::DrawAPaintImage(name, + size, + device_pixel_ratio, + properties, + arguments, + sender); + self.executor.lock().expect("Locking a painter.") .schedule_a_worklet_task(WorkletTask::Paint(task)); receiver.recv().expect("Worklet thread died?") } } - Arc::new(WorkletPainter(name, Mutex::new(self.worklet_global.executor()))) + Box::new(WorkletPainter { + name: name, + executor: Mutex::new(self.worklet_global.executor()), + }) } } @@ -296,7 +396,7 @@ impl PaintWorkletGlobalScopeMethods for PaintWorkletGlobalScope { let properties = property_names.drain(..).map(Atom::from).collect(); // Step 7-9. - let _argument_names: Vec<String> = + let input_arguments: Vec<String> = unsafe { get_property(cx, paint_obj.handle(), "inputArguments", ()) }? .unwrap_or_default(); @@ -332,6 +432,7 @@ impl PaintWorkletGlobalScopeMethods for PaintWorkletGlobalScope { let definition = PaintDefinition::new(paint_val.handle(), paint_function.handle(), alpha, + input_arguments.len(), &*context); // Step 20. @@ -356,7 +457,11 @@ pub enum PaintWorkletTask { TypedSize2D<f32, CSSPixel>, ScaleFactor<f32, CSSPixel, DevicePixel>, Vec<(Atom, String)>, - Sender<DrawAPaintImageResult>) + Vec<String>, + Sender<DrawAPaintImageResult>), + SpeculativelyDrawAPaintImage(Atom, + Vec<(Atom, String)>, + Vec<String>), } /// A paint definition @@ -370,6 +475,8 @@ struct PaintDefinition { paint_function: Heap<JSVal>, constructor_valid_flag: Cell<bool>, context_alpha_flag: bool, + // TODO: this should be a list of CSS syntaxes. + input_arguments_len: usize, // TODO: the spec calls for fresh rendering contexts each time a paint image is drawn, // but to avoid having the primary worklet thread create a new renering context, // we recycle them. @@ -380,6 +487,7 @@ impl PaintDefinition { fn new(class_constructor: HandleValue, paint_function: HandleValue, alpha: bool, + input_arguments_len: usize, context: &PaintRenderingContext2D) -> Box<PaintDefinition> { @@ -388,6 +496,7 @@ impl PaintDefinition { paint_function: Heap::default(), constructor_valid_flag: Cell::new(true), context_alpha_flag: alpha, + input_arguments_len: input_arguments_len, context: JS::from_ref(context), }); result.class_constructor.set(class_constructor.get()); diff --git a/components/script/dom/request.rs b/components/script/dom/request.rs index 82b7773fc3e..9abfb4b0eb4 100644 --- a/components/script/dom/request.rs +++ b/components/script/dom/request.rs @@ -38,7 +38,6 @@ use net_traits::request::Request as NetTraitsRequest; use net_traits::request::RequestMode as NetTraitsRequestMode; use net_traits::request::Type as NetTraitsRequestType; use servo_url::ServoUrl; -use std::ascii::AsciiExt; use std::cell::{Cell, Ref}; use std::rc::Rc; @@ -453,15 +452,16 @@ fn net_request_from_global(global: &GlobalScope, // https://fetch.spec.whatwg.org/#concept-method-normalize fn normalize_method(m: &str) -> HttpMethod { - match m { - m if m.eq_ignore_ascii_case("DELETE") => HttpMethod::Delete, - m if m.eq_ignore_ascii_case("GET") => HttpMethod::Get, - m if m.eq_ignore_ascii_case("HEAD") => HttpMethod::Head, - m if m.eq_ignore_ascii_case("OPTIONS") => HttpMethod::Options, - m if m.eq_ignore_ascii_case("POST") => HttpMethod::Post, - m if m.eq_ignore_ascii_case("PUT") => HttpMethod::Put, - m => HttpMethod::Extension(m.to_string()), - } + match_ignore_ascii_case! { m, + "delete" => return HttpMethod::Delete, + "get" => return HttpMethod::Get, + "head" => return HttpMethod::Head, + "options" => return HttpMethod::Options, + "post" => return HttpMethod::Post, + "put" => return HttpMethod::Put, + _ => (), + } + HttpMethod::Extension(m.to_string()) } // https://fetch.spec.whatwg.org/#concept-method diff --git a/components/script/dom/servoparser/async_html.rs b/components/script/dom/servoparser/async_html.rs index 243e4452bd6..59411fda1c7 100644 --- a/components/script/dom/servoparser/async_html.rs +++ b/components/script/dom/servoparser/async_html.rs @@ -7,9 +7,8 @@ use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::inheritance::Castable; -use dom::bindings::js::{JS, MutNullableJS, Root}; +use dom::bindings::js::{JS, Root}; use dom::bindings::str::DOMString; -use dom::bindings::trace::JSTraceable; use dom::comment::Comment; use dom::document::Document; use dom::documenttype::DocumentType; @@ -20,25 +19,167 @@ use dom::htmltemplateelement::HTMLTemplateElement; use dom::node::Node; use dom::processinginstruction::ProcessingInstruction; use dom::virtualmethods::vtable_for; -use html5ever::{Attribute, LocalName, QualName, ExpandedName}; +use html5ever::{Attribute as HtmlAttribute, ExpandedName, LocalName, QualName}; use html5ever::buffer_queue::BufferQueue; -use html5ever::tendril::StrTendril; +use html5ever::tendril::{SendTendril, StrTendril, Tendril}; +use html5ever::tendril::fmt::UTF8; use html5ever::tokenizer::{Tokenizer as HtmlTokenizer, TokenizerOpts, TokenizerResult}; -use html5ever::tree_builder::{NodeOrText, TreeSink, NextParserState, QuirksMode, ElementFlags}; -use html5ever::tree_builder::{Tracer as HtmlTracer, TreeBuilder, TreeBuilderOpts}; -use js::jsapi::JSTracer; +use html5ever::tree_builder::{ElementFlags, NodeOrText as HtmlNodeOrText, NextParserState, QuirksMode, TreeSink}; +use html5ever::tree_builder::{TreeBuilder, TreeBuilderOpts}; use servo_url::ServoUrl; use std::ascii::AsciiExt; use std::borrow::Cow; use std::cell::Cell; use std::collections::HashMap; +use std::collections::vec_deque::VecDeque; +use std::sync::mpsc::{channel, Receiver, Sender}; +use std::thread; use style::context::QuirksMode as ServoQuirksMode; +type ParseNodeId = usize; + +#[derive(Clone, HeapSizeOf, JSTraceable)] +pub struct ParseNode { + id: ParseNodeId, + qual_name: Option<QualName>, +} + +#[derive(HeapSizeOf, JSTraceable)] +enum NodeOrText { + Node(ParseNode), + Text(String), +} + +#[derive(HeapSizeOf, JSTraceable)] +struct Attribute { + name: QualName, + value: String, +} + +#[derive(HeapSizeOf, JSTraceable)] +enum ParseOperation { + GetTemplateContents { target: ParseNodeId, contents: ParseNodeId }, + + CreateElement { + node: ParseNodeId, + name: QualName, + attrs: Vec<Attribute>, + current_line: u64 + }, + + CreateComment { text: String, node: ParseNodeId }, + AppendBeforeSibling { sibling: ParseNodeId, node: NodeOrText }, + Append { parent: ParseNodeId, node: NodeOrText }, + + AppendDoctypeToDocument { + name: String, + public_id: String, + system_id: String + }, + + AddAttrsIfMissing { target: ParseNodeId, attrs: Vec<Attribute> }, + RemoveFromParent { target: ParseNodeId }, + MarkScriptAlreadyStarted { node: ParseNodeId }, + ReparentChildren { parent: ParseNodeId, new_parent: ParseNodeId }, + AssociateWithForm { target: ParseNodeId, form: ParseNodeId }, + + CreatePI { + node: ParseNodeId, + target: String, + data: String + }, + + Pop { node: ParseNodeId }, + + SetQuirksMode { + #[ignore_heap_size_of = "Defined in style"] + mode: ServoQuirksMode + }, +} + +#[derive(HeapSizeOf)] +enum ToTokenizerMsg { + // From HtmlTokenizer + TokenizerResultDone { + #[ignore_heap_size_of = "Defined in html5ever"] + updated_input: VecDeque<SendTendril<UTF8>> + }, + TokenizerResultScript { + script: ParseNode, + #[ignore_heap_size_of = "Defined in html5ever"] + updated_input: VecDeque<SendTendril<UTF8>> + }, + End, // Sent to Tokenizer to signify HtmlTokenizer's end method has returned + + // From Sink + ProcessOperation(ParseOperation), + IsSameTree(ParseNodeId, ParseNodeId), + HasParentNode(ParseNodeId), +} + +#[derive(HeapSizeOf)] +enum ToHtmlTokenizerMsg { + Feed { + #[ignore_heap_size_of = "Defined in html5ever"] + input: VecDeque<SendTendril<UTF8>> + }, + End, + SetPlainTextState, +} + +// Responses to the queries asked by the the Sink to the Tokenizer, +// using the messages types in FromSinkMsg. +#[derive(HeapSizeOf)] +enum ToSinkMsg { + IsSameTree(bool), + HasParentNode(bool), +} + +fn create_buffer_queue(mut buffers: VecDeque<SendTendril<UTF8>>) -> BufferQueue { + let mut buffer_queue = BufferQueue::new(); + while let Some(st) = buffers.pop_front() { + buffer_queue.push_back(StrTendril::from(st)); + } + buffer_queue +} + +// The async HTML Tokenizer consists of two separate types working together: the Tokenizer +// (defined below), which lives on the main thread, and the HtmlTokenizer, defined in html5ever, which +// lives on the parser thread. +// Steps: +// 1. A call to Tokenizer::new will spin up a new parser thread, creating an HtmlTokenizer instance, +// which starts listening for messages from Tokenizer. +// 2. Upon receiving an input from ServoParser, the Tokenizer forwards it to HtmlTokenizer, where it starts +// creating the necessary tree actions based on the input. +// 3. HtmlTokenizer sends these tree actions to the Tokenizer as soon as it creates them. The Tokenizer +// then executes the received actions. +// +// _____________ _______________ +// | | ToHtmlTokenizerMsg | | +// | |------------------------>| | +// | | | | +// | | ToTokenizerMsg | HtmlTokenizer | +// | |<------------------------| | +// | Tokenizer | | | +// | | ToTokenizerMsg | ________ | +// | |<------------------------|---| | | +// | | | | Sink | | +// | | ToSinkMsg | | | | +// | |-------------------------|-->|________| | +// |_____________| |_______________| +// #[derive(HeapSizeOf, JSTraceable)] #[must_root] pub struct Tokenizer { - #[ignore_heap_size_of = "Defined in html5ever"] - inner: HtmlTokenizer<TreeBuilder<ParseNode, Sink>>, + document: JS<Document>, + #[ignore_heap_size_of = "Defined in std"] + receiver: Receiver<ToTokenizerMsg>, + #[ignore_heap_size_of = "Defined in std"] + html_tokenizer_sender: Sender<ToHtmlTokenizerMsg>, + #[ignore_heap_size_of = "Defined in std"] + sink_sender: Sender<ToSinkMsg>, + nodes: HashMap<ParseNodeId, JS<Node>>, + url: ServoUrl, } impl Tokenizer { @@ -47,171 +188,125 @@ impl Tokenizer { url: ServoUrl, fragment_context: Option<super::FragmentContext>) -> Self { - let mut sink = Sink::new(url, document); - - let options = TreeBuilderOpts { - ignore_missing_rules: true, - .. Default::default() + // Messages from the Tokenizer (main thread) to HtmlTokenizer (parser thread) + let (to_html_tokenizer_sender, html_tokenizer_receiver) = channel(); + // Messages from the Tokenizer (main thread) to Sink (parser thread) + let (to_sink_sender, sink_receiver) = channel(); + // Messages from HtmlTokenizer and Sink (parser thread) to Tokenizer (main thread) + let (to_tokenizer_sender, tokenizer_receiver) = channel(); + + let mut tokenizer = Tokenizer { + document: JS::from_ref(document), + receiver: tokenizer_receiver, + html_tokenizer_sender: to_html_tokenizer_sender, + sink_sender: to_sink_sender, + nodes: HashMap::new(), + url: url }; - - let inner = if let Some(fc) = fragment_context { - let ctxt_parse_node = sink.new_parse_node(); - sink.nodes.insert(ctxt_parse_node.id, JS::from_ref(fc.context_elem)); - - let form_parse_node = fc.form_elem.map(|form_elem| { + tokenizer.insert_node(0, JS::from_ref(document.upcast())); + + let mut sink = Sink::new(to_tokenizer_sender.clone(), sink_receiver); + let mut ctxt_parse_node = None; + let mut form_parse_node = None; + let mut fragment_context_is_some = false; + if let Some(fc) = fragment_context { + let node = sink.new_parse_node(); + tokenizer.insert_node(node.id, JS::from_ref(fc.context_elem)); + ctxt_parse_node = Some(node); + + form_parse_node = fc.form_elem.map(|form_elem| { let node = sink.new_parse_node(); - sink.nodes.insert(node.id, JS::from_ref(form_elem)); + tokenizer.insert_node(node.id, JS::from_ref(form_elem)); node }); - let tb = TreeBuilder::new_for_fragment( - sink, + fragment_context_is_some = true; + }; + + // Create new thread for HtmlTokenizer. This is where parser actions + // will be generated from the input provided. These parser actions are then passed + // onto the main thread to be executed. + thread::Builder::new().name(String::from("HTML Parser")).spawn(move || { + run(sink, + fragment_context_is_some, ctxt_parse_node, form_parse_node, - options); - - let tok_options = TokenizerOpts { - initial_state: Some(tb.tokenizer_state_for_context_elem()), - .. Default::default() - }; - - HtmlTokenizer::new(tb, tok_options) - } else { - HtmlTokenizer::new(TreeBuilder::new(sink, options), Default::default()) - }; + to_tokenizer_sender, + html_tokenizer_receiver); + }).expect("HTML Parser thread spawning failed"); - Tokenizer { - inner: inner, - } + tokenizer } pub fn feed(&mut self, input: &mut BufferQueue) -> Result<(), Root<HTMLScriptElement>> { - match self.inner.feed(input) { - TokenizerResult::Done => Ok(()), - TokenizerResult::Script(script) => { - let nodes = &self.inner.sink.sink.nodes; - let script = nodes.get(&script.id).unwrap(); - Err(Root::from_ref(script.downcast().unwrap())) - }, + let mut send_tendrils = VecDeque::new(); + while let Some(str) = input.pop_front() { + send_tendrils.push_back(SendTendril::from(str)); } - } - - pub fn end(&mut self) { - self.inner.end(); - } - - pub fn url(&self) -> &ServoUrl { - &self.inner.sink.sink.base_url - } - pub fn set_plaintext_state(&mut self) { - self.inner.set_plaintext_state(); - } -} - -#[allow(unsafe_code)] -unsafe impl JSTraceable for HtmlTokenizer<TreeBuilder<ParseNode, Sink>> { - unsafe fn trace(&self, trc: *mut JSTracer) { - struct Tracer(*mut JSTracer); - let tracer = Tracer(trc); - - impl HtmlTracer for Tracer { - type Handle = ParseNode; - #[allow(unrooted_must_root)] - fn trace_handle(&self, node: &ParseNode) { - unsafe { node.trace(self.0); } - } + // Send message to parser thread, asking it to start reading from the input. + // Parser operation messages will be sent to main thread as they are evaluated. + self.html_tokenizer_sender.send(ToHtmlTokenizerMsg::Feed { input: send_tendrils }).unwrap(); + + loop { + match self.receiver.recv().expect("Unexpected channel panic in main thread.") { + ToTokenizerMsg::ProcessOperation(parse_op) => self.process_operation(parse_op), + ToTokenizerMsg::IsSameTree(ref x_id, ref y_id) => { + let x = self.get_node(x_id); + let y = self.get_node(y_id); + + let x = x.downcast::<Element>().expect("Element node expected"); + let y = y.downcast::<Element>().expect("Element node expected"); + self.sink_sender.send(ToSinkMsg::IsSameTree(x.is_in_same_home_subtree(y))).unwrap(); + }, + ToTokenizerMsg::HasParentNode(ref id) => { + let res = self.get_node(id).GetParentNode().is_some(); + self.sink_sender.send(ToSinkMsg::HasParentNode(res)).unwrap(); + }, + ToTokenizerMsg::TokenizerResultDone { updated_input } => { + let buffer_queue = create_buffer_queue(updated_input); + *input = buffer_queue; + return Ok(()); + }, + ToTokenizerMsg::TokenizerResultScript { script, updated_input } => { + let buffer_queue = create_buffer_queue(updated_input); + *input = buffer_queue; + let script = self.get_node(&script.id); + return Err(Root::from_ref(script.downcast().unwrap())); + } + ToTokenizerMsg::End => unreachable!(), + }; } - - let tree_builder = &self.sink; - tree_builder.trace_handles(&tracer); - tree_builder.sink.trace(trc); } -} - -type ParseNodeId = usize; -#[derive(JSTraceable, Clone, HeapSizeOf)] -pub struct ParseNode { - id: ParseNodeId, - qual_name: Option<QualName>, -} - -#[derive(JSTraceable, HeapSizeOf)] -struct ParseNodeData { - contents: Option<ParseNode>, - is_integration_point: bool, -} - -impl Default for ParseNodeData { - fn default() -> ParseNodeData { - ParseNodeData { - contents: None, - is_integration_point: false, + pub fn end(&mut self) { + self.html_tokenizer_sender.send(ToHtmlTokenizerMsg::End).unwrap(); + loop { + match self.receiver.recv().expect("Unexpected channel panic in main thread.") { + ToTokenizerMsg::ProcessOperation(parse_op) => self.process_operation(parse_op), + ToTokenizerMsg::IsSameTree(ref x_id, ref y_id) => { + let x = self.get_node(x_id); + let y = self.get_node(y_id); + + let x = x.downcast::<Element>().expect("Element node expected"); + let y = y.downcast::<Element>().expect("Element node expected"); + self.sink_sender.send(ToSinkMsg::IsSameTree(x.is_in_same_home_subtree(y))).unwrap(); + }, + ToTokenizerMsg::HasParentNode(ref id) => { + let res = self.get_node(id).GetParentNode().is_some(); + self.sink_sender.send(ToSinkMsg::HasParentNode(res)).unwrap(); + }, + ToTokenizerMsg::End => return, + _ => unreachable!(), + }; } } -} -enum ParseOperation { - GetTemplateContents(ParseNodeId, ParseNodeId), - CreateElement(ParseNodeId, QualName, Vec<Attribute>), - CreateComment(StrTendril, ParseNodeId), - // sibling, node to be inserted - AppendBeforeSibling(ParseNodeId, NodeOrText<ParseNode>), - // parent, node to be inserted - Append(ParseNodeId, NodeOrText<ParseNode>), - AppendDoctypeToDocument(StrTendril, StrTendril, StrTendril), - AddAttrsIfMissing(ParseNodeId, Vec<Attribute>), - RemoveFromParent(ParseNodeId), - MarkScriptAlreadyStarted(ParseNodeId), - ReparentChildren(ParseNodeId, ParseNodeId), - AssociateWithForm(ParseNodeId, ParseNodeId), - CreatePI(ParseNodeId, StrTendril, StrTendril), - Pop(ParseNodeId), -} - -#[derive(JSTraceable, HeapSizeOf)] -#[must_root] -pub struct Sink { - base_url: ServoUrl, - document: JS<Document>, - current_line: u64, - script: MutNullableJS<HTMLScriptElement>, - parse_node_data: HashMap<ParseNodeId, ParseNodeData>, - next_parse_node_id: Cell<ParseNodeId>, - nodes: HashMap<ParseNodeId, JS<Node>>, - document_node: ParseNode, -} - -impl Sink { - fn new(base_url: ServoUrl, document: &Document) -> Sink { - let mut sink = Sink { - base_url: base_url, - document: JS::from_ref(document), - current_line: 1, - script: Default::default(), - parse_node_data: HashMap::new(), - next_parse_node_id: Cell::new(1), - nodes: HashMap::new(), - document_node: ParseNode { - id: 0, - qual_name: None, - } - }; - let data = ParseNodeData::default(); - sink.insert_parse_node_data(0, data); - sink.insert_node(0, JS::from_ref(document.upcast())); - sink + pub fn url(&self) -> &ServoUrl { + &self.url } - fn new_parse_node(&mut self) -> ParseNode { - let id = self.next_parse_node_id.get(); - let data = ParseNodeData::default(); - self.insert_parse_node_data(id, data); - self.next_parse_node_id.set(id + 1); - ParseNode { - id: id, - qual_name: None, - } + pub fn set_plaintext_state(&mut self) { + self.html_tokenizer_sender.send(ToHtmlTokenizerMsg::SetPlainTextState).unwrap(); } fn insert_node(&mut self, id: ParseNodeId, node: JS<Node>) { @@ -222,29 +317,17 @@ impl Sink { self.nodes.get(id).expect("Node not found!") } - fn insert_parse_node_data(&mut self, id: ParseNodeId, data: ParseNodeData) { - assert!(self.parse_node_data.insert(id, data).is_none()); - } - - fn get_parse_node_data<'a>(&'a self, id: &'a ParseNodeId) -> &'a ParseNodeData { - self.parse_node_data.get(id).expect("Parse Node data not found!") - } - - fn get_parse_node_data_mut<'a>(&'a mut self, id: &'a ParseNodeId) -> &'a mut ParseNodeData { - self.parse_node_data.get_mut(id).expect("Parse Node data not found!") - } - fn process_operation(&mut self, op: ParseOperation) { let document = Root::from_ref(&**self.get_node(&0)); let document = document.downcast::<Document>().expect("Document node should be downcasted!"); match op { - ParseOperation::GetTemplateContents(target, contents) => { + ParseOperation::GetTemplateContents { target, contents } => { let target = Root::from_ref(&**self.get_node(&target)); let template = target.downcast::<HTMLTemplateElement>().expect( "Tried to extract contents from non-template element while parsing"); self.insert_node(contents, JS::from_ref(template.Content().upcast())); } - ParseOperation::CreateElement(id, name, attrs) => { + ParseOperation::CreateElement { node, name, attrs, current_line } => { let is = attrs.iter() .find(|attr| attr.name.local.eq_str_ignore_ascii_case("is")) .map(|attr| LocalName::from(&*attr.value)); @@ -252,68 +335,72 @@ impl Sink { let elem = Element::create(name, is, &*self.document, - ElementCreator::ParserCreated(self.current_line), + ElementCreator::ParserCreated(current_line), CustomElementCreationMode::Synchronous); for attr in attrs { - elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None); + elem.set_attribute_from_parser(attr.name, DOMString::from(attr.value), None); } - self.insert_node(id, JS::from_ref(elem.upcast())); + self.insert_node(node, JS::from_ref(elem.upcast())); } - ParseOperation::CreateComment(text, id) => { - let comment = Comment::new(DOMString::from(String::from(text)), document); - self.insert_node(id, JS::from_ref(&comment.upcast())); + ParseOperation::CreateComment { text, node } => { + let comment = Comment::new(DOMString::from(text), document); + self.insert_node(node, JS::from_ref(&comment.upcast())); } - ParseOperation::AppendBeforeSibling(sibling, node) => { + ParseOperation::AppendBeforeSibling { sibling, node } => { let node = match node { - NodeOrText::AppendNode(n) => NodeOrText::AppendNode(JS::from_ref(&**self.get_node(&n.id))), - NodeOrText::AppendText(text) => NodeOrText::AppendText(text) + NodeOrText::Node(n) => HtmlNodeOrText::AppendNode(JS::from_ref(&**self.get_node(&n.id))), + NodeOrText::Text(text) => HtmlNodeOrText::AppendText( + Tendril::from(text) + ) }; let sibling = &**self.get_node(&sibling); let parent = &*sibling.GetParentNode().expect("append_before_sibling called on node without parent"); super::insert(parent, Some(sibling), node); } - ParseOperation::Append(parent, node) => { + ParseOperation::Append { parent, node } => { let node = match node { - NodeOrText::AppendNode(n) => NodeOrText::AppendNode(JS::from_ref(&**self.get_node(&n.id))), - NodeOrText::AppendText(text) => NodeOrText::AppendText(text) + NodeOrText::Node(n) => HtmlNodeOrText::AppendNode(JS::from_ref(&**self.get_node(&n.id))), + NodeOrText::Text(text) => HtmlNodeOrText::AppendText( + Tendril::from(text) + ) }; let parent = &**self.get_node(&parent); super::insert(parent, None, node); } - ParseOperation::AppendDoctypeToDocument(name, public_id, system_id) => { + ParseOperation::AppendDoctypeToDocument { name, public_id, system_id } => { let doctype = DocumentType::new( - DOMString::from(String::from(name)), Some(DOMString::from(String::from(public_id))), - Some(DOMString::from(String::from(system_id))), document); + DOMString::from(String::from(name)), Some(DOMString::from(public_id)), + Some(DOMString::from(system_id)), document); document.upcast::<Node>().AppendChild(doctype.upcast()).expect("Appending failed"); } - ParseOperation::AddAttrsIfMissing(target_id, attrs) => { - let elem = self.get_node(&target_id).downcast::<Element>() + ParseOperation::AddAttrsIfMissing { target, attrs } => { + let elem = self.get_node(&target).downcast::<Element>() .expect("tried to set attrs on non-Element in HTML parsing"); for attr in attrs { - elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None); + elem.set_attribute_from_parser(attr.name, DOMString::from(attr.value), None); } } - ParseOperation::RemoveFromParent(target) => { + ParseOperation::RemoveFromParent { target } => { if let Some(ref parent) = self.get_node(&target).GetParentNode() { parent.RemoveChild(&**self.get_node(&target)).unwrap(); } } - ParseOperation::MarkScriptAlreadyStarted(node) => { + ParseOperation::MarkScriptAlreadyStarted { node } => { let script = self.get_node(&node).downcast::<HTMLScriptElement>(); script.map(|script| script.set_already_started(true)); } - ParseOperation::ReparentChildren(parent, new_parent) => { + ParseOperation::ReparentChildren { parent, new_parent } => { let parent = self.get_node(&parent); let new_parent = self.get_node(&new_parent); while let Some(child) = parent.GetFirstChild() { new_parent.AppendChild(&child).unwrap(); } } - ParseOperation::AssociateWithForm(target, form) => { + ParseOperation::AssociateWithForm { target, form } => { let form = self.get_node(&form); let form = Root::downcast::<HTMLFormElement>(Root::from_ref(&**form)) .expect("Owner must be a form element"); @@ -329,20 +416,141 @@ impl Sink { assert!(node.NodeName() == "KEYGEN", "Unknown form-associatable element"); } } - ParseOperation::Pop(node) => { + ParseOperation::Pop { node } => { vtable_for(self.get_node(&node)).pop(); } - ParseOperation::CreatePI(node, target, data) => { + ParseOperation::CreatePI { node, target, data } => { let pi = ProcessingInstruction::new( - DOMString::from(String::from(target)), - DOMString::from(String::from(data)), - document); + DOMString::from(target), + DOMString::from(data), + document); self.insert_node(node, JS::from_ref(pi.upcast())); } + ParseOperation::SetQuirksMode { mode } => { + document.set_quirks_mode(mode); + } } } } +fn run(sink: Sink, + fragment_context_is_some: bool, + ctxt_parse_node: Option<ParseNode>, + form_parse_node: Option<ParseNode>, + sender: Sender<ToTokenizerMsg>, + receiver: Receiver<ToHtmlTokenizerMsg>) { + let options = TreeBuilderOpts { + ignore_missing_rules: true, + .. Default::default() + }; + + let mut html_tokenizer = if fragment_context_is_some { + let tb = TreeBuilder::new_for_fragment( + sink, + ctxt_parse_node.unwrap(), + form_parse_node, + options); + + let tok_options = TokenizerOpts { + initial_state: Some(tb.tokenizer_state_for_context_elem()), + .. Default::default() + }; + + HtmlTokenizer::new(tb, tok_options) + } else { + HtmlTokenizer::new(TreeBuilder::new(sink, options), Default::default()) + }; + + loop { + match receiver.recv().expect("Unexpected channel panic in html parser thread") { + ToHtmlTokenizerMsg::Feed { input } => { + let mut input = create_buffer_queue(input); + let res = html_tokenizer.feed(&mut input); + + // Gather changes to 'input' and place them in 'updated_input', + // which will be sent to the main thread to update feed method's 'input' + let mut updated_input = VecDeque::new(); + while let Some(st) = input.pop_front() { + updated_input.push_back(SendTendril::from(st)); + } + + let res = match res { + TokenizerResult::Done => ToTokenizerMsg::TokenizerResultDone { updated_input }, + TokenizerResult::Script(script) => ToTokenizerMsg::TokenizerResultScript { script, updated_input } + }; + sender.send(res).unwrap(); + }, + ToHtmlTokenizerMsg::End => { + html_tokenizer.end(); + sender.send(ToTokenizerMsg::End).unwrap(); + break; + }, + ToHtmlTokenizerMsg::SetPlainTextState => html_tokenizer.set_plaintext_state() + }; + } +} + +#[derive(JSTraceable, HeapSizeOf, Default)] +struct ParseNodeData { + contents: Option<ParseNode>, + is_integration_point: bool, +} + +pub struct Sink { + current_line: u64, + parse_node_data: HashMap<ParseNodeId, ParseNodeData>, + next_parse_node_id: Cell<ParseNodeId>, + document_node: ParseNode, + sender: Sender<ToTokenizerMsg>, + receiver: Receiver<ToSinkMsg>, +} + +impl Sink { + fn new(sender: Sender<ToTokenizerMsg>, receiver: Receiver<ToSinkMsg>) -> Sink { + let mut sink = Sink { + current_line: 1, + parse_node_data: HashMap::new(), + next_parse_node_id: Cell::new(1), + document_node: ParseNode { + id: 0, + qual_name: None, + }, + sender: sender, + receiver: receiver, + }; + let data = ParseNodeData::default(); + sink.insert_parse_node_data(0, data); + sink + } + + fn new_parse_node(&mut self) -> ParseNode { + let id = self.next_parse_node_id.get(); + let data = ParseNodeData::default(); + self.insert_parse_node_data(id, data); + self.next_parse_node_id.set(id + 1); + ParseNode { + id: id, + qual_name: None, + } + } + + fn send_op(&self, op: ParseOperation) { + self.sender.send(ToTokenizerMsg::ProcessOperation(op)).unwrap(); + } + + fn insert_parse_node_data(&mut self, id: ParseNodeId, data: ParseNodeData) { + assert!(self.parse_node_data.insert(id, data).is_none()); + } + + fn get_parse_node_data<'a>(&'a self, id: &'a ParseNodeId) -> &'a ParseNodeData { + self.parse_node_data.get(id).expect("Parse Node data not found!") + } + + fn get_parse_node_data_mut<'a>(&'a mut self, id: &'a ParseNodeId) -> &'a mut ParseNodeData { + self.parse_node_data.get_mut(id).expect("Parse Node data not found!") + } +} + #[allow(unrooted_must_root)] impl TreeSink for Sink { type Output = Self; @@ -363,7 +571,7 @@ impl TreeSink for Sink { let mut data = self.get_parse_node_data_mut(&target.id); data.contents = Some(node.clone()); } - self.process_operation(ParseOperation::GetTemplateContents(target.id, node.id)); + self.send_op(ParseOperation::GetTemplateContents { target: target.id, contents: node.id }); node } @@ -376,21 +584,20 @@ impl TreeSink for Sink { } fn same_tree(&self, x: &Self::Handle, y: &Self::Handle) -> bool { - let x = self.get_node(&x.id); - let y = self.get_node(&y.id); - - let x = x.downcast::<Element>().expect("Element node expected"); - let y = y.downcast::<Element>().expect("Element node expected"); - x.is_in_same_home_subtree(y) + self.sender.send(ToTokenizerMsg::IsSameTree(x.id, y.id)).unwrap(); + match self.receiver.recv().expect("Unexpected channel panic in html parser thread.") { + ToSinkMsg::IsSameTree(result) => result, + _ => unreachable!(), + } } - fn create_element(&mut self, name: QualName, attrs: Vec<Attribute>, _flags: ElementFlags) + fn create_element(&mut self, name: QualName, html_attrs: Vec<HtmlAttribute>, _flags: ElementFlags) -> Self::Handle { let mut node = self.new_parse_node(); node.qual_name = Some(name.clone()); { let mut node_data = self.get_parse_node_data_mut(&node.id); - node_data.is_integration_point = attrs.iter() + node_data.is_integration_point = html_attrs.iter() .any(|attr| { let attr_value = &String::from(attr.value.clone()); (attr.name.local == local_name!("encoding") && attr.name.ns == ns!()) && @@ -398,34 +605,57 @@ impl TreeSink for Sink { attr_value.eq_ignore_ascii_case("application/xhtml+xml")) }); } - self.process_operation(ParseOperation::CreateElement(node.id, name, attrs)); + let attrs = html_attrs.into_iter() + .map(|attr| Attribute { name: attr.name, value: String::from(attr.value) }).collect(); + + self.send_op(ParseOperation::CreateElement { + node: node.id, + name, + attrs, + current_line: self.current_line + }); node } fn create_comment(&mut self, text: StrTendril) -> Self::Handle { let node = self.new_parse_node(); - self.process_operation(ParseOperation::CreateComment(text, node.id)); + self.send_op(ParseOperation::CreateComment { text: String::from(text), node: node.id }); node } fn create_pi(&mut self, target: StrTendril, data: StrTendril) -> ParseNode { let node = self.new_parse_node(); - self.process_operation(ParseOperation::CreatePI(node.id, target, data)); + self.send_op(ParseOperation::CreatePI { + node: node.id, + target: String::from(target), + data: String::from(data) + }); node } fn has_parent_node(&self, node: &Self::Handle) -> bool { - self.get_node(&node.id).GetParentNode().is_some() + self.sender.send(ToTokenizerMsg::HasParentNode(node.id)).unwrap(); + match self.receiver.recv().expect("Unexpected channel panic in html parser thread.") { + ToSinkMsg::HasParentNode(result) => result, + _ => unreachable!(), + } } fn associate_with_form(&mut self, target: &Self::Handle, form: &Self::Handle) { - self.process_operation(ParseOperation::AssociateWithForm(target.id, form.id)); + self.send_op(ParseOperation::AssociateWithForm { + target: target.id, + form: form.id + }); } fn append_before_sibling(&mut self, sibling: &Self::Handle, - new_node: NodeOrText<Self::Handle>) { - self.process_operation(ParseOperation::AppendBeforeSibling(sibling.id, new_node)); + new_node: HtmlNodeOrText<Self::Handle>) { + let new_node = match new_node { + HtmlNodeOrText::AppendNode(node) => NodeOrText::Node(node), + HtmlNodeOrText::AppendText(text) => NodeOrText::Text(String::from(text)) + }; + self.send_op(ParseOperation::AppendBeforeSibling { sibling: sibling.id, node: new_node }); } fn parse_error(&mut self, msg: Cow<'static, str>) { @@ -438,28 +668,38 @@ impl TreeSink for Sink { QuirksMode::LimitedQuirks => ServoQuirksMode::LimitedQuirks, QuirksMode::NoQuirks => ServoQuirksMode::NoQuirks, }; - self.document.set_quirks_mode(mode); + self.send_op(ParseOperation::SetQuirksMode { mode }); } - fn append(&mut self, parent: &Self::Handle, child: NodeOrText<Self::Handle>) { - self.process_operation(ParseOperation::Append(parent.id, child)); + fn append(&mut self, parent: &Self::Handle, child: HtmlNodeOrText<Self::Handle>) { + let child = match child { + HtmlNodeOrText::AppendNode(node) => NodeOrText::Node(node), + HtmlNodeOrText::AppendText(text) => NodeOrText::Text(String::from(text)) + }; + self.send_op(ParseOperation::Append { parent: parent.id, node: child }); } fn append_doctype_to_document(&mut self, name: StrTendril, public_id: StrTendril, system_id: StrTendril) { - self.process_operation(ParseOperation::AppendDoctypeToDocument(name, public_id, system_id)); + self.send_op(ParseOperation::AppendDoctypeToDocument { + name: String::from(name), + public_id: String::from(public_id), + system_id: String::from(system_id) + }); } - fn add_attrs_if_missing(&mut self, target: &Self::Handle, attrs: Vec<Attribute>) { - self.process_operation(ParseOperation::AddAttrsIfMissing(target.id, attrs)); + fn add_attrs_if_missing(&mut self, target: &Self::Handle, html_attrs: Vec<HtmlAttribute>) { + let attrs = html_attrs.into_iter() + .map(|attr| Attribute { name: attr.name, value: String::from(attr.value) }).collect(); + self.send_op(ParseOperation::AddAttrsIfMissing { target: target.id, attrs }); } fn remove_from_parent(&mut self, target: &Self::Handle) { - self.process_operation(ParseOperation::RemoveFromParent(target.id)); + self.send_op(ParseOperation::RemoveFromParent { target: target.id }); } fn mark_script_already_started(&mut self, node: &Self::Handle) { - self.process_operation(ParseOperation::MarkScriptAlreadyStarted(node.id)); + self.send_op(ParseOperation::MarkScriptAlreadyStarted { node: node.id }); } fn complete_script(&mut self, _: &Self::Handle) -> NextParserState { @@ -467,7 +707,7 @@ impl TreeSink for Sink { } fn reparent_children(&mut self, parent: &Self::Handle, new_parent: &Self::Handle) { - self.process_operation(ParseOperation::ReparentChildren(parent.id, new_parent.id)); + self.send_op(ParseOperation::ReparentChildren { parent: parent.id, new_parent: new_parent.id }); } /// https://html.spec.whatwg.org/multipage/#html-integration-point @@ -482,6 +722,6 @@ impl TreeSink for Sink { } fn pop(&mut self, node: &Self::Handle) { - self.process_operation(ParseOperation::Pop(node.id)); + self.send_op(ParseOperation::Pop { node: node.id }); } } diff --git a/components/script/dom/stylepropertymapreadonly.rs b/components/script/dom/stylepropertymapreadonly.rs index 323f5dae5a9..02f8a342321 100644 --- a/components/script/dom/stylepropertymapreadonly.rs +++ b/components/script/dom/stylepropertymapreadonly.rs @@ -13,8 +13,10 @@ use dom::cssstylevalue::CSSStyleValue; use dom::globalscope::GlobalScope; use dom_struct::dom_struct; use servo_atoms::Atom; +use std::cmp::Ordering; use std::collections::HashMap; use std::iter::Iterator; +use style::custom_properties; #[dom_struct] pub struct StylePropertyMapReadOnly { @@ -63,4 +65,29 @@ impl StylePropertyMapReadOnlyMethods for StylePropertyMapReadOnly { // TODO: avoid constructing an Atom self.entries.contains_key(&Atom::from(property)) } + + /// https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymapreadonly-getproperties + fn GetProperties(&self) -> Vec<DOMString> { + let mut result: Vec<DOMString> = self.entries.keys() + .map(|key| DOMString::from(&**key)) + .collect(); + // https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-getproperties + // requires this sort order + result.sort_by(|key1, key2| { + if let Ok(key1) = custom_properties::parse_name(key1) { + if let Ok(key2) = custom_properties::parse_name(key2) { + key1.cmp(key2) + } else { + Ordering::Greater + } + } else { + if let Ok(_) = custom_properties::parse_name(key2) { + Ordering::Less + } else { + key1.cmp(key2) + } + } + }); + result + } } diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index 26eba98d3ce..09eedd6870c 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -154,7 +154,7 @@ impl TestBindingMethods for TestBinding { unsafe fn ArrayAttribute(&self, cx: *mut JSContext) -> NonZero<*mut JSObject> { rooted!(in(cx) let array = JS_NewUint8ClampedArray(cx, 16)); assert!(!array.is_null()); - NonZero::new(array.get()) + NonZero::new_unchecked(array.get()) } #[allow(unsafe_code)] unsafe fn AnyAttribute(&self, _: *mut JSContext) -> JSVal { NullValue() } @@ -164,7 +164,7 @@ impl TestBindingMethods for TestBinding { unsafe fn ObjectAttribute(&self, cx: *mut JSContext) -> NonZero<*mut JSObject> { rooted!(in(cx) let obj = JS_NewPlainObject(cx)); assert!(!obj.is_null()); - NonZero::new(obj.get()) + NonZero::new_unchecked(obj.get()) } #[allow(unsafe_code)] unsafe fn SetObjectAttribute(&self, _: *mut JSContext, _: *mut JSObject) {} diff --git a/components/script/dom/textencoder.rs b/components/script/dom/textencoder.rs index 5cdbeca1dd3..fa527d71073 100644 --- a/components/script/dom/textencoder.rs +++ b/components/script/dom/textencoder.rs @@ -53,6 +53,6 @@ impl TextEncoderMethods for TextEncoder { rooted!(in(cx) let mut js_object = ptr::null_mut()); assert!(Uint8Array::create(cx, CreateWith::Slice(&encoded), js_object.handle_mut()).is_ok()); - NonZero::new(js_object.get()) + NonZero::new_unchecked(js_object.get()) } } diff --git a/components/script/dom/vreyeparameters.rs b/components/script/dom/vreyeparameters.rs index ab568287064..d77350ae140 100644 --- a/components/script/dom/vreyeparameters.rs +++ b/components/script/dom/vreyeparameters.rs @@ -61,7 +61,7 @@ impl VREyeParametersMethods for VREyeParameters { #[allow(unsafe_code)] // https://w3c.github.io/webvr/#dom-vreyeparameters-offset unsafe fn Offset(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> { - NonZero::new(self.offset.get()) + NonZero::new_unchecked(self.offset.get()) } // https://w3c.github.io/webvr/#dom-vreyeparameters-fieldofview diff --git a/components/script/dom/vrframedata.rs b/components/script/dom/vrframedata.rs index a7b70c7ead3..70e238e9fb5 100644 --- a/components/script/dom/vrframedata.rs +++ b/components/script/dom/vrframedata.rs @@ -119,25 +119,25 @@ impl VRFrameDataMethods for VRFrameData { #[allow(unsafe_code)] // https://w3c.github.io/webvr/#dom-vrframedata-leftprojectionmatrix unsafe fn LeftProjectionMatrix(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> { - NonZero::new(self.left_proj.get()) + NonZero::new_unchecked(self.left_proj.get()) } #[allow(unsafe_code)] // https://w3c.github.io/webvr/#dom-vrframedata-leftviewmatrix unsafe fn LeftViewMatrix(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> { - NonZero::new(self.left_view.get()) + NonZero::new_unchecked(self.left_view.get()) } #[allow(unsafe_code)] // https://w3c.github.io/webvr/#dom-vrframedata-rightprojectionmatrix unsafe fn RightProjectionMatrix(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> { - NonZero::new(self.right_proj.get()) + NonZero::new_unchecked(self.right_proj.get()) } #[allow(unsafe_code)] // https://w3c.github.io/webvr/#dom-vrframedata-rightviewmatrix unsafe fn RightViewMatrix(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> { - NonZero::new(self.right_view.get()) + NonZero::new_unchecked(self.right_view.get()) } // https://w3c.github.io/webvr/#dom-vrframedata-pose diff --git a/components/script/dom/vrpose.rs b/components/script/dom/vrpose.rs index ee035e2a0f1..539a42e5e3b 100644 --- a/components/script/dom/vrpose.rs +++ b/components/script/dom/vrpose.rs @@ -58,7 +58,7 @@ fn heap_to_option(heap: &Heap<*mut JSObject>) -> Option<NonZero<*mut JSObject>> None } else { unsafe { - Some(NonZero::new(js_object)) + Some(NonZero::new_unchecked(js_object)) } } } diff --git a/components/script/dom/vrstageparameters.rs b/components/script/dom/vrstageparameters.rs index 9c38fb8d494..7bfaa95ea76 100644 --- a/components/script/dom/vrstageparameters.rs +++ b/components/script/dom/vrstageparameters.rs @@ -70,7 +70,7 @@ impl VRStageParametersMethods for VRStageParameters { #[allow(unsafe_code)] // https://w3c.github.io/webvr/#dom-vrstageparameters-sittingtostandingtransform unsafe fn SittingToStandingTransform(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> { - NonZero::new(self.transform.get()) + NonZero::new_unchecked(self.transform.get()) } // https://w3c.github.io/webvr/#dom-vrstageparameters-sizex diff --git a/components/script/dom/webgl_extensions/wrapper.rs b/components/script/dom/webgl_extensions/wrapper.rs index 33fdd727529..5741597cd85 100644 --- a/components/script/dom/webgl_extensions/wrapper.rs +++ b/components/script/dom/webgl_extensions/wrapper.rs @@ -57,7 +57,7 @@ impl<T> WebGLExtensionWrapper for TypedWebGLExtensionWrapper<T> self.enable(ext); } unsafe { - NonZero::new(extension.reflector().get_jsobject().get()) + NonZero::new_unchecked(extension.reflector().get_jsobject().get()) } } diff --git a/components/script/dom/webidls/StylePropertyMapReadOnly.webidl b/components/script/dom/webidls/StylePropertyMapReadOnly.webidl index 7557a0d6071..360e3af909d 100644 --- a/components/script/dom/webidls/StylePropertyMapReadOnly.webidl +++ b/components/script/dom/webidls/StylePropertyMapReadOnly.webidl @@ -10,6 +10,7 @@ interface StylePropertyMapReadOnly { // sequence<CSSStyleValue> getAll(DOMString property); boolean has(DOMString property); // iterable<DOMString, (CSSStyleValue or sequence<CSSStyleValue>)>; - // sequence<DOMString> getProperties(); + sequence<DOMString> getProperties(); + // https://github.com/w3c/css-houdini-drafts/issues/268 // stringifier; }; diff --git a/components/script/lib.rs b/components/script/lib.rs index e1a1ab592cb..cab84d54294 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -2,6 +2,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/. */ +#![feature(ascii_ctype)] #![feature(box_syntax)] #![feature(conservative_impl_trait)] #![feature(const_fn)] diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs index bae4480d14c..c01a7d9a51a 100644 --- a/components/script/webdriver_handlers.rs +++ b/components/script/webdriver_handlers.rs @@ -392,7 +392,7 @@ pub fn handle_is_selected(documents: &Documents, else if let Some(option_element) = node.downcast::<HTMLOptionElement>() { Ok(option_element.Selected()) } - else if let Some(_) = node.downcast::<HTMLElement>() { + else if node.is::<HTMLElement>() { Ok(false) // regular elements are not selectable } else { Err(()) diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs index 9c8a3fbbd47..e74447ade26 100644 --- a/components/script_layout_interface/message.rs +++ b/components/script_layout_interface/message.rs @@ -89,7 +89,7 @@ pub enum Msg { UpdateScrollStateFromScript(ScrollState), /// Tells layout that script has added some paint worklet modules. - RegisterPaint(Atom, Vec<Atom>, Arc<Painter>), + RegisterPaint(Atom, Vec<Atom>, Box<Painter>), /// Send to layout the precise time when the navigation started. SetNavigationStart(f64), diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index f48b9708e49..a9023e3c2a3 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -66,10 +66,9 @@ use std::fmt; use std::sync::Arc; use std::sync::mpsc::{Receiver, Sender, RecvTimeoutError}; use style_traits::CSSPixel; -use style_traits::DevicePixel; +use style_traits::SpeculativePainter; use webdriver_msg::{LoadStatus, WebDriverScriptCommand}; -use webrender_api::ClipId; -use webrender_api::ImageKey; +use webrender_api::{ClipId, DevicePixel, ImageKey}; use webvr_traits::{WebVREvent, WebVRMsg}; pub use script_msg::{LayoutMsg, ScriptMsg, EventResult, LogEntry}; @@ -819,18 +818,19 @@ impl From<RecvTimeoutError> for PaintWorkletError { } /// Execute paint code in the worklet thread pool. -pub trait Painter: Sync + Send { +pub trait Painter: SpeculativePainter { /// https://drafts.css-houdini.org/css-paint-api/#draw-a-paint-image fn draw_a_paint_image(&self, size: TypedSize2D<f32, CSSPixel>, zoom: ScaleFactor<f32, CSSPixel, DevicePixel>, - properties: Vec<(Atom, String)>) + properties: Vec<(Atom, String)>, + arguments: Vec<String>) -> DrawAPaintImageResult; } /// The result of executing paint code: the image together with any image URLs that need to be loaded. /// TODO: this should return a WR display list. https://github.com/servo/servo/issues/17497 -#[derive(Debug, Deserialize, Serialize, Clone)] +#[derive(Debug, Deserialize, Serialize, Clone, HeapSizeOf)] pub struct DrawAPaintImageResult { /// The image height pub width: u32, diff --git a/components/selectors/matching.rs b/components/selectors/matching.rs index f65703d0578..7bd9814d26f 100644 --- a/components/selectors/matching.rs +++ b/components/selectors/matching.rs @@ -93,10 +93,10 @@ impl<'a, 'b, Impl> LocalMatchingContext<'a, 'b, Impl> /// Updates offset of Selector to show new compound selector. /// To be able to correctly re-synthesize main SelectorIter. - pub fn note_next_sequence(&mut self, selector_iter: &SelectorIter<Impl>) { + fn note_position(&mut self, selector_iter: &SelectorIter<Impl>) { if let QuirksMode::Quirks = self.shared.quirks_mode() { if self.selector.has_pseudo_element() && self.offset != 0 { - // This is the _second_ call to note_next_sequence, + // This is the _second_ call to note_position, // which means we've moved past the compound // selector adjacent to the pseudo-element. self.hover_active_quirk_disabled = false; @@ -108,7 +108,7 @@ impl<'a, 'b, Impl> LocalMatchingContext<'a, 'b, Impl> /// Returns true if current compound selector matches :active and :hover quirk. /// https://quirks.spec.whatwg.org/#the-active-and-hover-quirk - pub fn active_hover_quirk_matches(&mut self) -> bool { + pub fn active_hover_quirk_matches(&self) -> bool { if self.shared.quirks_mode() != QuirksMode::Quirks { return false; } @@ -490,11 +490,12 @@ pub fn matches_complex_selector<E, F>(mut iter: SelectorIter<E::Impl>, return false; } - // Advance to the non-pseudo-element part of the selector, and inform the context. + // Advance to the non-pseudo-element part of the selector, and inform + // the context. if iter.next_sequence().is_none() { return true; } - context.note_next_sequence(&mut iter); + context.note_position(&iter); } match matches_complex_selector_internal(iter, @@ -526,8 +527,6 @@ fn matches_complex_selector_internal<E, F>(mut selector_iter: SelectorIter<E::Im element, selector_iter, relevant_link); let combinator = selector_iter.next_sequence(); - // Inform the context that the we've advanced to the next compound selector. - context.note_next_sequence(&mut selector_iter); let siblings = combinator.map_or(false, |c| c.is_sibling()); if siblings { flags_setter(element, HAS_SLOW_SELECTOR_LATER_SIBLINGS); @@ -567,6 +566,8 @@ fn matches_complex_selector_internal<E, F>(mut selector_iter: SelectorIter<E::Im None => return candidate_not_found, Some(next_element) => next_element, }; + // Note in which compound selector are we currently. + context.note_position(&selector_iter); let result = matches_complex_selector_internal(selector_iter.clone(), &element, context, diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs index 490399ce38c..06f381d600c 100644 --- a/components/selectors/parser.rs +++ b/components/selectors/parser.rs @@ -1528,7 +1528,7 @@ fn parse_compound_selector<'i, 't, P, E, Impl>( } builder.push_simple_selector(Component::PseudoElement(p)); - for state_selector in state_selectors.into_iter() { + for state_selector in state_selectors.drain() { builder.push_simple_selector(state_selector); } @@ -1586,10 +1586,10 @@ where Impl: SelectorImpl, F: FnOnce(i32, i32) -> Component<Impl> { /// double-colon syntax, which can be used for all pseudo-elements). pub fn is_css2_pseudo_element<'i>(name: &CowRcStr<'i>) -> bool { // ** Do not add to this list! ** - return name.eq_ignore_ascii_case("before") || - name.eq_ignore_ascii_case("after") || - name.eq_ignore_ascii_case("first-line") || - name.eq_ignore_ascii_case("first-letter"); + match_ignore_ascii_case! { name, + "before" | "after" | "first-line" | "first-letter" => true, + _ => false, + } } /// Parse a simple selector other than a type selector. diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 116f13c2cd9..896887e2e34 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -174,10 +174,6 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static { None }; - let framebuffer_size = window.framebuffer_size(); - let framebuffer_size = webrender_api::DeviceUintSize::new(framebuffer_size.width, - framebuffer_size.height); - webrender::Renderer::new(window.gl(), webrender::RendererOptions { device_pixel_ratio: device_pixel_ratio, resource_override_path: Some(resource_path), @@ -191,9 +187,12 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static { renderer_kind: renderer_kind, enable_subpixel_aa: opts.enable_subpixel_text_antialiasing, ..Default::default() - }, framebuffer_size).expect("Unable to initialize webrender!") + }).expect("Unable to initialize webrender!") }; + let webrender_api = webrender_api_sender.create_api(); + let webrender_document = webrender_api.add_document(window.framebuffer_size()); + // Important that this call is done in a single-threaded fashion, we // can't defer it after `create_constellation` has started. script::init(); @@ -211,7 +210,8 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static { devtools_chan, supports_clipboard, &webrender, - webrender_api_sender.clone()); + webrender_document, + webrender_api_sender); // Send the constellation's swmanager sender to service worker manager thread script::init_service_workers(sw_senders); @@ -230,8 +230,9 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static { constellation_chan: constellation_chan.clone(), time_profiler_chan: time_profiler_chan, mem_profiler_chan: mem_profiler_chan, - webrender: webrender, - webrender_api_sender: webrender_api_sender, + webrender, + webrender_document, + webrender_api, }); Browser { @@ -287,6 +288,7 @@ fn create_constellation(user_agent: Cow<'static, str>, devtools_chan: Option<Sender<devtools_traits::DevtoolsControlMsg>>, supports_clipboard: bool, webrender: &webrender::Renderer, + webrender_document: webrender_api::DocumentId, webrender_api_sender: webrender_api::RenderApiSender) -> (Sender<ConstellationMsg>, SWManagerSenders) { let bluetooth_thread: IpcSender<BluetoothRequest> = BluetoothThreadFactory::new(); @@ -302,17 +304,18 @@ fn create_constellation(user_agent: Cow<'static, str>, let resource_sender = public_resource_threads.sender(); let initial_state = InitialConstellationState { - compositor_proxy: compositor_proxy, - debugger_chan: debugger_chan, - devtools_chan: devtools_chan, - bluetooth_thread: bluetooth_thread, - font_cache_thread: font_cache_thread, - public_resource_threads: public_resource_threads, - private_resource_threads: private_resource_threads, - time_profiler_chan: time_profiler_chan, - mem_profiler_chan: mem_profiler_chan, - supports_clipboard: supports_clipboard, - webrender_api_sender: webrender_api_sender, + compositor_proxy, + debugger_chan, + devtools_chan, + bluetooth_thread, + font_cache_thread, + public_resource_threads, + private_resource_threads, + time_profiler_chan, + mem_profiler_chan, + supports_clipboard, + webrender_document, + webrender_api_sender, }; let (constellation_chan, from_swmanager_sender) = Constellation::<script_layout_interface::message::Msg, diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs index d8a74758247..182acecf885 100644 --- a/components/servo_arc/lib.rs +++ b/components/servo_arc/lib.rs @@ -41,6 +41,7 @@ use std::hash::{Hash, Hasher}; use std::iter::{ExactSizeIterator, Iterator}; use std::mem; use std::ops::{Deref, DerefMut}; +use std::os::raw::c_void; use std::process; use std::ptr; use std::slice; @@ -200,6 +201,7 @@ impl<T> Arc<T> { pub fn borrow_arc<'a>(&'a self) -> ArcBorrow<'a, T> { ArcBorrow(&**self) } + /// Temporarily converts |self| into a bonafide RawOffsetArc and exposes it to the /// provided callback. The refcount is not modified. #[inline(always)] @@ -218,6 +220,12 @@ impl<T> Arc<T> { // Forward the result. result } + + /// Returns the address on the heap of the Arc itself -- not the T within it -- for memory + /// reporting. + pub fn heap_ptr(&self) -> *const c_void { + self.p.ptr() as *const ArcInner<T> as *const c_void + } } impl<T: ?Sized> Arc<T> { diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index ec98f0a38b8..616553a0d3d 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -30,7 +30,7 @@ testing = [] gecko_debug = ["nsstring_vendor/gecko_debug"] [dependencies] -app_units = "0.5" +app_units = "0.5.2" arrayvec = "0.3.20" arraydeque = "0.2.3" atomic_refcell = "0.1" @@ -44,6 +44,7 @@ euclid = "0.15" fnv = "1.0" heapsize = {version = "0.4", optional = true} heapsize_derive = {version = "0.1", optional = true} +itertools = "0.5" itoa = "0.3" html5ever = {version = "0.18", optional = true} lazy_static = "0.2" @@ -78,7 +79,7 @@ kernel32-sys = "0.2" [build-dependencies] lazy_static = "0.2" log = "0.3" -bindgen = { version = "0.26.1", optional = true } +bindgen = { version = "0.29", optional = true } regex = {version = "0.2", optional = true} walkdir = "1.0" toml = {version = "0.2.1", optional = true, default-features = false} diff --git a/components/style/animation.rs b/components/style/animation.rs index d90467c7eea..69b94edb580 100644 --- a/components/style/animation.rs +++ b/components/style/animation.rs @@ -499,6 +499,7 @@ fn compute_style_for_animation_step(context: &SharedStyleContext, iter, Some(previous_style), Some(previous_style), + Some(previous_style), /* cascade_info = */ None, /* visited_style = */ None, font_metrics_provider, diff --git a/components/style/context.rs b/components/style/context.rs index 5abad6c5e03..675fff06cc7 100644 --- a/components/style/context.rs +++ b/components/style/context.rs @@ -18,10 +18,12 @@ use font_metrics::FontMetricsProvider; #[cfg(feature = "gecko")] use gecko_bindings::structs; #[cfg(feature = "servo")] use parking_lot::RwLock; use properties::ComputedValues; +#[cfg(feature = "servo")] use properties::PropertyId; use rule_tree::StrongRuleNode; use selector_parser::{EAGER_PSEUDO_COUNT, SnapshotMap}; use selectors::matching::ElementSelectorFlags; use servo_arc::Arc; +#[cfg(feature = "servo")] use servo_atoms::Atom; use shared_lock::StylesheetGuards; use sharing::StyleSharingCandidateCache; use std::fmt; @@ -30,11 +32,13 @@ use std::ops; #[cfg(feature = "servo")] use std::sync::mpsc::Sender; use style_traits::CSSPixel; use style_traits::DevicePixel; +#[cfg(feature = "servo")] use style_traits::SpeculativePainter; use stylist::Stylist; use thread_state; use time; use timer::Timer; -use traversal::{DomTraversal, TraversalFlags}; +use traversal::DomTraversal; +use traversal_flags::TraversalFlags; pub use selectors::matching::QuirksMode; @@ -150,6 +154,10 @@ pub struct SharedStyleContext<'a> { #[cfg(feature = "servo")] pub expired_animations: Arc<RwLock<FnvHashMap<OpaqueNode, Vec<Animation>>>>, + /// Paint worklets + #[cfg(feature = "servo")] + pub registered_speculative_painters: &'a RegisteredSpeculativePainters, + /// Data needed to create the thread-local style context from the shared one. #[cfg(feature = "servo")] pub local_context_creation_data: Mutex<ThreadLocalStyleContextCreationInfo>, @@ -190,7 +198,7 @@ pub struct CascadeInputs { impl CascadeInputs { /// Construct inputs from previous cascade results, if any. - pub fn new_from_style(style: &Arc<ComputedValues>) -> Self { + pub fn new_from_style(style: &ComputedValues) -> Self { CascadeInputs { rules: style.rules.clone(), visited_rules: style.get_visited_style().and_then(|v| v.rules.clone()), @@ -231,7 +239,7 @@ impl Clone for EagerPseudoCascadeInputs { impl EagerPseudoCascadeInputs { /// Construct inputs from previous cascade results, if any. fn new_from_style(styles: &EagerPseudoStyles) -> Self { - EagerPseudoCascadeInputs(styles.as_array().map(|styles| { + EagerPseudoCascadeInputs(styles.as_optional_array().map(|styles| { let mut inputs: [Option<CascadeInputs>; EAGER_PSEUDO_COUNT] = Default::default(); for i in 0..EAGER_PSEUDO_COUNT { inputs[i] = styles[i].as_ref().map(|s| CascadeInputs::new_from_style(s)); @@ -401,7 +409,7 @@ impl TraversalStatistics { #[cfg(feature = "gecko")] bitflags! { /// Represents which tasks are performed in a SequentialTask of - /// UpdateAnimations. + /// UpdateAnimations which is a result of normal restyle. pub flags UpdateAnimationsTasks: u8 { /// Update CSS Animations. const CSS_ANIMATIONS = structs::UpdateAnimationsTasks_CSSAnimations, @@ -414,6 +422,18 @@ bitflags! { } } +#[cfg(feature = "gecko")] +bitflags! { + /// Represents which tasks are performed in a SequentialTask as a result of + /// animation-only restyle. + pub flags PostAnimationTasks: u8 { + /// Display property was changed from none in animation-only restyle so + /// that we need to resolve styles for descendants in a subsequent + /// normal restyle. + const DISPLAY_CHANGED_FROM_NONE_FOR_SMIL = 0x01, + } +} + /// A task to be run in sequential mode on the parent (non-worker) thread. This /// is used by the style system to queue up work which is not safe to do during @@ -435,6 +455,17 @@ pub enum SequentialTask<E: TElement> { /// The tasks which are performed in this SequentialTask. tasks: UpdateAnimationsTasks }, + + /// Performs one of a number of possible tasks as a result of animation-only restyle. + /// Currently we do only process for resolving descendant elements that were display:none + /// subtree for SMIL animation. + #[cfg(feature = "gecko")] + PostAnimation { + /// The target element. + el: SendElement<E>, + /// The tasks which are performed in this SequentialTask. + tasks: PostAnimationTasks + }, } impl<E: TElement> SequentialTask<E> { @@ -448,6 +479,10 @@ impl<E: TElement> SequentialTask<E> { UpdateAnimations { el, before_change_style, tasks } => { unsafe { el.update_animations(before_change_style, tasks) }; } + #[cfg(feature = "gecko")] + PostAnimation { el, tasks } => { + unsafe { el.process_post_animation(tasks) }; + } } } @@ -464,6 +499,17 @@ impl<E: TElement> SequentialTask<E> { tasks: tasks, } } + + /// Creates a task to do post-process for a given element as a result of + /// animation-only restyle. + #[cfg(feature = "gecko")] + pub fn process_post_animation(el: E, tasks: PostAnimationTasks) -> Self { + use self::SequentialTask::*; + PostAnimation { + el: unsafe { SendElement::new(el) }, + tasks: tasks, + } + } } /// Map from Elements to ElementSelectorFlags. Used to defer applying selector @@ -676,3 +722,19 @@ pub enum ReflowGoal { /// We're reflowing in order to satisfy a script query. No display list will be created. ForScriptQuery, } + +/// A registered painter +#[cfg(feature = "servo")] +pub trait RegisteredSpeculativePainter: SpeculativePainter { + /// The name it was registered with + fn name(&self) -> Atom; + /// The properties it was registered with + fn properties(&self) -> &FnvHashMap<Atom, PropertyId>; +} + +/// A set of registered painters +#[cfg(feature = "servo")] +pub trait RegisteredSpeculativePainters: Sync { + /// Look up a speculative painter + fn get(&self, name: &Atom) -> Option<&RegisteredSpeculativePainter>; +} diff --git a/components/style/data.rs b/components/style/data.rs index c835593fed2..07870fad7a6 100644 --- a/components/style/data.rs +++ b/components/style/data.rs @@ -15,13 +15,24 @@ use servo_arc::Arc; use shared_lock::StylesheetGuards; use std::fmt; use std::ops::{Deref, DerefMut}; +#[cfg(feature = "gecko")] +use stylesheets::{MallocSizeOfWithRepeats, SizeOfState}; bitflags! { flags RestyleFlags: u8 { /// Whether the styles changed for this restyle. const WAS_RESTYLED = 1 << 0, + /// Whether the last traversal of this element did not do + /// any style computation. This is not true during the initial + /// styling pass, nor is it true when we restyle (in which case + /// WAS_RESTYLED is set). + /// + /// This bit always corresponds to the last time the element was + /// traversed, so each traversal simply updates it with the appropriate + /// value. + const TRAVERSED_WITHOUT_STYLING = 1 << 1, /// Whether we reframed/reconstructed any ancestor or self. - const ANCESTOR_WAS_RECONSTRUCTED = 1 << 1, + const ANCESTOR_WAS_RECONSTRUCTED = 1 << 2, } } @@ -96,14 +107,25 @@ impl RestyleData { /// to do a post-traversal. pub fn set_restyled(&mut self) { self.flags.insert(WAS_RESTYLED); + self.flags.remove(TRAVERSED_WITHOUT_STYLING); } - /// Mark this element as restyled, which is useful to know whether we need - /// to do a post-traversal. + /// Returns true if this element was restyled. pub fn is_restyle(&self) -> bool { self.flags.contains(WAS_RESTYLED) } + /// Mark that we traversed this element without computing any style for it. + pub fn set_traversed_without_styling(&mut self) { + self.flags.insert(TRAVERSED_WITHOUT_STYLING); + } + + /// Returns whether the element was traversed without computing any style for + /// it. + pub fn traversed_without_styling(&self) -> bool { + self.flags.contains(TRAVERSED_WITHOUT_STYLING) + } + /// Returns whether this element has been part of a restyle. pub fn contains_restyle_data(&self) -> bool { self.is_restyle() || !self.hint.is_empty() || !self.damage.is_empty() @@ -162,6 +184,13 @@ impl fmt::Debug for EagerPseudoArray { } } +// Can't use [None; EAGER_PSEUDO_COUNT] here because it complains +// about Copy not being implemented for our Arc type. +#[cfg(feature = "gecko")] +const EMPTY_PSEUDO_ARRAY: &'static EagerPseudoArrayInner = &[None, None, None, None]; +#[cfg(feature = "servo")] +const EMPTY_PSEUDO_ARRAY: &'static EagerPseudoArrayInner = &[None, None, None]; + impl EagerPseudoStyles { /// Returns whether there are any pseudo styles. pub fn is_empty(&self) -> bool { @@ -169,13 +198,19 @@ impl EagerPseudoStyles { } /// Grabs a reference to the list of styles, if they exist. - pub fn as_array(&self) -> Option<&EagerPseudoArrayInner> { + pub fn as_optional_array(&self) -> Option<&EagerPseudoArrayInner> { match self.0 { None => None, Some(ref x) => Some(&x.0), } } + /// Grabs a reference to the list of styles or a list of None if + /// there are no styles to be had. + pub fn as_array(&self) -> &EagerPseudoArrayInner { + self.as_optional_array().unwrap_or(EMPTY_PSEUDO_ARRAY) + } + /// Returns a reference to the style for a given eager pseudo, if it exists. pub fn get(&self, pseudo: &PseudoElement) -> Option<&Arc<ComputedValues>> { debug_assert!(pseudo.is_eager()); @@ -229,6 +264,20 @@ impl fmt::Debug for ElementStyles { } } +#[cfg(feature = "gecko")] +impl MallocSizeOfWithRepeats for ElementStyles { + fn malloc_size_of_children(&self, state: &mut SizeOfState) -> usize { + let mut n = 0; + if let Some(ref primary) = self.primary { + n += primary.malloc_size_of_children(state) + }; + + // We may measure more fields in the future if DMD says it's worth it. + + n + } +} + /// Style system data associated with an Element. /// /// In Gecko, this hangs directly off the Element. Servo, this is embedded @@ -379,3 +428,14 @@ impl ElementData { self.restyle.clear_flags_and_damage(); } } + +#[cfg(feature = "gecko")] +impl MallocSizeOfWithRepeats for ElementData { + fn malloc_size_of_children(&self, state: &mut SizeOfState) -> usize { + let n = self.styles.malloc_size_of_children(state); + + // We may measure more fields in the future if DMD says it's worth it. + + n + } +} diff --git a/components/style/dom.rs b/components/style/dom.rs index 58050757b30..154a19eb994 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -10,6 +10,7 @@ use {Atom, Namespace, LocalName}; use applicable_declarations::ApplicableDeclarationBlock; use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut}; +#[cfg(feature = "gecko")] use context::PostAnimationTasks; #[cfg(feature = "gecko")] use context::UpdateAnimationsTasks; use data::ElementData; use element_state::ElementState; @@ -33,7 +34,7 @@ use std::hash::Hash; use std::ops::Deref; use stylist::Stylist; use thread_state; -use traversal::TraversalFlags; +use traversal_flags::TraversalFlags; pub use style_traits::UnsafeNode; @@ -625,6 +626,10 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone + before_change_style: Option<Arc<ComputedValues>>, tasks: UpdateAnimationsTasks); + /// Creates a task to process post animation on a given element. + #[cfg(feature = "gecko")] + fn process_post_animation(&self, tasks: PostAnimationTasks); + /// Returns true if the element has relevant animations. Relevant /// animations are those animations that are affecting the element's style /// or are scheduled to do so in the future. diff --git a/components/style/error_reporting.rs b/components/style/error_reporting.rs index 09b7abf1c1d..56674fc908e 100644 --- a/components/style/error_reporting.rs +++ b/components/style/error_reporting.rs @@ -18,8 +18,12 @@ pub enum ContextualParseError<'a> { UnsupportedPropertyDeclaration(&'a str, ParseError<'a>), /// A font face descriptor was not recognized. UnsupportedFontFaceDescriptor(&'a str, ParseError<'a>), + /// A font feature values descroptor was not recognized. + UnsupportedFontFeatureValuesDescriptor(&'a str, ParseError<'a>), /// A keyframe rule was not valid. InvalidKeyframeRule(&'a str, ParseError<'a>), + /// A font feature values rule was not valid. + InvalidFontFeatureValuesRule(&'a str, ParseError<'a>), /// A keyframe property declaration was not recognized. UnsupportedKeyframePropertyDeclaration(&'a str, ParseError<'a>), /// A rule was invalid for some reason. @@ -108,9 +112,15 @@ impl<'a> ContextualParseError<'a> { ContextualParseError::UnsupportedFontFaceDescriptor(decl, ref err) => format!("Unsupported @font-face descriptor declaration: '{}', {}", decl, parse_error_to_str(err)), + ContextualParseError::UnsupportedFontFeatureValuesDescriptor(decl, ref err) => + format!("Unsupported @font-feature-values descriptor declaration: '{}', {}", decl, + parse_error_to_str(err)), ContextualParseError::InvalidKeyframeRule(rule, ref err) => format!("Invalid keyframe rule: '{}', {}", rule, parse_error_to_str(err)), + ContextualParseError::InvalidFontFeatureValuesRule(rule, ref err) => + format!("Invalid font feature value rule: '{}', {}", rule, + parse_error_to_str(err)), ContextualParseError::UnsupportedKeyframePropertyDeclaration(decl, ref err) => format!("Unsupported keyframe property declaration: '{}', {}", decl, parse_error_to_str(err)), diff --git a/components/style/font_face.rs b/components/style/font_face.rs index 3dca241828b..77bf43d2017 100644 --- a/components/style/font_face.rs +++ b/components/style/font_face.rs @@ -110,8 +110,7 @@ impl Parse for FontWeight { /// Note that the prelude parsing code lives in the `stylesheets` module. pub fn parse_font_face_block(context: &ParserContext, input: &mut Parser, location: SourceLocation) -> FontFaceRuleData { - let mut rule = FontFaceRuleData::empty(); - rule.source_location = location; + let mut rule = FontFaceRuleData::empty(location); { let parser = FontFaceRuleParser { context: context, @@ -211,6 +210,16 @@ impl Parse for Source { } } +macro_rules! is_descriptor_enabled { + ("font-display") => { + unsafe { + use gecko_bindings::structs::mozilla; + mozilla::StylePrefs_sFontDisplayEnabled + } + }; + ($name: tt) => { true } +} + macro_rules! font_face_descriptors_common { ( $( #[$doc: meta] $name: tt $ident: ident / $gecko_ident: ident: $ty: ty, )* @@ -229,15 +238,12 @@ macro_rules! font_face_descriptors_common { } impl FontFaceRuleData { - fn empty() -> Self { + fn empty(location: SourceLocation) -> Self { FontFaceRuleData { $( $ident: None, )* - source_location: SourceLocation { - line: 0, - column: 0, - }, + source_location: location, } } @@ -279,7 +285,7 @@ macro_rules! font_face_descriptors_common { -> Result<(), ParseError<'i>> { match_ignore_ascii_case! { &*name, $( - $name => { + $name if is_descriptor_enabled!($name) => { // DeclarationParser also calls parse_entirely // so we’d normally not need to, // but in this case we do because we set the value as a side effect diff --git a/components/style/gecko/arc_types.rs b/components/style/gecko/arc_types.rs index f25d5ef6f5f..21afd37217c 100644 --- a/components/style/gecko/arc_types.rs +++ b/components/style/gecko/arc_types.rs @@ -8,7 +8,7 @@ #![allow(non_snake_case, missing_docs)] -use gecko_bindings::bindings::{RawServoImportRule, RawServoSupportsRule}; +use gecko_bindings::bindings::{RawServoFontFeatureValuesRule, RawServoImportRule, RawServoSupportsRule}; use gecko_bindings::bindings::{RawServoKeyframe, RawServoKeyframesRule}; use gecko_bindings::bindings::{RawServoMediaRule, RawServoNamespaceRule, RawServoPageRule}; use gecko_bindings::bindings::{RawServoRuleNode, RawServoRuleNodeStrong, RawServoDocumentRule}; @@ -24,7 +24,7 @@ use servo_arc::{Arc, ArcBorrow}; use shared_lock::Locked; use std::{mem, ptr}; use stylesheets::{CssRules, StylesheetContents, StyleRule, ImportRule, KeyframesRule, MediaRule}; -use stylesheets::{NamespaceRule, PageRule, SupportsRule, DocumentRule}; +use stylesheets::{FontFeatureValuesRule, NamespaceRule, PageRule, SupportsRule, DocumentRule}; use stylesheets::keyframes_rule::Keyframe; macro_rules! impl_arc_ffi { @@ -88,6 +88,9 @@ impl_arc_ffi!(Locked<SupportsRule> => RawServoSupportsRule impl_arc_ffi!(Locked<DocumentRule> => RawServoDocumentRule [Servo_DocumentRule_AddRef, Servo_DocumentRule_Release]); +impl_arc_ffi!(Locked<FontFeatureValuesRule> => RawServoFontFeatureValuesRule + [Servo_FontFeatureValuesRule_AddRef, Servo_FontFeatureValuesRule_Release]); + // RuleNode is a Arc-like type but it does not use Arc. impl StrongRuleNode { diff --git a/components/style/gecko/conversions.rs b/components/style/gecko/conversions.rs index 2426bef42dc..5877e3917d8 100644 --- a/components/style/gecko/conversions.rs +++ b/components/style/gecko/conversions.rs @@ -102,6 +102,16 @@ impl From<nsStyleCoord_CalcValue> for LengthOrPercentage { } } +impl From<nsStyleCoord_CalcValue> for LengthOrPercentageOrAuto { + fn from(other: nsStyleCoord_CalcValue) -> LengthOrPercentageOrAuto { + match (other.mHasPercent, other.mLength) { + (false, _) => LengthOrPercentageOrAuto::Length(Au(other.mLength)), + (true, 0) => LengthOrPercentageOrAuto::Percentage(Percentage(other.mPercent)), + _ => LengthOrPercentageOrAuto::Calc(other.into()), + } + } +} + impl From<Angle> for CoordDataValue { fn from(reference: Angle) -> Self { match reference { @@ -219,14 +229,18 @@ impl nsStyleImage { } }, LineDirection::Vertical(y) => { - // Y::Bottom (to bottom) is ignored because it is the default value. - if y == Y::Top { - unsafe { - (*gecko_gradient).mBgPosX - .set_value(CoordDataValue::Percent(0.5)); - (*gecko_gradient).mBgPosY - .set_value(CoordDataValue::Percent(0.0)); - } + // Although bottom is the default value, we can not ignore + // it here, because the rendering code of Gecko relies on + // this to behave correctly for legacy mode. + let y = match y { + Y::Top => 0.0, + Y::Bottom => 1.0, + }; + unsafe { + (*gecko_gradient).mBgPosX + .set_value(CoordDataValue::Percent(0.5)); + (*gecko_gradient).mBgPosY + .set_value(CoordDataValue::Percent(y)); } }, LineDirection::Corner(horiz, vert) => { @@ -297,7 +311,7 @@ impl nsStyleImage { Gecko_CreateGradient(gecko_shape, gecko_size, gradient.repeating, - gradient.compat_mode != CompatMode::Modern, + gradient.compat_mode == CompatMode::Moz, gradient.compat_mode == CompatMode::Moz, stop_count as u32) }; @@ -800,7 +814,8 @@ impl TrackSize<LengthOrPercentage> { if gecko_min.unit() == nsStyleUnit::eStyleUnit_None { debug_assert!(gecko_max.unit() == nsStyleUnit::eStyleUnit_Coord || - gecko_max.unit() == nsStyleUnit::eStyleUnit_Percent); + gecko_max.unit() == nsStyleUnit::eStyleUnit_Percent || + gecko_max.unit() == nsStyleUnit::eStyleUnit_Calc); return TrackSize::FitContent(LengthOrPercentage::from_gecko_style_coord(gecko_max) .expect("gecko_max could not convert to LengthOrPercentage")); } diff --git a/components/style/gecko/data.rs b/components/style/gecko/data.rs index f845ec421c2..09e9fc511e1 100644 --- a/components/style/gecko/data.rs +++ b/components/style/gecko/data.rs @@ -204,6 +204,15 @@ impl PerDocumentStyleDataImpl { pub fn clear_stylist(&mut self) { self.stylist.clear(); } + + /// Returns whether visited links are enabled. + fn visited_links_enabled(&self) -> bool { + unsafe { bindings::Gecko_AreVisitedLinksEnabled() } + } + /// Returns whether visited styles are enabled. + pub fn visited_styles_enabled(&self) -> bool { + self.visited_links_enabled() && !self.is_private_browsing_enabled() + } } unsafe impl HasFFI for PerDocumentStyleData { diff --git a/components/style/gecko/generated/atom_macro.rs b/components/style/gecko/generated/atom_macro.rs index 6acf7f7f176..8c330f92b49 100644 --- a/components/style/gecko/generated/atom_macro.rs +++ b/components/style/gecko/generated/atom_macro.rs @@ -2026,6 +2026,8 @@ cfg_if! { pub static nsGkAtoms_onussdreceived: *mut nsIAtom; #[link_name = "_ZN9nsGkAtoms15onversionchangeE"] pub static nsGkAtoms_onversionchange: *mut nsIAtom; + #[link_name = "_ZN9nsGkAtoms18onvisibilitychangeE"] + pub static nsGkAtoms_onvisibilitychange: *mut nsIAtom; #[link_name = "_ZN9nsGkAtoms13onvoicechangeE"] pub static nsGkAtoms_onvoicechange: *mut nsIAtom; #[link_name = "_ZN9nsGkAtoms15onvoiceschangedE"] @@ -7155,6 +7157,8 @@ cfg_if! { pub static nsGkAtoms_onussdreceived: *mut nsIAtom; #[link_name = "?onversionchange@nsGkAtoms@@2PEAVnsIAtom@@EA"] pub static nsGkAtoms_onversionchange: *mut nsIAtom; + #[link_name = "?onvisibilitychange@nsGkAtoms@@2PEAVnsIAtom@@EA"] + pub static nsGkAtoms_onvisibilitychange: *mut nsIAtom; #[link_name = "?onvoicechange@nsGkAtoms@@2PEAVnsIAtom@@EA"] pub static nsGkAtoms_onvoicechange: *mut nsIAtom; #[link_name = "?onvoiceschanged@nsGkAtoms@@2PEAVnsIAtom@@EA"] @@ -12284,6 +12288,8 @@ cfg_if! { pub static nsGkAtoms_onussdreceived: *mut nsIAtom; #[link_name = "\x01?onversionchange@nsGkAtoms@@2PAVnsIAtom@@A"] pub static nsGkAtoms_onversionchange: *mut nsIAtom; + #[link_name = "\x01?onvisibilitychange@nsGkAtoms@@2PAVnsIAtom@@A"] + pub static nsGkAtoms_onvisibilitychange: *mut nsIAtom; #[link_name = "\x01?onvoicechange@nsGkAtoms@@2PAVnsIAtom@@A"] pub static nsGkAtoms_onvoicechange: *mut nsIAtom; #[link_name = "\x01?onvoiceschanged@nsGkAtoms@@2PAVnsIAtom@@A"] @@ -17416,6 +17422,8 @@ macro_rules! atom { { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_onussdreceived as *mut _) } }; ("onversionchange") => { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_onversionchange as *mut _) } }; +("onvisibilitychange") => + { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_onvisibilitychange as *mut _) } }; ("onvoicechange") => { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_onvoicechange as *mut _) } }; ("onvoiceschanged") => diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs index fb3d1a35c89..68036f26e89 100644 --- a/components/style/gecko/generated/bindings.rs +++ b/components/style/gecko/generated/bindings.rs @@ -8,6 +8,7 @@ type nsAString_internal = nsAString; pub type ServoStyleContextBorrowed<'a> = &'a ::properties::ComputedValues; pub type ServoStyleContextBorrowedOrNull<'a> = Option<&'a ::properties::ComputedValues>; pub type ServoComputedDataBorrowed<'a> = &'a ServoComputedData; +pub type RawServoAnimationValueTableBorrowed<'a> = &'a (); use gecko_bindings::structs::mozilla::css::GridTemplateAreasValue; use gecko_bindings::structs::mozilla::css::ErrorReporter; use gecko_bindings::structs::mozilla::css::ImageValue; @@ -37,15 +38,14 @@ use gecko_bindings::structs::RawServoStyleRule; use gecko_bindings::structs::RawGeckoPresContext; use gecko_bindings::structs::RawGeckoPresContextOwned; use gecko_bindings::structs::RawGeckoStyleAnimationList; -use gecko_bindings::structs::RawGeckoStyleChildrenIteratorBorrowedMut; +use gecko_bindings::structs::RawGeckoStyleChildrenIterator; use gecko_bindings::structs::RawGeckoServoStyleRuleList; use gecko_bindings::structs::RawGeckoURLExtraData; use gecko_bindings::structs::RawGeckoXBLBinding; use gecko_bindings::structs::RefPtr; use gecko_bindings::structs::CSSPseudoClassType; use gecko_bindings::structs::CSSPseudoElementType; -use gecko_bindings::structs::TraversalRestyleBehavior; -use gecko_bindings::structs::TraversalRootBehavior; +use gecko_bindings::structs::ServoTraversalFlags; use gecko_bindings::structs::ComputedTimingFunction_BeforeFlag; use gecko_bindings::structs::CounterStylePtr; use gecko_bindings::structs::FontFamilyList; @@ -55,6 +55,7 @@ use gecko_bindings::structs::GeckoFontMetrics; use gecko_bindings::structs::IterationCompositeOperation; use gecko_bindings::structs::Keyframe; use gecko_bindings::structs::PropertyValuePair; +use gecko_bindings::structs::SeenPtrs; use gecko_bindings::structs::ServoBundledURI; use gecko_bindings::structs::ServoElementSnapshot; use gecko_bindings::structs::ServoElementSnapshotTable; @@ -79,7 +80,6 @@ use gecko_bindings::structs::nsFont; use gecko_bindings::structs::nsIAtom; use gecko_bindings::structs::nsIURI; use gecko_bindings::structs::nsCompatibility; -use gecko_bindings::structs::nsMediaFeature; use gecko_bindings::structs::nsRestyleHint; use gecko_bindings::structs::nsStyleBackground; unsafe impl Send for nsStyleBackground {} @@ -174,6 +174,9 @@ unsafe impl Sync for nsStyleQuoteValues {} use gecko_bindings::structs::nsStyleSVG; unsafe impl Send for nsStyleSVG {} unsafe impl Sync for nsStyleSVG {} +use gecko_bindings::structs::nsStyleSVGOpacitySource; +unsafe impl Send for nsStyleSVGOpacitySource {} +unsafe impl Sync for nsStyleSVGOpacitySource {} use gecko_bindings::structs::nsStyleSVGPaint; unsafe impl Send for nsStyleSVGPaint {} unsafe impl Sync for nsStyleSVGPaint {} @@ -318,6 +321,10 @@ pub type RawGeckoServoAnimationValueListBorrowed<'a> = &'a RawGeckoServoAnimatio pub type RawGeckoServoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoServoAnimationValueList>; pub type RawGeckoServoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoServoAnimationValueList; pub type RawGeckoServoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoServoAnimationValueList>; +pub type RawGeckoStyleChildrenIteratorBorrowed<'a> = &'a RawGeckoStyleChildrenIterator; +pub type RawGeckoStyleChildrenIteratorBorrowedOrNull<'a> = Option<&'a RawGeckoStyleChildrenIterator>; +pub type RawGeckoStyleChildrenIteratorBorrowedMut<'a> = &'a mut RawGeckoStyleChildrenIterator; +pub type RawGeckoStyleChildrenIteratorBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoStyleChildrenIterator>; pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoCssRules>; pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules; pub type ServoCssRulesBorrowedOrNull<'a> = Option<&'a ServoCssRules>; @@ -378,6 +385,11 @@ pub type RawServoDocumentRuleBorrowed<'a> = &'a RawServoDocumentRule; pub type RawServoDocumentRuleBorrowedOrNull<'a> = Option<&'a RawServoDocumentRule>; enum RawServoDocumentRuleVoid { } pub struct RawServoDocumentRule(RawServoDocumentRuleVoid); +pub type RawServoFontFeatureValuesRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoFontFeatureValuesRule>; +pub type RawServoFontFeatureValuesRuleBorrowed<'a> = &'a RawServoFontFeatureValuesRule; +pub type RawServoFontFeatureValuesRuleBorrowedOrNull<'a> = Option<&'a RawServoFontFeatureValuesRule>; +enum RawServoFontFeatureValuesRuleVoid { } +pub struct RawServoFontFeatureValuesRule(RawServoFontFeatureValuesRuleVoid); pub type RawServoRuleNodeStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoRuleNode>; pub type RawServoRuleNodeBorrowed<'a> = &'a RawServoRuleNode; pub type RawServoRuleNodeBorrowedOrNull<'a> = Option<&'a RawServoRuleNode>; @@ -481,6 +493,14 @@ extern "C" { pub fn Servo_DocumentRule_Release(ptr: RawServoDocumentRuleBorrowed); } extern "C" { + pub fn Servo_FontFeatureValuesRule_AddRef(ptr: + RawServoFontFeatureValuesRuleBorrowed); +} +extern "C" { + pub fn Servo_FontFeatureValuesRule_Release(ptr: + RawServoFontFeatureValuesRuleBorrowed); +} +extern "C" { pub fn Servo_RuleNode_AddRef(ptr: RawServoRuleNodeBorrowed); } extern "C" { @@ -824,11 +844,8 @@ extern "C" { -> f64; } extern "C" { - pub fn Gecko_IsFramesTimingEnabled() -> bool; -} -extern "C" { pub fn Gecko_AnimationGetBaseStyle(aBaseStyles: - *mut ::std::os::raw::c_void, + RawServoAnimationValueTableBorrowed, aProperty: nsCSSPropertyID) -> RawServoAnimationValueBorrowedOrNull; } @@ -1071,6 +1088,10 @@ extern "C" { pub fn Gecko_DropElementSnapshot(snapshot: ServoElementSnapshotOwned); } extern "C" { + pub fn Gecko_HaveSeenPtr(table: *mut SeenPtrs, + ptr: *const ::std::os::raw::c_void) -> bool; +} +extern "C" { pub fn Gecko_ResizeTArrayForStrings(array: *mut nsTArray<nsStringRepr>, length: u32); } @@ -1407,9 +1428,6 @@ extern "C" { *mut nsCSSValueSharedList); } extern "C" { - pub fn Gecko_PropertyId_IsPrefEnabled(id: nsCSSPropertyID) -> bool; -} -extern "C" { pub fn Gecko_nsStyleFont_SetLang(font: *mut nsStyleFont, atom: *mut nsIAtom); } @@ -1477,9 +1495,6 @@ extern "C" { pub fn Gecko_StyleSheet_Release(aSheet: *const ServoStyleSheet); } extern "C" { - pub fn Gecko_GetMediaFeatures() -> *const nsMediaFeature; -} -extern "C" { pub fn Gecko_LookupCSSKeyword(string: *const u8, len: u32) -> nsCSSKeyword; } @@ -1874,6 +1889,12 @@ extern "C" { pub fn Servo_Element_ClearData(node: RawGeckoElementBorrowed); } extern "C" { + pub fn Servo_Element_SizeOfExcludingThis(arg1: MallocSizeOf, + seen_ptrs: *mut SeenPtrs, + node: RawGeckoElementBorrowed) + -> usize; +} +extern "C" { pub fn Servo_StyleSheet_FromUTF8Bytes(loader: *mut Loader, gecko_stylesheet: *mut ServoStyleSheet, @@ -1918,11 +1939,12 @@ extern "C" { pub fn Servo_StyleSet_Clear(set: RawServoStyleSetBorrowed); } extern "C" { - pub fn Servo_StyleSet_RebuildData(set: RawServoStyleSetBorrowed); + pub fn Servo_StyleSet_RebuildCachedData(set: RawServoStyleSetBorrowed); } extern "C" { - pub fn Servo_StyleSet_MediumFeaturesChanged(set: RawServoStyleSetBorrowed) - -> bool; + pub fn Servo_StyleSet_MediumFeaturesChanged(set: RawServoStyleSetBorrowed, + viewport_units_used: + *mut bool) -> bool; } extern "C" { pub fn Servo_StyleSet_CompatModeChanged(raw_data: @@ -2159,6 +2181,24 @@ extern "C" { -> ServoCssRulesStrong; } extern "C" { + pub fn Servo_CssRules_GetFontFeatureValuesRuleAt(rules: + ServoCssRulesBorrowed, + index: u32, + line: *mut u32, + column: *mut u32) + -> RawServoFontFeatureValuesRuleStrong; +} +extern "C" { + pub fn Servo_FontFeatureValuesRule_Debug(rule: + RawServoFontFeatureValuesRuleBorrowed, + result: *mut nsACString); +} +extern "C" { + pub fn Servo_FontFeatureValuesRule_GetCssText(rule: + RawServoFontFeatureValuesRuleBorrowed, + result: *mut nsAString); +} +extern "C" { pub fn Servo_CssRules_GetFontFaceRuleAt(rules: ServoCssRulesBorrowed, index: u32) -> *mut nsCSSFontFaceRule; @@ -2296,6 +2336,16 @@ extern "C" { result: *mut nsAString); } extern "C" { + pub fn Servo_FontFeatureValuesRule_GetFontFamily(rule: + RawServoFontFeatureValuesRuleBorrowed, + result: *mut nsAString); +} +extern "C" { + pub fn Servo_FontFeatureValuesRule_GetValueText(rule: + RawServoFontFeatureValuesRuleBorrowed, + result: *mut nsAString); +} +extern "C" { pub fn Servo_ParseProperty(property: nsCSSPropertyID, value: *const nsACString, data: *mut RawGeckoURLExtraData, @@ -2557,7 +2607,8 @@ extern "C" { extern "C" { pub fn Servo_AnimationCompose(animation_values: RawServoAnimationValueMapBorrowedMut, - base_values: *mut ::std::os::raw::c_void, + base_values: + RawServoAnimationValueTableBorrowed, property: nsCSSPropertyID, animation_segment: RawGeckoAnimationPropertySegmentBorrowed, @@ -2739,13 +2790,17 @@ extern "C" { } extern "C" { pub fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed, - restyle_behavior: TraversalRestyleBehavior, + flags: ServoTraversalFlags, was_restyled: *mut bool) -> nsChangeHint; } extern "C" { pub fn Servo_ResolveStyle(element: RawGeckoElementBorrowed, set: RawServoStyleSetBorrowed, - restyle_behavior: TraversalRestyleBehavior) + flags: ServoTraversalFlags) + -> ServoStyleContextStrong; +} +extern "C" { + pub fn Servo_ResolveStyleAllowStale(element: RawGeckoElementBorrowed) -> ServoStyleContextStrong; } extern "C" { @@ -2772,16 +2827,25 @@ extern "C" { rule_inclusion: StyleRuleInclusion, snapshots: *const ServoElementSnapshotTable, - set: RawServoStyleSetBorrowed) + set: RawServoStyleSetBorrowed, + ignore_existing_styles: bool) + -> ServoStyleContextStrong; +} +extern "C" { + pub fn Servo_ReparentStyle(style_to_reparent: ServoStyleContextBorrowed, + parent_style: ServoStyleContextBorrowed, + parent_style_ignoring_first_line: + ServoStyleContextBorrowed, + layout_parent_style: ServoStyleContextBorrowed, + element: RawGeckoElementBorrowedOrNull, + set: RawServoStyleSetBorrowed) -> ServoStyleContextStrong; } extern "C" { pub fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed, set: RawServoStyleSetBorrowed, snapshots: *const ServoElementSnapshotTable, - root_behavior: TraversalRootBehavior, - restyle_behavior: TraversalRestyleBehavior) - -> bool; + flags: ServoTraversalFlags) -> bool; } extern "C" { pub fn Servo_AssertTreeIsClean(root: RawGeckoElementBorrowed); @@ -2824,9 +2888,6 @@ extern "C" { -> bool; } extern "C" { - pub fn Servo_GetEmptyVariables() -> *const nsStyleVariables; -} -extern "C" { pub fn Gecko_CreateCSSErrorReporter(sheet: *mut ServoStyleSheet, loader: *mut Loader, uri: *mut nsIURI) -> *mut ErrorReporter; @@ -2841,8 +2902,15 @@ extern "C" { param: *const ::std::os::raw::c_char, paramLen: u32, + prefix: + *const ::std::os::raw::c_char, + prefixParam: + *const ::std::os::raw::c_char, + prefixParamLen: u32, + suffix: + *const ::std::os::raw::c_char, source: *const ::std::os::raw::c_char, sourceLen: u32, lineNumber: u32, - colNumber: u32, aURI: *mut nsIURI); + colNumber: u32); } diff --git a/components/style/gecko/generated/pseudo_element_definition.rs b/components/style/gecko/generated/pseudo_element_definition.rs index 46da69d1e9b..485d4a023f0 100644 --- a/components/style/gecko/generated/pseudo_element_definition.rs +++ b/components/style/gecko/generated/pseudo_element_definition.rs @@ -362,7 +362,7 @@ impl PseudoElement { /// Whether this pseudo-element is an anonymous box. #[inline] - fn is_anon_box(&self) -> bool { + pub fn is_anon_box(&self) -> bool { match *self { PseudoElement::MozText => true, PseudoElement::OofPlaceholder => true, diff --git a/components/style/gecko/generated/structs_debug.rs b/components/style/gecko/generated/structs_debug.rs index 5a6c073d0a1..33189e38370 100644 --- a/components/style/gecko/generated/structs_debug.rs +++ b/components/style/gecko/generated/structs_debug.rs @@ -1052,6 +1052,7 @@ pub mod root { } pub type pair_first_type<_T1> = _T1; pub type pair_second_type<_T2> = _T2; + pub type conditional_type<_If> = _If; #[repr(C)] #[derive(Debug, Copy)] pub struct input_iterator_tag { @@ -1071,47 +1072,114 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug, Copy)] + pub struct forward_iterator_tag { + pub _address: u8, + } + #[test] + fn bindgen_test_layout_forward_iterator_tag() { + assert_eq!(::std::mem::size_of::<forward_iterator_tag>() , 1usize + , concat ! ( + "Size of: " , stringify ! ( forward_iterator_tag ) )); + assert_eq! (::std::mem::align_of::<forward_iterator_tag>() , + 1usize , concat ! ( + "Alignment of " , stringify ! ( forward_iterator_tag ) + )); + } + impl Clone for forward_iterator_tag { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct bidirectional_iterator_tag { + pub _address: u8, + } + #[test] + fn bindgen_test_layout_bidirectional_iterator_tag() { + assert_eq!(::std::mem::size_of::<bidirectional_iterator_tag>() , + 1usize , concat ! ( + "Size of: " , stringify ! ( bidirectional_iterator_tag + ) )); + assert_eq! (::std::mem::align_of::<bidirectional_iterator_tag>() , + 1usize , concat ! ( + "Alignment of " , stringify ! ( + bidirectional_iterator_tag ) )); + } + impl Clone for bidirectional_iterator_tag { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct random_access_iterator_tag { + pub _address: u8, + } + #[test] + fn bindgen_test_layout_random_access_iterator_tag() { + assert_eq!(::std::mem::size_of::<random_access_iterator_tag>() , + 1usize , concat ! ( + "Size of: " , stringify ! ( random_access_iterator_tag + ) )); + assert_eq! (::std::mem::align_of::<random_access_iterator_tag>() , + 1usize , concat ! ( + "Alignment of " , stringify ! ( + random_access_iterator_tag ) )); + } + impl Clone for random_access_iterator_tag { + fn clone(&self) -> Self { *self } + } + #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct iterator { pub _address: u8, } - pub type iterator_iterator_category<_Category> = _Category; pub type iterator_value_type<_Tp> = _Tp; pub type iterator_difference_type<_Distance> = _Distance; pub type iterator_pointer<_Pointer> = _Pointer; pub type iterator_reference<_Reference> = _Reference; - #[repr(C)] - pub struct iterator_traits { - pub _address: u8, - } - #[repr(C)] - pub struct reverse_iterator<_Iterator> { - pub current: _Iterator, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iterator>>, - } - pub type reverse_iterator___traits_type = root::std::iterator_traits; - pub type reverse_iterator_iterator_type<_Iterator> = _Iterator; - pub type reverse_iterator_difference_type = - root::std::reverse_iterator___traits_type; - pub type reverse_iterator_pointer = - root::std::reverse_iterator___traits_type; - pub type reverse_iterator_reference = - root::std::reverse_iterator___traits_type; + pub type iterator_iterator_category<_Category> = _Category; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct atomic { } - pub mod chrono { - #[allow(unused_imports)] - use self::super::super::super::root; + pub type atomic___base = u8; + pub type __bit_iterator_difference_type = [u8; 0usize]; + pub type __bit_iterator_value_type = bool; + pub type __bit_iterator_pointer = u8; + pub type __bit_iterator_reference = u8; + pub type __bit_iterator_iterator_category = + root::std::random_access_iterator_tag; + pub type __bit_iterator___storage_type = [u8; 0usize]; + pub type __bit_iterator___storage_pointer = [u8; 0usize]; + #[repr(C)] + pub struct __bit_const_reference { + pub __seg_: root::std::__bit_const_reference___storage_pointer, + pub __mask_: root::std::__bit_const_reference___storage_type, + } + pub type __bit_const_reference___storage_type = [u8; 0usize]; + pub type __bit_const_reference___storage_pointer = [u8; 0usize]; + pub type __bit_reference___storage_type = [u8; 0usize]; + pub type __bit_reference___storage_pointer = [u8; 0usize]; + pub type __bitset_difference_type = isize; + pub type __bitset_size_type = usize; + pub type __bitset___storage_type = root::std::__bitset_size_type; + pub type __bitset___self = u8; + pub type __bitset___storage_pointer = + *mut root::std::__bitset___storage_type; + pub type __bitset___const_storage_pointer = + *const root::std::__bitset___storage_type; + pub const __bitset___bits_per_word: ::std::os::raw::c_uint = 64; + pub type __bitset_reference = u8; + pub type __bitset_const_reference = root::std::__bit_const_reference; + pub type __bitset_iterator = u8; + pub type __bitset_const_iterator = u8; + extern "C" { + #[link_name = "__n_words"] + pub static bitset___n_words: ::std::os::raw::c_uint; } + pub type bitset_base = u8; + pub type bitset_reference = root::std::bitset_base; + pub type bitset_const_reference = root::std::bitset_base; } - pub mod __gnu_cxx { - #[allow(unused_imports)] - use self::super::super::root; - } - pub type __off_t = ::std::os::raw::c_long; - pub type __off64_t = ::std::os::raw::c_long; pub mod mozilla { #[allow(unused_imports)] use self::super::super::root; @@ -1130,7 +1198,9 @@ pub mod root { impl Clone for fallible_t { fn clone(&self) -> Self { *self } } - /** Convenient aliases. */ + pub type IntegralConstant_ValueType<T> = T; + pub type IntegralConstant_Type = u8; + /// Convenient aliases. pub type TrueType = u8; pub type FalseType = u8; pub mod detail { @@ -1293,12 +1363,10 @@ pub mod root { } #[repr(u16)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum StringClassFlags { FIXED = 1, } - /** - * LinkedList supports refcounted elements using this adapter class. Clients - * using LinkedList<RefPtr<T>> will get a data structure that holds a strong - * reference to T as long as T is in the list. - */ + pub enum StringClassFlags { FIXED = 1, NULL_TERMINATED = 2, } + /// LinkedList supports refcounted elements using this adapter class. Clients + /// using LinkedList<RefPtr<T>> will get a data structure that holds a strong + /// reference to T as long as T is in the list. #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct LinkedListElementTraits { @@ -1310,29 +1378,6 @@ pub mod root { pub type LinkedListElementTraits_ConstClientType<T> = *mut T; #[repr(C)] #[derive(Debug)] - pub struct GuardObjectNotifier { - pub mStatementDone: *mut bool, - } - #[test] - fn bindgen_test_layout_GuardObjectNotifier() { - assert_eq!(::std::mem::size_of::<GuardObjectNotifier>() , - 8usize , concat ! ( - "Size of: " , stringify ! ( GuardObjectNotifier ) - )); - assert_eq! (::std::mem::align_of::<GuardObjectNotifier>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( - GuardObjectNotifier ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const GuardObjectNotifier ) ) . - mStatementDone as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - GuardObjectNotifier ) , "::" , stringify ! ( - mStatementDone ) )); - } - #[repr(C)] - #[derive(Debug)] pub struct GuardObjectNotificationReceiver { pub mStatementDone: bool, } @@ -1359,38 +1404,15 @@ pub mod root { #[derive(Debug, Copy, Clone)] pub struct WeakReference { } - #[repr(C)] - #[derive(Debug)] - pub struct MutexImpl { - pub platformData_: [*mut ::std::os::raw::c_void; 5usize], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct MutexImpl_PlatformData { - _unused: [u8; 0], - } - #[test] - fn bindgen_test_layout_MutexImpl() { - assert_eq!(::std::mem::size_of::<MutexImpl>() , 40usize , - concat ! ( "Size of: " , stringify ! ( MutexImpl ) - )); - assert_eq! (::std::mem::align_of::<MutexImpl>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( MutexImpl ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const MutexImpl ) ) . platformData_ - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( MutexImpl ) - , "::" , stringify ! ( platformData_ ) )); - } } + pub type Conditional_Type<A> = A; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum ArenaObjectID { eArenaObjectID_DummyBeforeFirstObjectID = 173, - eArenaObjectID_nsLineBox = 174, - eArenaObjectID_nsRuleNode = 175, - eArenaObjectID_GeckoStyleContext = 176, + eArenaObjectID_GeckoStyleContext = 174, + eArenaObjectID_nsLineBox = 175, + eArenaObjectID_nsRuleNode = 176, eArenaObjectID_DisplayItemData = 177, eArenaObjectID_nsInheritedStyleData = 178, eArenaObjectID_nsResetStyleData = 179, @@ -1447,19 +1469,17 @@ pub mod root { impl Clone for MallocAllocPolicy { fn clone(&self) -> Self { *self } } - /** - * A default deletion policy using plain old operator delete. - * - * Note that this type can be specialized, but authors should beware of the risk - * that the specialization may at some point cease to match (either because it - * gets moved to a different compilation unit or the signature changes). If the - * non-specialized (|delete|-based) version compiles for that type but does the - * wrong thing, bad things could happen. - * - * This is a non-issue for types which are always incomplete (i.e. opaque handle - * types), since |delete|-ing such a type will always trigger a compilation - * error. - */ + /// A default deletion policy using plain old operator delete. + /// + /// Note that this type can be specialized, but authors should beware of the risk + /// that the specialization may at some point cease to match (either because it + /// gets moved to a different compilation unit or the signature changes). If the + /// non-specialized (|delete|-based) version compiles for that type but does the + /// wrong thing, bad things could happen. + /// + /// This is a non-issue for types which are always incomplete (i.e. opaque handle + /// types), since |delete|-ing such a type will always trigger a compilation + /// error. #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DefaultDelete { @@ -1475,6 +1495,12 @@ pub mod root { pub mCurrent: IteratorT, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<IteratorT>>, } + pub type Array_iterator<T> = *mut T; + pub type Array_const_iterator<T> = *mut T; + pub type Array_reverse_iterator<T> = + root::mozilla::ReverseIterator<T>; + pub type Array_const_reverse_iterator<T> = + root::mozilla::ReverseIterator<T>; pub mod css { #[allow(unused_imports)] use self::super::super::super::root; @@ -1573,36 +1599,34 @@ pub mod root { mErrorColNumber ) )); } #[repr(u8)] - /** - * Enum defining the mode in which a sheet is to be parsed. This is - * usually, but not always, the same as the cascade level at which the - * sheet will apply (see nsStyleSet.h). Most of the Loader APIs only - * support loading of author sheets. - * - * Author sheets are the normal case: styles embedded in or linked - * from HTML pages. They are also the most restricted. - * - * User sheets can do anything author sheets can do, and also get - * access to a few CSS extensions that are not yet suitable for - * exposure on the public Web, but are very useful for expressing - * user style overrides, such as @-moz-document rules. - * - * XXX: eUserSheetFeatures was added in bug 1035091, but some patches in - * that bug never landed to use this enum value. Currently, all the features - * in user sheet are also available in author sheet. - * - * Agent sheets have access to all author- and user-sheet features - * plus more extensions that are necessary for internal use but, - * again, not yet suitable for exposure on the public Web. Some of - * these are outright unsafe to expose; in particular, incorrect - * styling of anonymous box pseudo-elements can violate layout - * invariants. - * - * Agent sheets that do not use any unsafe rules could use - * eSafeAgentSheetFeatures when creating the sheet. This enum value allows - * Servo backend to recognize the sheets as the agent level, but Gecko - * backend will parse it under _author_ level. - */ + /// Enum defining the mode in which a sheet is to be parsed. This is + /// usually, but not always, the same as the cascade level at which the + /// sheet will apply (see nsStyleSet.h). Most of the Loader APIs only + /// support loading of author sheets. + /// + /// Author sheets are the normal case: styles embedded in or linked + /// from HTML pages. They are also the most restricted. + /// + /// User sheets can do anything author sheets can do, and also get + /// access to a few CSS extensions that are not yet suitable for + /// exposure on the public Web, but are very useful for expressing + /// user style overrides, such as @-moz-document rules. + /// + /// XXX: eUserSheetFeatures was added in bug 1035091, but some patches in + /// that bug never landed to use this enum value. Currently, all the features + /// in user sheet are also available in author sheet. + /// + /// Agent sheets have access to all author- and user-sheet features + /// plus more extensions that are necessary for internal use but, + /// again, not yet suitable for exposure on the public Web. Some of + /// these are outright unsafe to expose; in particular, incorrect + /// styling of anonymous box pseudo-elements can violate layout + /// invariants. + /// + /// Agent sheets that do not use any unsafe rules could use + /// eSafeAgentSheetFeatures when creating the sheet. This enum value allows + /// Servo backend to recognize the sheets as the agent level, but Gecko + /// backend will parse it under _author_ level. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum SheetParsingMode { eAuthorSheetFeatures = 0, @@ -1719,6 +1743,7 @@ pub mod root { ( "Alignment of " , stringify ! ( Rule ) )); } #[repr(C)] + #[derive(Debug)] pub struct Loader { pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub _mOwningThread: root::nsAutoOwningThread, @@ -2240,9 +2265,7 @@ pub mod root { ComplexColorValue ) , "::" , stringify ! ( _mOwningThread ) )); } - /********************* - * Style sheet reuse * - *********************/ + /// Style sheet reuse * #[repr(C)] #[derive(Debug)] pub struct LoaderReusableStyleSheets { @@ -2271,16 +2294,9 @@ pub mod root { pub struct SheetLoadData { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ImportRule { - _unused: [u8; 0], - } #[repr(i32)] - /** - * Enum defining the type of URL matching function for a @-moz-document rule - * condition. - */ + /// Enum defining the type of URL matching function for a @-moz-document rule + /// condition. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum URLMatchingFunction { eURL = 0, @@ -2295,7 +2311,7 @@ pub mod root { } } #[repr(C)] - #[derive(Debug)] + #[derive(Debug, Copy)] pub struct ThreadSafeAutoRefCnt { pub mValue: u64, } @@ -2316,6 +2332,9 @@ pub mod root { ThreadSafeAutoRefCnt ) , "::" , stringify ! ( mValue ) )); } + impl Clone for ThreadSafeAutoRefCnt { + fn clone(&self) -> Self { *self } + } #[repr(C)] #[derive(Debug)] pub struct OwningNonNull<T> { @@ -2329,6 +2348,15 @@ pub mod root { pub mRawPtr: *mut T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } + pub type EnumeratedArray_ArrayType = u8; + pub type EnumeratedArray_iterator = + root::mozilla::EnumeratedArray_ArrayType; + pub type EnumeratedArray_const_iterator = + root::mozilla::EnumeratedArray_ArrayType; + pub type EnumeratedArray_reverse_iterator = + root::mozilla::EnumeratedArray_ArrayType; + pub type EnumeratedArray_const_reverse_iterator = + root::mozilla::EnumeratedArray_ArrayType; #[repr(C)] #[derive(Debug)] pub struct LinkedListElement { @@ -2371,87 +2399,15 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct AlignedStorage2 { - pub u: root::mozilla::AlignedStorage2_U, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AlignedStorage2_U { - pub mBytes: root::__BindgenUnionField<*mut ::std::os::raw::c_char>, - pub mDummy: root::__BindgenUnionField<u64>, - pub bindgen_union_field: u64, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct Maybe { } pub type Maybe_ValueType<T> = T; pub mod gfx { #[allow(unused_imports)] use self::super::super::super::root; - pub type IntRegion = [u64; 3usize]; pub type Float = f32; #[repr(C)] #[derive(Debug, Copy)] - pub struct Color { - pub _bindgen_opaque_blob: [u32; 4usize], - } - #[test] - fn bindgen_test_layout_Color() { - assert_eq!(::std::mem::size_of::<Color>() , 16usize , concat ! - ( "Size of: " , stringify ! ( Color ) )); - assert_eq! (::std::mem::align_of::<Color>() , 4usize , concat - ! ( "Alignment of " , stringify ! ( Color ) )); - } - impl Clone for Color { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct PointTyped { - } - pub type PointTyped_Coord = u8; - pub type PointTyped_Super = u8; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SizeTyped { - } - pub type SizeTyped_Super = u8; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct IntPointTyped { - } - pub type IntPointTyped_ToInt = u32; - pub type IntPointTyped_Coord = u8; - pub type IntPointTyped_Super = u8; - pub type IntPoint = [u32; 2usize]; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct IntSizeTyped { - } - pub type IntSizeTyped_ToInt = u32; - pub type IntSizeTyped_Super = u8; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct RectTyped { - } - pub type RectTyped_Super = u8; - pub type IntMargin = [u32; 4usize]; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct MarginTyped { - } - pub type MarginTyped_Super = u8; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct IntRectTyped { - } - pub type IntRectTyped_Super = u8; - pub type IntRectTyped_Self = u8; - pub type IntRectTyped_ToInt = u32; - pub type IntRect = [u32; 4usize]; - #[repr(C)] - #[derive(Debug, Copy)] pub struct FontVariation { pub mTag: u32, pub mValue: f32, @@ -2482,1012 +2438,18 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct ScaleFactor { - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ScaleFactors2D { - } - pub type Matrix4x4 = [u32; 16usize]; - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct SourceSurface { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DrawTarget { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Path { - _unused: [u8; 0], - } } pub mod layers { #[allow(unused_imports)] use self::super::super::super::root; - /** - * The viewport and displayport metrics for the painted frame at the - * time of a layer-tree transaction. These metrics are especially - * useful for shadow layers, because the metrics values are updated - * atomically with new pixels. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct FrameMetrics { - pub mScrollId: root::mozilla::layers::FrameMetrics_ViewID, - pub mPresShellResolution: f32, - pub mCompositionBounds: root::mozilla::ParentLayerRect, - pub mDisplayPort: root::mozilla::CSSRect, - pub mCriticalDisplayPort: root::mozilla::CSSRect, - pub mScrollableRect: root::mozilla::CSSRect, - pub mCumulativeResolution: root::mozilla::LayoutDeviceToLayerScale2D, - pub mDevPixelsPerCSSPixel: root::mozilla::CSSToLayoutDeviceScale, - pub mScrollOffset: root::mozilla::CSSPoint, - pub mZoom: root::mozilla::CSSToParentLayerScale2D, - pub mScrollGeneration: u32, - pub mSmoothScrollOffset: root::mozilla::CSSPoint, - pub mRootCompositionSize: root::mozilla::CSSSize, - pub mDisplayPortMargins: root::mozilla::ScreenMargin, - pub mPresShellId: u32, - pub mViewport: root::mozilla::CSSRect, - pub mExtraResolution: root::mozilla::ScreenToLayerScale2D, - pub mPaintRequestTime: root::mozilla::TimeStamp, - pub mScrollUpdateType: root::mozilla::layers::FrameMetrics_ScrollOffsetUpdateType, - pub _bitfield_1: u8, - pub __bindgen_padding_0: [u16; 3usize], - } - pub type FrameMetrics_ViewID = u64; - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum FrameMetrics_ScrollOffsetUpdateType { - eNone = 0, - eMainThread = 1, - ePending = 2, - eUserAction = 3, - eRestore = 4, - } - extern "C" { - #[link_name = - "_ZN7mozilla6layers12FrameMetrics14NULL_SCROLL_IDE"] - pub static FrameMetrics_NULL_SCROLL_ID: - root::mozilla::layers::FrameMetrics_ViewID; - } - pub const FrameMetrics_START_SCROLL_ID: - root::mozilla::layers::FrameMetrics_ViewID = - 2; - pub const FrameMetrics_sScrollOffsetUpdateTypeCount: usize = 5; - extern "C" { - #[link_name = - "_ZN7mozilla6layers12FrameMetrics30sHighestScrollOffsetUpdateTypeE"] - pub static FrameMetrics_sHighestScrollOffsetUpdateType: - root::mozilla::layers::FrameMetrics_ScrollOffsetUpdateType; - } - #[test] - fn bindgen_test_layout_FrameMetrics() { - assert_eq!(::std::mem::size_of::<FrameMetrics>() , 184usize , - concat ! ( - "Size of: " , stringify ! ( FrameMetrics ) )); - assert_eq! (::std::mem::align_of::<FrameMetrics>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( FrameMetrics ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . mScrollId - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( mScrollId ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mPresShellResolution as * const _ as usize } , - 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mPresShellResolution ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mCompositionBounds as * const _ as usize } , - 12usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mCompositionBounds ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mDisplayPort as * const _ as usize } , 28usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( mDisplayPort - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mCriticalDisplayPort as * const _ as usize } , - 44usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mCriticalDisplayPort ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mScrollableRect as * const _ as usize } , 60usize - , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mScrollableRect ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mCumulativeResolution as * const _ as usize } , - 76usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mCumulativeResolution ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mDevPixelsPerCSSPixel as * const _ as usize } , - 84usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mDevPixelsPerCSSPixel ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mScrollOffset as * const _ as usize } , 88usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mScrollOffset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . mZoom as * - const _ as usize } , 96usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( mZoom ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mScrollGeneration as * const _ as usize } , - 104usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mScrollGeneration ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mSmoothScrollOffset as * const _ as usize } , - 108usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mSmoothScrollOffset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mRootCompositionSize as * const _ as usize } , - 116usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mRootCompositionSize ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mDisplayPortMargins as * const _ as usize } , - 124usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mDisplayPortMargins ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mPresShellId as * const _ as usize } , 140usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( mPresShellId - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . mViewport - as * const _ as usize } , 144usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( mViewport ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mExtraResolution as * const _ as usize } , - 160usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mExtraResolution ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mPaintRequestTime as * const _ as usize } , - 168usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mPaintRequestTime ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mScrollUpdateType as * const _ as usize } , - 176usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mScrollUpdateType ) )); - } - impl Clone for FrameMetrics { - fn clone(&self) -> Self { *self } - } - impl FrameMetrics { - #[inline] - pub fn mIsRootContent(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 1u64 as u8; - let val = (unit_field_val & mask) >> 0usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsRootContent(&mut self, val: bool) { - let mask = 1u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 0usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mDoSmoothScroll(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 2u64 as u8; - let val = (unit_field_val & mask) >> 1usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mDoSmoothScroll(&mut self, val: bool) { - let mask = 2u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 1usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mUseDisplayPortMargins(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 4u64 as u8; - let val = (unit_field_val & mask) >> 2usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mUseDisplayPortMargins(&mut self, val: bool) { - let mask = 4u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 2usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mIsScrollInfoLayer(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 8u64 as u8; - let val = (unit_field_val & mask) >> 3usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsScrollInfoLayer(&mut self, val: bool) { - let mask = 8u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 3usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn new_bitfield_1(mIsRootContent: bool, - mDoSmoothScroll: bool, - mUseDisplayPortMargins: bool, - mIsScrollInfoLayer: bool) -> u8 { - ({ - ({ - ({ - ({ 0 } | - ((mIsRootContent as u8 as u8) << - 0usize) & (1u64 as u8)) - } | - ((mDoSmoothScroll as u8 as u8) << 1usize) & - (2u64 as u8)) - } | - ((mUseDisplayPortMargins as u8 as u8) << 2usize) - & (4u64 as u8)) - } | - ((mIsScrollInfoLayer as u8 as u8) << 3usize) & - (8u64 as u8)) - } - } - #[repr(C)] - #[derive(Debug)] - pub struct ScrollSnapInfo { - pub mScrollSnapTypeX: u8, - pub mScrollSnapTypeY: u8, - pub mScrollSnapIntervalX: [u32; 2usize], - pub mScrollSnapIntervalY: [u32; 2usize], - pub mScrollSnapDestination: root::nsPoint, - pub mScrollSnapCoordinates: root::nsTArray<root::nsPoint>, - } - #[test] - fn bindgen_test_layout_ScrollSnapInfo() { - assert_eq!(::std::mem::size_of::<ScrollSnapInfo>() , 40usize , - concat ! ( - "Size of: " , stringify ! ( ScrollSnapInfo ) )); - assert_eq! (::std::mem::align_of::<ScrollSnapInfo>() , 8usize - , concat ! ( - "Alignment of " , stringify ! ( ScrollSnapInfo ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollSnapInfo ) ) . - mScrollSnapTypeX as * const _ as usize } , 0usize - , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollSnapInfo ) , "::" , stringify ! ( - mScrollSnapTypeX ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollSnapInfo ) ) . - mScrollSnapTypeY as * const _ as usize } , 1usize - , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollSnapInfo ) , "::" , stringify ! ( - mScrollSnapTypeY ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollSnapInfo ) ) . - mScrollSnapIntervalX as * const _ as usize } , - 4usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollSnapInfo ) , "::" , stringify ! ( - mScrollSnapIntervalX ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollSnapInfo ) ) . - mScrollSnapIntervalY as * const _ as usize } , - 12usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollSnapInfo ) , "::" , stringify ! ( - mScrollSnapIntervalY ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollSnapInfo ) ) . - mScrollSnapDestination as * const _ as usize } , - 20usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollSnapInfo ) , "::" , stringify ! ( - mScrollSnapDestination ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollSnapInfo ) ) . - mScrollSnapCoordinates as * const _ as usize } , - 32usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollSnapInfo ) , "::" , stringify ! ( - mScrollSnapCoordinates ) )); - } - /** - * A clip that applies to a layer, that may be scrolled by some of the - * scroll frames associated with the layer. - */ - #[repr(C)] - #[derive(Debug)] - pub struct LayerClip { - pub mClipRect: root::mozilla::ParentLayerIntRect, - pub mMaskLayerIndex: [u64; 2usize], - } - #[test] - fn bindgen_test_layout_LayerClip() { - assert_eq!(::std::mem::size_of::<LayerClip>() , 32usize , - concat ! ( "Size of: " , stringify ! ( LayerClip ) - )); - assert_eq! (::std::mem::align_of::<LayerClip>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( LayerClip ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const LayerClip ) ) . mClipRect as - * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( LayerClip ) - , "::" , stringify ! ( mClipRect ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const LayerClip ) ) . - mMaskLayerIndex as * const _ as usize } , 16usize - , concat ! ( - "Alignment of field: " , stringify ! ( LayerClip ) - , "::" , stringify ! ( mMaskLayerIndex ) )); - } - /** - * Metadata about a scroll frame that's stored in the layer tree for use by - * the compositor (including APZ). This includes the scroll frame's FrameMetrics, - * as well as other metadata. We don't put the other metadata into FrameMetrics - * to avoid FrameMetrics becoming too bloated (as a FrameMetrics is e.g. sent - * over IPC for every repaint request for every active scroll frame). - */ - #[repr(C)] - #[derive(Debug)] - pub struct ScrollMetadata { - pub mMetrics: root::mozilla::layers::FrameMetrics, - pub mSnapInfo: root::mozilla::layers::ScrollSnapInfo, - pub mScrollParentId: root::mozilla::layers::ScrollMetadata_ViewID, - pub mBackgroundColor: root::mozilla::gfx::Color, - pub mContentDescription: root::nsCString, - pub mLineScrollAmount: root::mozilla::LayoutDeviceIntSize, - pub mPageScrollAmount: root::mozilla::LayoutDeviceIntSize, - pub mScrollClip: [u64; 5usize], - pub _bitfield_1: u8, - pub __bindgen_padding_0: [u8; 7usize], - } - pub type ScrollMetadata_ViewID = - root::mozilla::layers::FrameMetrics_ViewID; - extern "C" { - #[link_name = - "_ZN7mozilla6layers14ScrollMetadata13sNullMetadataE"] - pub static mut ScrollMetadata_sNullMetadata: - root::mozilla::StaticAutoPtr<root::mozilla::layers::ScrollMetadata>; - } - #[test] - fn bindgen_test_layout_ScrollMetadata() { - assert_eq!(::std::mem::size_of::<ScrollMetadata>() , 328usize - , concat ! ( - "Size of: " , stringify ! ( ScrollMetadata ) )); - assert_eq! (::std::mem::align_of::<ScrollMetadata>() , 8usize - , concat ! ( - "Alignment of " , stringify ! ( ScrollMetadata ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . mMetrics - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( mMetrics ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mSnapInfo as * const _ as usize } , 184usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( mSnapInfo - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mScrollParentId as * const _ as usize } , 224usize - , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( - mScrollParentId ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mBackgroundColor as * const _ as usize } , - 232usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( - mBackgroundColor ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mContentDescription as * const _ as usize } , - 248usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( - mContentDescription ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mLineScrollAmount as * const _ as usize } , - 264usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( - mLineScrollAmount ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mPageScrollAmount as * const _ as usize } , - 272usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( - mPageScrollAmount ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mScrollClip as * const _ as usize } , 280usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( - mScrollClip ) )); - } - impl ScrollMetadata { - #[inline] - pub fn mHasScrollgrab(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 1u64 as u8; - let val = (unit_field_val & mask) >> 0usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mHasScrollgrab(&mut self, val: bool) { - let mask = 1u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 0usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mAllowVerticalScrollWithWheel(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 2u64 as u8; - let val = (unit_field_val & mask) >> 1usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mAllowVerticalScrollWithWheel(&mut self, - val: bool) { - let mask = 2u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 1usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mIsLayersIdRoot(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 4u64 as u8; - let val = (unit_field_val & mask) >> 2usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsLayersIdRoot(&mut self, val: bool) { - let mask = 4u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 2usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mUsesContainerScrolling(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 8u64 as u8; - let val = (unit_field_val & mask) >> 3usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mUsesContainerScrolling(&mut self, val: bool) { - let mask = 8u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 3usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mForceDisableApz(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 16u64 as u8; - let val = (unit_field_val & mask) >> 4usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mForceDisableApz(&mut self, val: bool) { - let mask = 16u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 4usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn new_bitfield_1(mHasScrollgrab: bool, - mAllowVerticalScrollWithWheel: bool, - mIsLayersIdRoot: bool, - mUsesContainerScrolling: bool, - mForceDisableApz: bool) -> u8 { - ({ - ({ - ({ - ({ - ({ 0 } | - ((mHasScrollgrab as u8 as u8) << - 0usize) & (1u64 as u8)) - } | - ((mAllowVerticalScrollWithWheel as u8 - as u8) << 1usize) & - (2u64 as u8)) - } | - ((mIsLayersIdRoot as u8 as u8) << 2usize) & - (4u64 as u8)) - } | - ((mUsesContainerScrolling as u8 as u8) << - 3usize) & (8u64 as u8)) - } | - ((mForceDisableApz as u8 as u8) << 4usize) & - (16u64 as u8)) - } - } - /** - * This class is used for communicating information about the currently focused - * element of a document and the scrollable frames to use when keyboard scrolling - * it. It is created on the main thread at paint-time, but is then passed over - * IPC to the compositor/APZ code. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct FocusTarget { - pub mSequenceNumber: u64, - pub mFocusHasKeyEventListeners: bool, - pub mType: root::mozilla::layers::FocusTarget_FocusTargetType, - pub mData: root::mozilla::layers::FocusTarget_FocusTargetData, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct FocusTarget_ScrollTargets { - pub mHorizontal: root::mozilla::layers::FrameMetrics_ViewID, - pub mVertical: root::mozilla::layers::FrameMetrics_ViewID, - } - #[test] - fn bindgen_test_layout_FocusTarget_ScrollTargets() { - assert_eq!(::std::mem::size_of::<FocusTarget_ScrollTargets>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - FocusTarget_ScrollTargets ) )); - assert_eq! (::std::mem::align_of::<FocusTarget_ScrollTargets>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - FocusTarget_ScrollTargets ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget_ScrollTargets ) ) - . mHorizontal as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FocusTarget_ScrollTargets ) , "::" , stringify ! ( - mHorizontal ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget_ScrollTargets ) ) - . mVertical as * const _ as usize } , 8usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FocusTarget_ScrollTargets ) , "::" , stringify ! ( - mVertical ) )); - } - impl Clone for FocusTarget_ScrollTargets { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum FocusTarget_FocusTargetType { - eNone = 0, - eRefLayer = 1, - eScrollLayer = 2, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct FocusTarget_FocusTargetData { - pub mRefLayerId: root::__BindgenUnionField<u64>, - pub mScrollTargets: root::__BindgenUnionField<root::mozilla::layers::FocusTarget_ScrollTargets>, - pub bindgen_union_field: [u64; 2usize], - } - #[test] - fn bindgen_test_layout_FocusTarget_FocusTargetData() { - assert_eq!(::std::mem::size_of::<FocusTarget_FocusTargetData>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - FocusTarget_FocusTargetData ) )); - assert_eq! (::std::mem::align_of::<FocusTarget_FocusTargetData>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - FocusTarget_FocusTargetData ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget_FocusTargetData ) - ) . mRefLayerId as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FocusTarget_FocusTargetData ) , "::" , stringify ! - ( mRefLayerId ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget_FocusTargetData ) - ) . mScrollTargets as * const _ as usize } , - 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - FocusTarget_FocusTargetData ) , "::" , stringify ! - ( mScrollTargets ) )); - } - impl Clone for FocusTarget_FocusTargetData { - fn clone(&self) -> Self { *self } - } - pub const FocusTarget_sFocusTargetTypeCount: usize = 3; - extern "C" { - #[link_name = - "_ZN7mozilla6layers11FocusTarget23sHighestFocusTargetTypeE"] - pub static FocusTarget_sHighestFocusTargetType: - root::mozilla::layers::FocusTarget_FocusTargetType; - } - #[test] - fn bindgen_test_layout_FocusTarget() { - assert_eq!(::std::mem::size_of::<FocusTarget>() , 32usize , - concat ! ( - "Size of: " , stringify ! ( FocusTarget ) )); - assert_eq! (::std::mem::align_of::<FocusTarget>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( FocusTarget ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget ) ) . - mSequenceNumber as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( FocusTarget - ) , "::" , stringify ! ( mSequenceNumber ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget ) ) . - mFocusHasKeyEventListeners as * const _ as usize } - , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( FocusTarget - ) , "::" , stringify ! ( - mFocusHasKeyEventListeners ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget ) ) . mType as * - const _ as usize } , 12usize , concat ! ( - "Alignment of field: " , stringify ! ( FocusTarget - ) , "::" , stringify ! ( mType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget ) ) . mData as * - const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( FocusTarget - ) , "::" , stringify ! ( mData ) )); - } - impl Clone for FocusTarget { - fn clone(&self) -> Self { *self } - } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct LayerManager { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ContainerLayer { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Layer { - _unused: [u8; 0], - } } pub mod dom { #[allow(unused_imports)] @@ -3515,106 +2477,6 @@ pub mod root { #[allow(unused_imports)] use self::super::super::super::super::root; #[repr(C)] - #[derive(Debug)] - pub struct FastErrorResult { - pub _base: root::mozilla::binding_danger::TErrorResult, - } - #[test] - fn bindgen_test_layout_FastErrorResult() { - assert_eq!(::std::mem::size_of::<FastErrorResult>() , - 32usize , concat ! ( - "Size of: " , stringify ! ( FastErrorResult ) - )); - assert_eq! (::std::mem::align_of::<FastErrorResult>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( - FastErrorResult ) )); - } - #[repr(C)] - pub struct FakeString { - pub mData: *mut root::mozilla::detail::nsStringRepr_char_type, - pub mLength: root::mozilla::detail::nsStringRepr_size_type, - pub mDataFlags: root::mozilla::detail::nsStringRepr_DataFlags, - pub mClassFlags: root::mozilla::detail::nsStringRepr_ClassFlags, - pub mInlineStorage: [root::mozilla::detail::nsStringRepr_char_type; 64usize], - } - #[repr(C)] - #[derive(Debug)] - pub struct FakeString_StringAsserter { - pub _base: ::nsstring::nsStringRepr, - } - #[test] - fn bindgen_test_layout_FakeString_StringAsserter() { - assert_eq!(::std::mem::size_of::<FakeString_StringAsserter>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - FakeString_StringAsserter ) )); - assert_eq! (::std::mem::align_of::<FakeString_StringAsserter>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - FakeString_StringAsserter ) )); - } - pub const FakeString_sInlineCapacity: usize = 64; - #[test] - fn bindgen_test_layout_FakeString() { - assert_eq!(::std::mem::size_of::<FakeString>() , 144usize - , concat ! ( - "Size of: " , stringify ! ( FakeString ) )); - assert_eq! (::std::mem::align_of::<FakeString>() , 8usize - , concat ! ( - "Alignment of " , stringify ! ( FakeString ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const FakeString ) ) . mData as - * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - FakeString ) , "::" , stringify ! ( mData ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const FakeString ) ) . mLength - as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - FakeString ) , "::" , stringify ! ( mLength ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const FakeString ) ) . - mDataFlags as * const _ as usize } , 12usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FakeString ) , "::" , stringify ! ( mDataFlags - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FakeString ) ) . - mClassFlags as * const _ as usize } , 14usize - , concat ! ( - "Alignment of field: " , stringify ! ( - FakeString ) , "::" , stringify ! ( - mClassFlags ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FakeString ) ) . - mInlineStorage as * const _ as usize } , - 16usize , concat ! ( - "Alignment of field: " , stringify ! ( - FakeString ) , "::" , stringify ! ( - mInlineStorage ) )); - } - #[repr(C)] - #[derive(Debug)] - pub struct FastElementCreationOptions { - pub _base: root::mozilla::dom::ElementCreationOptions, - } - #[test] - fn bindgen_test_layout_FastElementCreationOptions() { - assert_eq!(::std::mem::size_of::<FastElementCreationOptions>() - , 56usize , concat ! ( - "Size of: " , stringify ! ( - FastElementCreationOptions ) )); - assert_eq! (::std::mem::align_of::<FastElementCreationOptions>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - FastElementCreationOptions ) )); - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct RecordEntry<KeyType, ValueType> { pub mKey: KeyType, @@ -3623,127 +2485,6 @@ pub mod root { pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<ValueType>>, } } - /** - * A class for representing string return values. This can be either passed to - * callees that have an nsString or nsAString out param or passed to a callee - * that actually knows about this class and can work with it. Such a callee may - * call SetStringBuffer or SetEphemeralStringBuffer or SetOwnedString or - * SetOwnedAtom on this object. It's only OK to call - * SetStringBuffer/SetOwnedString/SetOwnedAtom if the caller of the method in - * question plans to keep holding a strong ref to the stringbuffer involved, - * whether it's a raw nsStringBuffer, or stored inside the string or atom being - * passed. In the string/atom cases that means the caller must own the string - * or atom, and not mutate it (in the string case) for the lifetime of the - * DOMString. - * - * The proper way to store a value in this class is to either to do nothing - * (which leaves this as an empty string), to call - * SetStringBuffer/SetEphemeralStringBuffer with a non-null stringbuffer, to - * call SetOwnedString, to call SetOwnedAtom, to call SetNull(), or to call - * AsAString() and set the value in the resulting nsString. These options are - * mutually exclusive! Don't do more than one of them. - * - * The proper way to extract a value is to check IsNull(). If not null, then - * check HasStringBuffer(). If that's true, check for a zero length, and if the - * length is nonzero call StringBuffer(). If the length is zero this is the - * empty string. If HasStringBuffer() returns false, call AsAString() and get - * the value from that. - */ - #[repr(C)] - #[derive(Debug)] - pub struct DOMString { - pub mString: [u64; 21usize], - pub mStringBuffer: *mut root::nsStringBuffer, - pub mLength: u32, - pub mIsNull: bool, - pub mStringBufferOwned: bool, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum DOMString_NullHandling { - eTreatNullAsNull = 0, - eTreatNullAsEmpty = 1, - eNullNotExpected = 2, - } - #[test] - fn bindgen_test_layout_DOMString() { - assert_eq!(::std::mem::size_of::<DOMString>() , 184usize , - concat ! ( "Size of: " , stringify ! ( DOMString ) - )); - assert_eq! (::std::mem::align_of::<DOMString>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( DOMString ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DOMString ) ) . mString as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( DOMString ) - , "::" , stringify ! ( mString ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DOMString ) ) . mStringBuffer - as * const _ as usize } , 168usize , concat ! ( - "Alignment of field: " , stringify ! ( DOMString ) - , "::" , stringify ! ( mStringBuffer ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DOMString ) ) . mLength as * - const _ as usize } , 176usize , concat ! ( - "Alignment of field: " , stringify ! ( DOMString ) - , "::" , stringify ! ( mLength ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DOMString ) ) . mIsNull as * - const _ as usize } , 180usize , concat ! ( - "Alignment of field: " , stringify ! ( DOMString ) - , "::" , stringify ! ( mIsNull ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DOMString ) ) . - mStringBufferOwned as * const _ as usize } , - 181usize , concat ! ( - "Alignment of field: " , stringify ! ( DOMString ) - , "::" , stringify ! ( mStringBufferOwned ) )); - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct DictionaryBase { - pub mIsAnyMemberPresent: bool, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct DictionaryBase_FastDictionaryInitializer { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_DictionaryBase_FastDictionaryInitializer() { - assert_eq!(::std::mem::size_of::<DictionaryBase_FastDictionaryInitializer>() - , 1usize , concat ! ( - "Size of: " , stringify ! ( - DictionaryBase_FastDictionaryInitializer ) )); - assert_eq! (::std::mem::align_of::<DictionaryBase_FastDictionaryInitializer>() - , 1usize , concat ! ( - "Alignment of " , stringify ! ( - DictionaryBase_FastDictionaryInitializer ) )); - } - impl Clone for DictionaryBase_FastDictionaryInitializer { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_DictionaryBase() { - assert_eq!(::std::mem::size_of::<DictionaryBase>() , 1usize , - concat ! ( - "Size of: " , stringify ! ( DictionaryBase ) )); - assert_eq! (::std::mem::align_of::<DictionaryBase>() , 1usize - , concat ! ( - "Alignment of " , stringify ! ( DictionaryBase ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const DictionaryBase ) ) . - mIsAnyMemberPresent as * const _ as usize } , - 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - DictionaryBase ) , "::" , stringify ! ( - mIsAnyMemberPresent ) )); - } - impl Clone for DictionaryBase { - fn clone(&self) -> Self { *self } - } #[repr(C)] #[derive(Debug, Copy)] pub struct AllOwningUnionBase { @@ -3803,142 +2544,18 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct Optional { - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct NonNull<T> { - pub ptr: *mut T, - pub inited: bool, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct Sequence { } #[repr(C)] - #[derive(Debug, Copy)] - pub struct ParentObject { - pub mObject: *const root::nsISupports, - pub mWrapperCache: *const root::nsWrapperCache, - pub mUseXBLScope: bool, - } - #[test] - fn bindgen_test_layout_ParentObject() { - assert_eq!(::std::mem::size_of::<ParentObject>() , 24usize , - concat ! ( - "Size of: " , stringify ! ( ParentObject ) )); - assert_eq! (::std::mem::align_of::<ParentObject>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( ParentObject ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ParentObject ) ) . mObject as - * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - ParentObject ) , "::" , stringify ! ( mObject ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ParentObject ) ) . - mWrapperCache as * const _ as usize } , 8usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ParentObject ) , "::" , stringify ! ( - mWrapperCache ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ParentObject ) ) . - mUseXBLScope as * const _ as usize } , 16usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ParentObject ) , "::" , stringify ! ( mUseXBLScope - ) )); - } - impl Clone for ParentObject { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Nullable { } - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum CSSStyleSheetParsingMode { - Author = 0, - User = 1, - Agent = 2, - EndGuard_ = 3, - } - #[repr(C)] - #[derive(Debug)] - pub struct OriginAttributesDictionary { - pub _base: root::mozilla::dom::DictionaryBase, - pub mAppId: u32, - pub mFirstPartyDomain: ::nsstring::nsStringRepr, - pub mInIsolatedMozBrowser: bool, - pub mPrivateBrowsingId: u32, - pub mUserContextId: u32, - } - #[test] - fn bindgen_test_layout_OriginAttributesDictionary() { - assert_eq!(::std::mem::size_of::<OriginAttributesDictionary>() - , 40usize , concat ! ( - "Size of: " , stringify ! ( - OriginAttributesDictionary ) )); - assert_eq! (::std::mem::align_of::<OriginAttributesDictionary>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - OriginAttributesDictionary ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OriginAttributesDictionary ) - ) . mAppId as * const _ as usize } , 4usize , - concat ! ( - "Alignment of field: " , stringify ! ( - OriginAttributesDictionary ) , "::" , stringify ! - ( mAppId ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OriginAttributesDictionary ) - ) . mFirstPartyDomain as * const _ as usize } , - 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - OriginAttributesDictionary ) , "::" , stringify ! - ( mFirstPartyDomain ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OriginAttributesDictionary ) - ) . mInIsolatedMozBrowser as * const _ as usize } - , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( - OriginAttributesDictionary ) , "::" , stringify ! - ( mInIsolatedMozBrowser ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OriginAttributesDictionary ) - ) . mPrivateBrowsingId as * const _ as usize } , - 28usize , concat ! ( - "Alignment of field: " , stringify ! ( - OriginAttributesDictionary ) , "::" , stringify ! - ( mPrivateBrowsingId ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OriginAttributesDictionary ) - ) . mUserContextId as * const _ as usize } , - 32usize , concat ! ( - "Alignment of field: " , stringify ! ( - OriginAttributesDictionary ) , "::" , stringify ! - ( mUserContextId ) )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Promise { - _unused: [u8; 0], - } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CSSImportRule { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct CSSRuleList { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug)] pub struct MediaList { pub _base: root::nsIDOMMediaList, @@ -4030,6 +2647,7 @@ pub mod root { ) , "::" , stringify ! ( mEmpty ) )); } #[repr(C)] + #[derive(Debug)] pub struct Element { pub _base: root::mozilla::dom::FragmentOrElement, pub mState: root::mozilla::EventStates, @@ -4040,10 +2658,8 @@ pub mod root { pub struct Element_COMTypeInfo { pub _address: u8, } - /** - * StyleStateLocks is used to specify which event states should be locked, - * and whether they should be locked to on or off. - */ + /// StyleStateLocks is used to specify which event states should be locked, + /// and whether they should be locked to on or off. #[repr(C)] #[derive(Debug, Copy)] pub struct Element_StyleStateLocks { @@ -4135,14 +2751,12 @@ pub mod root { pub struct ShadowRoot { _unused: [u8; 0], } - /** - * Struct that stores info on an attribute. The name and value must either both - * be null or both be non-null. - * - * Note that, just as the pointers returned by GetAttrNameAt, the pointers that - * this struct hold are only valid until the element or its attributes are - * mutated (directly or via script). - */ + /// Struct that stores info on an attribute. The name and value must either both + /// be null or both be non-null. + /// + /// Note that, just as the pointers returned by GetAttrNameAt, the pointers that + /// this struct hold are only valid until the element or its attributes are + /// mutated (directly or via script). #[repr(C)] #[derive(Debug, Copy)] pub struct BorrowedAttrInfo { @@ -4175,6 +2789,7 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug)] pub struct NodeInfo { pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub _mOwningThread: root::nsAutoOwningThread, @@ -4206,19 +2821,21 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug)] + #[derive(Debug, Copy)] pub struct NodeInfo_NodeInfoInner { - pub mName: root::nsCOMPtr<root::nsIAtom>, - pub mPrefix: root::nsCOMPtr<root::nsIAtom>, + pub mName: *const root::nsIAtom, + pub mPrefix: *mut root::nsIAtom, pub mNamespaceID: i32, pub mNodeType: u16, pub mNameString: *const root::nsAString, - pub mExtraName: root::nsCOMPtr<root::nsIAtom>, + pub mExtraName: *mut root::nsIAtom, + pub mHash: root::PLHashNumber, + pub mHashInitialized: bool, } #[test] fn bindgen_test_layout_NodeInfo_NodeInfoInner() { assert_eq!(::std::mem::size_of::<NodeInfo_NodeInfoInner>() , - 40usize , concat ! ( + 48usize , concat ! ( "Size of: " , stringify ! ( NodeInfo_NodeInfoInner ) )); assert_eq! (::std::mem::align_of::<NodeInfo_NodeInfoInner>() , @@ -4267,6 +2884,23 @@ pub mod root { "Alignment of field: " , stringify ! ( NodeInfo_NodeInfoInner ) , "::" , stringify ! ( mExtraName ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const NodeInfo_NodeInfoInner ) ) . + mHash as * const _ as usize } , 40usize , concat ! + ( + "Alignment of field: " , stringify ! ( + NodeInfo_NodeInfoInner ) , "::" , stringify ! ( + mHash ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const NodeInfo_NodeInfoInner ) ) . + mHashInitialized as * const _ as usize } , 44usize + , concat ! ( + "Alignment of field: " , stringify ! ( + NodeInfo_NodeInfoInner ) , "::" , stringify ! ( + mHashInitialized ) )); + } + impl Clone for NodeInfo_NodeInfoInner { + fn clone(&self) -> Self { *self } } extern "C" { #[link_name = @@ -4276,7 +2910,7 @@ pub mod root { } #[test] fn bindgen_test_layout_NodeInfo() { - assert_eq!(::std::mem::size_of::<NodeInfo>() , 120usize , + assert_eq!(::std::mem::size_of::<NodeInfo>() , 128usize , concat ! ( "Size of: " , stringify ! ( NodeInfo ) )); assert_eq! (::std::mem::align_of::<NodeInfo>() , 8usize , @@ -4304,22 +2938,22 @@ pub mod root { , "::" , stringify ! ( mInner ) )); assert_eq! (unsafe { & ( * ( 0 as * const NodeInfo ) ) . mOwnerManager - as * const _ as usize } , 64usize , concat ! ( + as * const _ as usize } , 72usize , concat ! ( "Alignment of field: " , stringify ! ( NodeInfo ) , "::" , stringify ! ( mOwnerManager ) )); assert_eq! (unsafe { & ( * ( 0 as * const NodeInfo ) ) . mQualifiedName - as * const _ as usize } , 72usize , concat ! ( + as * const _ as usize } , 80usize , concat ! ( "Alignment of field: " , stringify ! ( NodeInfo ) , "::" , stringify ! ( mQualifiedName ) )); assert_eq! (unsafe { & ( * ( 0 as * const NodeInfo ) ) . mNodeName as * - const _ as usize } , 88usize , concat ! ( + const _ as usize } , 96usize , concat ! ( "Alignment of field: " , stringify ! ( NodeInfo ) , "::" , stringify ! ( mNodeName ) )); assert_eq! (unsafe { & ( * ( 0 as * const NodeInfo ) ) . mLocalName as - * const _ as usize } , 104usize , concat ! ( + * const _ as usize } , 112usize , concat ! ( "Alignment of field: " , stringify ! ( NodeInfo ) , "::" , stringify ! ( mLocalName ) )); } @@ -4345,47 +2979,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct AddEventListenerOptionsOrBoolean { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Event { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventListener { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventListenerOptionsOrBoolean { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug)] - pub struct EventHandlerNonNull { - pub _base: root::mozilla::dom::CallbackFunction, - } - #[test] - fn bindgen_test_layout_EventHandlerNonNull() { - assert_eq!(::std::mem::size_of::<EventHandlerNonNull>() , - 56usize , concat ! ( - "Size of: " , stringify ! ( EventHandlerNonNull ) - )); - assert_eq! (::std::mem::align_of::<EventHandlerNonNull>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( - EventHandlerNonNull ) )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AccessibleNode { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct BoxQuadOptions { _unused: [u8; 0], } @@ -4466,9 +3059,7 @@ pub mod root { #[repr(C)] #[derive(Debug, Copy)] pub struct OwningNodeOrString_Value { - pub mNode: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub mString: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub bindgen_union_field: [u64; 2usize], + pub _bindgen_opaque_blob: [u64; 2usize], } #[test] fn bindgen_test_layout_OwningNodeOrString_Value() { @@ -4480,20 +3071,6 @@ pub mod root { , 8usize , concat ! ( "Alignment of " , stringify ! ( OwningNodeOrString_Value ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OwningNodeOrString_Value ) ) - . mNode as * const _ as usize } , 0usize , concat - ! ( - "Alignment of field: " , stringify ! ( - OwningNodeOrString_Value ) , "::" , stringify ! ( - mNode ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OwningNodeOrString_Value ) ) - . mString as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - OwningNodeOrString_Value ) , "::" , stringify ! ( - mString ) )); } impl Clone for OwningNodeOrString_Value { fn clone(&self) -> Self { *self } @@ -4525,11 +3102,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct Text { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct TextOrElementOrDocument { _unused: [u8; 0], } @@ -4540,25 +3112,10 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct GetRootNodeOptions { + pub struct TabGroup { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Touch { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Selection { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug)] - pub struct UnionMember { - pub mStorage: root::mozilla::AlignedStorage2, - } - #[repr(C)] pub struct DispatcherTrait__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] #[derive(Debug, Copy)] @@ -4773,11 +3330,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct Performance { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct ServiceWorkerRegistration { _unused: [u8; 0], } @@ -4788,26 +3340,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct CustomElementRegistry { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Location { - _unused: [u8; 0], - } - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum LargeAllocStatus { - NONE = 0, - SUCCESS = 1, - NON_GET = 2, - NON_E10S = 3, - NOT_ONLY_TOPLEVEL_IN_TABGROUP = 4, - NON_WIN32 = 5, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct PrefSetting { _unused: [u8; 0], } @@ -5060,30 +3592,6 @@ pub mod root { } #[repr(C)] #[derive(Debug)] - pub struct CallbackObjectHolder { - pub mPtrBits: usize, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct CallbackObjectHolderBase { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_CallbackObjectHolderBase() { - assert_eq!(::std::mem::size_of::<CallbackObjectHolderBase>() , - 1usize , concat ! ( - "Size of: " , stringify ! ( - CallbackObjectHolderBase ) )); - assert_eq! (::std::mem::align_of::<CallbackObjectHolderBase>() - , 1usize , concat ! ( - "Alignment of " , stringify ! ( - CallbackObjectHolderBase ) )); - } - impl Clone for CallbackObjectHolderBase { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug)] pub struct CallbackFunction { pub _base: root::mozilla::dom::CallbackObject, } @@ -5117,125 +3625,6 @@ pub mod root { Prerender = 2, EndGuard_ = 3, } - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum FlashClassification { - Unclassified = 0, - Unknown = 1, - Allowed = 2, - Denied = 3, - EndGuard_ = 4, - } - #[repr(C)] - #[derive(Debug)] - pub struct ElementCreationOptions { - pub _base: root::mozilla::dom::DictionaryBase, - pub mIs: [u64; 3usize], - pub mPseudo: [u64; 3usize], - } - #[test] - fn bindgen_test_layout_ElementCreationOptions() { - assert_eq!(::std::mem::size_of::<ElementCreationOptions>() , - 56usize , concat ! ( - "Size of: " , stringify ! ( ElementCreationOptions - ) )); - assert_eq! (::std::mem::align_of::<ElementCreationOptions>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( - ElementCreationOptions ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ElementCreationOptions ) ) . - mIs as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - ElementCreationOptions ) , "::" , stringify ! ( - mIs ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ElementCreationOptions ) ) . - mPseudo as * const _ as usize } , 32usize , concat - ! ( - "Alignment of field: " , stringify ! ( - ElementCreationOptions ) , "::" , stringify ! ( - mPseudo ) )); - } - #[repr(C)] - #[derive(Debug)] - pub struct ElementCreationOptionsOrString { - pub mType: root::mozilla::dom::ElementCreationOptionsOrString_Type, - pub mValue: root::mozilla::dom::ElementCreationOptionsOrString_Value, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum ElementCreationOptionsOrString_Type { - eUninitialized = 0, - eElementCreationOptions = 1, - eString = 2, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ElementCreationOptionsOrString_Value { - pub mElementCreationOptions: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub mString: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub bindgen_union_field: [u64; 18usize], - } - #[test] - fn bindgen_test_layout_ElementCreationOptionsOrString_Value() { - assert_eq!(::std::mem::size_of::<ElementCreationOptionsOrString_Value>() - , 144usize , concat ! ( - "Size of: " , stringify ! ( - ElementCreationOptionsOrString_Value ) )); - assert_eq! (::std::mem::align_of::<ElementCreationOptionsOrString_Value>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - ElementCreationOptionsOrString_Value ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const ElementCreationOptionsOrString_Value - ) ) . mElementCreationOptions as * const _ as - usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - ElementCreationOptionsOrString_Value ) , "::" , - stringify ! ( mElementCreationOptions ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const ElementCreationOptionsOrString_Value - ) ) . mString as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ElementCreationOptionsOrString_Value ) , "::" , - stringify ! ( mString ) )); - } - impl Clone for ElementCreationOptionsOrString_Value { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_ElementCreationOptionsOrString() { - assert_eq!(::std::mem::size_of::<ElementCreationOptionsOrString>() - , 152usize , concat ! ( - "Size of: " , stringify ! ( - ElementCreationOptionsOrString ) )); - assert_eq! (::std::mem::align_of::<ElementCreationOptionsOrString>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - ElementCreationOptionsOrString ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const ElementCreationOptionsOrString ) - ) . mType as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ElementCreationOptionsOrString ) , "::" , - stringify ! ( mType ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const ElementCreationOptionsOrString ) - ) . mValue as * const _ as usize } , 8usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ElementCreationOptionsOrString ) , "::" , - stringify ! ( mValue ) )); - } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Animation { @@ -5247,6 +3636,7 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] + #[derive(Debug)] pub struct Attr { pub _base: root::nsIAttribute, pub _base_1: root::nsIDOMAttr, @@ -5291,41 +3681,7 @@ pub mod root { ( "Alignment of " , stringify ! ( Attr ) )); } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct BoxObject { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct CDATASection { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Comment { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DocumentFragment { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DocumentTimeline { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DocumentType { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DOMImplementation { - _unused: [u8; 0], - } - #[repr(C)] + #[derive(Debug)] pub struct DOMIntersectionObserver { pub _base: root::nsISupports, pub _base_1: root::nsWrapperCache, @@ -5386,16 +3742,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct DOMStringList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ElementRegistrationOptions { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct FontFaceSet { _unused: [u8; 0], } @@ -5427,11 +3773,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct HTMLBodyElement { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct Link { _unused: [u8; 0], } @@ -5442,147 +3783,95 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct NodeFilter { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct NodeIterator { - _unused: [u8; 0], - } - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum OrientationType { } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ProcessingInstruction { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ScriptLoader { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct StyleSheetList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGSVGElement { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct TouchList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct TreeWalker { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct XPathEvaluator { _unused: [u8; 0], } + pub type Record_EntryType<KeyType, ValueType> = + root::mozilla::dom::binding_detail::RecordEntry<KeyType, + ValueType>; #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct XPathExpression { - _unused: [u8; 0], + #[derive(Debug)] + pub struct URLParams { + pub mParams: root::nsTArray<root::mozilla::dom::URLParams_Param>, } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct XPathNSResolver { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct XPathResult { - _unused: [u8; 0], - } - pub type NodeFilterHolder = - root::mozilla::dom::CallbackObjectHolder; - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum ScrollBehavior { - Auto = 0, - Instant = 1, - Smooth = 2, - EndGuard_ = 3, - } + pub struct URLParams_ForEachIterator__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] #[derive(Debug, Copy)] - pub struct ScrollOptions { - pub _base: root::mozilla::dom::DictionaryBase, - pub mBehavior: root::mozilla::dom::ScrollBehavior, + pub struct URLParams_ForEachIterator { + pub vtable_: *const URLParams_ForEachIterator__bindgen_vtable, } #[test] - fn bindgen_test_layout_ScrollOptions() { - assert_eq!(::std::mem::size_of::<ScrollOptions>() , 2usize , - concat ! ( - "Size of: " , stringify ! ( ScrollOptions ) )); - assert_eq! (::std::mem::align_of::<ScrollOptions>() , 1usize , - concat ! ( - "Alignment of " , stringify ! ( ScrollOptions ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollOptions ) ) . mBehavior - as * const _ as usize } , 1usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollOptions ) , "::" , stringify ! ( mBehavior ) - )); + fn bindgen_test_layout_URLParams_ForEachIterator() { + assert_eq!(::std::mem::size_of::<URLParams_ForEachIterator>() + , 8usize , concat ! ( + "Size of: " , stringify ! ( + URLParams_ForEachIterator ) )); + assert_eq! (::std::mem::align_of::<URLParams_ForEachIterator>() + , 8usize , concat ! ( + "Alignment of " , stringify ! ( + URLParams_ForEachIterator ) )); } - impl Clone for ScrollOptions { + impl Clone for URLParams_ForEachIterator { fn clone(&self) -> Self { *self } } #[repr(C)] #[derive(Debug)] - pub struct ScrollToOptions { - pub _base: root::mozilla::dom::ScrollOptions, - pub mLeft: [u64; 2usize], - pub mTop: [u64; 2usize], + pub struct URLParams_Param { + pub mKey: ::nsstring::nsStringRepr, + pub mValue: ::nsstring::nsStringRepr, } #[test] - fn bindgen_test_layout_ScrollToOptions() { - assert_eq!(::std::mem::size_of::<ScrollToOptions>() , 40usize + fn bindgen_test_layout_URLParams_Param() { + assert_eq!(::std::mem::size_of::<URLParams_Param>() , 32usize , concat ! ( - "Size of: " , stringify ! ( ScrollToOptions ) )); - assert_eq! (::std::mem::align_of::<ScrollToOptions>() , 8usize + "Size of: " , stringify ! ( URLParams_Param ) )); + assert_eq! (::std::mem::align_of::<URLParams_Param>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( ScrollToOptions ) + "Alignment of " , stringify ! ( URLParams_Param ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ScrollToOptions ) ) . mLeft - as * const _ as usize } , 8usize , concat ! ( + & ( * ( 0 as * const URLParams_Param ) ) . mKey as + * const _ as usize } , 0usize , concat ! ( "Alignment of field: " , stringify ! ( - ScrollToOptions ) , "::" , stringify ! ( mLeft ) + URLParams_Param ) , "::" , stringify ! ( mKey ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ScrollToOptions ) ) . mTop as - * const _ as usize } , 24usize , concat ! ( + & ( * ( 0 as * const URLParams_Param ) ) . mValue + as * const _ as usize } , 16usize , concat ! ( "Alignment of field: " , stringify ! ( - ScrollToOptions ) , "::" , stringify ! ( mTop ) + URLParams_Param ) , "::" , stringify ! ( mValue ) )); } - /** - * StyleChildrenIterator traverses the children of the element from the - * perspective of the style system, particularly the children we need to - * traverse during restyle. - * - * At present, this is identical to AllChildrenIterator with - * (eAllChildren | eSkipDocumentLevelNativeAnonymousContent). We used to have - * detect and skip any native anonymous children that are used to implement some - * special magic in here that went away, but we keep the separate class so - * we can reintroduce special magic back if needed. - * - * Note: it assumes that no mutation of the DOM or frame tree takes place during - * iteration, and will break horribly if that is not true. - * - * We require this to be memmovable since Rust code can create and move - * StyleChildrenIterators. - */ + #[test] + fn bindgen_test_layout_URLParams() { + assert_eq!(::std::mem::size_of::<URLParams>() , 8usize , + concat ! ( "Size of: " , stringify ! ( URLParams ) + )); + assert_eq! (::std::mem::align_of::<URLParams>() , 8usize , + concat ! ( + "Alignment of " , stringify ! ( URLParams ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const URLParams ) ) . mParams as * + const _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( URLParams ) + , "::" , stringify ! ( mParams ) )); + } + /// StyleChildrenIterator traverses the children of the element from the + /// perspective of the style system, particularly the children we need to + /// traverse during restyle. + /// + /// At present, this is identical to AllChildrenIterator with + /// (eAllChildren | eSkipDocumentLevelNativeAnonymousContent). We used to have + /// detect and skip any native anonymous children that are used to implement some + /// special magic in here that went away, but we keep the separate class so + /// we can reintroduce special magic back if needed. + /// + /// Note: it assumes that no mutation of the DOM or frame tree takes place during + /// iteration, and will break horribly if that is not true. + /// + /// We require this to be memmovable since Rust code can create and move + /// StyleChildrenIterators. #[repr(C)] #[derive(Debug)] pub struct StyleChildrenIterator { @@ -5607,11 +3896,6 @@ pub mod root { Accumulate = 2, EndGuard_ = 3, } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct CSSPseudoElement { - _unused: [u8; 0], - } #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum IterationCompositeOperation { @@ -5620,81 +3904,6 @@ pub mod root { EndGuard_ = 2, } #[repr(C)] - #[derive(Debug)] - pub struct ElementOrCSSPseudoElement { - pub mType: root::mozilla::dom::ElementOrCSSPseudoElement_Type, - pub mValue: root::mozilla::dom::ElementOrCSSPseudoElement_Value, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum ElementOrCSSPseudoElement_Type { - eUninitialized = 0, - eElement = 1, - eCSSPseudoElement = 2, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ElementOrCSSPseudoElement_Value { - pub mElement: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub mCSSPseudoElement: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub bindgen_union_field: [u64; 2usize], - } - #[test] - fn bindgen_test_layout_ElementOrCSSPseudoElement_Value() { - assert_eq!(::std::mem::size_of::<ElementOrCSSPseudoElement_Value>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - ElementOrCSSPseudoElement_Value ) )); - assert_eq! (::std::mem::align_of::<ElementOrCSSPseudoElement_Value>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - ElementOrCSSPseudoElement_Value ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const ElementOrCSSPseudoElement_Value ) - ) . mElement as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ElementOrCSSPseudoElement_Value ) , "::" , - stringify ! ( mElement ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const ElementOrCSSPseudoElement_Value ) - ) . mCSSPseudoElement as * const _ as usize } , - 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - ElementOrCSSPseudoElement_Value ) , "::" , - stringify ! ( mCSSPseudoElement ) )); - } - impl Clone for ElementOrCSSPseudoElement_Value { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_ElementOrCSSPseudoElement() { - assert_eq!(::std::mem::size_of::<ElementOrCSSPseudoElement>() - , 24usize , concat ! ( - "Size of: " , stringify ! ( - ElementOrCSSPseudoElement ) )); - assert_eq! (::std::mem::align_of::<ElementOrCSSPseudoElement>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - ElementOrCSSPseudoElement ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ElementOrCSSPseudoElement ) ) - . mType as * const _ as usize } , 0usize , concat - ! ( - "Alignment of field: " , stringify ! ( - ElementOrCSSPseudoElement ) , "::" , stringify ! ( - mType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ElementOrCSSPseudoElement ) ) - . mValue as * const _ as usize } , 8usize , concat - ! ( - "Alignment of field: " , stringify ! ( - ElementOrCSSPseudoElement ) , "::" , stringify ! ( - mValue ) )); - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct XBLChildrenElement { _unused: [u8; 0], @@ -5705,13 +3914,12 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] + #[derive(Debug)] pub struct FragmentOrElement { pub _base: root::nsIContent, pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub _mOwningThread: root::nsAutoOwningThread, - /** - * Array containing all attributes and children for this element - */ + /// Array containing all attributes and children for this element pub mAttrsAndChildren: root::nsAttrAndChildArray, } pub type FragmentOrElement_HasThreadSafeRefCnt = @@ -5735,70 +3943,43 @@ pub mod root { impl Clone for FragmentOrElement_cycleCollection { fn clone(&self) -> Self { *self } } - /** - * There are a set of DOM- and scripting-specific instance variables - * that may only be instantiated when a content object is accessed - * through the DOM. Rather than burn actual slots in the content - * objects for each of these instance variables, we put them off - * in a side structure that's only allocated when the content is - * accessed through the DOM. - */ + /// There are a set of DOM- and scripting-specific instance variables + /// that may only be instantiated when a content object is accessed + /// through the DOM. Rather than burn actual slots in the content + /// objects for each of these instance variables, we put them off + /// in a side structure that's only allocated when the content is + /// accessed through the DOM. #[repr(C)] + #[derive(Debug)] pub struct FragmentOrElement_nsExtendedDOMSlots { - /** - * SMIL Overridde style rules (for SMIL animation of CSS properties) - * @see Element::GetSMILOverrideStyle - */ + /// SMIL Overridde style rules (for SMIL animation of CSS properties) + /// @see Element::GetSMILOverrideStyle pub mSMILOverrideStyle: root::nsCOMPtr<root::nsICSSDeclaration>, - /** - * Holds any SMIL override style declaration for this element. - */ + /// Holds any SMIL override style declaration for this element. pub mSMILOverrideStyleDeclaration: root::RefPtr<root::mozilla::DeclarationBlock>, - /** - * The nearest enclosing content node with a binding that created us. - * @see FragmentOrElement::GetBindingParent - */ + /// The nearest enclosing content node with a binding that created us. + /// @see FragmentOrElement::GetBindingParent pub mBindingParent: *mut root::nsIContent, - /** - * The controllers of the XUL Element. - */ + /// The controllers of the XUL Element. pub mControllers: root::nsCOMPtr<root::nsIControllers>, - /** - * An object implementing the .labels property for this element. - */ + /// An object implementing the .labels property for this element. pub mLabelsList: root::RefPtr<root::nsLabelsNodeList>, - /** - * ShadowRoot bound to the element. - */ + /// ShadowRoot bound to the element. pub mShadowRoot: root::RefPtr<root::mozilla::dom::ShadowRoot>, - /** - * The root ShadowRoot of this element if it is in a shadow tree. - */ + /// The root ShadowRoot of this element if it is in a shadow tree. pub mContainingShadow: root::RefPtr<root::mozilla::dom::ShadowRoot>, - /** - * An array of web component insertion points to which this element - * is distributed. - */ + /// An array of web component insertion points to which this element + /// is distributed. pub mDestInsertionPoints: root::nsTArray<*mut root::nsIContent>, - /** - * XBL binding installed on the element. - */ + /// XBL binding installed on the element. pub mXBLBinding: root::RefPtr<root::nsXBLBinding>, - /** - * XBL binding installed on the lement. - */ + /// XBL binding installed on the lement. pub mXBLInsertionParent: root::nsCOMPtr<root::nsIContent>, - /** - * Web components custom element data. - */ + /// Web components custom element data. pub mCustomElementData: root::RefPtr<root::mozilla::dom::CustomElementData>, - /** - * Registered Intersection Observers on the element. - */ + /// Registered Intersection Observers on the element. pub mRegisteredIntersectionObservers: [u64; 6usize], - /** - * For XUL to hold either frameloader or opener. - */ + /// For XUL to hold either frameloader or opener. pub mFrameLoaderOrOpener: root::nsCOMPtr<root::nsISupports>, } #[test] @@ -5931,38 +4112,29 @@ pub mod root { stringify ! ( mFrameLoaderOrOpener ) )); } #[repr(C)] + #[derive(Debug)] pub struct FragmentOrElement_nsDOMSlots { pub _base: root::nsINode_nsSlots, - /** - * The .style attribute (an interface that forwards to the actual - * style rules) - * @see nsGenericHTMLElement::GetStyle - */ + /// The .style attribute (an interface that forwards to the actual + /// style rules) + /// @see nsGenericHTMLElement::GetStyle pub mStyle: root::nsCOMPtr<root::nsICSSDeclaration>, - /** - * The .dataset attribute. - * @see nsGenericHTMLElement::GetDataset - */ + /// The .dataset attribute. + /// @see nsGenericHTMLElement::GetDataset pub mDataset: *mut root::nsDOMStringMap, - /** - * An object implementing nsIDOMMozNamedAttrMap for this content (attributes) - * @see FragmentOrElement::GetAttributes - */ + /// An object implementing nsIDOMMozNamedAttrMap for this content (attributes) + /// @see FragmentOrElement::GetAttributes pub mAttributeMap: root::RefPtr<root::nsDOMAttributeMap>, - /** - * An object implementing the .children property for this element. - */ + /// An object implementing the .children property for this element. pub mChildrenList: root::RefPtr<root::nsContentList>, - /** - * An object implementing the .classList property for this element. - */ + /// An object implementing the .classList property for this element. pub mClassList: root::RefPtr<root::nsDOMTokenList>, pub mExtendedSlots: root::mozilla::UniquePtr<root::mozilla::dom::FragmentOrElement_nsExtendedDOMSlots>, } #[test] fn bindgen_test_layout_FragmentOrElement_nsDOMSlots() { assert_eq!(::std::mem::size_of::<FragmentOrElement_nsDOMSlots>() - , 96usize , concat ! ( + , 120usize , concat ! ( "Size of: " , stringify ! ( FragmentOrElement_nsDOMSlots ) )); assert_eq! (::std::mem::align_of::<FragmentOrElement_nsDOMSlots>() @@ -5972,7 +4144,7 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const FragmentOrElement_nsDOMSlots ) ) - . mStyle as * const _ as usize } , 48usize , + . mStyle as * const _ as usize } , 72usize , concat ! ( "Alignment of field: " , stringify ! ( FragmentOrElement_nsDOMSlots ) , "::" , stringify @@ -5980,7 +4152,7 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const FragmentOrElement_nsDOMSlots ) ) - . mDataset as * const _ as usize } , 56usize , + . mDataset as * const _ as usize } , 80usize , concat ! ( "Alignment of field: " , stringify ! ( FragmentOrElement_nsDOMSlots ) , "::" , stringify @@ -5988,7 +4160,7 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const FragmentOrElement_nsDOMSlots ) ) - . mAttributeMap as * const _ as usize } , 64usize + . mAttributeMap as * const _ as usize } , 88usize , concat ! ( "Alignment of field: " , stringify ! ( FragmentOrElement_nsDOMSlots ) , "::" , stringify @@ -5996,7 +4168,7 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const FragmentOrElement_nsDOMSlots ) ) - . mChildrenList as * const _ as usize } , 72usize + . mChildrenList as * const _ as usize } , 96usize , concat ! ( "Alignment of field: " , stringify ! ( FragmentOrElement_nsDOMSlots ) , "::" , stringify @@ -6004,7 +4176,7 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const FragmentOrElement_nsDOMSlots ) ) - . mClassList as * const _ as usize } , 80usize , + . mClassList as * const _ as usize } , 104usize , concat ! ( "Alignment of field: " , stringify ! ( FragmentOrElement_nsDOMSlots ) , "::" , stringify @@ -6012,8 +4184,8 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const FragmentOrElement_nsDOMSlots ) ) - . mExtendedSlots as * const _ as usize } , 88usize - , concat ! ( + . mExtendedSlots as * const _ as usize } , + 112usize , concat ! ( "Alignment of field: " , stringify ! ( FragmentOrElement_nsDOMSlots ) , "::" , stringify ! ( mExtendedSlots ) )); @@ -6056,11 +4228,6 @@ pub mod root { mAttrsAndChildren ) )); } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGAnimationElement { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug)] pub struct DOMRect { pub _base: root::mozilla::dom::DOMRectReadOnly, @@ -6080,89 +4247,6 @@ pub mod root { } #[repr(C)] #[derive(Debug)] - pub struct DOMRectList { - pub _base: root::nsIDOMClientRectList, - pub _base_1: root::nsWrapperCache, - pub mRefCnt: root::nsCycleCollectingAutoRefCnt, - pub _mOwningThread: root::nsAutoOwningThread, - pub mArray: root::nsTArray<root::RefPtr<root::mozilla::dom::DOMRect>>, - pub mParent: root::nsCOMPtr<root::nsISupports>, - } - pub type DOMRectList_HasThreadSafeRefCnt = - root::mozilla::FalseType; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct DOMRectList_cycleCollection { - pub _base: root::nsXPCOMCycleCollectionParticipant, - } - #[test] - fn bindgen_test_layout_DOMRectList_cycleCollection() { - assert_eq!(::std::mem::size_of::<DOMRectList_cycleCollection>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - DOMRectList_cycleCollection ) )); - assert_eq! (::std::mem::align_of::<DOMRectList_cycleCollection>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - DOMRectList_cycleCollection ) )); - } - impl Clone for DOMRectList_cycleCollection { - fn clone(&self) -> Self { *self } - } - extern "C" { - #[link_name = - "_ZN7mozilla3dom11DOMRectList21_cycleCollectorGlobalE"] - pub static mut DOMRectList__cycleCollectorGlobal: - root::mozilla::dom::DOMRectList_cycleCollection; - } - #[test] - fn bindgen_test_layout_DOMRectList() { - assert_eq!(::std::mem::size_of::<DOMRectList>() , 64usize , - concat ! ( - "Size of: " , stringify ! ( DOMRectList ) )); - assert_eq! (::std::mem::align_of::<DOMRectList>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( DOMRectList ) )); - } - pub type DOMTokenListSupportedToken = - *const ::std::os::raw::c_char; - pub type DOMTokenListSupportedTokenArray = - *mut root::mozilla::dom::DOMTokenListSupportedToken; - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum ScrollLogicalPosition { - Start = 0, - End = 1, - EndGuard_ = 2, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ScrollIntoViewOptions { - pub _base: root::mozilla::dom::ScrollOptions, - pub mBlock: root::mozilla::dom::ScrollLogicalPosition, - } - #[test] - fn bindgen_test_layout_ScrollIntoViewOptions() { - assert_eq!(::std::mem::size_of::<ScrollIntoViewOptions>() , - 3usize , concat ! ( - "Size of: " , stringify ! ( ScrollIntoViewOptions ) - )); - assert_eq! (::std::mem::align_of::<ScrollIntoViewOptions>() , - 1usize , concat ! ( - "Alignment of " , stringify ! ( - ScrollIntoViewOptions ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollIntoViewOptions ) ) . - mBlock as * const _ as usize } , 2usize , concat ! - ( - "Alignment of field: " , stringify ! ( - ScrollIntoViewOptions ) , "::" , stringify ! ( - mBlock ) )); - } - impl Clone for ScrollIntoViewOptions { - fn clone(&self) -> Self { *self } - } - #[repr(C)] pub struct DOMIntersectionObserverEntry { pub _base: root::nsISupports, pub _base_1: root::nsWrapperCache, @@ -6233,219 +4317,6 @@ pub mod root { IntersectionCallback ) )); } #[repr(C)] - #[derive(Debug)] - pub struct OwningDoubleOrDoubleSequence { - pub mType: root::mozilla::dom::OwningDoubleOrDoubleSequence_Type, - pub mValue: root::mozilla::dom::OwningDoubleOrDoubleSequence_Value, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum OwningDoubleOrDoubleSequence_Type { - eUninitialized = 0, - eDouble = 1, - eDoubleSequence = 2, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct OwningDoubleOrDoubleSequence_Value { - pub mDouble: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub mDoubleSequence: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub bindgen_union_field: u64, - } - #[test] - fn bindgen_test_layout_OwningDoubleOrDoubleSequence_Value() { - assert_eq!(::std::mem::size_of::<OwningDoubleOrDoubleSequence_Value>() - , 8usize , concat ! ( - "Size of: " , stringify ! ( - OwningDoubleOrDoubleSequence_Value ) )); - assert_eq! (::std::mem::align_of::<OwningDoubleOrDoubleSequence_Value>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - OwningDoubleOrDoubleSequence_Value ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const OwningDoubleOrDoubleSequence_Value ) - ) . mDouble as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - OwningDoubleOrDoubleSequence_Value ) , "::" , - stringify ! ( mDouble ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const OwningDoubleOrDoubleSequence_Value ) - ) . mDoubleSequence as * const _ as usize } , - 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - OwningDoubleOrDoubleSequence_Value ) , "::" , - stringify ! ( mDoubleSequence ) )); - } - impl Clone for OwningDoubleOrDoubleSequence_Value { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_OwningDoubleOrDoubleSequence() { - assert_eq!(::std::mem::size_of::<OwningDoubleOrDoubleSequence>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - OwningDoubleOrDoubleSequence ) )); - assert_eq! (::std::mem::align_of::<OwningDoubleOrDoubleSequence>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - OwningDoubleOrDoubleSequence ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const OwningDoubleOrDoubleSequence ) ) - . mType as * const _ as usize } , 0usize , concat - ! ( - "Alignment of field: " , stringify ! ( - OwningDoubleOrDoubleSequence ) , "::" , stringify - ! ( mType ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const OwningDoubleOrDoubleSequence ) ) - . mValue as * const _ as usize } , 8usize , concat - ! ( - "Alignment of field: " , stringify ! ( - OwningDoubleOrDoubleSequence ) , "::" , stringify - ! ( mValue ) )); - } - #[repr(C)] - pub struct IntersectionObserverInit { - pub _base: root::mozilla::dom::DictionaryBase, - pub mRoot: root::RefPtr<root::mozilla::dom::Element>, - pub mRootMargin: ::nsstring::nsStringRepr, - pub mThreshold: root::mozilla::dom::OwningDoubleOrDoubleSequence, - } - #[test] - fn bindgen_test_layout_IntersectionObserverInit() { - assert_eq!(::std::mem::size_of::<IntersectionObserverInit>() , - 48usize , concat ! ( - "Size of: " , stringify ! ( - IntersectionObserverInit ) )); - assert_eq! (::std::mem::align_of::<IntersectionObserverInit>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - IntersectionObserverInit ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const IntersectionObserverInit ) ) - . mRoot as * const _ as usize } , 8usize , concat - ! ( - "Alignment of field: " , stringify ! ( - IntersectionObserverInit ) , "::" , stringify ! ( - mRoot ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const IntersectionObserverInit ) ) - . mRootMargin as * const _ as usize } , 16usize , - concat ! ( - "Alignment of field: " , stringify ! ( - IntersectionObserverInit ) , "::" , stringify ! ( - mRootMargin ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const IntersectionObserverInit ) ) - . mThreshold as * const _ as usize } , 32usize , - concat ! ( - "Alignment of field: " , stringify ! ( - IntersectionObserverInit ) , "::" , stringify ! ( - mThreshold ) )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AnimationFilter { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DOMMatrixReadOnly { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct UnrestrictedDoubleOrKeyframeAnimationOptions { - _unused: [u8; 0], - } - #[repr(C)] - pub struct DestinationInsertionPointList { - pub _base: root::nsINodeList, - pub mRefCnt: root::nsCycleCollectingAutoRefCnt, - pub _mOwningThread: root::nsAutoOwningThread, - pub mParent: root::RefPtr<root::mozilla::dom::Element>, - pub mDestinationPoints: root::nsCOMArray, - } - pub type DestinationInsertionPointList_HasThreadSafeRefCnt = - root::mozilla::FalseType; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct DestinationInsertionPointList_cycleCollection { - pub _base: root::nsXPCOMCycleCollectionParticipant, - } - #[test] - fn bindgen_test_layout_DestinationInsertionPointList_cycleCollection() { - assert_eq!(::std::mem::size_of::<DestinationInsertionPointList_cycleCollection>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - DestinationInsertionPointList_cycleCollection ) )); - assert_eq! (::std::mem::align_of::<DestinationInsertionPointList_cycleCollection>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - DestinationInsertionPointList_cycleCollection ) - )); - } - impl Clone for DestinationInsertionPointList_cycleCollection { - fn clone(&self) -> Self { *self } - } - extern "C" { - #[link_name = - "_ZN7mozilla3dom29DestinationInsertionPointList21_cycleCollectorGlobalE"] - pub static mut - DestinationInsertionPointList__cycleCollectorGlobal: - root::mozilla::dom::DestinationInsertionPointList_cycleCollection; - } - #[test] - fn bindgen_test_layout_DestinationInsertionPointList() { - assert_eq!(::std::mem::size_of::<DestinationInsertionPointList>() - , 64usize , concat ! ( - "Size of: " , stringify ! ( - DestinationInsertionPointList ) )); - assert_eq! (::std::mem::align_of::<DestinationInsertionPointList>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - DestinationInsertionPointList ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const DestinationInsertionPointList ) ) - . mRefCnt as * const _ as usize } , 32usize , - concat ! ( - "Alignment of field: " , stringify ! ( - DestinationInsertionPointList ) , "::" , stringify - ! ( mRefCnt ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const DestinationInsertionPointList ) ) - . _mOwningThread as * const _ as usize } , 40usize - , concat ! ( - "Alignment of field: " , stringify ! ( - DestinationInsertionPointList ) , "::" , stringify - ! ( _mOwningThread ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const DestinationInsertionPointList ) ) - . mParent as * const _ as usize } , 48usize , - concat ! ( - "Alignment of field: " , stringify ! ( - DestinationInsertionPointList ) , "::" , stringify - ! ( mParent ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const DestinationInsertionPointList ) ) - . mDestinationPoints as * const _ as usize } , - 56usize , concat ! ( - "Alignment of field: " , stringify ! ( - DestinationInsertionPointList ) , "::" , stringify - ! ( mDestinationPoints ) )); - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Grid { _unused: [u8; 0], @@ -6537,15 +4408,13 @@ pub mod root { FlattenedChildIterator ) , "::" , stringify ! ( mXBLInvolved ) )); } - /** - * AllChildrenIterator traverses the children of an element including before / - * after content and optionally XBL children. The iterator can be initialized - * to start at the end by providing false for aStartAtBeginning in order to - * start iterating in reverse from the last child. - * - * Note: it assumes that no mutation of the DOM or frame tree takes place during - * iteration, and will break horribly if that is not true. - */ + /// AllChildrenIterator traverses the children of an element including before / + /// after content and optionally XBL children. The iterator can be initialized + /// to start at the end by providing false for aStartAtBeginning in order to + /// start iterating in reverse from the last child. + /// + /// Note: it assumes that no mutation of the DOM or frame tree takes place during + /// iteration, and will break horribly if that is not true. #[repr(C)] #[derive(Debug)] pub struct AllChildrenIterator { @@ -6620,41 +4489,14 @@ pub mod root { AllChildrenIterator ) , "::" , stringify ! ( mMutationGuard ) )); } - /** - * CSSValue - a DOM object representing values in DOM computed style. - */ - #[repr(C)] - #[derive(Debug)] - pub struct CSSValue { - pub _base: root::nsISupports, - pub _base_1: root::nsWrapperCache, - } - #[test] - fn bindgen_test_layout_CSSValue() { - assert_eq!(::std::mem::size_of::<CSSValue>() , 32usize , - concat ! ( "Size of: " , stringify ! ( CSSValue ) - )); - assert_eq! (::std::mem::align_of::<CSSValue>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( CSSValue ) )); - } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct CSSVariableResolver { - _unused: [u8; 0], } #[repr(C)] #[derive(Debug)] pub struct CSSVariableValues { - /** - * Map of variable names to IDs. Variable IDs are indexes into - * mVariables. - */ + /// Map of variable names to IDs. Variable IDs are indexes into + /// mVariables. pub mVariableIDs: [u64; 6usize], - /** - * Array of variables, indexed by variable ID. - */ + /// Array of variables, indexed by variable ID. pub mVariables: root::nsTArray<root::mozilla::CSSVariableValues_Variable>, } #[repr(C)] @@ -6742,39 +4584,11 @@ pub mod root { Count = 9, Unknown = 255, } - /** - * StaticAutoPtr and StaticRefPtr are like nsAutoPtr and nsRefPtr, except they - * are suitable for use as global variables. - * - * In particular, a global instance of Static{Auto,Ref}Ptr doesn't cause the - * compiler to emit a static initializer (in release builds, anyway). - * - * In order to accomplish this, Static{Auto,Ref}Ptr must have a trivial - * constructor and destructor. As a consequence, it cannot initialize its raw - * pointer to 0 on construction, and it cannot delete/release its raw pointer - * upon destruction. - * - * Since the compiler guarantees that all global variables are initialized to - * 0, these trivial constructors are safe. Since we rely on this, the clang - * plugin, run as part of our "static analysis" builds, makes it a compile-time - * error to use Static{Auto,Ref}Ptr as anything except a global variable. - * - * Static{Auto,Ref}Ptr have a limited interface as compared to ns{Auto,Ref}Ptr; - * this is intentional, since their range of acceptable uses is smaller. - */ - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct StaticAutoPtr<T> { - pub mRawPtr: *mut T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } - /** - * This struct represents a combined color from a numeric color and - * the current foreground color (currentcolor keyword). - * Conceptually, the formula is "color * (1 - p) + currentcolor * p" - * where p is mForegroundRatio. See mozilla::LinearBlendColors for - * the actual algorithm. - */ + /// This struct represents a combined color from a numeric color and + /// the current foreground color (currentcolor keyword). + /// Conceptually, the formula is "color * (1 - p) + currentcolor * p" + /// where p is mForegroundRatio. See mozilla::LinearBlendColors for + /// the actual algorithm. #[repr(C)] #[derive(Debug, Copy)] pub struct StyleComplexColor { @@ -6844,11 +4658,9 @@ pub mod root { root::mozilla::FontFamilyType = FontFamilyType::eFamily_monospace; #[repr(u32)] - /** - * type of font family name, either a name (e.g. Helvetica) or a - * generic (e.g. serif, sans-serif), with the ability to distinguish - * between unquoted and quoted names for serializaiton - */ + /// type of font family name, either a name (e.g. Helvetica) or a + /// generic (e.g. serif, sans-serif), with the ability to distinguish + /// between unquoted and quoted names for serializaiton #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum FontFamilyType { eFamily_none = 0, @@ -6862,10 +4674,8 @@ pub mod root { eFamily_moz_variable = 8, eFamily_moz_fixed = 9, } - /** - * font family name, a string for the name if not a generic and - * a font type indicated named family or which generic family - */ + /// font family name, a string for the name if not a generic and + /// a font type indicated named family or which generic family #[repr(C)] #[derive(Debug)] pub struct FontFamilyName { @@ -6891,11 +4701,9 @@ pub mod root { "Alignment of field: " , stringify ! ( FontFamilyName ) , "::" , stringify ! ( mName ) )); } - /** - * font family list, array of font families and a default font type. - * font family names are either named strings or generics. the default - * font type is used to preserve the variable font fallback behavior - */ + /// font family list, array of font families and a default font type. + /// font family names are either named strings or generics. the default + /// font type is used to preserve the variable font fallback behavior #[repr(C)] #[derive(Debug)] pub struct FontFamilyList { @@ -7146,44 +4954,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct WritingMode { - _unused: [u8; 0], - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum LogicalSide { - eLogicalSideBStart = 0, - eLogicalSideBEnd = 1, - eLogicalSideIStart = 2, - eLogicalSideIEnd = 3, - } - /** - * Additional data used in conjunction with an nsRestyleHint to control the - * restyle process. - */ - #[repr(C)] - #[derive(Debug)] - pub struct RestyleHintData { - pub mSelectorsForDescendants: root::nsTArray<*mut root::nsCSSSelector>, - } - #[test] - fn bindgen_test_layout_RestyleHintData() { - assert_eq!(::std::mem::size_of::<RestyleHintData>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( RestyleHintData ) )); - assert_eq! (::std::mem::align_of::<RestyleHintData>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( RestyleHintData ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const RestyleHintData ) ) . - mSelectorsForDescendants as * const _ as usize } , - 0usize , concat ! ( - "Alignment of field: " , stringify ! ( RestyleHintData - ) , "::" , stringify ! ( mSelectorsForDescendants ) - )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct NotNull<T> { pub mBasePtr: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, @@ -7199,307 +4969,14 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct WidgetEvent { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct WidgetGUIEvent { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct WidgetInputEvent { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct WidgetPointerEvent { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventFlags { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct ShortcutKeyCandidate { _unused: [u8; 0], } - pub const FlushType_Frames: root::mozilla::FlushType = - FlushType::Style; - #[repr(u8)] - /** - * This is the enum used by nsIDocument::FlushPendingNotifications to - * decide what to flush. - * - * Please note that if you change these values, you should sync it with the - * flushTypeNames array inside PresShell::FlushPendingNotifications. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum FlushType { - None = 0, - Content = 1, - ContentAndNotify = 2, - Style = 3, - EnsurePresShellInitAndFrames = 4, - InterruptibleLayout = 5, - Layout = 6, - Display = 7, - Count = 8, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ChangesToFlush { - pub mFlushType: root::mozilla::FlushType, - pub mFlushAnimations: bool, - } - #[test] - fn bindgen_test_layout_ChangesToFlush() { - assert_eq!(::std::mem::size_of::<ChangesToFlush>() , 2usize , - concat ! ( "Size of: " , stringify ! ( ChangesToFlush ) - )); - assert_eq! (::std::mem::align_of::<ChangesToFlush>() , 1usize , - concat ! ( - "Alignment of " , stringify ! ( ChangesToFlush ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ChangesToFlush ) ) . mFlushType - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( ChangesToFlush - ) , "::" , stringify ! ( mFlushType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ChangesToFlush ) ) . - mFlushAnimations as * const _ as usize } , 1usize , - concat ! ( - "Alignment of field: " , stringify ! ( ChangesToFlush - ) , "::" , stringify ! ( mFlushAnimations ) )); - } - impl Clone for ChangesToFlush { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct CSSPixel { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_CSSPixel() { - assert_eq!(::std::mem::size_of::<CSSPixel>() , 1usize , concat ! ( - "Size of: " , stringify ! ( CSSPixel ) )); - assert_eq! (::std::mem::align_of::<CSSPixel>() , 1usize , concat ! - ( "Alignment of " , stringify ! ( CSSPixel ) )); - } - impl Clone for CSSPixel { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct LayoutDevicePixel { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_LayoutDevicePixel() { - assert_eq!(::std::mem::size_of::<LayoutDevicePixel>() , 1usize , - concat ! ( - "Size of: " , stringify ! ( LayoutDevicePixel ) )); - assert_eq! (::std::mem::align_of::<LayoutDevicePixel>() , 1usize , - concat ! ( - "Alignment of " , stringify ! ( LayoutDevicePixel ) - )); - } - impl Clone for LayoutDevicePixel { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct LayerPixel { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_LayerPixel() { - assert_eq!(::std::mem::size_of::<LayerPixel>() , 1usize , concat ! - ( "Size of: " , stringify ! ( LayerPixel ) )); - assert_eq! (::std::mem::align_of::<LayerPixel>() , 1usize , concat - ! ( "Alignment of " , stringify ! ( LayerPixel ) )); - } - impl Clone for LayerPixel { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ScreenPixel { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_ScreenPixel() { - assert_eq!(::std::mem::size_of::<ScreenPixel>() , 1usize , concat - ! ( "Size of: " , stringify ! ( ScreenPixel ) )); - assert_eq! (::std::mem::align_of::<ScreenPixel>() , 1usize , - concat ! ( - "Alignment of " , stringify ! ( ScreenPixel ) )); - } - impl Clone for ScreenPixel { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ParentLayerPixel { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_ParentLayerPixel() { - assert_eq!(::std::mem::size_of::<ParentLayerPixel>() , 1usize , - concat ! ( - "Size of: " , stringify ! ( ParentLayerPixel ) )); - assert_eq! (::std::mem::align_of::<ParentLayerPixel>() , 1usize , - concat ! ( - "Alignment of " , stringify ! ( ParentLayerPixel ) )); - } - impl Clone for ParentLayerPixel { - fn clone(&self) -> Self { *self } - } - pub type CSSPoint = [u32; 2usize]; - pub type CSSIntPoint = [u32; 2usize]; - pub type CSSSize = [u32; 2usize]; - pub type CSSRect = [u32; 4usize]; - pub type LayoutDeviceIntPoint = [u32; 2usize]; - pub type LayoutDeviceIntSize = [u32; 2usize]; - pub type LayoutDeviceIntRect = [u32; 4usize]; - pub type ScreenIntSize = u8; - pub type ScreenMargin = [u32; 4usize]; - pub type ParentLayerRect = [u32; 4usize]; - pub type ParentLayerIntRect = [u32; 4usize]; - pub type CSSToLayoutDeviceScale = u32; - pub type CSSToParentLayerScale2D = [u32; 2usize]; - pub type LayoutDeviceToLayerScale2D = [u32; 2usize]; - pub type ScreenToLayerScale2D = [u32; 2usize]; - pub type TimeStampValue = u64; - /** - * Instances of this class represent moments in time, or a special - * "null" moment. We do not use the non-monotonic system clock or - * local time, since they can be reset, causing apparent backward - * travel in time, which can confuse algorithms. Instead we measure - * elapsed time according to the system. This time can never go - * backwards (i.e. it never wraps around, at least not in less than - * five million years of system elapsed time). It might not advance - * while the system is sleeping. If TimeStamp::SetNow() is not called - * at all for hours or days, we might not notice the passage of some - * of that time. - * - * We deliberately do not expose a way to convert TimeStamps to some - * particular unit. All you can do is compute a difference between two - * TimeStamps to get a TimeDuration. You can also add a TimeDuration - * to a TimeStamp to get a new TimeStamp. You can't do something - * meaningless like add two TimeStamps. - * - * Internally this is implemented as either a wrapper around - * - high-resolution, monotonic, system clocks if they exist on this - * platform - * - PRIntervalTime otherwise. We detect wraparounds of - * PRIntervalTime and work around them. - * - * This class is similar to C++11's time_point, however it is - * explicitly nullable and provides an IsNull() method. time_point - * is initialized to the clock's epoch and provides a - * time_since_epoch() method that functions similiarly. i.e. - * t.IsNull() is equivalent to t.time_since_epoch() == decltype(t)::duration::zero(); - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct TimeStamp { - /** - * When built with PRIntervalTime, a value of 0 means this instance - * is "null". Otherwise, the low 32 bits represent a PRIntervalTime, - * and the high 32 bits represent a counter of the number of - * rollovers of PRIntervalTime that we've seen. This counter starts - * at 1 to avoid a real time colliding with the "null" value. - * - * PR_INTERVAL_MAX is set at 100,000 ticks per second. So the minimum - * time to wrap around is about 2^64/100000 seconds, i.e. about - * 5,849,424 years. - * - * When using a system clock, a value is system dependent. - */ - pub mValue: root::mozilla::TimeStampValue, - } - #[test] - fn bindgen_test_layout_TimeStamp() { - assert_eq!(::std::mem::size_of::<TimeStamp>() , 8usize , concat ! - ( "Size of: " , stringify ! ( TimeStamp ) )); - assert_eq! (::std::mem::align_of::<TimeStamp>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( TimeStamp ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const TimeStamp ) ) . mValue as * const - _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( TimeStamp ) , - "::" , stringify ! ( mValue ) )); - } - impl Clone for TimeStamp { - fn clone(&self) -> Self { *self } - } - /** - * Instances of this class represent the length of an interval of time. - * Negative durations are allowed, meaning the end is before the start. - * - * Internally the duration is stored as a int64_t in units of - * PR_TicksPerSecond() when building with NSPR interval timers, or a - * system-dependent unit when building with system clocks. The - * system-dependent unit must be constant, otherwise the semantics of - * this class would be broken. - * - * The ValueCalculator template parameter determines how arithmetic - * operations are performed on the integer count of ticks (mValue). - */ - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct BaseTimeDuration { - pub mValue: i64, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct BaseTimeDuration__SomethingVeryRandomHere { - pub _address: u8, - } - /** - * Perform arithmetic operations on the value of a BaseTimeDuration without - * doing strict checks on the range of values. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct TimeDurationValueCalculator { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_TimeDurationValueCalculator() { - assert_eq!(::std::mem::size_of::<TimeDurationValueCalculator>() , - 1usize , concat ! ( - "Size of: " , stringify ! ( TimeDurationValueCalculator - ) )); - assert_eq! (::std::mem::align_of::<TimeDurationValueCalculator>() - , 1usize , concat ! ( - "Alignment of " , stringify ! ( - TimeDurationValueCalculator ) )); - } - impl Clone for TimeDurationValueCalculator { - fn clone(&self) -> Self { *self } - } - /** - * Specialization of BaseTimeDuration that uses TimeDurationValueCalculator for - * arithmetic on the mValue member. - * - * Use this class for time durations that are *not* expected to hold values of - * Forever (or the negative equivalent) or when such time duration are *not* - * expected to be used in arithmetic operations. - */ - pub type TimeDuration = root::mozilla::BaseTimeDuration; - /** - * EventStates is the class used to represent the event states of nsIContent - * instances. These states are calculated by IntrinsicState() and - * ContentStatesChanged() has to be called when one of them changes thus - * informing the layout/style engine of the change. - * Event states are associated with pseudo-classes. - */ + /// EventStates is the class used to represent the event states of nsIContent + /// instances. These states are calculated by IntrinsicState() and + /// ContentStatesChanged() has to be called when one of them changes thus + /// informing the layout/style engine of the change. + /// Event states are associated with pseudo-classes. #[repr(C)] #[derive(Debug, Copy)] pub struct EventStates { @@ -7523,24 +5000,31 @@ pub mod root { impl Clone for EventStates { fn clone(&self) -> Self { *self } } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum LazyComputeBehavior { Allow = 0, Assert = 1, } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum TraversalRootBehavior { - Normal = 0, - UnstyledChildrenOnly = 1, - } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum TraversalRestyleBehavior { - Normal = 0, - ForNewlyBoundElement = 1, - ForReconstruct = 2, - ForThrottledAnimationFlush = 3, - ForCSSRuleChanges = 4, - } + pub const ServoTraversalFlags_Empty: + root::mozilla::ServoTraversalFlags = + 0; + pub const ServoTraversalFlags_AnimationOnly: + root::mozilla::ServoTraversalFlags = + 1; + pub const ServoTraversalFlags_ForCSSRuleChanges: + root::mozilla::ServoTraversalFlags = + 2; + pub const ServoTraversalFlags_UnstyledChildrenOnly: + root::mozilla::ServoTraversalFlags = + 4; + pub const ServoTraversalFlags_Forgetful: + root::mozilla::ServoTraversalFlags = + 8; + pub const ServoTraversalFlags_AggressivelyForgetful: + root::mozilla::ServoTraversalFlags = + 16; + pub const ServoTraversalFlags_ClearDirtyDescendants: + root::mozilla::ServoTraversalFlags = + 32; + pub const ServoTraversalFlags_ClearAnimationOnlyDirtyDescendants: + root::mozilla::ServoTraversalFlags = + 64; + pub type ServoTraversalFlags = u32; #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleRuleInclusion { All = 0, DefaultOnly = 1, } @@ -8039,11 +5523,117 @@ pub mod root { , "::" , stringify ! ( gecko ) )); } #[repr(u8)] - /** - * Enumeration that represents one of the two supported style system backends. - */ + /// Enumeration that represents one of the two supported style system backends. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleBackendType { None = 0, Gecko = 1, Servo = 2, } + pub type TimeStampValue = u64; + /// Instances of this class represent moments in time, or a special + /// "null" moment. We do not use the non-monotonic system clock or + /// local time, since they can be reset, causing apparent backward + /// travel in time, which can confuse algorithms. Instead we measure + /// elapsed time according to the system. This time can never go + /// backwards (i.e. it never wraps around, at least not in less than + /// five million years of system elapsed time). It might not advance + /// while the system is sleeping. If TimeStamp::SetNow() is not called + /// at all for hours or days, we might not notice the passage of some + /// of that time. + /// + /// We deliberately do not expose a way to convert TimeStamps to some + /// particular unit. All you can do is compute a difference between two + /// TimeStamps to get a TimeDuration. You can also add a TimeDuration + /// to a TimeStamp to get a new TimeStamp. You can't do something + /// meaningless like add two TimeStamps. + /// + /// Internally this is implemented as either a wrapper around + /// - high-resolution, monotonic, system clocks if they exist on this + /// platform + /// - PRIntervalTime otherwise. We detect wraparounds of + /// PRIntervalTime and work around them. + /// + /// This class is similar to C++11's time_point, however it is + /// explicitly nullable and provides an IsNull() method. time_point + /// is initialized to the clock's epoch and provides a + /// time_since_epoch() method that functions similiarly. i.e. + /// t.IsNull() is equivalent to t.time_since_epoch() == decltype(t)::duration::zero(); + #[repr(C)] + #[derive(Debug, Copy)] + pub struct TimeStamp { + /// When built with PRIntervalTime, a value of 0 means this instance + /// is "null". Otherwise, the low 32 bits represent a PRIntervalTime, + /// and the high 32 bits represent a counter of the number of + /// rollovers of PRIntervalTime that we've seen. This counter starts + /// at 1 to avoid a real time colliding with the "null" value. + /// + /// PR_INTERVAL_MAX is set at 100,000 ticks per second. So the minimum + /// time to wrap around is about 2^64/100000 seconds, i.e. about + /// 5,849,424 years. + /// + /// When using a system clock, a value is system dependent. + pub mValue: root::mozilla::TimeStampValue, + } + #[test] + fn bindgen_test_layout_TimeStamp() { + assert_eq!(::std::mem::size_of::<TimeStamp>() , 8usize , concat ! + ( "Size of: " , stringify ! ( TimeStamp ) )); + assert_eq! (::std::mem::align_of::<TimeStamp>() , 8usize , concat + ! ( "Alignment of " , stringify ! ( TimeStamp ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const TimeStamp ) ) . mValue as * const + _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( TimeStamp ) , + "::" , stringify ! ( mValue ) )); + } + impl Clone for TimeStamp { + fn clone(&self) -> Self { *self } + } + /// Instances of this class represent the length of an interval of time. + /// Negative durations are allowed, meaning the end is before the start. + /// + /// Internally the duration is stored as a int64_t in units of + /// PR_TicksPerSecond() when building with NSPR interval timers, or a + /// system-dependent unit when building with system clocks. The + /// system-dependent unit must be constant, otherwise the semantics of + /// this class would be broken. + /// + /// The ValueCalculator template parameter determines how arithmetic + /// operations are performed on the integer count of ticks (mValue). + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct BaseTimeDuration { + pub mValue: i64, + } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct BaseTimeDuration__SomethingVeryRandomHere { + pub _address: u8, + } + pub type Vector_Impl = u8; + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct Vector_CapacityAndReserved { + pub mCapacity: usize, + pub mReserved: usize, + } + pub type Vector_ElementType<T> = T; + pub const Vector_InlineLength: root::mozilla::Vector__bindgen_ty_1 = + Vector__bindgen_ty_1::InlineLength; + #[repr(i32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum Vector__bindgen_ty_1 { InlineLength = 0, } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct Vector_Range<T> { + pub mCur: *mut T, + pub mEnd: *mut T, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct Vector_ConstRange<T> { + pub mCur: *mut T, + pub mEnd: *mut T, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + } #[repr(C)] #[derive(Debug, Copy)] pub struct ErrorResult { @@ -8062,33 +5652,18 @@ pub mod root { impl Clone for ErrorResult { fn clone(&self) -> Self { *self } } - #[repr(C)] - #[derive(Debug)] - pub struct OOMReporter { - pub _base: root::mozilla::dom::binding_detail::FastErrorResult, - } - #[test] - fn bindgen_test_layout_OOMReporter() { - assert_eq!(::std::mem::size_of::<OOMReporter>() , 32usize , concat - ! ( "Size of: " , stringify ! ( OOMReporter ) )); - assert_eq! (::std::mem::align_of::<OOMReporter>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( OOMReporter ) )); - } pub mod binding_danger { #[allow(unused_imports)] use self::super::super::super::root; - /** - * Templated implementation class for various ErrorResult-like things. The - * instantiations differ only in terms of their cleanup policies (used in the - * destructor), which they can specify via the template argument. Note that - * this means it's safe to reinterpret_cast between the instantiations unless - * you plan to invoke the destructor through such a cast pointer. - * - * A cleanup policy consists of two booleans: whether to assert that we've been - * reported or suppressed, and whether to then go ahead and suppress the - * exception. - */ + /// Templated implementation class for various ErrorResult-like things. The + /// instantiations differ only in terms of their cleanup policies (used in the + /// destructor), which they can specify via the template argument. Note that + /// this means it's safe to reinterpret_cast between the instantiations unless + /// you plan to invoke the destructor through such a cast pointer. + /// + /// A cleanup policy consists of two booleans: whether to assert that we've been + /// reported or suppressed, and whether to then go ahead and suppress the + /// exception. #[repr(C)] #[derive(Debug)] pub struct TErrorResult { @@ -8130,27 +5705,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] - pub struct JustAssertCleanupPolicy { - pub _address: u8, - } - pub const JustAssertCleanupPolicy_assertHandled: bool = true; - pub const JustAssertCleanupPolicy_suppress: bool = false; - #[test] - fn bindgen_test_layout_JustAssertCleanupPolicy() { - assert_eq!(::std::mem::size_of::<JustAssertCleanupPolicy>() , - 1usize , concat ! ( - "Size of: " , stringify ! ( JustAssertCleanupPolicy - ) )); - assert_eq! (::std::mem::align_of::<JustAssertCleanupPolicy>() - , 1usize , concat ! ( - "Alignment of " , stringify ! ( - JustAssertCleanupPolicy ) )); - } - impl Clone for JustAssertCleanupPolicy { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] pub struct AssertAndSuppressCleanupPolicy { pub _address: u8, } @@ -8172,9 +5726,7 @@ pub mod root { fn clone(&self) -> Self { *self } } } - /** - * Superclass for data common to CSSStyleSheet and ServoStyleSheet. - */ + /// Superclass for data common to CSSStyleSheet and ServoStyleSheet. #[repr(C)] #[derive(Debug)] pub struct StyleSheet { @@ -8219,12 +5771,10 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(i32)] - /** - * The different changes that a stylesheet may go through. - * - * Used by the StyleSets in order to handle more efficiently some kinds of - * changes. - */ + /// The different changes that a stylesheet may go through. + /// + /// Used by the StyleSets in order to handle more efficiently some kinds of + /// changes. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleSheet_ChangeType { Added = 0, @@ -8287,42 +5837,6 @@ pub mod root { assert_eq! (::std::mem::align_of::<StyleSheet>() , 8usize , concat ! ( "Alignment of " , stringify ! ( StyleSheet ) )); } - #[repr(C)] - #[derive(Debug)] - pub struct OriginAttributes { - pub _base: root::mozilla::dom::OriginAttributesDictionary, - } - pub const OriginAttributes_STRIP_FIRST_PARTY_DOMAIN: - root::mozilla::OriginAttributes__bindgen_ty_1 = - OriginAttributes__bindgen_ty_1::STRIP_FIRST_PARTY_DOMAIN; - pub const OriginAttributes_STRIP_USER_CONTEXT_ID: - root::mozilla::OriginAttributes__bindgen_ty_1 = - OriginAttributes__bindgen_ty_1::STRIP_USER_CONTEXT_ID; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum OriginAttributes__bindgen_ty_1 { - STRIP_FIRST_PARTY_DOMAIN = 1, - STRIP_USER_CONTEXT_ID = 2, - } - extern "C" { - #[link_name = - "_ZN7mozilla16OriginAttributes20sFirstPartyIsolationE"] - pub static mut OriginAttributes_sFirstPartyIsolation: bool; - } - extern "C" { - #[link_name = - "_ZN7mozilla16OriginAttributes23sRestrictedOpenerAccessE"] - pub static mut OriginAttributes_sRestrictedOpenerAccess: bool; - } - #[test] - fn bindgen_test_layout_OriginAttributes() { - assert_eq!(::std::mem::size_of::<OriginAttributes>() , 40usize , - concat ! ( - "Size of: " , stringify ! ( OriginAttributes ) )); - assert_eq! (::std::mem::align_of::<OriginAttributes>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( OriginAttributes ) )); - } pub mod net { #[allow(unused_imports)] use self::super::super::super::root; @@ -8348,6 +5862,7 @@ pub mod root { CORS_USE_CREDENTIALS = 2, } #[repr(C)] + #[derive(Debug)] pub struct CSSStyleSheet { pub _base: root::mozilla::StyleSheet, pub mRuleCollection: root::RefPtr<root::CSSRuleListImpl>, @@ -8469,10 +5984,8 @@ pub mod root { "Alignment of field: " , stringify ! ( ServoStyleSheet ) , "::" , stringify ! ( mRuleList ) )); } - /** - * Smart pointer class that can hold a pointer to either an nsStyleSet - * or a ServoStyleSet. - */ + /// Smart pointer class that can hold a pointer to either an nsStyleSet + /// or a ServoStyleSet. #[repr(C)] #[derive(Debug, Copy)] pub struct StyleSetHandle { @@ -8521,10 +6034,9 @@ pub mod root { } #[repr(C)] pub struct StyleSheetInfo__bindgen_vtable(::std::os::raw::c_void); - /** - * Struct for data common to CSSStyleSheetInner and ServoStyleSheet. - */ + /// Struct for data common to CSSStyleSheetInner and ServoStyleSheet. #[repr(C)] + #[derive(Debug)] pub struct StyleSheetInfo { pub vtable_: *const StyleSheetInfo__bindgen_vtable, pub mSheetURI: root::nsCOMPtr<root::nsIURI>, @@ -8661,174 +6173,20 @@ pub mod root { NotPseudo = 28, MAX = 29, } - /** - * The set of style sheets that apply to a document, backed by a Servo - * Stylist. A ServoStyleSet contains ServoStyleSheets. - */ - #[repr(C)] - pub struct ServoStyleSet { - pub mPresContext: *mut root::nsPresContext, - pub mRawSet: root::mozilla::UniquePtr<root::RawServoStyleSet>, - pub mSheets: [u64; 9usize], - pub mAuthorStyleDisabled: bool, - pub mStylistState: root::mozilla::StylistState, - pub mUserFontSetUpdateGeneration: u64, - pub mUserFontCacheUpdateGeneration: u32, - pub mNeedsRestyleAfterEnsureUniqueInner: bool, - pub mNonInheritingStyleContexts: [u64; 5usize], - pub mPostTraversalTasks: root::nsTArray<root::mozilla::PostTraversalTask>, - pub mStyleRuleMap: root::RefPtr<root::mozilla::ServoStyleRuleMap>, - pub mBindingManager: root::RefPtr<root::nsBindingManager>, - } - pub type ServoStyleSet_SnapshotTable = - root::mozilla::ServoElementSnapshotTable; #[repr(C)] - #[derive(Debug)] - pub struct ServoStyleSet_AutoSetInServoTraversal { - pub mSet: *mut root::mozilla::ServoStyleSet, + #[derive(Debug, Copy)] + pub struct SeenPtrs { + pub _bindgen_opaque_blob: [u64; 6usize], } #[test] - fn bindgen_test_layout_ServoStyleSet_AutoSetInServoTraversal() { - assert_eq!(::std::mem::size_of::<ServoStyleSet_AutoSetInServoTraversal>() - , 8usize , concat ! ( - "Size of: " , stringify ! ( - ServoStyleSet_AutoSetInServoTraversal ) )); - assert_eq! (::std::mem::align_of::<ServoStyleSet_AutoSetInServoTraversal>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - ServoStyleSet_AutoSetInServoTraversal ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const ServoStyleSet_AutoSetInServoTraversal - ) ) . mSet as * const _ as usize } , 0usize , concat ! - ( - "Alignment of field: " , stringify ! ( - ServoStyleSet_AutoSetInServoTraversal ) , "::" , - stringify ! ( mSet ) )); - } - extern "C" { - #[link_name = "_ZN7mozilla13ServoStyleSet17sInServoTraversalE"] - pub static mut ServoStyleSet_sInServoTraversal: - *mut root::mozilla::ServoStyleSet; + fn bindgen_test_layout_SeenPtrs() { + assert_eq!(::std::mem::size_of::<SeenPtrs>() , 48usize , concat ! + ( "Size of: " , stringify ! ( SeenPtrs ) )); + assert_eq! (::std::mem::align_of::<SeenPtrs>() , 8usize , concat ! + ( "Alignment of " , stringify ! ( SeenPtrs ) )); } - #[test] - fn bindgen_test_layout_ServoStyleSet() { - assert_eq!(::std::mem::size_of::<ServoStyleSet>() , 176usize , - concat ! ( "Size of: " , stringify ! ( ServoStyleSet ) - )); - assert_eq! (::std::mem::align_of::<ServoStyleSet>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( ServoStyleSet ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . mPresContext - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mPresContext ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . mRawSet as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mRawSet ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . mSheets as * - const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mSheets ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mAuthorStyleDisabled as * const _ as usize } , 88usize - , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mAuthorStyleDisabled ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . mStylistState - as * const _ as usize } , 89usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mStylistState ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mUserFontSetUpdateGeneration as * const _ as usize } , - 96usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mUserFontSetUpdateGeneration ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mUserFontCacheUpdateGeneration as * const _ as usize } - , 104usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mUserFontCacheUpdateGeneration - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mNeedsRestyleAfterEnsureUniqueInner as * const _ as - usize } , 108usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( - mNeedsRestyleAfterEnsureUniqueInner ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mNonInheritingStyleContexts as * const _ as usize } , - 112usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mNonInheritingStyleContexts ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mPostTraversalTasks as * const _ as usize } , 152usize - , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mPostTraversalTasks ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . mStyleRuleMap - as * const _ as usize } , 160usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mStyleRuleMap ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mBindingManager as * const _ as usize } , 168usize , - concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mBindingManager ) )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventChainVisitor { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventChainPostVisitor { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventChainPreVisitor { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventListenerManager { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct TextEditor { - _unused: [u8; 0], - } - #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_2() { - assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::mozilla::URLExtraData>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::StaticRefPtr<root::mozilla::URLExtraData> - ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::mozilla::URLExtraData>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! - ( - root::mozilla::StaticRefPtr<root::mozilla::URLExtraData> - ) )); + impl Clone for SeenPtrs { + fn clone(&self) -> Self { *self } } #[repr(C)] #[derive(Debug)] @@ -8837,6 +6195,7 @@ pub mod root { pub mBaseURI: root::nsCOMPtr<root::nsIURI>, pub mReferrer: root::nsCOMPtr<root::nsIURI>, pub mPrincipal: root::nsCOMPtr<root::nsIPrincipal>, + pub mIsChrome: bool, } pub type URLExtraData_HasThreadSafeRefCnt = root::mozilla::TrueType; extern "C" { @@ -8846,7 +6205,7 @@ pub mod root { } #[test] fn bindgen_test_layout_URLExtraData() { - assert_eq!(::std::mem::size_of::<URLExtraData>() , 32usize , + assert_eq!(::std::mem::size_of::<URLExtraData>() , 40usize , concat ! ( "Size of: " , stringify ! ( URLExtraData ) )); assert_eq! (::std::mem::align_of::<URLExtraData>() , 8usize , @@ -8872,6 +6231,25 @@ pub mod root { * const _ as usize } , 24usize , concat ! ( "Alignment of field: " , stringify ! ( URLExtraData ) , "::" , stringify ! ( mPrincipal ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const URLExtraData ) ) . mIsChrome as * + const _ as usize } , 32usize , concat ! ( + "Alignment of field: " , stringify ! ( URLExtraData ) + , "::" , stringify ! ( mIsChrome ) )); + } + #[test] + fn __bindgen_test_layout_StaticRefPtr_open0_URLExtraData_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::mozilla::URLExtraData>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr<root::mozilla::URLExtraData> + ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::mozilla::URLExtraData>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! + ( + root::mozilla::StaticRefPtr<root::mozilla::URLExtraData> + ) )); } pub mod widget { #[allow(unused_imports)] @@ -8882,27 +6260,25 @@ pub mod root { _unused: [u8; 0], } } - pub type RawSelectionType = ::std::os::raw::c_short; - #[repr(i16)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum SelectionType { - eInvalid = -1, - eNone = 0, - eNormal = 1, - eSpellCheck = 2, - eIMERawClause = 4, - eIMESelectedRawClause = 8, - eIMEConvertedClause = 16, - eIMESelectedClause = 32, - eAccessibility = 64, - eFind = 128, - eURLSecondary = 256, - eURLStrikeout = 512, + #[repr(C)] + #[derive(Debug, Copy)] + pub struct ArenaAllocator_ArenaHeader { + /// The location in memory of the data portion of the arena. + pub offset: usize, + /// The location in memory of the end of the data portion of the arena. + pub tail: usize, + } + impl Clone for ArenaAllocator_ArenaHeader { + fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AccessibleCaretEventHub { - _unused: [u8; 0], + #[derive(Debug, Copy)] + pub struct ArenaAllocator_ArenaChunk { + pub header: root::mozilla::ArenaAllocator_ArenaHeader, + pub next: *mut root::mozilla::ArenaAllocator_ArenaChunk, + } + impl Clone for ArenaAllocator_ArenaChunk { + fn clone(&self) -> Self { *self } } pub mod a11y { #[allow(unused_imports)] @@ -8935,23 +6311,56 @@ pub mod root { assert_eq! (::std::mem::align_of::<Runnable>() , 8usize , concat ! ( "Alignment of " , stringify ! ( Runnable ) )); } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum TaskCategory { - UI = 0, - Network = 1, - Timer = 2, - Worker = 3, - IdleCallback = 4, - RefreshDriver = 5, - GarbageCollection = 6, - Other = 7, - Count = 8, + #[repr(C)] + #[derive(Debug)] + pub struct CycleCollectedJSContext_RunInMetastableStateData { + pub mRunnable: root::nsCOMPtr<root::nsIRunnable>, + pub mRecursionDepth: u32, + } + #[test] + fn bindgen_test_layout_CycleCollectedJSContext_RunInMetastableStateData() { + assert_eq!(::std::mem::size_of::<CycleCollectedJSContext_RunInMetastableStateData>() + , 16usize , concat ! ( + "Size of: " , stringify ! ( + CycleCollectedJSContext_RunInMetastableStateData ) )); + assert_eq! (::std::mem::align_of::<CycleCollectedJSContext_RunInMetastableStateData>() + , 8usize , concat ! ( + "Alignment of " , stringify ! ( + CycleCollectedJSContext_RunInMetastableStateData ) )); + assert_eq! (unsafe { + & ( + * ( + 0 as * const + CycleCollectedJSContext_RunInMetastableStateData ) ) . + mRunnable as * const _ as usize } , 0usize , concat ! + ( + "Alignment of field: " , stringify ! ( + CycleCollectedJSContext_RunInMetastableStateData ) , + "::" , stringify ! ( mRunnable ) )); + assert_eq! (unsafe { + & ( + * ( + 0 as * const + CycleCollectedJSContext_RunInMetastableStateData ) ) . + mRecursionDepth as * const _ as usize } , 8usize , + concat ! ( + "Alignment of field: " , stringify ! ( + CycleCollectedJSContext_RunInMetastableStateData ) , + "::" , stringify ! ( mRecursionDepth ) )); } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct AbstractThread { - _unused: [u8; 0], + pub struct SegmentedVector_SegmentImpl_Storage { + pub mBuf: root::__BindgenUnionField<*mut ::std::os::raw::c_char>, + pub mAlign: root::__BindgenUnionField<u8>, + pub bindgen_union_field: u64, + } + pub type SegmentedVector_Segment = u8; + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct SegmentedVector_IterImpl { + pub mSegment: *mut root::mozilla::SegmentedVector_Segment, + pub mIndex: usize, } #[repr(i16)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -9031,7 +6440,7 @@ pub mod root { eUseCounter_ShowModalDialog = 71, eUseCounter_Window_Content = 72, eUseCounter_SyncXMLHttpRequest = 73, - eUseCounter_Window_Controllers = 74, + eUseCounter_Window_Cc_ontrollers = 74, eUseCounter_ImportXULIntoContent = 75, eUseCounter_PannerNodeDoppler = 76, eUseCounter_NavigatorGetUserMedia = 77, @@ -9049,11 +6458,6 @@ pub mod root { eUseCounter_Count = 89, } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct PendingAnimationTracker { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug)] pub struct ScrollbarStyles { pub mHorizontal: u8, @@ -9220,12 +6624,10 @@ pub mod root { LangGroupFontPrefs ) , "::" , stringify ! ( mNext ) )); } - /** - * Some functionality that has historically lived on nsPresContext does not - * actually need to be per-document. This singleton class serves as a host - * for that functionality. We delegate to it from nsPresContext where - * appropriate, and use it standalone in some cases as well. - */ + /// Some functionality that has historically lived on nsPresContext does not + /// actually need to be per-document. This singleton class serves as a host + /// for that functionality. We delegate to it from nsPresContext where + /// appropriate, and use it standalone in some cases as well. #[repr(C)] #[derive(Debug)] pub struct StaticPresData { @@ -9261,6 +6663,7 @@ pub mod root { )); } #[repr(C)] + #[derive(Debug)] pub struct EffectCompositor { pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub _mOwningThread: root::nsAutoOwningThread, @@ -9492,155 +6895,23 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DeadlockDetector { + #[derive(Debug, Copy)] + pub struct XREAppData_NSFreePolicy { pub _address: u8, } - /** - * BlockingResourceBase - * Base class of resources that might block clients trying to acquire them. - * Does debugging and deadlock detection in DEBUG builds. - **/ - #[repr(C)] - #[derive(Debug)] - pub struct BlockingResourceBase { - /** - * mChainPrev - * A series of resource acquisitions creates a chain of orders. This - * chain is implemented as a linked list; |mChainPrev| points to the - * resource most recently Acquire()'d before this one. - **/ - pub mChainPrev: *mut root::mozilla::BlockingResourceBase, - /** - * mName - * A descriptive name for this resource. Used in error - * messages etc. - */ - pub mName: *const ::std::os::raw::c_char, - /** - * mType - * The more specific type of this resource. Used to implement - * special semantics (e.g., reentrancy of monitors). - **/ - pub mType: root::mozilla::BlockingResourceBase_BlockingResourceType, - /** - * mAcquired - * Indicates if this resource is currently acquired. - */ - pub mAcquired: root::mozilla::BlockingResourceBase_AcquisitionState, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum BlockingResourceBase_BlockingResourceType { - eMutex = 0, - eReentrantMonitor = 1, - eCondVar = 2, - } - pub type BlockingResourceBase_DDT = root::mozilla::DeadlockDetector; - pub type BlockingResourceBase_AcquisitionState = bool; - extern "C" { - #[link_name = - "_ZN7mozilla20BlockingResourceBase17kResourceTypeNameE"] - pub static mut BlockingResourceBase_kResourceTypeName: - [*const ::std::os::raw::c_char; 0usize]; - } - extern "C" { - #[link_name = "_ZN7mozilla20BlockingResourceBase9sCallOnceE"] - pub static mut BlockingResourceBase_sCallOnce: - root::PRCallOnceType; - } - extern "C" { - #[link_name = - "_ZN7mozilla20BlockingResourceBase26sResourceAcqnChainFrontTPIE"] - pub static mut BlockingResourceBase_sResourceAcqnChainFrontTPI: - ::std::os::raw::c_uint; - } - extern "C" { - #[link_name = - "_ZN7mozilla20BlockingResourceBase17sDeadlockDetectorE"] - pub static mut BlockingResourceBase_sDeadlockDetector: - *mut root::mozilla::BlockingResourceBase_DDT; - } - #[test] - fn bindgen_test_layout_BlockingResourceBase() { - assert_eq!(::std::mem::size_of::<BlockingResourceBase>() , 24usize - , concat ! ( - "Size of: " , stringify ! ( BlockingResourceBase ) )); - assert_eq! (::std::mem::align_of::<BlockingResourceBase>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( BlockingResourceBase ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const BlockingResourceBase ) ) . - mChainPrev as * const _ as usize } , 0usize , concat ! - ( - "Alignment of field: " , stringify ! ( - BlockingResourceBase ) , "::" , stringify ! ( - mChainPrev ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const BlockingResourceBase ) ) . mName - as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - BlockingResourceBase ) , "::" , stringify ! ( mName ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const BlockingResourceBase ) ) . mType - as * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( - BlockingResourceBase ) , "::" , stringify ! ( mType ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const BlockingResourceBase ) ) . - mAcquired as * const _ as usize } , 20usize , concat ! - ( - "Alignment of field: " , stringify ! ( - BlockingResourceBase ) , "::" , stringify ! ( - mAcquired ) )); - } - /** - * OffTheBooksMutex is identical to Mutex, except that OffTheBooksMutex doesn't - * include leak checking. Sometimes you want to intentionally "leak" a mutex - * until shutdown; in these cases, OffTheBooksMutex is for you. - */ - #[repr(C)] - #[derive(Debug)] - pub struct OffTheBooksMutex { - pub _base: root::mozilla::detail::MutexImpl, - pub _base_1: root::mozilla::BlockingResourceBase, - pub mOwningThread: *mut root::PRThread, - } #[test] - fn bindgen_test_layout_OffTheBooksMutex() { - assert_eq!(::std::mem::size_of::<OffTheBooksMutex>() , 72usize , - concat ! ( - "Size of: " , stringify ! ( OffTheBooksMutex ) )); - assert_eq! (::std::mem::align_of::<OffTheBooksMutex>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( OffTheBooksMutex ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OffTheBooksMutex ) ) . - mOwningThread as * const _ as usize } , 64usize , - concat ! ( - "Alignment of field: " , stringify ! ( - OffTheBooksMutex ) , "::" , stringify ! ( - mOwningThread ) )); - } - /** - * Mutex - * When possible, use MutexAutoLock/MutexAutoUnlock to lock/unlock this - * mutex within a scope, instead of calling Lock/Unlock directly. - */ - #[repr(C)] - #[derive(Debug)] - pub struct Mutex { - pub _base: root::mozilla::OffTheBooksMutex, + fn bindgen_test_layout_XREAppData_NSFreePolicy() { + assert_eq!(::std::mem::size_of::<XREAppData_NSFreePolicy>() , + 1usize , concat ! ( + "Size of: " , stringify ! ( XREAppData_NSFreePolicy ) + )); + assert_eq! (::std::mem::align_of::<XREAppData_NSFreePolicy>() , + 1usize , concat ! ( + "Alignment of " , stringify ! ( + XREAppData_NSFreePolicy ) )); } - #[test] - fn bindgen_test_layout_Mutex() { - assert_eq!(::std::mem::size_of::<Mutex>() , 72usize , concat ! ( - "Size of: " , stringify ! ( Mutex ) )); - assert_eq! (::std::mem::align_of::<Mutex>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( Mutex ) )); + impl Clone for XREAppData_NSFreePolicy { + fn clone(&self) -> Self { *self } } pub mod image { #[allow(unused_imports)] @@ -9650,71 +6921,6 @@ pub mod root { pub struct ImageURL { _unused: [u8; 0], } - /** - * An ImageLib cache entry key. - * - * We key the cache on the initial URI (before any redirects), with some - * canonicalization applied. See ComputeHash() for the details. - * Controlled documents do not share their cache entries with - * non-controlled documents, or other controlled documents. - */ - #[repr(C)] - #[derive(Debug)] - pub struct ImageCacheKey { - pub mURI: root::RefPtr<root::mozilla::image::ImageURL>, - pub mBlobSerial: [u64; 2usize], - pub mOriginAttributes: root::mozilla::OriginAttributes, - pub mControlledDocument: *mut ::std::os::raw::c_void, - pub mHash: root::PLDHashNumber, - pub mIsChrome: bool, - } - #[test] - fn bindgen_test_layout_ImageCacheKey() { - assert_eq!(::std::mem::size_of::<ImageCacheKey>() , 80usize , - concat ! ( - "Size of: " , stringify ! ( ImageCacheKey ) )); - assert_eq! (::std::mem::align_of::<ImageCacheKey>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( ImageCacheKey ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ImageCacheKey ) ) . mURI as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - ImageCacheKey ) , "::" , stringify ! ( mURI ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ImageCacheKey ) ) . - mBlobSerial as * const _ as usize } , 8usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ImageCacheKey ) , "::" , stringify ! ( mBlobSerial - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ImageCacheKey ) ) . - mOriginAttributes as * const _ as usize } , - 24usize , concat ! ( - "Alignment of field: " , stringify ! ( - ImageCacheKey ) , "::" , stringify ! ( - mOriginAttributes ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ImageCacheKey ) ) . - mControlledDocument as * const _ as usize } , - 64usize , concat ! ( - "Alignment of field: " , stringify ! ( - ImageCacheKey ) , "::" , stringify ! ( - mControlledDocument ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ImageCacheKey ) ) . mHash as - * const _ as usize } , 72usize , concat ! ( - "Alignment of field: " , stringify ! ( - ImageCacheKey ) , "::" , stringify ! ( mHash ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ImageCacheKey ) ) . mIsChrome - as * const _ as usize } , 76usize , concat ! ( - "Alignment of field: " , stringify ! ( - ImageCacheKey ) , "::" , stringify ! ( mIsChrome ) - )); - } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Image { @@ -9727,18 +6933,16 @@ pub mod root { } #[repr(C)] pub struct IProgressObserver__bindgen_vtable(::std::os::raw::c_void); - /** - * An interface for observing changes to image state, as reported by - * ProgressTracker. - * - * This is the ImageLib-internal version of imgINotificationObserver, - * essentially, with implementation details that code outside of ImageLib - * shouldn't see. - * - * XXX(seth): It's preferable to avoid adding anything to this interface if - * possible. In the long term, it would be ideal to get to a place where we can - * just use the imgINotificationObserver interface internally as well. - */ + /// An interface for observing changes to image state, as reported by + /// ProgressTracker. + /// + /// This is the ImageLib-internal version of imgINotificationObserver, + /// essentially, with implementation details that code outside of ImageLib + /// shouldn't see. + /// + /// XXX(seth): It's preferable to avoid adding anything to this interface if + /// possible. In the long term, it would be ideal to get to a place where we can + /// just use the imgINotificationObserver interface internally as well. #[repr(C)] #[derive(Debug)] pub struct IProgressObserver { @@ -9756,17 +6960,6 @@ pub mod root { ) )); } } - pub type CounterValue = i32; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct NegativeType { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct PadType { - _unused: [u8; 0], - } #[repr(C)] pub struct CounterStyle__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] @@ -10068,6 +7261,16 @@ pub mod root { StyleShapeSource ) , "::" , stringify ! ( mReferenceBox ) )); } + /// <div rustbindgen="true" replaces="mozilla::UniquePtr"> + /// + /// TODO(Emilio): This is a workaround and we should be able to get rid of this + /// one. + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct UniquePtr<T> { + pub mPtr: *mut T, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + } pub const SERVO_PREF_ENABLED_align_content: bool = false; pub const SERVO_PREF_ENABLED_align_items: bool = false; pub const SERVO_PREF_ENABLED_align_self: bool = false; @@ -10447,13 +7650,11 @@ pub mod root { pub const SERVO_PREF_ENABLED_overflow_wrap: bool = false; pub const SERVO_PREF_ENABLED_writing_mode: bool = false; pub const SERVO_PREF_ENABLED_z_index: bool = false; - /** - * This class holds all non-tree-structural state of an element that might be - * used for selector matching eventually. - * - * This means the attributes, and the element state, such as :hover, :active, - * etc... - */ + /// This class holds all non-tree-structural state of an element that might be + /// used for selector matching eventually. + /// + /// This means the attributes, and the element state, such as :hover, :active, + /// etc... #[repr(C)] #[derive(Debug)] pub struct ServoElementSnapshot { @@ -10925,10 +8126,8 @@ pub mod root { AnimationPropertySegment ) , "::" , stringify ! ( mToComposite ) )); } - /** - * Stores the results of calculating the timing properties of an animation - * at a given sample time. - */ + /// Stores the results of calculating the timing properties of an animation + /// at a given sample time. #[repr(C)] #[derive(Debug)] pub struct ComputedTiming { @@ -11019,22 +8218,20 @@ pub mod root { "Alignment of field: " , stringify ! ( ComputedTiming ) , "::" , stringify ! ( mBeforeFlag ) )); } - /** - * A single keyframe. - * - * This is the canonical form in which keyframe effects are stored and - * corresponds closely to the type of objects returned via the getKeyframes() - * API. - * - * Before computing an output animation value, however, we flatten these frames - * down to a series of per-property value arrays where we also resolve any - * overlapping shorthands/longhands, convert specified CSS values to computed - * values, etc. - * - * When the target element or style context changes, however, we rebuild these - * per-property arrays from the original list of keyframes objects. As a result, - * these objects represent the master definition of the effect's values. - */ + /// A single keyframe. + /// + /// This is the canonical form in which keyframe effects are stored and + /// corresponds closely to the type of objects returned via the getKeyframes() + /// API. + /// + /// Before computing an output animation value, however, we flatten these frames + /// down to a series of per-property value arrays where we also resolve any + /// overlapping shorthands/longhands, convert specified CSS values to computed + /// values, etc. + /// + /// When the target element or style context changes, however, we rebuild these + /// per-property arrays from the original list of keyframes objects. As a result, + /// these objects represent the master definition of the effect's values. #[repr(C)] #[derive(Debug)] pub struct Keyframe { @@ -11077,9 +8274,7 @@ pub mod root { "Alignment of field: " , stringify ! ( Keyframe ) , "::" , stringify ! ( mPropertyValues ) )); } - /** - * A property-value pair specified on a keyframe. - */ + /// A property-value pair specified on a keyframe. #[repr(C)] #[derive(Debug)] pub struct PropertyValuePair { @@ -11156,7 +8351,7 @@ pub mod root { ( mValue ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_3() { + fn __bindgen_test_layout_DefaultDelete_open0_RawServoStyleSet_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -11166,18 +8361,14 @@ pub mod root { "Alignment of template specialization: " , stringify ! ( root::mozilla::DefaultDelete ) )); } - /** - * Utility class to handle animated style values - */ + /// Utility class to handle animated style values #[repr(C)] #[derive(Debug, Copy)] pub struct StyleAnimationValue { pub _bindgen_opaque_blob: [u64; 2usize], } #[repr(u32)] - /** - * The types and values for the values that we extract and animate. - */ + /// The types and values for the values that we extract and animate. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleAnimationValue_Unit { eUnit_Null = 0, @@ -11411,6 +8602,7 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] + #[derive(Debug)] pub struct ServoStyleSheetInner { pub _base: root::mozilla::StyleSheetInfo, pub mContents: root::RefPtr<root::RawServoStyleSheetContents>, @@ -11548,20 +8740,18 @@ pub mod root { impl Clone for ComputedTimingFunction { fn clone(&self) -> Self { *self } } - /** - * A ValueCalculator class that performs additional checks before performing - * arithmetic operations such that if either operand is Forever (or the - * negative equivalent) the result remains Forever (or the negative equivalent - * as appropriate). - * - * Currently this only checks if either argument to each operation is - * Forever/-Forever. However, it is possible that, for example, - * aA + aB > INT64_MAX (or < INT64_MIN). - * - * We currently don't check for that case since we don't expect that to - * happen often except under test conditions in which case the wrapping - * behavior is probably acceptable. - */ + /// A ValueCalculator class that performs additional checks before performing + /// arithmetic operations such that if either operand is Forever (or the + /// negative equivalent) the result remains Forever (or the negative equivalent + /// as appropriate). + /// + /// Currently this only checks if either argument to each operation is + /// Forever/-Forever. However, it is possible that, for example, + /// aA + aB > INT64_MAX (or < INT64_MIN). + /// + /// We currently don't check for that case since we don't expect that to + /// happen often except under test conditions in which case the wrapping + /// behavior is probably acceptable. #[repr(C)] #[derive(Debug, Copy)] pub struct StickyTimeDurationValueCalculator { @@ -11581,61 +8771,22 @@ pub mod root { impl Clone for StickyTimeDurationValueCalculator { fn clone(&self) -> Self { *self } } - /** - * Specialization of BaseTimeDuration that uses - * StickyTimeDurationValueCalculator for arithmetic on the mValue member. - * - * Use this class when you need a time duration that is expected to hold values - * of Forever (or the negative equivalent) *and* when you expect that - * time duration to be used in arithmetic operations (and not just value - * comparisons). - */ + /// Specialization of BaseTimeDuration that uses + /// StickyTimeDurationValueCalculator for arithmetic on the mValue member. + /// + /// Use this class when you need a time duration that is expected to hold values + /// of Forever (or the negative equivalent) *and* when you expect that + /// time duration to be used in arithmetic operations (and not just value + /// comparisons). pub type StickyTimeDuration = root::mozilla::BaseTimeDuration; #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct SVGLengthList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGNumberList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGPathData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGPointList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGAnimatedPreserveAspectRatio { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGStringList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGTransformList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct DeclarationBlock { _unused: [u8; 0], } - /** - * A structure representing a single attribute name and value. - * - * This is pretty similar to the private nsAttrAndChildArray::InternalAttr. - */ + /// A structure representing a single attribute name and value. + /// + /// This is pretty similar to the private nsAttrAndChildArray::InternalAttr. #[repr(C)] #[derive(Debug)] pub struct ServoAttrSnapshot { @@ -11664,10 +8815,8 @@ pub mod root { )); } #[repr(u8)] - /** - * A bitflags enum class used to determine what data does a ServoElementSnapshot - * contains. - */ + /// A bitflags enum class used to determine what data does a ServoElementSnapshot + /// contains. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum ServoElementSnapshotFlags { State = 1, @@ -11709,30 +8858,6 @@ pub mod root { impl Clone for NonOwningAnimationTarget { fn clone(&self) -> Self { *self } } - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum Directionality { - eDir_NotSet = 0, - eDir_RTL = 1, - eDir_LTR = 2, - eDir_Auto = 3, - } - /** - * An DisplayItemClip represents the intersection of an optional rectangle - * with a list of rounded rectangles (which is often empty), all in appunits. - * It can represent everything CSS clipping can do to an element (except for - * SVG clip-path), including no clipping at all. - */ - #[repr(C)] - #[derive(Debug)] - pub struct DisplayItemClip { - pub mClipRect: root::nsRect, - pub mRoundedClipRects: root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>, - pub mHaveClipRect: bool, - } - pub type DisplayItemClip_Color = root::mozilla::gfx::Color; - pub type DisplayItemClip_DrawTarget = root::mozilla::gfx::DrawTarget; - pub type DisplayItemClip_Path = root::mozilla::gfx::Path; #[repr(C)] #[derive(Debug, Copy)] pub struct DisplayItemClip_RoundedRect { @@ -11765,37 +8890,6 @@ pub mod root { impl Clone for DisplayItemClip_RoundedRect { fn clone(&self) -> Self { *self } } - #[test] - fn bindgen_test_layout_DisplayItemClip() { - assert_eq!(::std::mem::size_of::<DisplayItemClip>() , 32usize , - concat ! ( - "Size of: " , stringify ! ( DisplayItemClip ) )); - assert_eq! (::std::mem::align_of::<DisplayItemClip>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( DisplayItemClip ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DisplayItemClip ) ) . mClipRect - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( DisplayItemClip - ) , "::" , stringify ! ( mClipRect ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DisplayItemClip ) ) . - mRoundedClipRects as * const _ as usize } , 16usize , - concat ! ( - "Alignment of field: " , stringify ! ( DisplayItemClip - ) , "::" , stringify ! ( mRoundedClipRects ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DisplayItemClip ) ) . - mHaveClipRect as * const _ as usize } , 24usize , - concat ! ( - "Alignment of field: " , stringify ! ( DisplayItemClip - ) , "::" , stringify ! ( mHaveClipRect ) )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ContainerLayerParameters { - _unused: [u8; 0], - } #[repr(C)] #[derive(Debug)] pub struct ServoElementSnapshotTable { @@ -11975,9 +9069,7 @@ pub mod root { eIntID_ContextMenuOffsetHorizontal = 52, } #[repr(u32)] - /** - * Windows themes we currently detect. - */ + /// Windows themes we currently detect. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum LookAndFeel_WindowsTheme { eWindowsTheme_Generic = 0, @@ -11991,9 +9083,7 @@ pub mod root { eWindowsTheme_AeroLite = 8, } #[repr(u32)] - /** - * Operating system versions. - */ + /// Operating system versions. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum LookAndFeel_OperatingSystemVersion { eOperatingSystemVersion_Windows7 = 2, @@ -12104,6 +9194,53 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug, Copy)] + pub struct StylePrefs { + pub _address: u8, + } + extern "C" { + #[link_name = "_ZN7mozilla10StylePrefs19sFontDisplayEnabledE"] + pub static mut StylePrefs_sFontDisplayEnabled: bool; + } + extern "C" { + #[link_name = "_ZN7mozilla10StylePrefs19sOpentypeSVGEnabledE"] + pub static mut StylePrefs_sOpentypeSVGEnabled: bool; + } + extern "C" { + #[link_name = + "_ZN7mozilla10StylePrefs29sWebkitPrefixedAliasesEnabledE"] + pub static mut StylePrefs_sWebkitPrefixedAliasesEnabled: bool; + } + extern "C" { + #[link_name = + "_ZN7mozilla10StylePrefs30sWebkitDevicePixelRatioEnabledE"] + pub static mut StylePrefs_sWebkitDevicePixelRatioEnabled: bool; + } + extern "C" { + #[link_name = "_ZN7mozilla10StylePrefs20sMozGradientsEnabledE"] + pub static mut StylePrefs_sMozGradientsEnabled: bool; + } + extern "C" { + #[link_name = "_ZN7mozilla10StylePrefs22sControlCharVisibilityE"] + pub static mut StylePrefs_sControlCharVisibility: bool; + } + extern "C" { + #[link_name = + "_ZN7mozilla10StylePrefs28sFramesTimingFunctionEnabledE"] + pub static mut StylePrefs_sFramesTimingFunctionEnabled: bool; + } + #[test] + fn bindgen_test_layout_StylePrefs() { + assert_eq!(::std::mem::size_of::<StylePrefs>() , 1usize , concat ! + ( "Size of: " , stringify ! ( StylePrefs ) )); + assert_eq! (::std::mem::align_of::<StylePrefs>() , 1usize , concat + ! ( "Alignment of " , stringify ! ( StylePrefs ) )); + } + impl Clone for StylePrefs { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug)] pub struct PseudoElementHashEntry { pub _base: root::PLDHashEntryHdr, pub mElement: root::RefPtr<root::mozilla::dom::Element>, @@ -12143,16 +9280,6 @@ pub mod root { PseudoElementHashEntry ) , "::" , stringify ! ( mPseudoType ) )); } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct RestyleTracker { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AnimationPerformanceWarning { - _unused: [u8; 0], - } pub type CSSPseudoClassTypeBase = u8; #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -12267,14 +9394,12 @@ pub mod root { "Alignment of field: " , stringify ! ( ServoMediaList ) , "::" , stringify ! ( mRawList ) )); } - /** - * A PostTraversalTask is a task to be performed immediately after a Servo - * traversal. There are just a few tasks we need to perform, so we use this - * class rather than Runnables, to avoid virtual calls and some allocations. - * - * A PostTraversalTask is only safe to run immediately after the Servo - * traversal, since it can hold raw pointers to DOM objects. - */ + /// A PostTraversalTask is a task to be performed immediately after a Servo + /// traversal. There are just a few tasks we need to perform, so we use this + /// class rather than Runnables, to avoid virtual calls and some allocations. + /// + /// A PostTraversalTask is only safe to run immediately after the Servo + /// traversal, since it can hold raw pointers to DOM objects. #[repr(C)] #[derive(Debug, Copy)] pub struct PostTraversalTask { @@ -12322,22 +9447,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ServoStyleRuleMap { - _unused: [u8; 0], - } - #[repr(u8)] - /** - * A few flags used to track which kind of stylist state we may need to - * update. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum StylistState { - NotDirty = 0, - StyleSheetsDirty = 1, - FullyDirty = 2, - } - #[repr(C)] #[derive(Debug)] pub struct CSSFontFaceDescriptors { pub mFamily: root::nsCSSValue, @@ -12425,211 +9534,9 @@ pub mod root { CSSFontFaceDescriptors ) , "::" , stringify ! ( mDisplay ) )); } - /** - * <div rustbindgen="true" replaces="mozilla::UniquePtr"> - * - * TODO(Emilio): This is a workaround and we should be able to get rid of this - * one. - */ - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct UniquePtr<T> { - pub mPtr: *mut T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } } #[repr(C)] #[derive(Debug, Copy)] - pub struct _IO_FILE { - pub _flags: ::std::os::raw::c_int, - pub _IO_read_ptr: *mut ::std::os::raw::c_char, - pub _IO_read_end: *mut ::std::os::raw::c_char, - pub _IO_read_base: *mut ::std::os::raw::c_char, - pub _IO_write_base: *mut ::std::os::raw::c_char, - pub _IO_write_ptr: *mut ::std::os::raw::c_char, - pub _IO_write_end: *mut ::std::os::raw::c_char, - pub _IO_buf_base: *mut ::std::os::raw::c_char, - pub _IO_buf_end: *mut ::std::os::raw::c_char, - pub _IO_save_base: *mut ::std::os::raw::c_char, - pub _IO_backup_base: *mut ::std::os::raw::c_char, - pub _IO_save_end: *mut ::std::os::raw::c_char, - pub _markers: *mut root::_IO_marker, - pub _chain: *mut root::_IO_FILE, - pub _fileno: ::std::os::raw::c_int, - pub _flags2: ::std::os::raw::c_int, - pub _old_offset: root::__off_t, - pub _cur_column: ::std::os::raw::c_ushort, - pub _vtable_offset: ::std::os::raw::c_schar, - pub _shortbuf: [::std::os::raw::c_char; 1usize], - pub _lock: *mut root::_IO_lock_t, - pub _offset: root::__off64_t, - pub __pad1: *mut ::std::os::raw::c_void, - pub __pad2: *mut ::std::os::raw::c_void, - pub __pad3: *mut ::std::os::raw::c_void, - pub __pad4: *mut ::std::os::raw::c_void, - pub __pad5: usize, - pub _mode: ::std::os::raw::c_int, - pub _unused2: [::std::os::raw::c_char; 20usize], - } - #[test] - fn bindgen_test_layout__IO_FILE() { - assert_eq!(::std::mem::size_of::<_IO_FILE>() , 216usize , concat ! ( - "Size of: " , stringify ! ( _IO_FILE ) )); - assert_eq! (::std::mem::align_of::<_IO_FILE>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( _IO_FILE ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _flags as * const _ as - usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _flags ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _IO_read_ptr as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _IO_read_ptr ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _IO_read_end as * - const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _IO_read_end ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _IO_read_base as * - const _ as usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _IO_read_base ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _IO_write_base as * - const _ as usize } , 32usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _IO_write_base ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _IO_write_ptr as * - const _ as usize } , 40usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _IO_write_ptr ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _IO_write_end as * - const _ as usize } , 48usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _IO_write_end ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _IO_buf_base as * - const _ as usize } , 56usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _IO_buf_base ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _IO_buf_end as * const - _ as usize } , 64usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _IO_buf_end ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _IO_save_base as * - const _ as usize } , 72usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _IO_save_base ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _IO_backup_base as * - const _ as usize } , 80usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _IO_backup_base ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _IO_save_end as * - const _ as usize } , 88usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _IO_save_end ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _markers as * const _ - as usize } , 96usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _markers ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _chain as * const _ as - usize } , 104usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _chain ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _fileno as * const _ - as usize } , 112usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _fileno ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _flags2 as * const _ - as usize } , 116usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _flags2 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _old_offset as * const - _ as usize } , 120usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _old_offset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _cur_column as * const - _ as usize } , 128usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _cur_column ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _vtable_offset as * - const _ as usize } , 130usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _vtable_offset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _shortbuf as * const _ - as usize } , 131usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _shortbuf ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _lock as * const _ as - usize } , 136usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _lock ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _offset as * const _ - as usize } , 144usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _offset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . __pad1 as * const _ as - usize } , 152usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( __pad1 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . __pad2 as * const _ as - usize } , 160usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( __pad2 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . __pad3 as * const _ as - usize } , 168usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( __pad3 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . __pad4 as * const _ as - usize } , 176usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( __pad4 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . __pad5 as * const _ as - usize } , 184usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( __pad5 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _mode as * const _ as - usize } , 192usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _mode ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_FILE ) ) . _unused2 as * const _ - as usize } , 196usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , - stringify ! ( _unused2 ) )); - } - impl Clone for _IO_FILE { - fn clone(&self) -> Self { *self } - } - pub type FILE = root::_IO_FILE; - pub type va_list = root::__builtin_va_list; - #[repr(C)] - #[derive(Debug, Copy)] pub struct InfallibleAllocPolicy { pub _address: u8, } @@ -12646,18 +9553,15 @@ pub mod root { impl Clone for InfallibleAllocPolicy { fn clone(&self) -> Self { *self } } - /** - * MozRefCountType is Mozilla's reference count type. - * - * We use the same type to represent the refcount of RefCounted objects - * as well, in order to be able to use the leak detection facilities - * that are implemented by XPCOM. - * - * Note that this type is not in the mozilla namespace so that it is - * usable for both C and C++ code. - */ + /// MozRefCountType is Mozilla's reference count type. + /// + /// We use the same type to represent the refcount of RefCounted objects + /// as well, in order to be able to use the leak detection facilities + /// that are implemented by XPCOM. + /// + /// Note that this type is not in the mozilla namespace so that it is + /// usable for both C and C++ code. pub type MozRefCountType = usize; - pub type MozExternalRefCountType = u32; pub const nsresult_NS_ERROR_NO_INTERFACE: root::nsresult = nsresult::NS_NOINTERFACE; pub const nsresult_NS_ERROR_INVALID_ARG: root::nsresult = @@ -13184,382 +10088,6 @@ pub mod root { NS_OK_NO_NAME_CLAUSE_HANDLED = 7864354, } pub type nsrefcnt = root::MozRefCountType; - pub type _IO_lock_t = ::std::os::raw::c_void; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct _IO_marker { - pub _next: *mut root::_IO_marker, - pub _sbuf: *mut root::_IO_FILE, - pub _pos: ::std::os::raw::c_int, - } - #[test] - fn bindgen_test_layout__IO_marker() { - assert_eq!(::std::mem::size_of::<_IO_marker>() , 24usize , concat ! ( - "Size of: " , stringify ! ( _IO_marker ) )); - assert_eq! (::std::mem::align_of::<_IO_marker>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( _IO_marker ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_marker ) ) . _next as * const _ - as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_marker ) , "::" - , stringify ! ( _next ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_marker ) ) . _sbuf as * const _ - as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_marker ) , "::" - , stringify ! ( _sbuf ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const _IO_marker ) ) . _pos as * const _ as - usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( _IO_marker ) , "::" - , stringify ! ( _pos ) )); - } - impl Clone for _IO_marker { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - pub struct nsQueryFrame__bindgen_vtable(::std::os::raw::c_void); - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsQueryFrame { - pub vtable_: *const nsQueryFrame__bindgen_vtable, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsQueryFrame_FrameIID { - BRFrame_id = 0, - DetailsFrame_id = 1, - nsAutoRepeatBoxFrame_id = 2, - nsBCTableCellFrame_id = 3, - nsBackdropFrame_id = 4, - nsBlockFrame_id = 5, - nsBox_id = 6, - nsBoxFrame_id = 7, - nsBulletFrame_id = 8, - nsButtonBoxFrame_id = 9, - nsCanvasFrame_id = 10, - nsColorControlFrame_id = 11, - nsColumnSetFrame_id = 12, - nsComboboxControlFrame_id = 13, - nsComboboxDisplayFrame_id = 14, - nsContinuingTextFrame_id = 15, - nsDateTimeControlFrame_id = 16, - nsDeckFrame_id = 17, - nsDocElementBoxFrame_id = 18, - nsFieldSetFrame_id = 19, - nsFileControlFrame_id = 20, - nsFirstLetterFrame_id = 21, - nsFirstLineFrame_id = 22, - nsFlexContainerFrame_id = 23, - nsFrame_id = 24, - nsGfxButtonControlFrame_id = 25, - nsGfxCheckboxControlFrame_id = 26, - nsGfxRadioControlFrame_id = 27, - nsGridContainerFrame_id = 28, - nsGridRowGroupFrame_id = 29, - nsGridRowLeafFrame_id = 30, - nsGroupBoxFrame_id = 31, - nsHTMLButtonControlFrame_id = 32, - nsHTMLCanvasFrame_id = 33, - nsHTMLFramesetBlankFrame_id = 34, - nsHTMLFramesetBorderFrame_id = 35, - nsHTMLFramesetFrame_id = 36, - nsHTMLScrollFrame_id = 37, - nsImageBoxFrame_id = 38, - nsImageControlFrame_id = 39, - nsImageFrame_id = 40, - nsInlineFrame_id = 41, - nsLeafBoxFrame_id = 42, - nsLegendFrame_id = 43, - nsListBoxBodyFrame_id = 44, - nsListControlFrame_id = 45, - nsListItemFrame_id = 46, - nsMathMLFrame_id = 47, - nsMathMLmactionFrame_id = 48, - nsMathMLmathBlockFrame_id = 49, - nsMathMLmathInlineFrame_id = 50, - nsMathMLmencloseFrame_id = 51, - nsMathMLmfencedFrame_id = 52, - nsMathMLmfracFrame_id = 53, - nsMathMLmmultiscriptsFrame_id = 54, - nsMathMLmoFrame_id = 55, - nsMathMLmpaddedFrame_id = 56, - nsMathMLmrootFrame_id = 57, - nsMathMLmrowFrame_id = 58, - nsMathMLmspaceFrame_id = 59, - nsMathMLmsqrtFrame_id = 60, - nsMathMLmtableFrame_id = 61, - nsMathMLmtableWrapperFrame_id = 62, - nsMathMLmtdFrame_id = 63, - nsMathMLmtdInnerFrame_id = 64, - nsMathMLmtrFrame_id = 65, - nsMathMLmunderoverFrame_id = 66, - nsMathMLsemanticsFrame_id = 67, - nsMathMLTokenFrame_id = 68, - nsMenuBarFrame_id = 69, - nsMenuFrame_id = 70, - nsMenuPopupFrame_id = 71, - nsMeterFrame_id = 72, - nsNumberControlFrame_id = 73, - nsPluginFrame_id = 74, - nsPageBreakFrame_id = 75, - nsPageContentFrame_id = 76, - nsPageFrame_id = 77, - nsPlaceholderFrame_id = 78, - nsPopupSetFrame_id = 79, - nsProgressFrame_id = 80, - nsProgressMeterFrame_id = 81, - nsRangeFrame_id = 82, - nsResizerFrame_id = 83, - nsRootBoxFrame_id = 84, - nsRubyBaseContainerFrame_id = 85, - nsRubyBaseFrame_id = 86, - nsRubyFrame_id = 87, - nsRubyTextContainerFrame_id = 88, - nsRubyTextFrame_id = 89, - nsScrollbarButtonFrame_id = 90, - nsScrollbarFrame_id = 91, - nsSelectsAreaFrame_id = 92, - nsSimplePageSequenceFrame_id = 93, - nsSliderFrame_id = 94, - nsSplitterFrame_id = 95, - nsStackFrame_id = 96, - nsSubDocumentFrame_id = 97, - nsSVGAFrame_id = 98, - nsSVGClipPathFrame_id = 99, - nsSVGContainerFrame_id = 100, - SVGFEContainerFrame_id = 101, - SVGFEImageFrame_id = 102, - SVGFELeafFrame_id = 103, - SVGFEUnstyledLeafFrame_id = 104, - nsSVGFilterFrame_id = 105, - nsSVGForeignObjectFrame_id = 106, - nsSVGGenericContainerFrame_id = 107, - nsSVGGFrame_id = 108, - nsSVGImageFrame_id = 109, - nsSVGInnerSVGFrame_id = 110, - nsSVGLinearGradientFrame_id = 111, - nsSVGMarkerFrame_id = 112, - nsSVGMarkerAnonChildFrame_id = 113, - nsSVGMaskFrame_id = 114, - nsSVGOuterSVGFrame_id = 115, - nsSVGOuterSVGAnonChildFrame_id = 116, - SVGGeometryFrame_id = 117, - nsSVGPatternFrame_id = 118, - nsSVGRadialGradientFrame_id = 119, - nsSVGStopFrame_id = 120, - nsSVGSwitchFrame_id = 121, - nsSVGSymbolFrame_id = 122, - SVGTextFrame_id = 123, - nsSVGUseFrame_id = 124, - SVGViewFrame_id = 125, - nsTableCellFrame_id = 126, - nsTableColFrame_id = 127, - nsTableColGroupFrame_id = 128, - nsTableFrame_id = 129, - nsTableWrapperFrame_id = 130, - nsTableRowFrame_id = 131, - nsTableRowGroupFrame_id = 132, - nsTextBoxFrame_id = 133, - nsTextControlFrame_id = 134, - nsTextFrame_id = 135, - nsTitleBarFrame_id = 136, - nsTreeBodyFrame_id = 137, - nsTreeColFrame_id = 138, - nsVideoFrame_id = 139, - nsXULLabelFrame_id = 140, - nsXULScrollFrame_id = 141, - ViewportFrame_id = 142, - nsContainerFrame_id = 143, - nsFormControlFrame_id = 144, - nsIFrame_id = 145, - nsLeafFrame_id = 146, - nsMathMLContainerFrame_id = 147, - nsRubyContentFrame_id = 148, - nsSplittableFrame_id = 149, - nsSVGDisplayContainerFrame_id = 150, - nsSVGGradientFrame_id = 151, - nsSVGPaintServerFrame_id = 152, - nsIAnonymousContentCreator_id = 153, - nsIComboboxControlFrame_id = 154, - nsIFormControlFrame_id = 155, - nsIFrameFrame_id = 156, - nsIListControlFrame_id = 157, - nsIMathMLFrame_id = 158, - nsIMenuFrame_id = 159, - nsIObjectFrame_id = 160, - nsIPageSequenceFrame_id = 161, - nsIPercentBSizeObserver_id = 162, - nsIRootBox_id = 163, - nsIScrollableFrame_id = 164, - nsIScrollbarMediator_id = 165, - nsISelectControlFrame_id = 166, - nsISVGSVGFrame_id = 167, - nsIStatefulFrame_id = 168, - nsITableCellLayout_id = 169, - nsITableLayout_id = 170, - nsITextControlFrame_id = 171, - nsITreeBoxObject_id = 172, - nsSVGDisplayableFrame_id = 173, - NON_FRAME_MARKER = 174, - } - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsQueryFrame_ClassID { - BRFrame_id = 0, - DetailsFrame_id = 1, - nsAutoRepeatBoxFrame_id = 2, - nsBCTableCellFrame_id = 3, - nsBackdropFrame_id = 4, - nsBlockFrame_id = 5, - nsBox_id = 6, - nsBoxFrame_id = 7, - nsBulletFrame_id = 8, - nsButtonBoxFrame_id = 9, - nsCanvasFrame_id = 10, - nsColorControlFrame_id = 11, - nsColumnSetFrame_id = 12, - nsComboboxControlFrame_id = 13, - nsComboboxDisplayFrame_id = 14, - nsContinuingTextFrame_id = 15, - nsDateTimeControlFrame_id = 16, - nsDeckFrame_id = 17, - nsDocElementBoxFrame_id = 18, - nsFieldSetFrame_id = 19, - nsFileControlFrame_id = 20, - nsFirstLetterFrame_id = 21, - nsFirstLineFrame_id = 22, - nsFlexContainerFrame_id = 23, - nsFrame_id = 24, - nsGfxButtonControlFrame_id = 25, - nsGfxCheckboxControlFrame_id = 26, - nsGfxRadioControlFrame_id = 27, - nsGridContainerFrame_id = 28, - nsGridRowGroupFrame_id = 29, - nsGridRowLeafFrame_id = 30, - nsGroupBoxFrame_id = 31, - nsHTMLButtonControlFrame_id = 32, - nsHTMLCanvasFrame_id = 33, - nsHTMLFramesetBlankFrame_id = 34, - nsHTMLFramesetBorderFrame_id = 35, - nsHTMLFramesetFrame_id = 36, - nsHTMLScrollFrame_id = 37, - nsImageBoxFrame_id = 38, - nsImageControlFrame_id = 39, - nsImageFrame_id = 40, - nsInlineFrame_id = 41, - nsLeafBoxFrame_id = 42, - nsLegendFrame_id = 43, - nsListBoxBodyFrame_id = 44, - nsListControlFrame_id = 45, - nsListItemFrame_id = 46, - nsMathMLFrame_id = 47, - nsMathMLmactionFrame_id = 48, - nsMathMLmathBlockFrame_id = 49, - nsMathMLmathInlineFrame_id = 50, - nsMathMLmencloseFrame_id = 51, - nsMathMLmfencedFrame_id = 52, - nsMathMLmfracFrame_id = 53, - nsMathMLmmultiscriptsFrame_id = 54, - nsMathMLmoFrame_id = 55, - nsMathMLmpaddedFrame_id = 56, - nsMathMLmrootFrame_id = 57, - nsMathMLmrowFrame_id = 58, - nsMathMLmspaceFrame_id = 59, - nsMathMLmsqrtFrame_id = 60, - nsMathMLmtableFrame_id = 61, - nsMathMLmtableWrapperFrame_id = 62, - nsMathMLmtdFrame_id = 63, - nsMathMLmtdInnerFrame_id = 64, - nsMathMLmtrFrame_id = 65, - nsMathMLmunderoverFrame_id = 66, - nsMathMLsemanticsFrame_id = 67, - nsMathMLTokenFrame_id = 68, - nsMenuBarFrame_id = 69, - nsMenuFrame_id = 70, - nsMenuPopupFrame_id = 71, - nsMeterFrame_id = 72, - nsNumberControlFrame_id = 73, - nsPluginFrame_id = 74, - nsPageBreakFrame_id = 75, - nsPageContentFrame_id = 76, - nsPageFrame_id = 77, - nsPlaceholderFrame_id = 78, - nsPopupSetFrame_id = 79, - nsProgressFrame_id = 80, - nsProgressMeterFrame_id = 81, - nsRangeFrame_id = 82, - nsResizerFrame_id = 83, - nsRootBoxFrame_id = 84, - nsRubyBaseContainerFrame_id = 85, - nsRubyBaseFrame_id = 86, - nsRubyFrame_id = 87, - nsRubyTextContainerFrame_id = 88, - nsRubyTextFrame_id = 89, - nsScrollbarButtonFrame_id = 90, - nsScrollbarFrame_id = 91, - nsSelectsAreaFrame_id = 92, - nsSimplePageSequenceFrame_id = 93, - nsSliderFrame_id = 94, - nsSplitterFrame_id = 95, - nsStackFrame_id = 96, - nsSubDocumentFrame_id = 97, - nsSVGAFrame_id = 98, - nsSVGClipPathFrame_id = 99, - nsSVGContainerFrame_id = 100, - SVGFEContainerFrame_id = 101, - SVGFEImageFrame_id = 102, - SVGFELeafFrame_id = 103, - SVGFEUnstyledLeafFrame_id = 104, - nsSVGFilterFrame_id = 105, - nsSVGForeignObjectFrame_id = 106, - nsSVGGenericContainerFrame_id = 107, - nsSVGGFrame_id = 108, - nsSVGImageFrame_id = 109, - nsSVGInnerSVGFrame_id = 110, - nsSVGLinearGradientFrame_id = 111, - nsSVGMarkerFrame_id = 112, - nsSVGMarkerAnonChildFrame_id = 113, - nsSVGMaskFrame_id = 114, - nsSVGOuterSVGFrame_id = 115, - nsSVGOuterSVGAnonChildFrame_id = 116, - SVGGeometryFrame_id = 117, - nsSVGPatternFrame_id = 118, - nsSVGRadialGradientFrame_id = 119, - nsSVGStopFrame_id = 120, - nsSVGSwitchFrame_id = 121, - nsSVGSymbolFrame_id = 122, - SVGTextFrame_id = 123, - nsSVGUseFrame_id = 124, - SVGViewFrame_id = 125, - nsTableCellFrame_id = 126, - nsTableColFrame_id = 127, - nsTableColGroupFrame_id = 128, - nsTableFrame_id = 129, - nsTableWrapperFrame_id = 130, - nsTableRowFrame_id = 131, - nsTableRowGroupFrame_id = 132, - nsTextBoxFrame_id = 133, - nsTextControlFrame_id = 134, - nsTextFrame_id = 135, - nsTitleBarFrame_id = 136, - nsTreeBodyFrame_id = 137, - nsTreeColFrame_id = 138, - nsVideoFrame_id = 139, - nsXULLabelFrame_id = 140, - nsXULScrollFrame_id = 141, - ViewportFrame_id = 142, - } - #[test] - fn bindgen_test_layout_nsQueryFrame() { - assert_eq!(::std::mem::size_of::<nsQueryFrame>() , 8usize , concat ! ( - "Size of: " , stringify ! ( nsQueryFrame ) )); - assert_eq! (::std::mem::align_of::<nsQueryFrame>() , 8usize , concat ! - ( "Alignment of " , stringify ! ( nsQueryFrame ) )); - } - impl Clone for nsQueryFrame { - fn clone(&self) -> Self { *self } - } #[repr(C)] #[derive(Debug)] pub struct nsAString { @@ -13617,6 +10145,34 @@ pub mod root { impl Clone for nsSubstringTuple { fn clone(&self) -> Self { *self } } + pub type nsString_self_type = ::nsstring::nsStringRepr; + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsString_Segment { + pub mBegin: u32, + pub mLength: u32, + } + #[test] + fn bindgen_test_layout_nsString_Segment() { + assert_eq!(::std::mem::size_of::<nsString_Segment>() , 8usize , concat + ! ( "Size of: " , stringify ! ( nsString_Segment ) )); + assert_eq! (::std::mem::align_of::<nsString_Segment>() , 4usize , + concat ! ( + "Alignment of " , stringify ! ( nsString_Segment ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsString_Segment ) ) . mBegin as * + const _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( nsString_Segment ) + , "::" , stringify ! ( mBegin ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsString_Segment ) ) . mLength as * + const _ as usize } , 4usize , concat ! ( + "Alignment of field: " , stringify ! ( nsString_Segment ) + , "::" , stringify ! ( mLength ) )); + } + impl Clone for nsString_Segment { + fn clone(&self) -> Self { *self } + } #[repr(C)] pub struct nsAutoString { pub _base: root::nsFixedString, @@ -13642,21 +10198,6 @@ pub mod root { "::" , stringify ! ( mStorage ) )); } #[repr(C)] - #[derive(Debug)] - pub struct nsDependentSubstring { - pub _base: root::nsAString, - } - pub type nsDependentSubstring_self_type = root::nsDependentSubstring; - #[test] - fn bindgen_test_layout_nsDependentSubstring() { - assert_eq!(::std::mem::size_of::<nsDependentSubstring>() , 16usize , - concat ! ( - "Size of: " , stringify ! ( nsDependentSubstring ) )); - assert_eq! (::std::mem::align_of::<nsDependentSubstring>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsDependentSubstring ) )); - } - #[repr(C)] pub struct nsStringComparator__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] #[derive(Debug, Copy)] @@ -13775,22 +10316,6 @@ pub mod root { "Alignment of " , stringify ! ( nsCString ) )); } #[repr(C)] - #[derive(Debug)] - pub struct nsDependentCSubstring { - pub _base: root::nsACString, - } - pub type nsDependentCSubstring_self_type = root::nsDependentCSubstring; - #[test] - fn bindgen_test_layout_nsDependentCSubstring() { - assert_eq!(::std::mem::size_of::<nsDependentCSubstring>() , 16usize , - concat ! ( - "Size of: " , stringify ! ( nsDependentCSubstring ) )); - assert_eq! (::std::mem::align_of::<nsDependentCSubstring>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsDependentCSubstring ) - )); - } - #[repr(C)] pub struct nsCStringComparator__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] #[derive(Debug, Copy)] @@ -13812,12 +10337,10 @@ pub mod root { } #[repr(C)] pub struct nsISupports__bindgen_vtable(::std::os::raw::c_void); - /** - * Basic component object model interface. Objects which implement - * this interface support runtime interface discovery (QueryInterface) - * and a reference counted memory model (AddRef/Release). This is - * modelled after the win32 IUnknown API. - */ + /// Basic component object model interface. Objects which implement + /// this interface support runtime interface discovery (QueryInterface) + /// and a reference counted memory model (AddRef/Release). This is + /// modelled after the win32 IUnknown API. #[repr(C)] #[derive(Debug, Copy)] pub struct nsISupports { @@ -13840,9 +10363,7 @@ pub mod root { } #[repr(C)] pub struct nsCycleCollectionParticipant__bindgen_vtable(::std::os::raw::c_void); - /** - * Participant implementation classes - */ + /// Participant implementation classes #[repr(C)] #[derive(Debug, Copy)] pub struct nsCycleCollectionParticipant { @@ -13908,9 +10429,7 @@ pub mod root { pub struct nsCharTraits { pub _address: u8, } - /** - * @see nsTAString - */ + /// @see nsTAString #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsReadingIterator<CharT> { @@ -13926,9 +10445,7 @@ pub mod root { pub type nsReadingIterator_value_type<CharT> = CharT; pub type nsReadingIterator_pointer<CharT> = *mut CharT; pub type nsReadingIterator_reference = u8; - /** - * @see nsTAString - */ + /// @see nsTAString #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsWritingIterator<CharT> { @@ -13944,158 +10461,16 @@ pub mod root { pub type nsWritingIterator_value_type<CharT> = CharT; pub type nsWritingIterator_pointer<CharT> = *mut CharT; pub type nsWritingIterator_reference = u8; + pub type AutoTArray_self_type = u8; + pub type AutoTArray_base_type<E> = root::nsTArray<E>; + pub type AutoTArray_Header<E> = root::AutoTArray_base_type<E>; + pub type AutoTArray_elem_type<E> = root::AutoTArray_base_type<E>; #[repr(C)] - pub struct nsSubstringSplitter { - pub mStr: *const root::nsAString, - pub mArray: u64, - pub mArraySize: root::nsSubstringSplitter_size_type, - pub mDelim: root::nsSubstringSplitter_char_type, - } - pub type nsSubstringSplitter_size_type = - root::mozilla::detail::nsStringRepr_size_type; - pub type nsSubstringSplitter_char_type = - root::mozilla::detail::nsStringRepr_char_type; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsSubstringSplitter_nsTSubstringSplit_Iter { - pub mObj: *const root::nsSubstringSplitter, - pub mPos: root::nsSubstringSplitter_size_type, - } - #[test] - fn bindgen_test_layout_nsSubstringSplitter_nsTSubstringSplit_Iter() { - assert_eq!(::std::mem::size_of::<nsSubstringSplitter_nsTSubstringSplit_Iter>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - nsSubstringSplitter_nsTSubstringSplit_Iter ) )); - assert_eq! (::std::mem::align_of::<nsSubstringSplitter_nsTSubstringSplit_Iter>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsSubstringSplitter_nsTSubstringSplit_Iter ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const nsSubstringSplitter_nsTSubstringSplit_Iter ) - ) . mObj as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsSubstringSplitter_nsTSubstringSplit_Iter ) , "::" , - stringify ! ( mObj ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const nsSubstringSplitter_nsTSubstringSplit_Iter ) - ) . mPos as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsSubstringSplitter_nsTSubstringSplit_Iter ) , "::" , - stringify ! ( mPos ) )); - } - impl Clone for nsSubstringSplitter_nsTSubstringSplit_Iter { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_nsSubstringSplitter() { - assert_eq!(::std::mem::size_of::<nsSubstringSplitter>() , 24usize , - concat ! ( - "Size of: " , stringify ! ( nsSubstringSplitter ) )); - assert_eq! (::std::mem::align_of::<nsSubstringSplitter>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsSubstringSplitter ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsSubstringSplitter ) ) . mStr as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsSubstringSplitter - ) , "::" , stringify ! ( mStr ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsSubstringSplitter ) ) . mArray as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( nsSubstringSplitter - ) , "::" , stringify ! ( mArray ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsSubstringSplitter ) ) . mArraySize - as * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( nsSubstringSplitter - ) , "::" , stringify ! ( mArraySize ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsSubstringSplitter ) ) . mDelim as * - const _ as usize } , 20usize , concat ! ( - "Alignment of field: " , stringify ! ( nsSubstringSplitter - ) , "::" , stringify ! ( mDelim ) )); - } - #[repr(C)] - pub struct nsCSubstringSplitter { - pub mStr: *const root::nsACString, - pub mArray: u64, - pub mArraySize: root::nsCSubstringSplitter_size_type, - pub mDelim: root::nsCSubstringSplitter_char_type, - } - pub type nsCSubstringSplitter_size_type = - root::mozilla::detail::nsCStringRepr_size_type; - pub type nsCSubstringSplitter_char_type = - root::mozilla::detail::nsCStringRepr_char_type; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsCSubstringSplitter_nsTSubstringSplit_Iter { - pub mObj: *const root::nsCSubstringSplitter, - pub mPos: root::nsCSubstringSplitter_size_type, - } - #[test] - fn bindgen_test_layout_nsCSubstringSplitter_nsTSubstringSplit_Iter() { - assert_eq!(::std::mem::size_of::<nsCSubstringSplitter_nsTSubstringSplit_Iter>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - nsCSubstringSplitter_nsTSubstringSplit_Iter ) )); - assert_eq! (::std::mem::align_of::<nsCSubstringSplitter_nsTSubstringSplit_Iter>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsCSubstringSplitter_nsTSubstringSplit_Iter ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const nsCSubstringSplitter_nsTSubstringSplit_Iter ) - ) . mObj as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSubstringSplitter_nsTSubstringSplit_Iter ) , "::" , - stringify ! ( mObj ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const nsCSubstringSplitter_nsTSubstringSplit_Iter ) - ) . mPos as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSubstringSplitter_nsTSubstringSplit_Iter ) , "::" , - stringify ! ( mPos ) )); - } - impl Clone for nsCSubstringSplitter_nsTSubstringSplit_Iter { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_nsCSubstringSplitter() { - assert_eq!(::std::mem::size_of::<nsCSubstringSplitter>() , 24usize , - concat ! ( - "Size of: " , stringify ! ( nsCSubstringSplitter ) )); - assert_eq! (::std::mem::align_of::<nsCSubstringSplitter>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsCSubstringSplitter ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSubstringSplitter ) ) . mStr as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSubstringSplitter ) , "::" , stringify ! ( mStr ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSubstringSplitter ) ) . mArray as - * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSubstringSplitter ) , "::" , stringify ! ( mArray ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSubstringSplitter ) ) . mArraySize - as * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSubstringSplitter ) , "::" , stringify ! ( mArraySize ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSubstringSplitter ) ) . mDelim as - * const _ as usize } , 20usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSubstringSplitter ) , "::" , stringify ! ( mDelim ) )); + #[derive(Debug, Copy, Clone)] + pub struct AutoTArray__bindgen_ty_1 { + pub mAutoBuf: root::__BindgenUnionField<*mut ::std::os::raw::c_char>, + pub mAlign: root::__BindgenUnionField<u8>, + pub bindgen_union_field: u64, } #[repr(C)] #[derive(Debug)] @@ -14124,18 +10499,12 @@ pub mod root { "::" , stringify ! ( mFixedBuf ) )); } pub type PRUint32 = ::std::os::raw::c_uint; - pub type PRInt32 = ::std::os::raw::c_int; pub type PRIntn = ::std::os::raw::c_int; pub type PRUintn = ::std::os::raw::c_uint; - /************************************************************************ -** TYPES: PRSize -** DESCRIPTION: -** A type for representing the size of objects. -************************************************************************/ + /// TYPES: PRSize + /// DESCRIPTION: + /// A type for representing the size of objects. pub type PRSize = usize; - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum PRStatus { PR_FAILURE = -1, PR_SUCCESS = 0, } #[repr(C)] #[derive(Debug, Copy)] pub struct PLHashEntry { @@ -14304,32 +10673,6 @@ pub mod root { } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsCSSTokenType { - eCSSToken_Whitespace = 0, - eCSSToken_Comment = 1, - eCSSToken_Ident = 2, - eCSSToken_Function = 3, - eCSSToken_AtKeyword = 4, - eCSSToken_ID = 5, - eCSSToken_Hash = 6, - eCSSToken_Number = 7, - eCSSToken_Dimension = 8, - eCSSToken_Percentage = 9, - eCSSToken_String = 10, - eCSSToken_Bad_String = 11, - eCSSToken_URL = 12, - eCSSToken_Bad_URL = 13, - eCSSToken_Symbol = 14, - eCSSToken_Includes = 15, - eCSSToken_Dashmatch = 16, - eCSSToken_Beginsmatch = 17, - eCSSToken_Endsmatch = 18, - eCSSToken_Containsmatch = 19, - eCSSToken_URange = 20, - eCSSToken_HTMLComment = 21, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsCSSTokenSerializationType { eCSSTokenSerialization_Nothing = 0, eCSSTokenSerialization_Whitespace = 1, @@ -14358,140 +10701,6 @@ pub mod root { eCSSTokenSerialization_Other = 24, } #[repr(C)] - pub struct nsCSSToken { - pub mIdent: root::nsAutoString, - pub mNumber: f32, - pub mInteger: i32, - pub mInteger2: i32, - pub mType: root::nsCSSTokenType, - pub mSymbol: u16, - pub mIntegerValid: bool, - pub mHasSign: bool, - } - #[test] - fn bindgen_test_layout_nsCSSToken() { - assert_eq!(::std::mem::size_of::<nsCSSToken>() , 184usize , concat ! ( - "Size of: " , stringify ! ( nsCSSToken ) )); - assert_eq! (::std::mem::align_of::<nsCSSToken>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( nsCSSToken ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mIdent as * const _ - as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mIdent ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mNumber as * const _ - as usize } , 160usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mNumber ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mInteger as * const - _ as usize } , 164usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mInteger ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mInteger2 as * const - _ as usize } , 168usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mInteger2 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mType as * const _ - as usize } , 172usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mSymbol as * const _ - as usize } , 176usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mSymbol ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mIntegerValid as * - const _ as usize } , 178usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mIntegerValid ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mHasSign as * const - _ as usize } , 179usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mHasSign ) )); - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsCSSScannerPosition { - pub mOffset: u32, - pub mLineNumber: u32, - pub mLineOffset: u32, - pub mTokenLineNumber: u32, - pub mTokenLineOffset: u32, - pub mTokenOffset: u32, - pub mInitialized: bool, - } - #[test] - fn bindgen_test_layout_nsCSSScannerPosition() { - assert_eq!(::std::mem::size_of::<nsCSSScannerPosition>() , 28usize , - concat ! ( - "Size of: " , stringify ! ( nsCSSScannerPosition ) )); - assert_eq! (::std::mem::align_of::<nsCSSScannerPosition>() , 4usize , - concat ! ( - "Alignment of " , stringify ! ( nsCSSScannerPosition ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . mOffset as - * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( mOffset ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . - mLineNumber as * const _ as usize } , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( mLineNumber - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . - mLineOffset as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( mLineOffset - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . - mTokenLineNumber as * const _ as usize } , 12usize , - concat ! ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( - mTokenLineNumber ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . - mTokenLineOffset as * const _ as usize } , 16usize , - concat ! ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( - mTokenLineOffset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . - mTokenOffset as * const _ as usize } , 20usize , concat ! - ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( mTokenOffset - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . - mInitialized as * const _ as usize } , 24usize , concat ! - ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( mInitialized - ) )); - } - impl Clone for nsCSSScannerPosition { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsCSSScannerExclude { - eCSSScannerExclude_None = 0, - eCSSScannerExclude_Comments = 1, - eCSSScannerExclude_WhitespaceAndComments = 2, - } - #[repr(C)] #[derive(Debug)] pub struct nsCSSScanner { pub mBuffer: *const u16, @@ -14599,53 +10808,6 @@ pub mod root { "Alignment of field: " , stringify ! ( nsCSSScanner ) , "::" , stringify ! ( mSeenVariableReference ) )); } - /** - * A "unique identifier". This is modeled after OSF DCE UUIDs. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsID { - pub m0: u32, - pub m1: u16, - pub m2: u16, - pub m3: [u8; 8usize], - } - #[test] - fn bindgen_test_layout_nsID() { - assert_eq!(::std::mem::size_of::<nsID>() , 16usize , concat ! ( - "Size of: " , stringify ! ( nsID ) )); - assert_eq! (::std::mem::align_of::<nsID>() , 4usize , concat ! ( - "Alignment of " , stringify ! ( nsID ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsID ) ) . m0 as * const _ as usize } - , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsID ) , "::" , - stringify ! ( m0 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsID ) ) . m1 as * const _ as usize } - , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( nsID ) , "::" , - stringify ! ( m1 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsID ) ) . m2 as * const _ as usize } - , 6usize , concat ! ( - "Alignment of field: " , stringify ! ( nsID ) , "::" , - stringify ! ( m2 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsID ) ) . m3 as * const _ as usize } - , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( nsID ) , "::" , - stringify ! ( m3 ) )); - } - impl Clone for nsID { - fn clone(&self) -> Self { *self } - } - /** - * An "interface id" which can be used to uniquely identify a given - * interface. - */ - pub type nsIID = root::nsID; - pub type PRTime = i64; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PRThread { @@ -14694,29 +10856,6 @@ pub mod root { impl Clone for nsAutoRefCnt { fn clone(&self) -> Self { *self } } - /** - * already_AddRefed cooperates with reference counting smart pointers to enable - * you to assign in a pointer _without_ |AddRef|ing it. You might want to use - * this as a return type from a function that returns an already |AddRef|ed - * pointer. - * - * TODO Move already_AddRefed to namespace mozilla. This has not yet been done - * because of the sheer number of usages of already_AddRefed. - * - * When should you use already_AddRefed<>? - * * Ensure a consumer takes ownership of a reference - * * Pass ownership without calling AddRef/Release (sometimes required in - * off-main-thread code) - * * The ref pointer type you're using doesn't support move construction - * - * Otherwise, use Move(RefPtr/nsCOMPtr/etc). - */ - #[repr(C)] - #[derive(Debug)] - pub struct already_AddRefed<T> { - pub mRawPtr: *mut T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } #[repr(C)] #[derive(Debug)] pub struct RefPtr<T> { @@ -14735,46 +10874,6 @@ pub mod root { pub _address: u8, } #[repr(C)] - pub struct nsCycleCollectionTraversalCallback__bindgen_vtable(::std::os::raw::c_void); - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsCycleCollectionTraversalCallback { - pub vtable_: *const nsCycleCollectionTraversalCallback__bindgen_vtable, - pub mFlags: u32, - } - pub const nsCycleCollectionTraversalCallback_WANT_DEBUG_INFO: - root::nsCycleCollectionTraversalCallback__bindgen_ty_1 = - nsCycleCollectionTraversalCallback__bindgen_ty_1::WANT_DEBUG_INFO; - pub const nsCycleCollectionTraversalCallback_WANT_ALL_TRACES: - root::nsCycleCollectionTraversalCallback__bindgen_ty_1 = - nsCycleCollectionTraversalCallback__bindgen_ty_1::WANT_ALL_TRACES; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsCycleCollectionTraversalCallback__bindgen_ty_1 { - WANT_DEBUG_INFO = 1, - WANT_ALL_TRACES = 2, - } - #[test] - fn bindgen_test_layout_nsCycleCollectionTraversalCallback() { - assert_eq!(::std::mem::size_of::<nsCycleCollectionTraversalCallback>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - nsCycleCollectionTraversalCallback ) )); - assert_eq! (::std::mem::align_of::<nsCycleCollectionTraversalCallback>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsCycleCollectionTraversalCallback ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCycleCollectionTraversalCallback ) - ) . mFlags as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCycleCollectionTraversalCallback ) , "::" , stringify ! - ( mFlags ) )); - } - impl Clone for nsCycleCollectionTraversalCallback { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSContext { _unused: [u8; 0], @@ -14782,37 +10881,35 @@ pub mod root { pub mod JS { #[allow(unused_imports)] use self::super::super::root; - /** - * JS::Value is the interface for a single JavaScript Engine value. A few - * general notes on JS::Value: - * - * - JS::Value has setX() and isX() members for X in - * - * { Int32, Double, String, Symbol, Boolean, Undefined, Null, Object, Magic } - * - * JS::Value also contains toX() for each of the non-singleton types. - * - * - Magic is a singleton type whose payload contains either a JSWhyMagic "reason" for - * the magic value or a uint32_t value. By providing JSWhyMagic values when - * creating and checking for magic values, it is possible to assert, at - * runtime, that only magic values with the expected reason flow through a - * particular value. For example, if cx->exception has a magic value, the - * reason must be JS_GENERATOR_CLOSING. - * - * - The JS::Value operations are preferred. The JSVAL_* operations remain for - * compatibility; they may be removed at some point. These operations mostly - * provide similar functionality. But there are a few key differences. One - * is that JS::Value gives null a separate type. - * Also, to help prevent mistakenly boxing a nullable JSObject* as an object, - * Value::setObject takes a JSObject&. (Conversely, Value::toObject returns a - * JSObject&.) A convenience member Value::setObjectOrNull is provided. - * - * - JSVAL_VOID is the same as the singleton value of the Undefined type. - * - * - Note that JS::Value is 8 bytes on 32 and 64-bit architectures. Thus, on - * 32-bit user code should avoid copying jsval/JS::Value as much as possible, - * preferring to pass by const Value&. - */ + /// JS::Value is the interface for a single JavaScript Engine value. A few + /// general notes on JS::Value: + /// + /// - JS::Value has setX() and isX() members for X in + /// + /// { Int32, Double, String, Symbol, Boolean, Undefined, Null, Object, Magic } + /// + /// JS::Value also contains toX() for each of the non-singleton types. + /// + /// - Magic is a singleton type whose payload contains either a JSWhyMagic "reason" for + /// the magic value or a uint32_t value. By providing JSWhyMagic values when + /// creating and checking for magic values, it is possible to assert, at + /// runtime, that only magic values with the expected reason flow through a + /// particular value. For example, if cx->exception has a magic value, the + /// reason must be JS_GENERATOR_CLOSING. + /// + /// - The JS::Value operations are preferred. The JSVAL_* operations remain for + /// compatibility; they may be removed at some point. These operations mostly + /// provide similar functionality. But there are a few key differences. One + /// is that JS::Value gives null a separate type. + /// Also, to help prevent mistakenly boxing a nullable JSObject* as an object, + /// Value::setObject takes a JSObject&. (Conversely, Value::toObject returns a + /// JSObject&.) A convenience member Value::setObjectOrNull is provided. + /// + /// - JSVAL_VOID is the same as the singleton value of the Undefined type. + /// + /// - Note that JS::Value is 8 bytes on 32 and 64-bit architectures. Thus, on + /// 32-bit user code should avoid copying jsval/JS::Value as much as possible, + /// preferring to pass by const Value&. #[repr(C)] #[derive(Debug, Copy)] pub struct Value { @@ -15075,117 +11172,19 @@ pub mod root { impl Clone for Value { fn clone(&self) -> Self { *self } } - /** - * Reference to a T that has been rooted elsewhere. This is most useful - * as a parameter type, which guarantees that the T lvalue is properly - * rooted. See "Move GC Stack Rooting" above. - * - * If you want to add additional methods to Handle for a specific - * specialization, define a HandleBase<T> specialization containing them. - */ - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Handle<T> { - pub ptr: *mut T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } - pub type Handle_ElementType<T> = T; - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum Handle_Disambiguator { - DeliberatelyChoosingThisOverload = 0, - } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum Handle_CallerIdentity { - ImUsingThisOnlyInFromFromMarkedLocation = 0, - } - /** - * Similar to a handle, but the underlying storage can be changed. This is - * useful for outparams. - * - * If you want to add additional methods to MutableHandle for a specific - * specialization, define a MutableHandleBase<T> specialization containing - * them. - */ - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct MutableHandle<T> { - pub ptr: *mut T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } - pub type MutableHandle_ElementType<T> = T; - /** - * Local variable of type T whose value is always rooted. This is typically - * used for local variables, or for non-rooted values being passed to a - * function that requires a handle, e.g. Foo(Root<T>(cx, x)). - * - * If you want to add additional methods to Rooted for a specific - * specialization, define a RootedBase<T> specialization containing them. - */ + /// Local variable of type T whose value is always rooted. This is typically + /// used for local variables, or for non-rooted values being passed to a + /// function that requires a handle, e.g. Foo(Root<T>(cx, x)). + /// + /// If you want to add additional methods to Rooted for a specific + /// specialization, define a RootedBase<T> specialization containing them. #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Rooted { } pub type Rooted_ElementType<T> = T; - pub type HandleId = root::JS::Handle<root::jsid>; - pub type HandleObject = root::JS::Handle<*mut root::JSObject>; - pub type HandleValue = root::JS::Handle<root::JS::Value>; - pub type MutableHandleValue = - root::JS::MutableHandle<root::JS::Value>; pub type RootedObject = [u64; 3usize]; #[repr(C)] - #[derive(Debug, Copy)] - pub struct PropertyDescriptor { - pub obj: *mut root::JSObject, - pub attrs: ::std::os::raw::c_uint, - pub getter: root::JSGetterOp, - pub setter: root::JSSetterOp, - pub value: root::JS::Value, - } - #[test] - fn bindgen_test_layout_PropertyDescriptor() { - assert_eq!(::std::mem::size_of::<PropertyDescriptor>() , 40usize , - concat ! ( - "Size of: " , stringify ! ( PropertyDescriptor ) )); - assert_eq! (::std::mem::align_of::<PropertyDescriptor>() , 8usize - , concat ! ( - "Alignment of " , stringify ! ( PropertyDescriptor ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const PropertyDescriptor ) ) . obj as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - PropertyDescriptor ) , "::" , stringify ! ( obj ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const PropertyDescriptor ) ) . attrs as - * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - PropertyDescriptor ) , "::" , stringify ! ( attrs ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const PropertyDescriptor ) ) . getter - as * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( - PropertyDescriptor ) , "::" , stringify ! ( getter ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const PropertyDescriptor ) ) . setter - as * const _ as usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( - PropertyDescriptor ) , "::" , stringify ! ( setter ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const PropertyDescriptor ) ) . value as - * const _ as usize } , 32usize , concat ! ( - "Alignment of field: " , stringify ! ( - PropertyDescriptor ) , "::" , stringify ! ( value ) - )); - } - impl Clone for PropertyDescriptor { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DeletePolicy { pub _address: u8, @@ -15205,52 +11204,23 @@ pub mod root { impl Clone for FreePolicy { fn clone(&self) -> Self { *self } } - /** - * A GC pointer, tagged with the trace kind. - * - * In general, a GC pointer should be stored with an exact type. This class - * is for use when that is not possible because a single pointer must point - * to several kinds of GC thing. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct GCCellPtr { - pub ptr: usize, - } - #[test] - fn bindgen_test_layout_GCCellPtr() { - assert_eq!(::std::mem::size_of::<GCCellPtr>() , 8usize , concat ! - ( "Size of: " , stringify ! ( GCCellPtr ) )); - assert_eq! (::std::mem::align_of::<GCCellPtr>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( GCCellPtr ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const GCCellPtr ) ) . ptr as * const _ - as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( GCCellPtr ) , - "::" , stringify ! ( ptr ) )); - } - impl Clone for GCCellPtr { - fn clone(&self) -> Self { *self } - } - /** - * The Heap<T> class is a heap-stored reference to a JS GC thing. All members of - * heap classes that refer to GC things should use Heap<T> (or possibly - * TenuredHeap<T>, described below). - * - * Heap<T> is an abstraction that hides some of the complexity required to - * maintain GC invariants for the contained reference. It uses operator - * overloading to provide a normal pointer interface, but notifies the GC every - * time the value it contains is updated. This is necessary for generational GC, - * which keeps track of all pointers into the nursery. - * - * Heap<T> instances must be traced when their containing object is traced to - * keep the pointed-to GC thing alive. - * - * Heap<T> objects should only be used on the heap. GC references stored on the - * C/C++ stack must use Rooted/Handle/MutableHandle instead. - * - * Type T must be a public GC pointer type. - */ + /// The Heap<T> class is a heap-stored reference to a JS GC thing. All members of + /// heap classes that refer to GC things should use Heap<T> (or possibly + /// TenuredHeap<T>, described below). + /// + /// Heap<T> is an abstraction that hides some of the complexity required to + /// maintain GC invariants for the contained reference. It uses operator + /// overloading to provide a normal pointer interface, but notifies the GC every + /// time the value it contains is updated. This is necessary for generational GC, + /// which keeps track of all pointers into the nursery. + /// + /// Heap<T> instances must be traced when their containing object is traced to + /// keep the pointed-to GC thing alive. + /// + /// Heap<T> objects should only be used on the heap. GC references stored on the + /// C/C++ stack must use Rooted/Handle/MutableHandle instead. + /// + /// Type T must be a public GC pointer type. #[repr(C)] #[derive(Debug)] pub struct Heap<T> { @@ -15262,6 +11232,7 @@ pub mod root { #[allow(unused_imports)] use self::super::super::super::root; #[repr(C)] + #[derive(Debug)] pub struct GarbageCollectionEvent { pub majorGCNumber_: u64, pub reason: *const ::std::os::raw::c_char, @@ -15378,35 +11349,33 @@ pub mod root { savedMonitor_ ) )); } } - /** - * The TenuredHeap<T> class is similar to the Heap<T> class above in that it - * encapsulates the GC concerns of an on-heap reference to a JS object. However, - * it has two important differences: - * - * 1) Pointers which are statically known to only reference "tenured" objects - * can avoid the extra overhead of SpiderMonkey's write barriers. - * - * 2) Objects in the "tenured" heap have stronger alignment restrictions than - * those in the "nursery", so it is possible to store flags in the lower - * bits of pointers known to be tenured. TenuredHeap wraps a normal tagged - * pointer with a nice API for accessing the flag bits and adds various - * assertions to ensure that it is not mis-used. - * - * GC things are said to be "tenured" when they are located in the long-lived - * heap: e.g. they have gained tenure as an object by surviving past at least - * one GC. For performance, SpiderMonkey allocates some things which are known - * to normally be long lived directly into the tenured generation; for example, - * global objects. Additionally, SpiderMonkey does not visit individual objects - * when deleting non-tenured objects, so object with finalizers are also always - * tenured; for instance, this includes most DOM objects. - * - * The considerations to keep in mind when using a TenuredHeap<T> vs a normal - * Heap<T> are: - * - * - It is invalid for a TenuredHeap<T> to refer to a non-tenured thing. - * - It is however valid for a Heap<T> to refer to a tenured thing. - * - It is not possible to store flag bits in a Heap<T>. - */ + /// The TenuredHeap<T> class is similar to the Heap<T> class above in that it + /// encapsulates the GC concerns of an on-heap reference to a JS object. However, + /// it has two important differences: + /// + /// 1) Pointers which are statically known to only reference "tenured" objects + /// can avoid the extra overhead of SpiderMonkey's write barriers. + /// + /// 2) Objects in the "tenured" heap have stronger alignment restrictions than + /// those in the "nursery", so it is possible to store flags in the lower + /// bits of pointers known to be tenured. TenuredHeap wraps a normal tagged + /// pointer with a nice API for accessing the flag bits and adds various + /// assertions to ensure that it is not mis-used. + /// + /// GC things are said to be "tenured" when they are located in the long-lived + /// heap: e.g. they have gained tenure as an object by surviving past at least + /// one GC. For performance, SpiderMonkey allocates some things which are known + /// to normally be long lived directly into the tenured generation; for example, + /// global objects. Additionally, SpiderMonkey does not visit individual objects + /// when deleting non-tenured objects, so object with finalizers are also always + /// tenured; for instance, this includes most DOM objects. + /// + /// The considerations to keep in mind when using a TenuredHeap<T> vs a normal + /// Heap<T> are: + /// + /// - It is invalid for a TenuredHeap<T> to refer to a non-tenured thing. + /// - It is however valid for a Heap<T> to refer to a tenured thing. + /// - It is not possible to store flag bits in a Heap<T>. #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct TenuredHeap { @@ -15443,93 +11412,21 @@ pub mod root { impl Clone for ConstUTF8CharsZ { fn clone(&self) -> Self { *self } } - /** - * Per ES6, the [[DefineOwnProperty]] internal method has three different - * possible outcomes: - * - * - It can throw an exception (which we indicate by returning false). - * - * - It can return true, indicating unvarnished success. - * - * - It can return false, indicating "strict failure". The property could - * not be defined. It's an error, but no exception was thrown. - * - * It's not just [[DefineOwnProperty]]: all the mutating internal methods have - * the same three outcomes. (The other affected internal methods are [[Set]], - * [[Delete]], [[SetPrototypeOf]], and [[PreventExtensions]].) - * - * If you think this design is awful, you're not alone. But as it's the - * standard, we must represent these boolean "success" values somehow. - * ObjectOpSuccess is the class for this. It's like a bool, but when it's false - * it also stores an error code. - * - * Typical usage: - * - * ObjectOpResult result; - * if (!DefineProperty(cx, obj, id, ..., result)) - * return false; - * if (!result) - * return result.reportError(cx, obj, id); - * - * Users don't have to call `result.report()`; another possible ending is: - * - * argv.rval().setBoolean(bool(result)); - * return true; - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ObjectOpResult { - /** - * code_ is either one of the special codes OkCode or Uninitialized, or - * an error code. For now the error codes are private to the JS engine; - * they're defined in js/src/js.msg. - * - * code_ is uintptr_t (rather than uint32_t) for the convenience of the - * JITs, which would otherwise have to deal with either padding or stack - * alignment on 64-bit platforms. - */ - pub code_: usize, - } - #[repr(u64)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum ObjectOpResult_SpecialCodes { - OkCode = 0, - Uninitialized = 18446744073709551615, - } - #[test] - fn bindgen_test_layout_ObjectOpResult() { - assert_eq!(::std::mem::size_of::<ObjectOpResult>() , 8usize , - concat ! ( "Size of: " , stringify ! ( ObjectOpResult ) - )); - assert_eq! (::std::mem::align_of::<ObjectOpResult>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( ObjectOpResult ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ObjectOpResult ) ) . code_ as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( ObjectOpResult - ) , "::" , stringify ! ( code_ ) )); - } - impl Clone for ObjectOpResult { - fn clone(&self) -> Self { *self } - } - /** - * This class can be used to store a pointer to the youngest frame of a saved - * stack in the specified JSContext. This reference will be picked up by any new - * calls performed until the class is destroyed, with the specified asyncCause, - * that must not be empty. - * - * Any stack capture initiated during these new calls will go through the async - * stack instead of the current stack. - * - * Capturing the stack before a new call is performed will not be affected. - * - * The provided chain of SavedFrame objects can live in any compartment, - * although it will be copied to the compartment where the stack is captured. - * - * See also `js/src/doc/SavedFrame/SavedFrame.md` for documentation on async - * stack frames. - */ + /// This class can be used to store a pointer to the youngest frame of a saved + /// stack in the specified JSContext. This reference will be picked up by any new + /// calls performed until the class is destroyed, with the specified asyncCause, + /// that must not be empty. + /// + /// Any stack capture initiated during these new calls will go through the async + /// stack instead of the current stack. + /// + /// Capturing the stack before a new call is performed will not be affected. + /// + /// The provided chain of SavedFrame objects can live in any compartment, + /// although it will be copied to the compartment where the stack is captured. + /// + /// See also `js/src/doc/SavedFrame/SavedFrame.md` for documentation on async + /// stack frames. #[repr(C)] #[derive(Debug)] pub struct AutoSetAsyncStackForNewCalls { @@ -15615,44 +11512,9 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct JSFunction { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct JSObject { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct JSScript { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct JSString { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct jsid { - pub asBits: usize, - } - #[test] - fn bindgen_test_layout_jsid() { - assert_eq!(::std::mem::size_of::<jsid>() , 8usize , concat ! ( - "Size of: " , stringify ! ( jsid ) )); - assert_eq! (::std::mem::align_of::<jsid>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( jsid ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const jsid ) ) . asBits as * const _ as - usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( jsid ) , "::" , - stringify ! ( asBits ) )); - } - impl Clone for jsid { - fn clone(&self) -> Self { *self } - } pub mod js { #[allow(unused_imports)] use self::super::super::root; @@ -15660,15 +11522,6 @@ pub mod root { #[allow(unused_imports)] use self::super::super::super::root; } - pub mod gcstats { - #[allow(unused_imports)] - use self::super::super::super::root; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Statistics { - _unused: [u8; 0], - } - } #[repr(C)] #[derive(Debug, Copy)] pub struct SystemAllocPolicy { @@ -15699,32 +11552,20 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct HandleBase { - pub _address: u8, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct MutableHandleBase { - pub _address: u8, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct HeapBase { pub _address: u8, } #[repr(C)] pub struct SourceHook__bindgen_vtable(::std::os::raw::c_void); - /** - * A class of objects that return source code on demand. - * - * When code is compiled with setSourceIsLazy(true), SpiderMonkey doesn't - * retain the source code (and doesn't do lazy bytecode generation). If we ever - * need the source code, say, in response to a call to Function.prototype. - * toSource or Debugger.Source.prototype.text, then we call the 'load' member - * function of the instance of this class that has hopefully been registered - * with the runtime, passing the code's URL, and hope that it will be able to - * find the source. - */ + /// A class of objects that return source code on demand. + /// + /// When code is compiled with setSourceIsLazy(true), SpiderMonkey doesn't + /// retain the source code (and doesn't do lazy bytecode generation). If we ever + /// need the source code, say, in response to a call to Function.prototype. + /// toSource or Debugger.Source.prototype.text, then we call the 'load' member + /// function of the instance of this class that has hopefully been registered + /// with the runtime, passing the code's URL, and hope that it will be able to + /// find the source. #[repr(C)] #[derive(Debug)] pub struct SourceHook { @@ -15744,63 +11585,6 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct JSRuntime { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct JSTracer { - pub runtime_: *mut root::JSRuntime, - pub weakMapAction_: root::WeakMapTraceKind, - pub checkEdges_: bool, - pub tag_: root::JSTracer_TracerKindTag, - pub traceWeakEdges_: bool, - } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum JSTracer_TracerKindTag { - Marking = 0, - WeakMarking = 1, - Tenuring = 2, - Callback = 3, - } - #[test] - fn bindgen_test_layout_JSTracer() { - assert_eq!(::std::mem::size_of::<JSTracer>() , 24usize , concat ! ( - "Size of: " , stringify ! ( JSTracer ) )); - assert_eq! (::std::mem::align_of::<JSTracer>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( JSTracer ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSTracer ) ) . runtime_ as * const _ - as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( JSTracer ) , "::" , - stringify ! ( runtime_ ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSTracer ) ) . weakMapAction_ as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( JSTracer ) , "::" , - stringify ! ( weakMapAction_ ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSTracer ) ) . checkEdges_ as * const - _ as usize } , 12usize , concat ! ( - "Alignment of field: " , stringify ! ( JSTracer ) , "::" , - stringify ! ( checkEdges_ ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSTracer ) ) . tag_ as * const _ as - usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( JSTracer ) , "::" , - stringify ! ( tag_ ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSTracer ) ) . traceWeakEdges_ as * - const _ as usize } , 20usize , concat ! ( - "Alignment of field: " , stringify ! ( JSTracer ) , "::" , - stringify ! ( traceWeakEdges_ ) )); - } - impl Clone for JSTracer { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug)] pub struct nsCOMPtr<T> { pub mRawPtr: *mut T, @@ -15827,6 +11611,7 @@ pub mod root { pub type nsAutoPtr_Proxy_member_function = u8; pub type PLDHashNumber = u32; #[repr(C)] + #[derive(Debug)] pub struct PLDHashTable { pub mOps: *const root::PLDHashTableOps, pub mHashShift: i16, @@ -16047,6 +11832,7 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug, Copy)] pub struct Checker { pub mState: u32, pub mIsWritable: u32, @@ -16072,6 +11858,9 @@ pub mod root { "Alignment of field: " , stringify ! ( Checker ) , "::" , stringify ! ( mIsWritable ) )); } + impl Clone for Checker { + fn clone(&self) -> Self { *self } + } pub type PLDHashHashKey = ::std::option::Option<unsafe extern "C" fn(aKey: *const ::std::os::raw::c_void) @@ -16099,11 +11888,9 @@ pub mod root { *mut root::PLDHashEntryHdr, aKey: *const ::std::os::raw::c_void)>; - /** - * hashkey wrapper using T* KeyType - * - * @see nsTHashtable::EntryType for specification - */ + /// hashkey wrapper using T* KeyType + /// + /// @see nsTHashtable::EntryType for specification #[repr(C)] #[derive(Debug)] pub struct nsPtrHashKey<T> { @@ -16118,11 +11905,9 @@ pub mod root { #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsPtrHashKey__bindgen_ty_1 { ALLOW_MEMMOVE = 0, } - /** - * hashkey wrapper using nsAString KeyType - * - * @see nsTHashtable::EntryType for specification - */ + /// hashkey wrapper using nsAString KeyType + /// + /// @see nsTHashtable::EntryType for specification #[repr(C)] #[derive(Debug)] pub struct nsStringHashKey { @@ -16150,11 +11935,9 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStringHashKey ) , "::" , stringify ! ( mStr ) )); } - /** - * hashkey wrapper using nsACString KeyType - * - * @see nsTHashtable::EntryType for specification - */ + /// hashkey wrapper using nsACString KeyType + /// + /// @see nsTHashtable::EntryType for specification #[repr(C)] #[derive(Debug)] pub struct nsCStringHashKey { @@ -16183,11 +11966,9 @@ pub mod root { "Alignment of field: " , stringify ! ( nsCStringHashKey ) , "::" , stringify ! ( mStr ) )); } - /** - * hashkey wrapper using nsISupports* KeyType - * - * @see nsTHashtable::EntryType for specification - */ + /// hashkey wrapper using nsISupports* KeyType + /// + /// @see nsTHashtable::EntryType for specification #[repr(C)] #[derive(Debug)] pub struct nsISupportsHashKey { @@ -16216,11 +11997,9 @@ pub mod root { "Alignment of field: " , stringify ! ( nsISupportsHashKey ) , "::" , stringify ! ( mSupports ) )); } - /** - * hashkey wrapper using refcounted * KeyType - * - * @see nsTHashtable::EntryType for specification - */ + /// hashkey wrapper using refcounted * KeyType + /// + /// @see nsTHashtable::EntryType for specification #[repr(C)] #[derive(Debug)] pub struct nsRefPtrHashKey<T> { @@ -16236,69 +12015,63 @@ pub mod root { #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsRefPtrHashKey__bindgen_ty_1 { ALLOW_MEMMOVE = 0, } - /** - * a base class for templated hashtables. - * - * Clients will rarely need to use this class directly. Check the derived - * classes first, to see if they will meet your needs. - * - * @param EntryType the templated entry-type class that is managed by the - * hashtable. <code>EntryType</code> must extend the following declaration, - * and <strong>must not declare any virtual functions or derive from classes - * with virtual functions.</strong> Any vtable pointer would break the - * PLDHashTable code. - *<pre> class EntryType : public PLDHashEntryHdr - * { - * public: or friend nsTHashtable<EntryType>; - * // KeyType is what we use when Get()ing or Put()ing this entry - * // this should either be a simple datatype (uint32_t, nsISupports*) or - * // a const reference (const nsAString&) - * typedef something KeyType; - * // KeyTypePointer is the pointer-version of KeyType, because - * // PLDHashTable.h requires keys to cast to <code>const void*</code> - * typedef const something* KeyTypePointer; - * - * EntryType(KeyTypePointer aKey); - * - * // A copy or C++11 Move constructor must be defined, even if - * // AllowMemMove() == true, otherwise you will cause link errors. - * EntryType(const EntryType& aEnt); // Either this... - * EntryType(EntryType&& aEnt); // ...or this - * - * // the destructor must be defined... or you will cause link errors! - * ~EntryType(); - * - * // KeyEquals(): does this entry match this key? - * bool KeyEquals(KeyTypePointer aKey) const; - * - * // KeyToPointer(): Convert KeyType to KeyTypePointer - * static KeyTypePointer KeyToPointer(KeyType aKey); - * - * // HashKey(): calculate the hash number - * static PLDHashNumber HashKey(KeyTypePointer aKey); - * - * // ALLOW_MEMMOVE can we move this class with memmove(), or do we have - * // to use the copy constructor? - * enum { ALLOW_MEMMOVE = true/false }; - * }</pre> - * - * @see nsInterfaceHashtable - * @see nsDataHashtable - * @see nsClassHashtable - * @author "Benjamin Smedberg <bsmedberg@covad.net>" - */ + /// a base class for templated hashtables. + /// + /// Clients will rarely need to use this class directly. Check the derived + /// classes first, to see if they will meet your needs. + /// + /// @param EntryType the templated entry-type class that is managed by the + /// hashtable. <code>EntryType</code> must extend the following declaration, + /// and <strong>must not declare any virtual functions or derive from classes + /// with virtual functions.</strong> Any vtable pointer would break the + /// PLDHashTable code. + /// <pre> class EntryType : public PLDHashEntryHdr + /// { + /// public: or friend nsTHashtable<EntryType>; + /// // KeyType is what we use when Get()ing or Put()ing this entry + /// // this should either be a simple datatype (uint32_t, nsISupports*) or + /// // a const reference (const nsAString&) + /// typedef something KeyType; + /// // KeyTypePointer is the pointer-version of KeyType, because + /// // PLDHashTable.h requires keys to cast to <code>const void*</code> + /// typedef const something* KeyTypePointer; + /// + /// EntryType(KeyTypePointer aKey); + /// + /// // A copy or C++11 Move constructor must be defined, even if + /// // AllowMemMove() == true, otherwise you will cause link errors. + /// EntryType(const EntryType& aEnt); // Either this... + /// EntryType(EntryType&& aEnt); // ...or this + /// + /// // the destructor must be defined... or you will cause link errors! + /// ~EntryType(); + /// + /// // KeyEquals(): does this entry match this key? + /// bool KeyEquals(KeyTypePointer aKey) const; + /// + /// // KeyToPointer(): Convert KeyType to KeyTypePointer + /// static KeyTypePointer KeyToPointer(KeyType aKey); + /// + /// // HashKey(): calculate the hash number + /// static PLDHashNumber HashKey(KeyTypePointer aKey); + /// + /// // ALLOW_MEMMOVE can we move this class with memmove(), or do we have + /// // to use the copy constructor? + /// enum { ALLOW_MEMMOVE = true/false }; + /// }</pre> + /// + /// @see nsInterfaceHashtable + /// @see nsDataHashtable + /// @see nsClassHashtable + /// @author "Benjamin Smedberg <bsmedberg@covad.net>" #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsTHashtable { } pub type nsTHashtable_fallible_t = root::mozilla::fallible_t; - /** - * KeyType is typedef'ed for ease of use. - */ + /// KeyType is typedef'ed for ease of use. pub type nsTHashtable_KeyType = [u8; 0usize]; - /** - * KeyTypePointer is typedef'ed for ease of use. - */ + /// KeyTypePointer is typedef'ed for ease of use. pub type nsTHashtable_KeyTypePointer = [u8; 0usize]; #[repr(C)] #[derive(Debug)] @@ -16306,18 +12079,16 @@ pub mod root { pub _base: root::PLDHashTable_Iterator, } pub type nsTHashtable_Iterator_Base = root::PLDHashTable_Iterator; - /** - * templated hashtable for simple data types - * This class manages simple data types that do not need construction or - * destruction. - * - * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h - * for a complete specification. - * @param DataType the datatype stored in the hashtable, - * for example, uint32_t or nsCOMPtr. If UserDataType is not the same, - * DataType must implicitly cast to UserDataType - * @param UserDataType the user sees, for example uint32_t or nsISupports* - */ + /// templated hashtable for simple data types + /// This class manages simple data types that do not need construction or + /// destruction. + /// + /// @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h + /// for a complete specification. + /// @param DataType the datatype stored in the hashtable, + /// for example, uint32_t or nsCOMPtr. If UserDataType is not the same, + /// DataType must implicitly cast to UserDataType + /// @param UserDataType the user sees, for example uint32_t or nsISupports* #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsBaseHashtable { @@ -16352,11 +12123,9 @@ pub mod root { pub _base: root::PLDHashTable_Iterator, } pub type nsBaseHashtable_Iterator_Base = root::PLDHashTable_Iterator; - /** - * the private nsTHashtable::EntryType class used by nsBaseHashtable - * @see nsTHashtable for the specification of this class - * @see nsBaseHashtable for template parameters - */ + /// the private nsTHashtable::EntryType class used by nsBaseHashtable + /// @see nsTHashtable for the specification of this class + /// @see nsBaseHashtable for template parameters #[repr(C)] #[derive(Debug)] pub struct nsBaseHashtableET<KeyClass, DataType> { @@ -16367,105 +12136,17 @@ pub mod root { } pub type nsBaseHashtableET_KeyType = [u8; 0usize]; pub type nsBaseHashtableET_KeyTypePointer = [u8; 0usize]; - /** - * templated hashtable class maps keys to simple datatypes. - * See nsBaseHashtable for complete declaration - * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h - * for a complete specification. - * @param DataType the simple datatype being wrapped - * @see nsInterfaceHashtable, nsClassHashtable - */ + /// templated hashtable class maps keys to simple datatypes. + /// See nsBaseHashtable for complete declaration + /// @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h + /// for a complete specification. + /// @param DataType the simple datatype being wrapped + /// @see nsInterfaceHashtable, nsClassHashtable #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsDataHashtable { } pub type nsDataHashtable_BaseClass = u8; - pub type nsIntRegion = root::mozilla::gfx::IntRegion; - #[repr(C)] - #[derive(Debug)] - pub struct nsRegion { - pub mImpl: root::pixman_region32_t, - } - pub type nsRegion_RectType = root::nsRect; - pub type nsRegion_PointType = root::nsPoint; - pub type nsRegion_MarginType = root::nsMargin; - /** - * VisitEdges is a weird kind of function that we use for padding - * out surfaces to prevent texture filtering artifacts. - * It calls the visitFn callback for each of the exterior edges of - * the regions. The top and bottom edges will be expanded 1 pixel - * to the left and right if there's an outside corner. The order - * the edges are visited is not guaranteed. - * - * visitFn has a side parameter that can be TOP,BOTTOM,LEFT,RIGHT - * and specifies which kind of edge is being visited. x1, y1, x2, y2 - * are the coordinates of the line. (x1 == x2) || (y1 == y2) - */ - pub type nsRegion_visitFn = - ::std::option::Option<unsafe extern "C" fn(closure: - *mut ::std::os::raw::c_void, - side: root::VisitSide, - x1: ::std::os::raw::c_int, - y1: ::std::os::raw::c_int, - x2: ::std::os::raw::c_int, - y2: - ::std::os::raw::c_int)>; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsRegion_RectIterator { - pub mCurrent: ::std::os::raw::c_int, - pub mLimit: ::std::os::raw::c_int, - pub mTmp: root::nsRect, - pub mBoxes: *mut root::pixman_box32_t, - } - #[test] - fn bindgen_test_layout_nsRegion_RectIterator() { - assert_eq!(::std::mem::size_of::<nsRegion_RectIterator>() , 32usize , - concat ! ( - "Size of: " , stringify ! ( nsRegion_RectIterator ) )); - assert_eq! (::std::mem::align_of::<nsRegion_RectIterator>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsRegion_RectIterator ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRegion_RectIterator ) ) . mCurrent - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsRegion_RectIterator ) , "::" , stringify ! ( mCurrent ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRegion_RectIterator ) ) . mLimit as - * const _ as usize } , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsRegion_RectIterator ) , "::" , stringify ! ( mLimit ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRegion_RectIterator ) ) . mTmp as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsRegion_RectIterator ) , "::" , stringify ! ( mTmp ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRegion_RectIterator ) ) . mBoxes as - * const _ as usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsRegion_RectIterator ) , "::" , stringify ! ( mBoxes ) - )); - } - impl Clone for nsRegion_RectIterator { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_nsRegion() { - assert_eq!(::std::mem::size_of::<nsRegion>() , 24usize , concat ! ( - "Size of: " , stringify ! ( nsRegion ) )); - assert_eq! (::std::mem::align_of::<nsRegion>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( nsRegion ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRegion ) ) . mImpl as * const _ as - usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsRegion ) , "::" , - stringify ! ( mImpl ) )); - } #[repr(C)] #[derive(Debug, Copy)] pub struct nsTArrayHeader { @@ -16581,8 +12262,6 @@ pub mod root { } pub type nscoord = i32; pub type nscolor = u32; - pub type nsIntPoint = root::mozilla::gfx::IntPoint; - pub type nsIntMargin = root::mozilla::gfx::IntMargin; #[repr(C)] #[derive(Debug, Copy)] pub struct gfxFontFeature { @@ -16826,11 +12505,6 @@ pub mod root { mFontFeatureValues ) )); } pub type gfxFontVariation = root::mozilla::gfx::FontVariation; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct gfxFontStyle { - _unused: [u8; 0], - } pub const kGenericFont_NONE: u8 = 0; pub const kGenericFont_moz_variable: u8 = 0; pub const kGenericFont_moz_fixed: u8 = 1; @@ -16982,10 +12656,8 @@ pub mod root { "Alignment of field: " , stringify ! ( nsFont ) , "::" , stringify ! ( languageOverride ) )); } - /** - * An array of objects, similar to AutoTArray<T,1> but which is memmovable. It - * always has length >= 1. - */ + /// An array of objects, similar to AutoTArray<T,1> but which is memmovable. It + /// always has length >= 1. #[repr(C)] #[derive(Debug)] pub struct nsStyleAutoArray<T> { @@ -17052,15 +12724,14 @@ pub mod root { impl Clone for nsStyleUnion { fn clone(&self) -> Self { *self } } - /** - * Class that hold a single size specification used by the style - * system. The size specification consists of two parts -- a number - * and a unit. The number is an integer, a floating point value, an - * nscoord, or undefined, and the unit is an nsStyleUnit. Checking - * the unit is a must before asking for the value in any particular - * form. - */ - /** <div rustbindgen private accessor="unsafe"></div> */ + /// Class that hold a single size specification used by the style + /// system. The size specification consists of two parts -- a number + /// and a unit. The number is an integer, a floating point value, an + /// nscoord, or undefined, and the unit is an nsStyleUnit. Checking + /// the unit is a must before asking for the value in any particular + /// form. + /// / + /// /** <div rustbindgen private accessor="unsafe"></div> #[repr(C)] #[derive(Debug)] pub struct nsStyleCoord { @@ -17162,12 +12833,11 @@ pub mod root { &mut self.mValue } } - /** - * Class that represents a set of top/right/bottom/left nsStyleCoords. - * This is commonly used to hold the widths of the borders, margins, - * or paddings of a box. - */ - /** <div rustbindgen private accessor="unsafe"></div> */ + /// Class that represents a set of top/right/bottom/left nsStyleCoords. + /// This is commonly used to hold the widths of the borders, margins, + /// or paddings of a box. + /// / + /// /** <div rustbindgen private accessor="unsafe"></div> #[repr(C)] #[derive(Debug)] pub struct nsStyleSides { @@ -17211,12 +12881,11 @@ pub mod root { &mut self.mValues } } - /** - * Class that represents a set of top-left/top-right/bottom-right/bottom-left - * nsStyleCoord pairs. This is used to hold the dimensions of the - * corners of a box (for, e.g., border-radius and outline-radius). - */ - /** <div rustbindgen private accessor="unsafe"></div> */ + /// Class that represents a set of top-left/top-right/bottom-right/bottom-left + /// nsStyleCoord pairs. This is used to hold the dimensions of the + /// corners of a box (for, e.g., border-radius and outline-radius). + /// / + /// /** <div rustbindgen private accessor="unsafe"></div> #[repr(C)] #[derive(Debug)] pub struct nsStyleCorners { @@ -17438,1408 +13107,24 @@ pub mod root { } } #[repr(C)] - /** - * |nsRestyleHint| is a bitfield for the result of - * |HasStateDependentStyle| and |HasAttributeDependentStyle|. When no - * restyling is necessary, use |nsRestyleHint(0)|. - * - * Without eRestyle_Force or eRestyle_ForceDescendants, the restyling process - * can stop processing at a frame when it detects no style changes and it is - * known that the styles of the subtree beneath it will not change, leaving - * the old style context on the frame. eRestyle_Force can be used to skip this - * optimization on a frame, and to force its new style context to be used. - * - * Similarly, eRestyle_ForceDescendants will cause the frame and all of its - * descendants to be traversed and for the new style contexts that are created - * to be set on the frames. - * - * NOTE: When adding new restyle hints, please also add them to - * RestyleManager::RestyleHintToString. - */ + /// |nsRestyleHint| is a bitfield for the result of + /// |HasStateDependentStyle| and |HasAttributeDependentStyle|. When no + /// restyling is necessary, use |nsRestyleHint(0)|. + /// + /// Without eRestyle_Force or eRestyle_ForceDescendants, the restyling process + /// can stop processing at a frame when it detects no style changes and it is + /// known that the styles of the subtree beneath it will not change, leaving + /// the old style context on the frame. eRestyle_Force can be used to skip this + /// optimization on a frame, and to force its new style context to be used. + /// + /// Similarly, eRestyle_ForceDescendants will cause the frame and all of its + /// descendants to be traversed and for the new style contexts that are created + /// to be set on the frames. + /// + /// NOTE: When adding new restyle hints, please also add them to + /// RestyleManager::RestyleHintToString. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct nsRestyleHint(pub u32); - #[repr(u32)] - /** - * Return status for event processors. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsEventStatus { - nsEventStatus_eIgnore = 0, - nsEventStatus_eConsumeNoDefault = 1, - nsEventStatus_eConsumeDoDefault = 2, - nsEventStatus_eSentinel = 3, - } - pub type gfxSize = [u64; 2usize]; - pub type nsIntRect = root::mozilla::gfx::IntRect; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct pixman_region32_data { - pub size: ::std::os::raw::c_long, - pub numRects: ::std::os::raw::c_long, - } - #[test] - fn bindgen_test_layout_pixman_region32_data() { - assert_eq!(::std::mem::size_of::<pixman_region32_data>() , 16usize , - concat ! ( - "Size of: " , stringify ! ( pixman_region32_data ) )); - assert_eq! (::std::mem::align_of::<pixman_region32_data>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( pixman_region32_data ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_region32_data ) ) . size as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - pixman_region32_data ) , "::" , stringify ! ( size ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_region32_data ) ) . numRects - as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - pixman_region32_data ) , "::" , stringify ! ( numRects ) - )); - } - impl Clone for pixman_region32_data { - fn clone(&self) -> Self { *self } - } - pub type pixman_region32_data_t = root::pixman_region32_data; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct pixman_box32 { - pub x1: i32, - pub y1: i32, - pub x2: i32, - pub y2: i32, - } - #[test] - fn bindgen_test_layout_pixman_box32() { - assert_eq!(::std::mem::size_of::<pixman_box32>() , 16usize , concat ! - ( "Size of: " , stringify ! ( pixman_box32 ) )); - assert_eq! (::std::mem::align_of::<pixman_box32>() , 4usize , concat ! - ( "Alignment of " , stringify ! ( pixman_box32 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_box32 ) ) . x1 as * const _ as - usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( pixman_box32 ) , - "::" , stringify ! ( x1 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_box32 ) ) . y1 as * const _ as - usize } , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( pixman_box32 ) , - "::" , stringify ! ( y1 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_box32 ) ) . x2 as * const _ as - usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( pixman_box32 ) , - "::" , stringify ! ( x2 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_box32 ) ) . y2 as * const _ as - usize } , 12usize , concat ! ( - "Alignment of field: " , stringify ! ( pixman_box32 ) , - "::" , stringify ! ( y2 ) )); - } - impl Clone for pixman_box32 { - fn clone(&self) -> Self { *self } - } - pub type pixman_box32_t = root::pixman_box32; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct pixman_region32 { - pub extents: root::pixman_box32_t, - pub data: *mut root::pixman_region32_data_t, - } - #[test] - fn bindgen_test_layout_pixman_region32() { - assert_eq!(::std::mem::size_of::<pixman_region32>() , 24usize , concat - ! ( "Size of: " , stringify ! ( pixman_region32 ) )); - assert_eq! (::std::mem::align_of::<pixman_region32>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( pixman_region32 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_region32 ) ) . extents as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( pixman_region32 ) , - "::" , stringify ! ( extents ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_region32 ) ) . data as * const - _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( pixman_region32 ) , - "::" , stringify ! ( data ) )); - } - impl Clone for pixman_region32 { - fn clone(&self) -> Self { *self } - } - pub type pixman_region32_t = root::pixman_region32; - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum VisitSide { TOP = 0, BOTTOM = 1, LEFT = 2, RIGHT = 3, } - /** - * Presentation shell interface. Presentation shells are the - * controlling point for managing the presentation of a document. The - * presentation shell holds a live reference to the document, the - * presentation context, the style manager, the style set and the root - * frame. <p> - * - * When this object is Release'd, it will release the document, the - * presentation context, the style manager, the style set and the root - * frame. - */ - #[repr(C)] - pub struct nsIPresShell { - pub _base: root::nsISupports, - pub mDocument: root::nsCOMPtr<root::nsIDocument>, - pub mPresContext: root::RefPtr<root::nsPresContext>, - pub mStyleSet: root::mozilla::StyleSetHandle, - pub mFrameConstructor: *mut root::nsCSSFrameConstructor, - pub mViewManager: *mut root::nsViewManager, - pub mFrameArena: root::nsPresArena, - pub mSelection: root::RefPtr<root::nsFrameSelection>, - pub mFrameManager: *mut root::nsFrameManagerBase, - pub mForwardingContainer: u64, - pub mDocAccessible: *mut root::mozilla::a11y::DocAccessible, - pub mReflowContinueTimer: root::nsCOMPtr<root::nsITimer>, - pub mDrawEventTargetFrame: *mut root::nsIFrame, - pub mAllocatedPointers: [u64; 6usize], - pub mPaintCount: u64, - pub mScrollPositionClampingScrollPortSize: root::nsSize, - pub mAutoWeakFrames: *mut root::AutoWeakFrame, - pub mWeakFrames: [u64; 6usize], - pub mCanvasBackgroundColor: root::nscolor, - pub mResolution: [u32; 2usize], - pub mSelectionFlags: i16, - pub mRenderFlags: root::nsIPresShell_RenderFlags, - pub _bitfield_1: [u8; 2usize], - pub mPresShellId: u32, - pub mFontSizeInflationEmPerLine: u32, - pub mFontSizeInflationMinTwips: u32, - pub mFontSizeInflationLineThreshold: u32, - pub mFontSizeInflationForceEnabled: bool, - pub mFontSizeInflationDisabledInMasterProcess: bool, - pub mFontSizeInflationEnabled: bool, - pub mFontSizeInflationEnabledIsDirty: bool, - pub mPaintingIsFrozen: bool, - pub mIsNeverPainting: bool, - pub mInFlush: bool, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIPresShell_COMTypeInfo { - pub _address: u8, - } - pub type nsIPresShell_FocusTarget = root::mozilla::layers::FocusTarget; - pub type nsIPresShell_LayerManager = root::mozilla::layers::LayerManager; - pub type nsIPresShell_SourceSurface = root::mozilla::gfx::SourceSurface; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_eRenderFlag { - STATE_IGNORING_VIEWPORT_SCROLLING = 1, - STATE_DRAWWINDOW_NOT_FLUSHING = 2, - } - pub type nsIPresShell_RenderFlags = u8; - #[repr(u32)] - /** - * Gets nearest scrollable frame from the specified content node. The frame - * is scrollable with overflow:scroll or overflow:auto in some direction when - * aDirection is eEither. Otherwise, this returns a nearest frame that is - * scrollable in the specified direction. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_ScrollDirection { - eHorizontal = 0, - eVertical = 1, - eEither = 2, - } - #[repr(u32)] - /** - * Tell the pres shell that a frame needs to be marked dirty and needs - * Reflow. It's OK if this is an ancestor of the frame needing reflow as - * long as the ancestor chain between them doesn't cross a reflow root. - * - * The bit to add should be NS_FRAME_IS_DIRTY, NS_FRAME_HAS_DIRTY_CHILDREN - * or nsFrameState(0); passing 0 means that dirty bits won't be set on the - * frame or its ancestors/descendants, but that intrinsic widths will still - * be marked dirty. Passing aIntrinsicDirty = eResize and aBitToAdd = 0 - * would result in no work being done, so don't do that. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_IntrinsicDirty { - eResize = 0, - eTreeChange = 1, - eStyleChange = 2, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_ReflowRootHandling { - ePositionOrSizeChange = 0, - eNoPositionOrSizeChange = 1, - eInferFromBitToAdd = 2, - } - pub const nsIPresShell_SCROLL_TOP: root::nsIPresShell__bindgen_ty_1 = - nsIPresShell__bindgen_ty_1::SCROLL_TOP; - pub const nsIPresShell_SCROLL_BOTTOM: root::nsIPresShell__bindgen_ty_1 = - nsIPresShell__bindgen_ty_1::SCROLL_BOTTOM; - pub const nsIPresShell_SCROLL_LEFT: root::nsIPresShell__bindgen_ty_1 = - nsIPresShell__bindgen_ty_1::SCROLL_TOP; - pub const nsIPresShell_SCROLL_RIGHT: root::nsIPresShell__bindgen_ty_1 = - nsIPresShell__bindgen_ty_1::SCROLL_BOTTOM; - pub const nsIPresShell_SCROLL_CENTER: root::nsIPresShell__bindgen_ty_1 = - nsIPresShell__bindgen_ty_1::SCROLL_CENTER; - pub const nsIPresShell_SCROLL_MINIMUM: root::nsIPresShell__bindgen_ty_1 = - nsIPresShell__bindgen_ty_1::SCROLL_MINIMUM; - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell__bindgen_ty_1 { - SCROLL_TOP = 0, - SCROLL_BOTTOM = 100, - SCROLL_CENTER = 50, - SCROLL_MINIMUM = -1, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_WhenToScroll { - SCROLL_ALWAYS = 0, - SCROLL_IF_NOT_VISIBLE = 1, - SCROLL_IF_NOT_FULLY_VISIBLE = 2, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIPresShell_ScrollAxis { - pub _bindgen_opaque_blob: u32, - } - #[test] - fn bindgen_test_layout_nsIPresShell_ScrollAxis() { - assert_eq!(::std::mem::size_of::<nsIPresShell_ScrollAxis>() , 4usize , - concat ! ( - "Size of: " , stringify ! ( nsIPresShell_ScrollAxis ) )); - assert_eq! (::std::mem::align_of::<nsIPresShell_ScrollAxis>() , 4usize - , concat ! ( - "Alignment of " , stringify ! ( nsIPresShell_ScrollAxis ) - )); - } - impl Clone for nsIPresShell_ScrollAxis { - fn clone(&self) -> Self { *self } - } - pub const nsIPresShell_SCROLL_FIRST_ANCESTOR_ONLY: - root::nsIPresShell__bindgen_ty_2 = - nsIPresShell__bindgen_ty_2::SCROLL_FIRST_ANCESTOR_ONLY; - pub const nsIPresShell_SCROLL_OVERFLOW_HIDDEN: - root::nsIPresShell__bindgen_ty_2 = - nsIPresShell__bindgen_ty_2::SCROLL_OVERFLOW_HIDDEN; - pub const nsIPresShell_SCROLL_NO_PARENT_FRAMES: - root::nsIPresShell__bindgen_ty_2 = - nsIPresShell__bindgen_ty_2::SCROLL_NO_PARENT_FRAMES; - pub const nsIPresShell_SCROLL_SMOOTH: root::nsIPresShell__bindgen_ty_2 = - nsIPresShell__bindgen_ty_2::SCROLL_SMOOTH; - pub const nsIPresShell_SCROLL_SMOOTH_AUTO: - root::nsIPresShell__bindgen_ty_2 = - nsIPresShell__bindgen_ty_2::SCROLL_SMOOTH_AUTO; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell__bindgen_ty_2 { - SCROLL_FIRST_ANCESTOR_ONLY = 1, - SCROLL_OVERFLOW_HIDDEN = 2, - SCROLL_NO_PARENT_FRAMES = 4, - SCROLL_SMOOTH = 8, - SCROLL_SMOOTH_AUTO = 16, - } - pub const nsIPresShell_RENDER_IS_UNTRUSTED: - root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_IS_UNTRUSTED; - pub const nsIPresShell_RENDER_IGNORE_VIEWPORT_SCROLLING: - root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_IGNORE_VIEWPORT_SCROLLING; - pub const nsIPresShell_RENDER_CARET: root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_CARET; - pub const nsIPresShell_RENDER_USE_WIDGET_LAYERS: - root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_USE_WIDGET_LAYERS; - pub const nsIPresShell_RENDER_ASYNC_DECODE_IMAGES: - root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_ASYNC_DECODE_IMAGES; - pub const nsIPresShell_RENDER_DOCUMENT_RELATIVE: - root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_DOCUMENT_RELATIVE; - pub const nsIPresShell_RENDER_DRAWWINDOW_NOT_FLUSHING: - root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_DRAWWINDOW_NOT_FLUSHING; - #[repr(u32)] - /** - * Render the document into an arbitrary gfxContext - * Designed for getting a picture of a document or a piece of a document - * Note that callers will generally want to call FlushPendingNotifications - * to get an up-to-date view of the document - * @param aRect is the region to capture into the offscreen buffer, in the - * root frame's coordinate system (if aIgnoreViewportScrolling is false) - * or in the root scrolled frame's coordinate system - * (if aIgnoreViewportScrolling is true). The coordinates are in appunits. - * @param aFlags see below; - * set RENDER_IS_UNTRUSTED if the contents may be passed to malicious - * agents. E.g. we might choose not to paint the contents of sensitive widgets - * such as the file name in a file upload widget, and we might choose not - * to paint themes. - * set RENDER_IGNORE_VIEWPORT_SCROLLING to ignore - * clipping and scrollbar painting due to scrolling in the viewport - * set RENDER_CARET to draw the caret if one would be visible - * (by default the caret is never drawn) - * set RENDER_USE_LAYER_MANAGER to force rendering to go through - * the layer manager for the window. This may be unexpectedly slow - * (if the layer manager must read back data from the GPU) or low-quality - * (if the layer manager reads back pixel data and scales it - * instead of rendering using the appropriate scaling). It may also - * slow everything down if the area rendered does not correspond to the - * normal visible area of the window. - * set RENDER_ASYNC_DECODE_IMAGES to avoid having images synchronously - * decoded during rendering. - * (by default images decode synchronously with RenderDocument) - * set RENDER_DOCUMENT_RELATIVE to render the document as if there has been - * no scrolling and interpret |aRect| relative to the document instead of the - * CSS viewport. Only considered if RENDER_IGNORE_VIEWPORT_SCROLLING is set - * or the document is in ignore viewport scrolling mode - * (nsIPresShell::SetIgnoreViewportScrolling/IgnoringViewportScrolling). - * @param aBackgroundColor a background color to render onto - * @param aRenderedContext the gfxContext to render to. We render so that - * one CSS pixel in the source document is rendered to one unit in the current - * transform. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell__bindgen_ty_3 { - RENDER_IS_UNTRUSTED = 1, - RENDER_IGNORE_VIEWPORT_SCROLLING = 2, - RENDER_CARET = 4, - RENDER_USE_WIDGET_LAYERS = 8, - RENDER_ASYNC_DECODE_IMAGES = 16, - RENDER_DOCUMENT_RELATIVE = 32, - RENDER_DRAWWINDOW_NOT_FLUSHING = 64, - } - pub const nsIPresShell_RENDER_IS_IMAGE: root::nsIPresShell__bindgen_ty_4 = - nsIPresShell__bindgen_ty_4::RENDER_IS_IMAGE; - pub const nsIPresShell_RENDER_AUTO_SCALE: root::nsIPresShell__bindgen_ty_4 - = - nsIPresShell__bindgen_ty_4::RENDER_AUTO_SCALE; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell__bindgen_ty_4 { - RENDER_IS_IMAGE = 256, - RENDER_AUTO_SCALE = 128, - } - pub const nsIPresShell_FORCE_DRAW: root::nsIPresShell__bindgen_ty_5 = - nsIPresShell__bindgen_ty_5::FORCE_DRAW; - pub const nsIPresShell_ADD_FOR_SUBDOC: root::nsIPresShell__bindgen_ty_5 = - nsIPresShell__bindgen_ty_5::ADD_FOR_SUBDOC; - pub const nsIPresShell_APPEND_UNSCROLLED_ONLY: - root::nsIPresShell__bindgen_ty_5 = - nsIPresShell__bindgen_ty_5::APPEND_UNSCROLLED_ONLY; - #[repr(u32)] - /** - * Add a solid color item to the bottom of aList with frame aFrame and bounds - * aBounds. Checks first if this needs to be done by checking if aFrame is a - * canvas frame (if the FORCE_DRAW flag is passed then this check is skipped). - * aBackstopColor is composed behind the background color of the canvas, it is - * transparent by default. - * We attempt to make the background color part of the scrolled canvas (to reduce - * transparent layers), and if async scrolling is enabled (and the background - * is opaque) then we add a second, unscrolled item to handle the checkerboarding - * case. - * ADD_FOR_SUBDOC shoud be specified when calling this for a subdocument, and - * LayoutUseContainersForRootFrame might cause the whole list to be scrolled. In - * that case the second unscrolled item will be elided. - * APPEND_UNSCROLLED_ONLY only attempts to add the unscrolled item, so that we - * can add it manually after LayoutUseContainersForRootFrame has built the - * scrolling ContainerLayer. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell__bindgen_ty_5 { - FORCE_DRAW = 1, - ADD_FOR_SUBDOC = 2, - APPEND_UNSCROLLED_ONLY = 4, - } - #[repr(C)] - pub struct nsIPresShell_PointerCaptureInfo { - pub mPendingContent: root::nsCOMPtr<root::nsIContent>, - pub mOverrideContent: root::nsCOMPtr<root::nsIContent>, - } - #[test] - fn bindgen_test_layout_nsIPresShell_PointerCaptureInfo() { - assert_eq!(::std::mem::size_of::<nsIPresShell_PointerCaptureInfo>() , - 16usize , concat ! ( - "Size of: " , stringify ! ( nsIPresShell_PointerCaptureInfo - ) )); - assert_eq! (::std::mem::align_of::<nsIPresShell_PointerCaptureInfo>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsIPresShell_PointerCaptureInfo ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell_PointerCaptureInfo ) ) . - mPendingContent as * const _ as usize } , 0usize , concat - ! ( - "Alignment of field: " , stringify ! ( - nsIPresShell_PointerCaptureInfo ) , "::" , stringify ! ( - mPendingContent ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell_PointerCaptureInfo ) ) . - mOverrideContent as * const _ as usize } , 8usize , concat - ! ( - "Alignment of field: " , stringify ! ( - nsIPresShell_PointerCaptureInfo ) , "::" , stringify ! ( - mOverrideContent ) )); - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIPresShell_PointerInfo { - pub mPointerType: u16, - pub mActiveState: bool, - pub mPrimaryState: bool, - pub mPreventMouseEventByContent: bool, - } - #[test] - fn bindgen_test_layout_nsIPresShell_PointerInfo() { - assert_eq!(::std::mem::size_of::<nsIPresShell_PointerInfo>() , 6usize - , concat ! ( - "Size of: " , stringify ! ( nsIPresShell_PointerInfo ) )); - assert_eq! (::std::mem::align_of::<nsIPresShell_PointerInfo>() , - 2usize , concat ! ( - "Alignment of " , stringify ! ( nsIPresShell_PointerInfo ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . - mPointerType as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsIPresShell_PointerInfo ) , "::" , stringify ! ( - mPointerType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . - mActiveState as * const _ as usize } , 2usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsIPresShell_PointerInfo ) , "::" , stringify ! ( - mActiveState ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . - mPrimaryState as * const _ as usize } , 3usize , concat ! - ( - "Alignment of field: " , stringify ! ( - nsIPresShell_PointerInfo ) , "::" , stringify ! ( - mPrimaryState ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . - mPreventMouseEventByContent as * const _ as usize } , - 4usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsIPresShell_PointerInfo ) , "::" , stringify ! ( - mPreventMouseEventByContent ) )); - } - impl Clone for nsIPresShell_PointerInfo { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_PaintFlags { - PAINT_LAYERS = 1, - PAINT_COMPOSITE = 2, - PAINT_SYNC_DECODE_IMAGES = 4, - } - #[repr(u32)] - /** - * Ensures that the refresh driver is running, and schedules a view - * manager flush on the next tick. - * - * @param aType PAINT_DELAYED_COMPRESS : Schedule a paint to be executed after a delay, and - * put FrameLayerBuilder in 'compressed' mode that avoids short cut optimizations. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_PaintType { - PAINT_DEFAULT = 0, - PAINT_DELAYED_COMPRESS = 1, - } - extern "C" { - #[link_name = "_ZN12nsIPresShell12gCaptureInfoE"] - pub static mut nsIPresShell_gCaptureInfo: root::CapturingContentInfo; - } - extern "C" { - #[link_name = "_ZN12nsIPresShell14gKeyDownTargetE"] - pub static mut nsIPresShell_gKeyDownTarget: *mut root::nsIContent; - } - #[test] - fn bindgen_test_layout_nsIPresShell() { - assert_eq!(::std::mem::size_of::<nsIPresShell>() , 5456usize , concat - ! ( "Size of: " , stringify ! ( nsIPresShell ) )); - assert_eq! (::std::mem::align_of::<nsIPresShell>() , 8usize , concat ! - ( "Alignment of " , stringify ! ( nsIPresShell ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mDocument as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mDocument ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mPresContext as * - const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mPresContext ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mStyleSet as * - const _ as usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mStyleSet ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mFrameConstructor - as * const _ as usize } , 32usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFrameConstructor ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mViewManager as * - const _ as usize } , 40usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mViewManager ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mFrameArena as * - const _ as usize } , 48usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFrameArena ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mSelection as * - const _ as usize } , 5240usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mSelection ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mFrameManager as * - const _ as usize } , 5248usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFrameManager ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mForwardingContainer as * const _ as usize } , 5256usize , - concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mForwardingContainer ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mDocAccessible as - * const _ as usize } , 5264usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mDocAccessible ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mReflowContinueTimer as * const _ as usize } , 5272usize , - concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mReflowContinueTimer ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mDrawEventTargetFrame as * const _ as usize } , 5280usize - , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mDrawEventTargetFrame ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mAllocatedPointers - as * const _ as usize } , 5288usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mAllocatedPointers ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mPaintCount as * - const _ as usize } , 5336usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mPaintCount ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mScrollPositionClampingScrollPortSize as * const _ as - usize } , 5344usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mScrollPositionClampingScrollPortSize - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mAutoWeakFrames as - * const _ as usize } , 5352usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mAutoWeakFrames ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mWeakFrames as * - const _ as usize } , 5360usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mWeakFrames ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mCanvasBackgroundColor as * const _ as usize } , 5408usize - , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mCanvasBackgroundColor ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mResolution as * - const _ as usize } , 5412usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mResolution ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mSelectionFlags as - * const _ as usize } , 5420usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mSelectionFlags ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mRenderFlags as * - const _ as usize } , 5422usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mRenderFlags ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mPresShellId as * - const _ as usize } , 5428usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mPresShellId ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationEmPerLine as * const _ as usize } , - 5432usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFontSizeInflationEmPerLine ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationMinTwips as * const _ as usize } , - 5436usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFontSizeInflationMinTwips ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationLineThreshold as * const _ as usize } , - 5440usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFontSizeInflationLineThreshold ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationForceEnabled as * const _ as usize } , - 5444usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFontSizeInflationForceEnabled ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationDisabledInMasterProcess as * const _ as - usize } , 5445usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( - mFontSizeInflationDisabledInMasterProcess ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationEnabled as * const _ as usize } , - 5446usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFontSizeInflationEnabled ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationEnabledIsDirty as * const _ as usize } , - 5447usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFontSizeInflationEnabledIsDirty ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mPaintingIsFrozen - as * const _ as usize } , 5448usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mPaintingIsFrozen ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mIsNeverPainting - as * const _ as usize } , 5449usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mIsNeverPainting ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mInFlush as * - const _ as usize } , 5450usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mInFlush ) )); - } - impl nsIPresShell { - #[inline] - pub fn mDidInitialize(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 1u64 as u16; - let val = (unit_field_val & mask) >> 0usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mDidInitialize(&mut self, val: bool) { - let mask = 1u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 0usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mIsDestroying(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 2u64 as u16; - let val = (unit_field_val & mask) >> 1usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsDestroying(&mut self, val: bool) { - let mask = 2u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 1usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mIsReflowing(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 4u64 as u16; - let val = (unit_field_val & mask) >> 2usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsReflowing(&mut self, val: bool) { - let mask = 4u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 2usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mPaintingSuppressed(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 8u64 as u16; - let val = (unit_field_val & mask) >> 3usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mPaintingSuppressed(&mut self, val: bool) { - let mask = 8u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 3usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mIsActive(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 16u64 as u16; - let val = (unit_field_val & mask) >> 4usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsActive(&mut self, val: bool) { - let mask = 16u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 4usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mFrozen(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 32u64 as u16; - let val = (unit_field_val & mask) >> 5usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mFrozen(&mut self, val: bool) { - let mask = 32u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 5usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mIsFirstPaint(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 64u64 as u16; - let val = (unit_field_val & mask) >> 6usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsFirstPaint(&mut self, val: bool) { - let mask = 64u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 6usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mObservesMutationsForPrint(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 128u64 as u16; - let val = (unit_field_val & mask) >> 7usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mObservesMutationsForPrint(&mut self, val: bool) { - let mask = 128u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 7usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mSuppressInterruptibleReflows(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 256u64 as u16; - let val = (unit_field_val & mask) >> 8usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mSuppressInterruptibleReflows(&mut self, val: bool) { - let mask = 256u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 8usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mScrollPositionClampingScrollPortSizeSet(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 512u64 as u16; - let val = (unit_field_val & mask) >> 9usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mScrollPositionClampingScrollPortSizeSet(&mut self, - val: bool) { - let mask = 512u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 9usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mNeedLayoutFlush(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 1024u64 as u16; - let val = (unit_field_val & mask) >> 10usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mNeedLayoutFlush(&mut self, val: bool) { - let mask = 1024u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 10usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mNeedStyleFlush(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 2048u64 as u16; - let val = (unit_field_val & mask) >> 11usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mNeedStyleFlush(&mut self, val: bool) { - let mask = 2048u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 11usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mObservingStyleFlushes(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 4096u64 as u16; - let val = (unit_field_val & mask) >> 12usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mObservingStyleFlushes(&mut self, val: bool) { - let mask = 4096u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 12usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mObservingLayoutFlushes(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 8192u64 as u16; - let val = (unit_field_val & mask) >> 13usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mObservingLayoutFlushes(&mut self, val: bool) { - let mask = 8192u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 13usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mNeedThrottledAnimationFlush(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 16384u64 as u16; - let val = (unit_field_val & mask) >> 14usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mNeedThrottledAnimationFlush(&mut self, val: bool) { - let mask = 16384u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 14usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn new_bitfield_1(mDidInitialize: bool, mIsDestroying: bool, - mIsReflowing: bool, mPaintingSuppressed: bool, - mIsActive: bool, mFrozen: bool, - mIsFirstPaint: bool, - mObservesMutationsForPrint: bool, - mSuppressInterruptibleReflows: bool, - mScrollPositionClampingScrollPortSizeSet: bool, - mNeedLayoutFlush: bool, mNeedStyleFlush: bool, - mObservingStyleFlushes: bool, - mObservingLayoutFlushes: bool, - mNeedThrottledAnimationFlush: bool) -> u16 { - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - 0 - } - | - ((mDidInitialize - as - u8 - as - u16) - << - 0usize) - & - (1u64 - as - u16)) - } - | - ((mIsDestroying - as - u8 - as - u16) - << - 1usize) - & - (2u64 - as - u16)) - } | - ((mIsReflowing - as - u8 - as - u16) - << - 2usize) - & - (4u64 - as - u16)) - } | - ((mPaintingSuppressed - as - u8 - as - u16) - << - 3usize) - & - (8u64 - as - u16)) - } | - ((mIsActive - as u8 - as - u16) - << - 4usize) - & - (16u64 - as - u16)) - } | - ((mFrozen as u8 - as u16) << - 5usize) & - (32u64 as - u16)) - } | - ((mIsFirstPaint as u8 - as u16) << - 6usize) & - (64u64 as u16)) - } | - ((mObservesMutationsForPrint - as u8 as u16) << - 7usize) & - (128u64 as u16)) - } | - ((mSuppressInterruptibleReflows - as u8 as u16) << 8usize) - & (256u64 as u16)) - } | - ((mScrollPositionClampingScrollPortSizeSet - as u8 as u16) << 9usize) & - (512u64 as u16)) - } | - ((mNeedLayoutFlush as u8 as u16) << - 10usize) & (1024u64 as u16)) - } | - ((mNeedStyleFlush as u8 as u16) << 11usize) & - (2048u64 as u16)) - } | - ((mObservingStyleFlushes as u8 as u16) << 12usize) - & (4096u64 as u16)) - } | - ((mObservingLayoutFlushes as u8 as u16) << 13usize) & - (8192u64 as u16)) - } | - ((mNeedThrottledAnimationFlush as u8 as u16) << 14usize) & - (16384u64 as u16)) - } - } #[repr(C)] #[derive(Debug)] pub struct nsStyleFont { @@ -18950,28 +13235,6 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStyleColor ) , "::" , stringify ! ( mColor ) )); } - #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_88() { - assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); - } - #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_89() { - assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); - } #[repr(C)] #[derive(Debug)] pub struct nsStyleList { @@ -19024,6 +13287,28 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStyleList ) , "::" , stringify ! ( mImageRegion ) )); } + #[test] + fn __bindgen_test_layout_StaticRefPtr_open0_nsStyleQuoteValues_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); + } + #[test] + fn __bindgen_test_layout_StaticRefPtr_open0_nsStyleQuoteValues_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); + } #[repr(C)] #[derive(Debug)] pub struct nsStyleText { @@ -19489,39 +13774,14 @@ pub mod root { pub mContextPropsBits: u8, pub mContextFlags: u8, } - pub const nsStyleSVG_FILL_OPACITY_SOURCE_MASK: - root::nsStyleSVG__bindgen_ty_1 = - nsStyleSVG__bindgen_ty_1::FILL_OPACITY_SOURCE_MASK; - pub const nsStyleSVG_STROKE_OPACITY_SOURCE_MASK: - root::nsStyleSVG__bindgen_ty_1 = - nsStyleSVG__bindgen_ty_1::STROKE_OPACITY_SOURCE_MASK; - pub const nsStyleSVG_STROKE_DASHARRAY_CONTEXT: - root::nsStyleSVG__bindgen_ty_1 = - nsStyleSVG__bindgen_ty_1::STROKE_DASHARRAY_CONTEXT; - pub const nsStyleSVG_STROKE_DASHOFFSET_CONTEXT: - root::nsStyleSVG__bindgen_ty_1 = - nsStyleSVG__bindgen_ty_1::STROKE_DASHOFFSET_CONTEXT; - pub const nsStyleSVG_STROKE_WIDTH_CONTEXT: root::nsStyleSVG__bindgen_ty_1 - = - nsStyleSVG__bindgen_ty_1::STROKE_WIDTH_CONTEXT; - pub const nsStyleSVG_FILL_OPACITY_SOURCE_SHIFT: - root::nsStyleSVG__bindgen_ty_1 = - nsStyleSVG__bindgen_ty_1::FILL_OPACITY_SOURCE_SHIFT; - pub const nsStyleSVG_STROKE_OPACITY_SOURCE_SHIFT: - root::nsStyleSVG__bindgen_ty_1 = - nsStyleSVG__bindgen_ty_1::STROKE_OPACITY_SOURCE_SHIFT; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsStyleSVG__bindgen_ty_1 { - FILL_OPACITY_SOURCE_MASK = 3, - STROKE_OPACITY_SOURCE_MASK = 12, - STROKE_DASHARRAY_CONTEXT = 16, - STROKE_DASHOFFSET_CONTEXT = 32, - STROKE_WIDTH_CONTEXT = 64, - FILL_OPACITY_SOURCE_SHIFT = 0, - STROKE_OPACITY_SOURCE_SHIFT = 2, - } pub const nsStyleSVG_kHasFinishStyle: bool = false; + pub const nsStyleSVG_FILL_OPACITY_SOURCE_MASK: u8 = 3; + pub const nsStyleSVG_STROKE_OPACITY_SOURCE_MASK: u8 = 12; + pub const nsStyleSVG_STROKE_DASHARRAY_CONTEXT: u8 = 16; + pub const nsStyleSVG_STROKE_DASHOFFSET_CONTEXT: u8 = 32; + pub const nsStyleSVG_STROKE_WIDTH_CONTEXT: u8 = 64; + pub const nsStyleSVG_FILL_OPACITY_SOURCE_SHIFT: u8 = 0; + pub const nsStyleSVG_STROKE_OPACITY_SOURCE_SHIFT: u8 = 2; #[test] fn bindgen_test_layout_nsStyleSVG() { assert_eq!(::std::mem::size_of::<nsStyleSVG>() , 128usize , concat ! ( @@ -19714,6 +13974,7 @@ pub mod root { pub mAlignItems: u8, pub mAlignSelf: u8, pub mJustifyContent: u16, + pub mSpecifiedJustifyItems: u8, pub mJustifyItems: u8, pub mJustifySelf: u8, pub mFlexDirection: u8, @@ -19842,28 +14103,34 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStylePosition ) , "::" , stringify ! ( mJustifyContent ) )); assert_eq! (unsafe { + & ( * ( 0 as * const nsStylePosition ) ) . + mSpecifiedJustifyItems as * const _ as usize } , 248usize + , concat ! ( + "Alignment of field: " , stringify ! ( nsStylePosition ) , + "::" , stringify ! ( mSpecifiedJustifyItems ) )); + assert_eq! (unsafe { & ( * ( 0 as * const nsStylePosition ) ) . mJustifyItems - as * const _ as usize } , 248usize , concat ! ( + as * const _ as usize } , 249usize , concat ! ( "Alignment of field: " , stringify ! ( nsStylePosition ) , "::" , stringify ! ( mJustifyItems ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsStylePosition ) ) . mJustifySelf as - * const _ as usize } , 249usize , concat ! ( + * const _ as usize } , 250usize , concat ! ( "Alignment of field: " , stringify ! ( nsStylePosition ) , "::" , stringify ! ( mJustifySelf ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsStylePosition ) ) . mFlexDirection - as * const _ as usize } , 250usize , concat ! ( + as * const _ as usize } , 251usize , concat ! ( "Alignment of field: " , stringify ! ( nsStylePosition ) , "::" , stringify ! ( mFlexDirection ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsStylePosition ) ) . mFlexWrap as * - const _ as usize } , 251usize , concat ! ( + const _ as usize } , 252usize , concat ! ( "Alignment of field: " , stringify ! ( nsStylePosition ) , "::" , stringify ! ( mFlexWrap ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsStylePosition ) ) . mObjectFit as * - const _ as usize } , 252usize , concat ! ( + const _ as usize } , 253usize , concat ! ( "Alignment of field: " , stringify ! ( nsStylePosition ) , "::" , stringify ! ( mObjectFit ) )); assert_eq! (unsafe { @@ -20985,12 +15252,9 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStyleEffects ) , "::" , stringify ! ( mMixBlendMode ) )); } - /** - * We want C++ to be abe to read the style struct fields of ComputedValues - * so we define this type on the C++ side and use the bindgenned version - * on the Rust side. - * - */ + /// We want C++ to be able to read the style struct fields of ComputedValues + /// so we define this type on the C++ side and use the bindgenned version + /// on the Rust side. #[repr(C)] #[derive(Debug)] pub struct ServoComputedData { @@ -21021,206 +15285,170 @@ pub mod root { pub writing_mode: ::gecko_bindings::structs::ServoWritingMode, pub flags: ::gecko_bindings::structs::ServoComputedValueFlags, /// The rule node representing the ordered list of rules matched for this - /// node. Can be None for default values and text nodes. This is - /// essentially an optimization to avoid referencing the root rule node. + /// /// node. Can be None for default values and text nodes. This is + /// /// essentially an optimization to avoid referencing the root rule node. pub rules: ::gecko_bindings::structs::ServoRuleNode, /// The element's computed values if visited, only computed if there's a - /// relevant link for this element. A element's "relevant link" is the - /// element being matched if it is a link or the nearest ancestor link. + /// /// relevant link for this element. A element's "relevant link" is the + /// /// element being matched if it is a link or the nearest ancestor link. pub visited_style: ::gecko_bindings::structs::ServoVisitedStyle, pub font_computation_data: ::gecko_bindings::structs::ServoFontComputationData, } #[test] fn bindgen_test_layout_ServoComputedData() { assert_eq!(::std::mem::size_of::<ServoComputedData>() , 224usize , - concat ! ( - "Size of: " , stringify ! ( ServoComputedData ) )); + concat ! ( "Size of: " , stringify ! ( ServoComputedData ) + )); assert_eq! (::std::mem::align_of::<ServoComputedData>() , 8usize , concat ! ( "Alignment of " , stringify ! ( ServoComputedData ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Font as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Font ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Font ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Color as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Color ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Color ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . List as * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( List ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( List ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Text as * const _ as usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Text ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Text ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Visibility - as * const _ as usize } , 32usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Visibility ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Visibility as + * const _ as usize } , 32usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Visibility ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . - UserInterface as * const _ as usize } , 40usize , concat ! - ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( UserInterface ) )); + & ( * ( 0 as * const ServoComputedData ) ) . UserInterface + as * const _ as usize } , 40usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( UserInterface ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . TableBorder as * const _ as usize } , 48usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( TableBorder ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( TableBorder ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . SVG as * const _ as usize } , 56usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( SVG ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( SVG ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Background - as * const _ as usize } , 64usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Background ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Background as + * const _ as usize } , 64usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Background ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Position as - * const _ as usize } , 72usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Position ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Position as * + const _ as usize } , 72usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Position ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . TextReset - as * const _ as usize } , 80usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( TextReset ) )); + & ( * ( 0 as * const ServoComputedData ) ) . TextReset as + * const _ as usize } , 80usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( TextReset ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Display as - * const _ as usize } , 88usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Display ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Display as * + const _ as usize } , 88usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Display ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Content as - * const _ as usize } , 96usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Content ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Content as * + const _ as usize } , 96usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Content ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . UIReset as - * const _ as usize } , 104usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( UIReset ) )); + & ( * ( 0 as * const ServoComputedData ) ) . UIReset as * + const _ as usize } , 104usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( UIReset ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Table as * const _ as usize } , 112usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Table ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Table ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Margin as * const _ as usize } , 120usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Margin ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Margin ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Padding as - * const _ as usize } , 128usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Padding ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Padding as * + const _ as usize } , 128usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Padding ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Border as * const _ as usize } , 136usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Border ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Border ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Outline as - * const _ as usize } , 144usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Outline ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Outline as * + const _ as usize } , 144usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Outline ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . XUL as * const _ as usize } , 152usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( XUL ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( XUL ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . SVGReset as - * const _ as usize } , 160usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( SVGReset ) )); + & ( * ( 0 as * const ServoComputedData ) ) . SVGReset as * + const _ as usize } , 160usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( SVGReset ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Column as * const _ as usize } , 168usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Column ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Column ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Effects as - * const _ as usize } , 176usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Effects ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Effects as * + const _ as usize } , 176usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Effects ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . custom_properties as * const _ as usize } , 184usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( custom_properties ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( custom_properties ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . - writing_mode as * const _ as usize } , 192usize , concat ! - ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( writing_mode ) )); + & ( * ( 0 as * const ServoComputedData ) ) . writing_mode + as * const _ as usize } , 192usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( writing_mode ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . flags as * const _ as usize } , 193usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( flags ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( flags ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . rules as * const _ as usize } , 200usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( rules ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( rules ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . - visited_style as * const _ as usize } , 208usize , concat - ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( visited_style ) )); + & ( * ( 0 as * const ServoComputedData ) ) . visited_style + as * const _ as usize } , 208usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( visited_style ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . font_computation_data as * const _ as usize } , 216usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( font_computation_data ) )); - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ServoComputedDataForgotten { - pub mPtr: *const root::ServoComputedData, - } - #[test] - fn bindgen_test_layout_ServoComputedDataForgotten() { - assert_eq!(::std::mem::size_of::<ServoComputedDataForgotten>() , - 8usize , concat ! ( - "Size of: " , stringify ! ( ServoComputedDataForgotten ) - )); - assert_eq! (::std::mem::align_of::<ServoComputedDataForgotten>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( - ServoComputedDataForgotten ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedDataForgotten ) ) . - mPtr as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - ServoComputedDataForgotten ) , "::" , stringify ! ( mPtr - ) )); - } - impl Clone for ServoComputedDataForgotten { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum WeakMapTraceKind { - DoNotTraceWeakMaps = 0, - ExpandWeakMaps = 1, - TraceWeakMapValues = 2, - TraceWeakMapKeysValues = 3, + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( font_computation_data ) )); } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -21258,17 +15486,15 @@ pub mod root { JS_GENERIC_MAGIC = 16, JS_WHY_MAGIC_COUNT = 17, } - /** - * This structure precedes the string buffers "we" allocate. It may be the - * case that nsTAString::mData does not point to one of these special - * buffers. The mDataFlags member variable distinguishes the buffer type. - * - * When this header is in use, it enables reference counting, and capacity - * tracking. NOTE: A string buffer can be modified only if its reference - * count is 1. - */ + /// This structure precedes the string buffers "we" allocate. It may be the + /// case that nsTAString::mData does not point to one of these special + /// buffers. The mDataFlags member variable distinguishes the buffer type. + /// + /// When this header is in use, it enables reference counting, and capacity + /// tracking. NOTE: A string buffer can be modified only if its reference + /// count is 1. #[repr(C)] - #[derive(Debug)] + #[derive(Debug, Copy)] pub struct nsStringBuffer { pub mRefCount: u32, pub mStorageSize: u32, @@ -21290,17 +15516,18 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStringBuffer ) , "::" , stringify ! ( mStorageSize ) )); } + impl Clone for nsStringBuffer { + fn clone(&self) -> Self { *self } + } #[repr(C)] #[derive(Debug, Copy)] pub struct nsIAtom { pub _base: root::nsISupports, pub _bitfield_1: u32, pub mHash: u32, - /** - * WARNING! There is an invisible constraint on |mString|: the chars it - * points to must belong to an nsStringBuffer. This is so that the - * nsStringBuffer::FromData() calls above are valid. - */ + /// WARNING! There is an invisible constraint on |mString|: the chars it + /// points to must belong to an nsStringBuffer. This is so that the + /// nsStringBuffer::FromData() calls above are valid. pub mString: *mut u16, } #[repr(C)] @@ -21438,43 +15665,41 @@ pub mod root { } #[repr(C)] pub struct nsWrapperCache__bindgen_vtable(::std::os::raw::c_void); - /** - * Class to store the wrapper for an object. This can only be used with objects - * that only have one non-security wrapper at a time (for an XPCWrappedNative - * this is usually ensured by setting an explicit parent in the PreCreate hook - * for the class). - * - * An instance of nsWrapperCache can be gotten from an object that implements - * a wrapper cache by calling QueryInterface on it. Note that this breaks XPCOM - * rules a bit (this object doesn't derive from nsISupports). - * - * The cache can store objects other than wrappers. We allow wrappers to use a - * separate JSObject to store their state (mostly expandos). If the wrapper is - * collected and we want to preserve this state we actually store the state - * object in the cache. - * - * The cache can store 2 types of objects: - * - * If WRAPPER_IS_NOT_DOM_BINDING is set (IsDOMBinding() returns false): - * - the JSObject of an XPCWrappedNative wrapper - * - * If WRAPPER_IS_NOT_DOM_BINDING is not set (IsDOMBinding() returns true): - * - a DOM binding object (regular JS object or proxy) - * - * The finalizer for the wrapper clears the cache. - * - * A compacting GC can move the wrapper object. Pointers to moved objects are - * usually found and updated by tracing the heap, however non-preserved wrappers - * are weak references and are not traced, so another approach is - * necessary. Instead a class hook (objectMovedOp) is provided that is called - * when an object is moved and is responsible for ensuring pointers are - * updated. It does this by calling UpdateWrapper() on the wrapper - * cache. SetWrapper() asserts that the hook is implemented for any wrapper set. - * - * A number of the methods are implemented in nsWrapperCacheInlines.h because we - * have to include some JS headers that don't play nicely with the rest of the - * codebase. Include nsWrapperCacheInlines.h if you need to call those methods. - */ + /// Class to store the wrapper for an object. This can only be used with objects + /// that only have one non-security wrapper at a time (for an XPCWrappedNative + /// this is usually ensured by setting an explicit parent in the PreCreate hook + /// for the class). + /// + /// An instance of nsWrapperCache can be gotten from an object that implements + /// a wrapper cache by calling QueryInterface on it. Note that this breaks XPCOM + /// rules a bit (this object doesn't derive from nsISupports). + /// + /// The cache can store objects other than wrappers. We allow wrappers to use a + /// separate JSObject to store their state (mostly expandos). If the wrapper is + /// collected and we want to preserve this state we actually store the state + /// object in the cache. + /// + /// The cache can store 2 types of objects: + /// + /// If WRAPPER_IS_NOT_DOM_BINDING is set (IsDOMBinding() returns false): + /// - the JSObject of an XPCWrappedNative wrapper + /// + /// If WRAPPER_IS_NOT_DOM_BINDING is not set (IsDOMBinding() returns true): + /// - a DOM binding object (regular JS object or proxy) + /// + /// The finalizer for the wrapper clears the cache. + /// + /// A compacting GC can move the wrapper object. Pointers to moved objects are + /// usually found and updated by tracing the heap, however non-preserved wrappers + /// are weak references and are not traced, so another approach is + /// necessary. Instead a class hook (objectMovedOp) is provided that is called + /// when an object is moved and is responsible for ensuring pointers are + /// updated. It does this by calling UpdateWrapper() on the wrapper + /// cache. SetWrapper() asserts that the hook is implemented for any wrapper set. + /// + /// A number of the methods are implemented in nsWrapperCacheInlines.h because we + /// have to include some JS headers that don't play nicely with the rest of the + /// codebase. Include nsWrapperCacheInlines.h if you need to call those methods. #[repr(C)] #[derive(Debug)] pub struct nsWrapperCache { @@ -21493,26 +15718,22 @@ pub mod root { root::nsWrapperCache__bindgen_ty_1 = nsWrapperCache__bindgen_ty_1::WRAPPER_BIT_PRESERVED; #[repr(u32)] - /** - * If this bit is set then we're preserving the wrapper, which in effect ties - * the lifetime of the JS object stored in the cache to the lifetime of the - * native object. We rely on the cycle collector to break the cycle that this - * causes between the native object and the JS object, so it is important that - * any native object that supports preserving of its wrapper - * traces/traverses/unlinks the cached JS object (see - * NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER and - * NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER). - */ + /// If this bit is set then we're preserving the wrapper, which in effect ties + /// the lifetime of the JS object stored in the cache to the lifetime of the + /// native object. We rely on the cycle collector to break the cycle that this + /// causes between the native object and the JS object, so it is important that + /// any native object that supports preserving of its wrapper + /// traces/traverses/unlinks the cached JS object (see + /// NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER and + /// NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER). #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsWrapperCache__bindgen_ty_1 { WRAPPER_BIT_PRESERVED = 1, } pub const nsWrapperCache_WRAPPER_IS_NOT_DOM_BINDING: root::nsWrapperCache__bindgen_ty_2 = nsWrapperCache__bindgen_ty_2::WRAPPER_IS_NOT_DOM_BINDING; #[repr(u32)] - /** - * If this bit is set then the wrapper for the native object is not a DOM - * binding. - */ + /// If this bit is set then the wrapper for the native object is not a DOM + /// binding. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsWrapperCache__bindgen_ty_2 { WRAPPER_IS_NOT_DOM_BINDING = 2, } pub const nsWrapperCache_kWrapperFlagsMask: @@ -21742,18 +15963,11 @@ pub mod root { impl Clone for nsIDOMNode { fn clone(&self) -> Self { *self } } - pub type nsContentPolicyType = u32; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMDocument { - _unused: [u8; 0], - } - /** - * An internal interface that abstracts some DOMNode-related parts that both - * nsIContent and nsIDocument share. An instance of this interface has a list - * of nsIContent children and provides access to them. - */ + /// An internal interface that abstracts some DOMNode-related parts that both + /// nsIContent and nsIDocument share. An instance of this interface has a list + /// of nsIContent children and provides access to them. #[repr(C)] + #[derive(Debug)] pub struct nsINode { pub _base: root::mozilla::dom::EventTarget, pub mNodeInfo: root::RefPtr<root::mozilla::dom::NodeInfo>, @@ -21808,9 +16022,7 @@ pub mod root { pub const nsINode_eFILTER: root::nsINode__bindgen_ty_2 = nsINode__bindgen_ty_2::eFILTER; #[repr(u32)] - /** - * Bit-flags to pass (or'ed together) to IsNodeOfType() - */ + /// Bit-flags to pass (or'ed together) to IsNodeOfType() #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsINode__bindgen_ty_2 { eCONTENT = 1, @@ -21832,30 +16044,25 @@ pub mod root { #[derive(Debug)] pub struct nsINode_nsSlots { pub vtable_: *const nsINode_nsSlots__bindgen_vtable, - /** - * A list of mutation observers - */ - pub mMutationObservers: [u64; 2usize], - /** - * An object implementing nsIDOMNodeList for this content (childNodes) - * @see nsIDOMNodeList - * @see nsGenericHTMLElement::GetChildNodes - */ + /// A list of mutation observers + pub mMutationObservers: [u64; 4usize], + /// An object implementing nsIDOMNodeList for this content (childNodes) + /// @see nsIDOMNodeList + /// @see nsGenericHTMLElement::GetChildNodes pub mChildNodes: root::RefPtr<root::nsChildContentList>, - /** - * Weak reference to this node. This is cleared by the destructor of - * nsNodeWeakReference. - */ + /// Weak reference to this node. This is cleared by the destructor of + /// nsNodeWeakReference. pub mWeakReference: *mut root::nsNodeWeakReference, - /** - * Number of descendant nodes in the uncomposed document that have been - * explicitly set as editable. - */ + /// A set of ranges in the common ancestor for the selection to which + /// this node belongs to. + pub mCommonAncestorRanges: u64, + /// Number of descendant nodes in the uncomposed document that have been + /// explicitly set as editable. pub mEditableDescendantCount: u32, } #[test] fn bindgen_test_layout_nsINode_nsSlots() { - assert_eq!(::std::mem::size_of::<nsINode_nsSlots>() , 48usize , concat + assert_eq!(::std::mem::size_of::<nsINode_nsSlots>() , 72usize , concat ! ( "Size of: " , stringify ! ( nsINode_nsSlots ) )); assert_eq! (::std::mem::align_of::<nsINode_nsSlots>() , 8usize , concat ! ( @@ -21868,25 +16075,29 @@ pub mod root { "::" , stringify ! ( mMutationObservers ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsINode_nsSlots ) ) . mChildNodes as - * const _ as usize } , 24usize , concat ! ( + * const _ as usize } , 40usize , concat ! ( "Alignment of field: " , stringify ! ( nsINode_nsSlots ) , "::" , stringify ! ( mChildNodes ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsINode_nsSlots ) ) . mWeakReference - as * const _ as usize } , 32usize , concat ! ( + as * const _ as usize } , 48usize , concat ! ( "Alignment of field: " , stringify ! ( nsINode_nsSlots ) , "::" , stringify ! ( mWeakReference ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsINode_nsSlots ) ) . - mEditableDescendantCount as * const _ as usize } , 40usize + mCommonAncestorRanges as * const _ as usize } , 56usize , + concat ! ( + "Alignment of field: " , stringify ! ( nsINode_nsSlots ) , + "::" , stringify ! ( mCommonAncestorRanges ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsINode_nsSlots ) ) . + mEditableDescendantCount as * const _ as usize } , 64usize , concat ! ( "Alignment of field: " , stringify ! ( nsINode_nsSlots ) , "::" , stringify ! ( mEditableDescendantCount ) )); } #[repr(u32)] - /** - * Boolean flags - */ + /// Boolean flags #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsINode_BooleanFlag { NodeHasRenderingObservers = 0, @@ -21997,86 +16208,6 @@ pub mod root { pub struct nsIRedirectHistoryEntry { _unused: [u8; 0], } - /** - * Get a property named by id in obj. Note the jsid id type -- id may - * be a string (Unicode property identifier) or an int (element index). The - * *vp out parameter, on success, is the new property value after the action. - */ - pub type JSGetterOp = - ::std::option::Option<unsafe extern "C" fn(cx: *mut root::JSContext, - obj: - root::JS::HandleObject, - id: root::JS::HandleId, - vp: - root::JS::MutableHandleValue) - -> bool>; - /** - * Set a property named by id in obj, treating the assignment as strict - * mode code if strict is true. Note the jsid id type -- id may be a string - * (Unicode property identifier) or an int (element index). The *vp out - * parameter, on success, is the new property value after the - * set. - */ - pub type JSSetterOp = - ::std::option::Option<unsafe extern "C" fn(cx: *mut root::JSContext, - obj: - root::JS::HandleObject, - id: root::JS::HandleId, - vp: - root::JS::MutableHandleValue, - result: - *mut root::JS::ObjectOpResult) - -> bool>; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct JSErrorFormatString { - /** The error message name in ASCII. */ - pub name: *const ::std::os::raw::c_char, - /** The error format string in ASCII. */ - pub format: *const ::std::os::raw::c_char, - /** The number of arguments to expand in the formatted error message. */ - pub argCount: u16, - /** One of the JSExnType constants above. */ - pub exnType: i16, - } - #[test] - fn bindgen_test_layout_JSErrorFormatString() { - assert_eq!(::std::mem::size_of::<JSErrorFormatString>() , 24usize , - concat ! ( - "Size of: " , stringify ! ( JSErrorFormatString ) )); - assert_eq! (::std::mem::align_of::<JSErrorFormatString>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( JSErrorFormatString ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSErrorFormatString ) ) . name as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( JSErrorFormatString - ) , "::" , stringify ! ( name ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSErrorFormatString ) ) . format as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( JSErrorFormatString - ) , "::" , stringify ! ( format ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSErrorFormatString ) ) . argCount as - * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( JSErrorFormatString - ) , "::" , stringify ! ( argCount ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSErrorFormatString ) ) . exnType as - * const _ as usize } , 18usize , concat ! ( - "Alignment of field: " , stringify ! ( JSErrorFormatString - ) , "::" , stringify ! ( exnType ) )); - } - impl Clone for JSErrorFormatString { - fn clone(&self) -> Self { *self } - } - pub type JSErrorCallback = - ::std::option::Option<unsafe extern "C" fn(userRef: - *mut ::std::os::raw::c_void, - errorNumber: - ::std::os::raw::c_uint) - -> *const root::JSErrorFormatString>; #[repr(C)] #[derive(Debug)] pub struct JSAutoRequest { @@ -22171,10 +16302,8 @@ pub mod root { JSAutoNullableCompartment ) , "::" , stringify ! ( _mCheckNotUsedAsTemporary ) )); } - /** - * Base class that implements parts shared by JSErrorReport and - * JSErrorNotes::Note. - */ + /// Base class that implements parts shared by JSErrorReport and + /// JSErrorNotes::Note. #[repr(C)] #[derive(Debug)] pub struct JSErrorBase { @@ -22262,10 +16391,9 @@ pub mod root { ({ 0 } | ((ownsMessage_ as u8 as u8) << 0usize) & (1u64 as u8)) } } - /** - * Notes associated with JSErrorReport. - */ + /// Notes associated with JSErrorReport. #[repr(C)] + #[derive(Debug)] pub struct JSErrorNotes { pub notes_: [u64; 6usize], } @@ -22316,16 +16444,6 @@ pub mod root { "::" , stringify ! ( notes_ ) )); } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIObjectInputStream { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIObjectOutputStream { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsISerializable { pub _base: root::nsISupports, @@ -22347,11 +16465,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIContentSecurityPolicy { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIChannel { pub _base: root::nsIRequest, @@ -22423,149 +16536,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDocShell { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsILoadContext { - _unused: [u8; 0], - } - pub type nsSecurityFlags = u32; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsILoadInfo { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsILoadInfo_COMTypeInfo { - pub _address: u8, - } - pub const nsILoadInfo_SEC_NORMAL: root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_NORMAL; - pub const nsILoadInfo_SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS; - pub const nsILoadInfo_SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED; - pub const nsILoadInfo_SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS; - pub const nsILoadInfo_SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL; - pub const nsILoadInfo_SEC_REQUIRE_CORS_DATA_INHERITS: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_REQUIRE_CORS_DATA_INHERITS; - pub const nsILoadInfo_SEC_COOKIES_DEFAULT: root::nsILoadInfo__bindgen_ty_1 - = - nsILoadInfo__bindgen_ty_1::SEC_NORMAL; - pub const nsILoadInfo_SEC_COOKIES_INCLUDE: root::nsILoadInfo__bindgen_ty_1 - = - nsILoadInfo__bindgen_ty_1::SEC_COOKIES_INCLUDE; - pub const nsILoadInfo_SEC_COOKIES_SAME_ORIGIN: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_COOKIES_SAME_ORIGIN; - pub const nsILoadInfo_SEC_COOKIES_OMIT: root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_COOKIES_OMIT; - pub const nsILoadInfo_SEC_FORCE_INHERIT_PRINCIPAL: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_FORCE_INHERIT_PRINCIPAL; - pub const nsILoadInfo_SEC_SANDBOXED: root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_SANDBOXED; - pub const nsILoadInfo_SEC_ABOUT_BLANK_INHERITS: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_ABOUT_BLANK_INHERITS; - pub const nsILoadInfo_SEC_ALLOW_CHROME: root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_ALLOW_CHROME; - pub const nsILoadInfo_SEC_DISALLOW_SCRIPT: root::nsILoadInfo__bindgen_ty_1 - = - nsILoadInfo__bindgen_ty_1::SEC_DISALLOW_SCRIPT; - pub const nsILoadInfo_SEC_DONT_FOLLOW_REDIRECTS: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_DONT_FOLLOW_REDIRECTS; - pub const nsILoadInfo_SEC_LOAD_ERROR_PAGE: root::nsILoadInfo__bindgen_ty_1 - = - nsILoadInfo__bindgen_ty_1::SEC_LOAD_ERROR_PAGE; - pub const nsILoadInfo_SEC_FORCE_INHERIT_PRINCIPAL_OVERRULE_OWNER: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_FORCE_INHERIT_PRINCIPAL_OVERRULE_OWNER; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsILoadInfo__bindgen_ty_1 { - SEC_NORMAL = 0, - SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS = 1, - SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED = 2, - SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS = 4, - SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL = 8, - SEC_REQUIRE_CORS_DATA_INHERITS = 16, - SEC_COOKIES_INCLUDE = 32, - SEC_COOKIES_SAME_ORIGIN = 64, - SEC_COOKIES_OMIT = 96, - SEC_FORCE_INHERIT_PRINCIPAL = 128, - SEC_SANDBOXED = 256, - SEC_ABOUT_BLANK_INHERITS = 512, - SEC_ALLOW_CHROME = 1024, - SEC_DISALLOW_SCRIPT = 2048, - SEC_DONT_FOLLOW_REDIRECTS = 4096, - SEC_LOAD_ERROR_PAGE = 8192, - SEC_FORCE_INHERIT_PRINCIPAL_OVERRULE_OWNER = 16384, - } - pub const nsILoadInfo_TAINTING_BASIC: root::nsILoadInfo__bindgen_ty_2 = - nsILoadInfo__bindgen_ty_2::TAINTING_BASIC; - pub const nsILoadInfo_TAINTING_CORS: root::nsILoadInfo__bindgen_ty_2 = - nsILoadInfo__bindgen_ty_2::TAINTING_CORS; - pub const nsILoadInfo_TAINTING_OPAQUE: root::nsILoadInfo__bindgen_ty_2 = - nsILoadInfo__bindgen_ty_2::TAINTING_OPAQUE; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsILoadInfo__bindgen_ty_2 { - TAINTING_BASIC = 0, - TAINTING_CORS = 1, - TAINTING_OPAQUE = 2, - } - #[test] - fn bindgen_test_layout_nsILoadInfo() { - assert_eq!(::std::mem::size_of::<nsILoadInfo>() , 8usize , concat ! ( - "Size of: " , stringify ! ( nsILoadInfo ) )); - assert_eq! (::std::mem::align_of::<nsILoadInfo>() , 8usize , concat ! - ( "Alignment of " , stringify ! ( nsILoadInfo ) )); - } - impl Clone for nsILoadInfo { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIInterfaceRequestor { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIInterfaceRequestor_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIInterfaceRequestor() { - assert_eq!(::std::mem::size_of::<nsIInterfaceRequestor>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsIInterfaceRequestor ) )); - assert_eq! (::std::mem::align_of::<nsIInterfaceRequestor>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIInterfaceRequestor ) - )); - } - impl Clone for nsIInterfaceRequestor { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIInputStream { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIStreamListener { pub _base: root::nsIRequestObserver, @@ -22632,46 +16602,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] - pub struct nsIDOMElement { - pub _base: root::nsIDOMNode, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMElement_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIDOMElement() { - assert_eq!(::std::mem::size_of::<nsIDOMElement>() , 8usize , concat ! - ( "Size of: " , stringify ! ( nsIDOMElement ) )); - assert_eq! (::std::mem::align_of::<nsIDOMElement>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( nsIDOMElement ) )); - } - impl Clone for nsIDOMElement { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIDOMNodeList { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMNodeList_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIDOMNodeList() { - assert_eq!(::std::mem::size_of::<nsIDOMNodeList>() , 8usize , concat ! - ( "Size of: " , stringify ! ( nsIDOMNodeList ) )); - assert_eq! (::std::mem::align_of::<nsIDOMNodeList>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( nsIDOMNodeList ) )); - } - impl Clone for nsIDOMNodeList { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] pub struct nsIDOMClientRect { pub _base: root::nsISupports, } @@ -22693,28 +16623,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] - pub struct nsIDOMClientRectList { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMClientRectList_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIDOMClientRectList() { - assert_eq!(::std::mem::size_of::<nsIDOMClientRectList>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsIDOMClientRectList ) )); - assert_eq! (::std::mem::align_of::<nsIDOMClientRectList>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIDOMClientRectList ) )); - } - impl Clone for nsIDOMClientRectList { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] pub struct nsIDOMStyleSheet { pub _base: root::nsISupports, } @@ -22756,11 +16664,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMEvent { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIDOMEventTarget { pub _base: root::nsISupports, @@ -22783,11 +16686,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMEventListener { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIDOMHTMLCollection { pub _base: root::nsISupports, @@ -22811,44 +16709,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] - pub struct nsIDOMCSSValue { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMCSSValue_COMTypeInfo { - pub _address: u8, - } - pub const nsIDOMCSSValue_CSS_INHERIT: root::nsIDOMCSSValue__bindgen_ty_1 = - nsIDOMCSSValue__bindgen_ty_1::CSS_INHERIT; - pub const nsIDOMCSSValue_CSS_PRIMITIVE_VALUE: - root::nsIDOMCSSValue__bindgen_ty_1 = - nsIDOMCSSValue__bindgen_ty_1::CSS_PRIMITIVE_VALUE; - pub const nsIDOMCSSValue_CSS_VALUE_LIST: - root::nsIDOMCSSValue__bindgen_ty_1 = - nsIDOMCSSValue__bindgen_ty_1::CSS_VALUE_LIST; - pub const nsIDOMCSSValue_CSS_CUSTOM: root::nsIDOMCSSValue__bindgen_ty_1 = - nsIDOMCSSValue__bindgen_ty_1::CSS_CUSTOM; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIDOMCSSValue__bindgen_ty_1 { - CSS_INHERIT = 0, - CSS_PRIMITIVE_VALUE = 1, - CSS_VALUE_LIST = 2, - CSS_CUSTOM = 3, - } - #[test] - fn bindgen_test_layout_nsIDOMCSSValue() { - assert_eq!(::std::mem::size_of::<nsIDOMCSSValue>() , 8usize , concat ! - ( "Size of: " , stringify ! ( nsIDOMCSSValue ) )); - assert_eq! (::std::mem::align_of::<nsIDOMCSSValue>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( nsIDOMCSSValue ) )); - } - impl Clone for nsIDOMCSSValue { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] pub struct nsIDOMCSSRule { pub _base: root::nsISupports, } @@ -22925,11 +16785,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMCSSRuleList { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIDOMCSSStyleSheet { pub _base: root::nsIDOMStyleSheet, @@ -22975,23 +16830,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - pub struct TraceCallbacks__bindgen_vtable(::std::os::raw::c_void); - #[repr(C)] - #[derive(Debug, Copy)] - pub struct TraceCallbacks { - pub vtable_: *const TraceCallbacks__bindgen_vtable, - } - #[test] - fn bindgen_test_layout_TraceCallbacks() { - assert_eq!(::std::mem::size_of::<TraceCallbacks>() , 8usize , concat ! - ( "Size of: " , stringify ! ( TraceCallbacks ) )); - assert_eq! (::std::mem::align_of::<TraceCallbacks>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( TraceCallbacks ) )); - } - impl Clone for TraceCallbacks { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsScriptObjectTracer { pub _base: root::nsCycleCollectionParticipant, @@ -23033,6 +16871,7 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug)] pub struct nsIDocument { pub _base: root::nsINode, pub _base_1: root::mozilla::dom::DispatcherTrait, @@ -23082,10 +16921,8 @@ pub mod root { pub mType: root::nsIDocument_Type, pub mDefaultElementType: u8, pub mAllowXULXBL: root::nsIDocument_Tri, - /** - * This is true while FlushPendingLinkUpdates executes. Calls to - * [Un]RegisterPendingLinkUpdate will assert when this is true. - */ + /// This is true while FlushPendingLinkUpdates executes. Calls to + /// [Un]RegisterPendingLinkUpdate will assert when this is true. pub mIsLinkUpdateRegistrationsForbidden: bool, pub mScriptGlobalObject: root::nsCOMPtr<root::nsIScriptGlobalObject>, pub mOriginalDocument: root::nsCOMPtr<root::nsIDocument>, @@ -23104,14 +16941,10 @@ pub mod root { pub mSubtreeModifiedDepth: u32, pub mDisplayDocument: root::nsCOMPtr<root::nsIDocument>, pub mEventsSuppressed: u32, - /** - * The number number of external scripts (ones with the src attribute) that - * have this document as their owner and that are being evaluated right now. - */ + /// The number number of external scripts (ones with the src attribute) that + /// have this document as their owner and that are being evaluated right now. pub mExternalScriptsBeingEvaluated: u32, - /** - * The current frame request callback handle - */ + /// The current frame request callback handle pub mFrameRequestCallbackCounter: i32, pub mStaticCloneCount: u32, pub mBlockedTrackingNodes: root::nsTArray<root::nsCOMPtr<root::nsIWeakReference>>, @@ -23150,6 +16983,7 @@ pub mod root { pub _address: u8, } #[repr(C)] + #[derive(Debug)] pub struct nsIDocument_PageUnloadingEventTimeStamp { pub mDocument: root::nsCOMPtr<root::nsIDocument>, pub mSet: bool, @@ -23180,14 +17014,12 @@ pub mod root { nsIDocument_PageUnloadingEventTimeStamp ) , "::" , stringify ! ( mSet ) )); } - /** - * This gets fired when the element that an id refers to changes. - * This fires at difficult times. It is generally not safe to do anything - * which could modify the DOM in any way. Use - * nsContentUtils::AddScriptRunner. - * @return true to keep the callback in the callback set, false - * to remove it. - */ + /// This gets fired when the element that an id refers to changes. + /// This fires at difficult times. It is generally not safe to do anything + /// which could modify the DOM in any way. Use + /// nsContentUtils::AddScriptRunner. + /// @return true to keep the callback in the callback set, false + /// to remove it. pub type nsIDocument_IDTargetObserver = ::std::option::Option<unsafe extern "C" fn(aOldElement: *mut root::nsIDocument_Element, @@ -23231,6 +17063,8 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] + pub struct nsIDocument_SelectorCache__bindgen_vtable(::std::os::raw::c_void); + #[repr(C)] #[derive(Debug, Copy)] pub struct nsIDocument_SelectorCache { pub _bindgen_opaque_blob: [u64; 18usize], @@ -23264,11 +17098,9 @@ pub mod root { READYSTATE_INTERACTIVE = 3, READYSTATE_COMPLETE = 4, } - /** - * Enumerate all subdocuments. - * The enumerator callback should return true to continue enumerating, or - * false to stop. This will never get passed a null aDocument. - */ + /// Enumerate all subdocuments. + /// The enumerator callback should return true to continue enumerating, or + /// false to stop. This will never get passed a null aDocument. pub type nsIDocument_nsSubDocEnumFunc = ::std::option::Option<unsafe extern "C" fn(aDocument: *mut root::nsIDocument, @@ -23282,17 +17114,16 @@ pub mod root { FLUSH_LAYOUT = 2, IS_ELEMENT_FROM_POINT = 4, } - /** - * A class that represents an external resource load that has begun but - * doesn't have a document yet. Observers can be registered on this object, - * and will be notified after the document is created. Observers registered - * after the document has been created will NOT be notified. When observers - * are notified, the subject will be the newly-created document, the topic - * will be "external-resource-document-created", and the data will be null. - * If document creation fails for some reason, observers will still be - * notified, with a null document pointer. - */ + /// A class that represents an external resource load that has begun but + /// doesn't have a document yet. Observers can be registered on this object, + /// and will be notified after the document is created. Observers registered + /// after the document has been created will NOT be notified. When observers + /// are notified, the subject will be the newly-created document, the topic + /// will be "external-resource-document-created", and the data will be null. + /// If document creation fails for some reason, observers will still be + /// notified, with a null document pointer. #[repr(C)] + #[derive(Debug)] pub struct nsIDocument_ExternalResourceLoad { pub _base: root::nsISupports, pub mObservers: [u64; 10usize], @@ -23360,7 +17191,7 @@ pub mod root { eShowModalDialog = 24, eWindow_Content = 25, eSyncXMLHttpRequest = 26, - eWindow_Controllers = 27, + eWindow_Cc_ontrollers = 27, eImportXULIntoContent = 28, ePannerNodeDoppler = 29, eNavigatorGetUserMedia = 30, @@ -25899,6 +19730,7 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] + #[derive(Debug)] pub struct nsBindingManager { pub _base: root::nsStubMutationObserver, pub mRefCnt: root::nsCycleCollectingAutoRefCnt, @@ -25916,18 +19748,16 @@ pub mod root { } pub type nsBindingManager_HasThreadSafeRefCnt = root::mozilla::FalseType; #[repr(u32)] - /** - * Notify the binding manager that an element - * has been removed from its document, - * so that it can update any bindings or - * nsIAnonymousContentCreator-created anonymous - * content that may depend on the document. - * @param aContent the element that's being moved - * @param aOldDocument the old document in which the - * content resided. - * @param aDestructorHandling whether or not to run the possible XBL - * destructor. - */ + /// Notify the binding manager that an element + /// has been removed from its document, + /// so that it can update any bindings or + /// nsIAnonymousContentCreator-created anonymous + /// content that may depend on the document. + /// @param aContent the element that's being moved + /// @param aOldDocument the old document in which the + /// content resided. + /// @param aDestructorHandling whether or not to run the possible XBL + /// destructor. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsBindingManager_DestructorHandling { eRunDtor = 0, @@ -26086,11 +19916,10 @@ pub mod root { nsFontFaceRuleContainer ) , "::" , stringify ! ( mSheetType ) )); } - /** - * A node of content in a document's content model. This interface - * is supported by all content objects. - */ + /// A node of content in a document's content model. This interface + /// is supported by all content objects. #[repr(C)] + #[derive(Debug)] pub struct nsIContent { pub _base: root::nsINode, } @@ -26128,23 +19957,21 @@ pub mod root { ATTR_MISSING = -1, ATTR_VALUE_NO_MATCH = -2, } - /** - * Check whether this content node's given attribute has one of a given - * list of values. If there is a match, we return the index in the list - * of the first matching value. If there was no attribute at all, then - * we return ATTR_MISSING. If there was an attribute but it didn't - * match, we return ATTR_VALUE_NO_MATCH. A non-negative result always - * indicates a match. - * - * @param aNameSpaceID The namespace ID of the attribute. Must not - * be kNameSpaceID_Unknown. - * @param aName The name atom of the attribute. Must not be null. - * @param aValues a nullptr-terminated array of pointers to atom values to test - * against. - * @param aCaseSensitive Whether to do a case-sensitive compare on the values. - * @return ATTR_MISSING, ATTR_VALUE_NO_MATCH or the non-negative index - * indicating the first value of aValues that matched - */ + /// Check whether this content node's given attribute has one of a given + /// list of values. If there is a match, we return the index in the list + /// of the first matching value. If there was no attribute at all, then + /// we return ATTR_MISSING. If there was an attribute but it didn't + /// match, we return ATTR_VALUE_NO_MATCH. A non-negative result always + /// indicates a match. + /// + /// @param aNameSpaceID The namespace ID of the attribute. Must not + /// be kNameSpaceID_Unknown. + /// @param aName The name atom of the attribute. Must not be null. + /// @param aValues a nullptr-terminated array of pointers to atom values to test + /// against. + /// @param aCaseSensitive Whether to do a case-sensitive compare on the values. + /// @return ATTR_MISSING, ATTR_VALUE_NO_MATCH or the non-negative index + /// indicating the first value of aValues that matched pub type nsIContent_AttrValuesArray = *const *const root::nsIAtom; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -26175,34 +20002,39 @@ pub mod root { assert_eq! (::std::mem::align_of::<nsIContent>() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsIContent ) )); } - /** - * An nsStyleContext represents the computed style data for an element. - * The computed style data are stored in a set of structs (see - * nsStyleStruct.h) that are cached either on the style context or in - * the rule tree (see nsRuleNode.h for a description of this caching and - * how the cached structs are shared). - * - * Since the data in |nsIStyleRule|s and |nsRuleNode|s are immutable - * (with a few exceptions, like system color changes), the data in an - * nsStyleContext are also immutable (with the additional exception of - * GetUniqueStyleData). When style data change, - * ElementRestyler::Restyle creates a new style context. - * - * Style contexts are reference counted. References are generally held - * by: - * 1. the |nsIFrame|s that are using the style context and - * 2. any *child* style contexts (this might be the reverse of - * expectation, but it makes sense in this case) - */ + /// An nsStyleContext represents the computed style data for an element. + /// The computed style data are stored in a set of structs (see + /// nsStyleStruct.h) that are cached either on the style context or in + /// the rule tree (see nsRuleNode.h for a description of this caching and + /// how the cached structs are shared). + /// + /// Since the data in |nsIStyleRule|s and |nsRuleNode|s are immutable + /// (with a few exceptions, like system color changes), the data in an + /// nsStyleContext are also immutable (with the additional exception of + /// GetUniqueStyleData). When style data change, + /// ElementRestyler::Restyle creates a new style context. + /// + /// Style contexts are reference counted. References are generally held + /// by: + /// 1. the |nsIFrame|s that are using the style context and + /// 2. any *child* style contexts (this might be the reverse of + /// expectation, but it makes sense in this case) #[repr(C)] #[derive(Debug)] pub struct nsStyleContext { pub mParent: root::RefPtr<root::nsStyleContext>, pub mPseudoTag: root::nsCOMPtr<root::nsIAtom>, pub mBits: u64, - pub mRefCnt: u32, pub mFrameRefCnt: u32, } + pub const nsStyleContext_kAllResolvedStructs: + root::nsStyleContext__bindgen_ty_1 = + nsStyleContext__bindgen_ty_1::kAllResolvedStructs; + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsStyleContext__bindgen_ty_1 { + kAllResolvedStructs = 4294967295, + } extern "C" { #[link_name = "_ZN14nsStyleContext16sDependencyTableE"] pub static mut nsStyleContext_sDependencyTable: [u32; 0usize]; @@ -26229,17 +20061,13 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStyleContext ) , "::" , stringify ! ( mBits ) )); assert_eq! (unsafe { - & ( * ( 0 as * const nsStyleContext ) ) . mRefCnt as * - const _ as usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( nsStyleContext ) , - "::" , stringify ! ( mRefCnt ) )); - assert_eq! (unsafe { & ( * ( 0 as * const nsStyleContext ) ) . mFrameRefCnt as - * const _ as usize } , 28usize , concat ! ( + * const _ as usize } , 24usize , concat ! ( "Alignment of field: " , stringify ! ( nsStyleContext ) , "::" , stringify ! ( mFrameRefCnt ) )); } #[repr(C)] + #[derive(Debug)] pub struct nsPresContext { pub _base: root::nsIObserver, pub _base_1: u64, @@ -26361,9 +20189,7 @@ pub mod root { eMouseMoveInteraction = 2, eScrollInteraction = 3, } - /** - * A class that can be used to temporarily disable reflow interruption. - */ + /// A class that can be used to temporarily disable reflow interruption. #[repr(C)] #[derive(Debug)] pub struct nsPresContext_InterruptPreventer { @@ -27969,7 +21795,7 @@ pub mod root { } } #[inline] - pub fn mUsesViewportUnits(&self) -> ::std::os::raw::c_uint { + pub fn mPendingViewportChange(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -27984,8 +21810,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mUsesViewportUnits(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mPendingViewportChange(&mut self, + val: ::std::os::raw::c_uint) { let mask = 1073741824u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28008,7 +21834,7 @@ pub mod root { } } #[inline] - pub fn mPendingViewportChange(&self) -> ::std::os::raw::c_uint { + pub fn mCounterStylesDirty(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28023,8 +21849,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mPendingViewportChange(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mCounterStylesDirty(&mut self, + val: ::std::os::raw::c_uint) { let mask = 2147483648u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28047,7 +21873,7 @@ pub mod root { } } #[inline] - pub fn mCounterStylesDirty(&self) -> ::std::os::raw::c_uint { + pub fn mPostedFlushCounterStyles(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28062,8 +21888,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mCounterStylesDirty(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mPostedFlushCounterStyles(&mut self, + val: ::std::os::raw::c_uint) { let mask = 4294967296u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28086,7 +21912,7 @@ pub mod root { } } #[inline] - pub fn mPostedFlushCounterStyles(&self) -> ::std::os::raw::c_uint { + pub fn mSuppressResizeReflow(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28101,8 +21927,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mPostedFlushCounterStyles(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mSuppressResizeReflow(&mut self, + val: ::std::os::raw::c_uint) { let mask = 8589934592u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28125,7 +21951,7 @@ pub mod root { } } #[inline] - pub fn mSuppressResizeReflow(&self) -> ::std::os::raw::c_uint { + pub fn mIsVisual(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28140,8 +21966,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mSuppressResizeReflow(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mIsVisual(&mut self, val: ::std::os::raw::c_uint) { let mask = 17179869184u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28164,7 +21989,7 @@ pub mod root { } } #[inline] - pub fn mIsVisual(&self) -> ::std::os::raw::c_uint { + pub fn mFireAfterPaintEvents(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28179,7 +22004,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mIsVisual(&mut self, val: ::std::os::raw::c_uint) { + pub fn set_mFireAfterPaintEvents(&mut self, + val: ::std::os::raw::c_uint) { let mask = 34359738368u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28202,7 +22028,7 @@ pub mod root { } } #[inline] - pub fn mFireAfterPaintEvents(&self) -> ::std::os::raw::c_uint { + pub fn mIsChrome(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28217,8 +22043,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mFireAfterPaintEvents(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mIsChrome(&mut self, val: ::std::os::raw::c_uint) { let mask = 68719476736u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28241,7 +22066,7 @@ pub mod root { } } #[inline] - pub fn mIsChrome(&self) -> ::std::os::raw::c_uint { + pub fn mIsChromeOriginImage(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28256,7 +22081,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mIsChrome(&mut self, val: ::std::os::raw::c_uint) { + pub fn set_mIsChromeOriginImage(&mut self, + val: ::std::os::raw::c_uint) { let mask = 137438953472u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28279,7 +22105,7 @@ pub mod root { } } #[inline] - pub fn mIsChromeOriginImage(&self) -> ::std::os::raw::c_uint { + pub fn mPaintFlashing(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28294,8 +22120,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mIsChromeOriginImage(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mPaintFlashing(&mut self, val: ::std::os::raw::c_uint) { let mask = 274877906944u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28318,7 +22143,7 @@ pub mod root { } } #[inline] - pub fn mPaintFlashing(&self) -> ::std::os::raw::c_uint { + pub fn mPaintFlashingInitialized(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28333,7 +22158,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mPaintFlashing(&mut self, val: ::std::os::raw::c_uint) { + pub fn set_mPaintFlashingInitialized(&mut self, + val: ::std::os::raw::c_uint) { let mask = 549755813888u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28356,7 +22182,8 @@ pub mod root { } } #[inline] - pub fn mPaintFlashingInitialized(&self) -> ::std::os::raw::c_uint { + pub fn mHasWarnedAboutPositionedTableParts(&self) + -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28371,8 +22198,9 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mPaintFlashingInitialized(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mHasWarnedAboutPositionedTableParts(&mut self, + val: + ::std::os::raw::c_uint) { let mask = 1099511627776u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28395,7 +22223,7 @@ pub mod root { } } #[inline] - pub fn mHasWarnedAboutPositionedTableParts(&self) + pub fn mHasWarnedAboutTooLargeDashedOrDottedRadius(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; @@ -28411,9 +22239,9 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mHasWarnedAboutPositionedTableParts(&mut self, - val: - ::std::os::raw::c_uint) { + pub fn set_mHasWarnedAboutTooLargeDashedOrDottedRadius(&mut self, + val: + ::std::os::raw::c_uint) { let mask = 2199023255552u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28436,8 +22264,7 @@ pub mod root { } } #[inline] - pub fn mHasWarnedAboutTooLargeDashedOrDottedRadius(&self) - -> ::std::os::raw::c_uint { + pub fn mQuirkSheetAdded(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28452,9 +22279,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mHasWarnedAboutTooLargeDashedOrDottedRadius(&mut self, - val: - ::std::os::raw::c_uint) { + pub fn set_mQuirkSheetAdded(&mut self, val: ::std::os::raw::c_uint) { let mask = 4398046511104u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28477,7 +22302,7 @@ pub mod root { } } #[inline] - pub fn mQuirkSheetAdded(&self) -> ::std::os::raw::c_uint { + pub fn mNeedsPrefUpdate(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28492,7 +22317,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mQuirkSheetAdded(&mut self, val: ::std::os::raw::c_uint) { + pub fn set_mNeedsPrefUpdate(&mut self, val: ::std::os::raw::c_uint) { let mask = 8796093022208u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28515,7 +22340,7 @@ pub mod root { } } #[inline] - pub fn mNeedsPrefUpdate(&self) -> ::std::os::raw::c_uint { + pub fn mHadNonBlankPaint(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28530,7 +22355,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mNeedsPrefUpdate(&mut self, val: ::std::os::raw::c_uint) { + pub fn set_mHadNonBlankPaint(&mut self, val: ::std::os::raw::c_uint) { let mask = 17592186044416u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28553,7 +22378,7 @@ pub mod root { } } #[inline] - pub fn mHadNonBlankPaint(&self) -> ::std::os::raw::c_uint { + pub fn mRestyleLoggingEnabled(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28568,7 +22393,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mHadNonBlankPaint(&mut self, val: ::std::os::raw::c_uint) { + pub fn set_mRestyleLoggingEnabled(&mut self, + val: ::std::os::raw::c_uint) { let mask = 35184372088832u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28591,7 +22417,7 @@ pub mod root { } } #[inline] - pub fn mRestyleLoggingEnabled(&self) -> ::std::os::raw::c_uint { + pub fn mInitialized(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28606,8 +22432,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mRestyleLoggingEnabled(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mInitialized(&mut self, val: ::std::os::raw::c_uint) { let mask = 70368744177664u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28630,44 +22455,6 @@ pub mod root { } } #[inline] - pub fn mInitialized(&self) -> ::std::os::raw::c_uint { - let mut unit_field_val: u64 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u64 as *mut u8, - ::std::mem::size_of::<u64>()) - }; - let mask = 140737488355328u64 as u64; - let val = (unit_field_val & mask) >> 47usize; - unsafe { ::std::mem::transmute(val as u32) } - } - #[inline] - pub fn set_mInitialized(&mut self, val: ::std::os::raw::c_uint) { - let mask = 140737488355328u64 as u64; - let val = val as u32 as u64; - let mut unit_field_val: u64 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u64 as *mut u8, - ::std::mem::size_of::<u64>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 47usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u64>()); - } - } - #[inline] pub fn new_bitfield_1(mHasPendingInterrupt: ::std::os::raw::c_uint, mPendingInterruptFromTest: ::std::os::raw::c_uint, @@ -28704,7 +22491,6 @@ pub mod root { mIsGlyph: ::std::os::raw::c_uint, mUsesRootEMUnits: ::std::os::raw::c_uint, mUsesExChUnits: ::std::os::raw::c_uint, - mUsesViewportUnits: ::std::os::raw::c_uint, mPendingViewportChange: ::std::os::raw::c_uint, mCounterStylesDirty: ::std::os::raw::c_uint, mPostedFlushCounterStyles: @@ -28772,396 +22558,382 @@ pub mod root { ({ ({ ({ - ({ - 0 - } - | - ((mHasPendingInterrupt - as - u32 - as - u64) - << - 0usize) - & - (1u64 - as - u64)) + 0 } | - ((mPendingInterruptFromTest + ((mHasPendingInterrupt as u32 as u64) << - 1usize) + 0usize) & - (2u64 + (1u64 as u64)) } | - ((mInterruptsEnabled + ((mPendingInterruptFromTest as u32 as u64) << - 2usize) + 1usize) & - (4u64 + (2u64 as u64)) } | - ((mUseDocumentFonts + ((mInterruptsEnabled as u32 as u64) << - 3usize) + 2usize) & - (8u64 + (4u64 as u64)) } | - ((mUseDocumentColors + ((mUseDocumentFonts as u32 as u64) << - 4usize) + 3usize) & - (16u64 + (8u64 as u64)) } | - ((mUnderlineLinks + ((mUseDocumentColors as u32 as u64) << - 5usize) + 4usize) & - (32u64 + (16u64 as u64)) } | - ((mSendAfterPaintToContent + ((mUnderlineLinks as u32 as u64) << - 6usize) + 5usize) & - (64u64 + (32u64 as u64)) } | - ((mUseFocusColors + ((mSendAfterPaintToContent as u32 as u64) << - 7usize) + 6usize) & - (128u64 + (64u64 as u64)) } | - ((mFocusRingOnAnything + ((mUseFocusColors as u32 as u64) << - 8usize) + 7usize) & - (256u64 + (128u64 as u64)) } | - ((mFocusRingStyle + ((mFocusRingOnAnything as u32 as u64) << - 9usize) + 8usize) & - (512u64 + (256u64 as u64)) } | - ((mDrawImageBackground + ((mFocusRingStyle as u32 as u64) << - 10usize) + 9usize) & - (1024u64 + (512u64 as u64)) } | - ((mDrawColorBackground + ((mDrawImageBackground as u32 as u64) << - 11usize) + 10usize) & - (2048u64 + (1024u64 as u64)) } | - ((mNeverAnimate + ((mDrawColorBackground as u32 as u64) << - 12usize) + 11usize) & - (4096u64 + (2048u64 as u64)) } | - ((mIsRenderingOnlySelection + ((mNeverAnimate as u32 as u64) << - 13usize) + 12usize) & - (8192u64 + (4096u64 as u64)) } | - ((mPaginated + ((mIsRenderingOnlySelection as u32 as u64) << - 14usize) + 13usize) & - (16384u64 + (8192u64 as u64)) } | - ((mCanPaginatedScroll + ((mPaginated as u32 as u64) << - 15usize) + 14usize) & - (32768u64 + (16384u64 as u64)) } | - ((mDoScaledTwips + ((mCanPaginatedScroll as u32 as u64) << - 16usize) + 15usize) & - (65536u64 + (32768u64 as u64)) } | - ((mIsRootPaginatedDocument + ((mDoScaledTwips as u32 as u64) << - 17usize) + 16usize) & - (131072u64 + (65536u64 as u64)) } | - ((mPrefBidiDirection + ((mIsRootPaginatedDocument as u32 as u64) << - 18usize) + 17usize) & - (262144u64 + (131072u64 as u64)) } | - ((mPrefScrollbarSide + ((mPrefBidiDirection as u32 as u64) << - 19usize) + 18usize) & - (1572864u64 + (262144u64 as u64)) } | - ((mPendingSysColorChanged + ((mPrefScrollbarSide as u32 as u64) << - 21usize) + 19usize) & - (2097152u64 + (1572864u64 as u64)) } | - ((mPendingThemeChanged + ((mPendingSysColorChanged as u32 as u64) << - 22usize) + 21usize) & - (4194304u64 + (2097152u64 as u64)) } | - ((mPendingUIResolutionChanged + ((mPendingThemeChanged as u32 as u64) << - 23usize) + 22usize) & - (8388608u64 + (4194304u64 as u64)) } | - ((mPendingMediaFeatureValuesChanged + ((mPendingUIResolutionChanged as u32 as u64) << - 24usize) + 23usize) & - (16777216u64 + (8388608u64 as u64)) } | - ((mPrefChangePendingNeedsReflow + ((mPendingMediaFeatureValuesChanged as u32 as u64) << - 25usize) + 24usize) & - (33554432u64 + (16777216u64 as u64)) } | - ((mIsEmulatingMedia + ((mPrefChangePendingNeedsReflow as u32 as u64) << - 26usize) + 25usize) & - (67108864u64 + (33554432u64 as u64)) } | - ((mIsGlyph + ((mIsEmulatingMedia as u32 as u64) << - 27usize) + 26usize) & - (134217728u64 + (67108864u64 as u64)) } | - ((mUsesRootEMUnits + ((mIsGlyph as u32 as u64) << - 28usize) + 27usize) & - (268435456u64 + (134217728u64 as u64)) } | - ((mUsesExChUnits + ((mUsesRootEMUnits as u32 as u64) << - 29usize) + 28usize) & - (536870912u64 + (268435456u64 as u64)) } | - ((mUsesViewportUnits + ((mUsesExChUnits as u32 as u64) << - 30usize) + 29usize) & - (1073741824u64 + (536870912u64 as u64)) } @@ -29172,9 +22944,9 @@ pub mod root { as u64) << - 31usize) + 30usize) & - (2147483648u64 + (1073741824u64 as u64)) } @@ -29185,9 +22957,9 @@ pub mod root { as u64) << - 32usize) + 31usize) & - (4294967296u64 + (2147483648u64 as u64)) } @@ -29198,9 +22970,9 @@ pub mod root { as u64) << - 33usize) + 32usize) & - (8589934592u64 + (4294967296u64 as u64)) } @@ -29211,9 +22983,9 @@ pub mod root { as u64) << - 34usize) + 33usize) & - (17179869184u64 + (8589934592u64 as u64)) } | @@ -29223,9 +22995,9 @@ pub mod root { as u64) << - 35usize) + 34usize) & - (34359738368u64 + (17179869184u64 as u64)) } | @@ -29235,9 +23007,9 @@ pub mod root { as u64) << - 36usize) + 35usize) & - (68719476736u64 + (34359738368u64 as u64)) } | @@ -29247,58 +23019,59 @@ pub mod root { as u64) << - 37usize) + 36usize) & - (137438953472u64 + (68719476736u64 as u64)) } | ((mIsChromeOriginImage as u32 as u64) << - 38usize) & - (274877906944u64 + 37usize) & + (137438953472u64 as u64)) } | ((mPaintFlashing as u32 as u64) << - 39usize) & - (549755813888u64 + 38usize) & + (274877906944u64 as u64)) } | ((mPaintFlashingInitialized as u32 as u64) << - 40usize) & - (1099511627776u64 as + 39usize) & + (549755813888u64 as u64)) } | ((mHasWarnedAboutPositionedTableParts as u32 as u64) << - 41usize) & - (2199023255552u64 as u64)) + 40usize) & + (1099511627776u64 as u64)) } | ((mHasWarnedAboutTooLargeDashedOrDottedRadius - as u32 as u64) << 42usize) & - (4398046511104u64 as u64)) + as u32 as u64) << 41usize) & + (2199023255552u64 as u64)) } | ((mQuirkSheetAdded as u32 as u64) << - 43usize) & - (8796093022208u64 as u64)) + 42usize) & + (4398046511104u64 as u64)) } | - ((mNeedsPrefUpdate as u32 as u64) << 44usize) - & (17592186044416u64 as u64)) + ((mNeedsPrefUpdate as u32 as u64) << 43usize) + & (8796093022208u64 as u64)) } | - ((mHadNonBlankPaint as u32 as u64) << 45usize) & - (35184372088832u64 as u64)) + ((mHadNonBlankPaint as u32 as u64) << 44usize) & + (17592186044416u64 as u64)) } | - ((mRestyleLoggingEnabled as u32 as u64) << 46usize) & - (70368744177664u64 as u64)) + ((mRestyleLoggingEnabled as u32 as u64) << 45usize) & + (35184372088832u64 as u64)) } | - ((mInitialized as u32 as u64) << 47usize) & - (140737488355328u64 as u64)) + ((mInitialized as u32 as u64) << 46usize) & + (70368744177664u64 as u64)) } } + pub type gfxSize = [u64; 2usize]; #[repr(C)] #[derive(Debug)] pub struct nsAttrName { @@ -29357,22 +23130,20 @@ pub mod root { eSVGTransformList = 32, eSVGViewBox = 33, } - /** - * Structure for a mapping from int (enum) values to strings. When you use - * it you generally create an array of them. - * Instantiate like this: - * EnumTable myTable[] = { - * { "string1", 1 }, - * { "string2", 2 }, - * { nullptr, 0 } - * } - */ + /// Structure for a mapping from int (enum) values to strings. When you use + /// it you generally create an array of them. + /// Instantiate like this: + /// EnumTable myTable[] = { + /// { "string1", 1 }, + /// { "string2", 2 }, + /// { nullptr, 0 } + /// } #[repr(C)] #[derive(Debug, Copy)] pub struct nsAttrValue_EnumTable { - /** The string the value maps to */ + /// The string the value maps to pub tag: *const ::std::os::raw::c_char, - /** The enum value that maps to this string */ + /// The enum value that maps to this string pub value: i16, } #[test] @@ -29423,13 +23194,6 @@ pub mod root { "Alignment of field: " , stringify ! ( nsAttrValue ) , "::" , stringify ! ( mBits ) )); } - #[repr(u32)] - /** - * This is the enum used by functions that need to be told whether to - * do case-sensitive or case-insensitive string comparisons. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsCaseTreatment { eCaseMatters = 0, eIgnoreCase = 1, } #[repr(C)] #[derive(Debug, Copy)] pub struct nsIVariant { @@ -29452,6 +23216,7 @@ pub mod root { } pub const kNameSpaceID_None: i32 = 0; #[repr(C)] + #[derive(Debug)] pub struct nsNodeInfoManager { pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub _mOwningThread: root::nsAutoOwningThread, @@ -29567,49 +23332,12 @@ pub mod root { "Alignment of field: " , stringify ! ( nsNodeInfoManager ) , "::" , stringify ! ( mRecentlyUsedNodeInfos ) )); } - pub type NSPropertyFunc = - ::std::option::Option<unsafe extern "C" fn(aObject: - *mut ::std::os::raw::c_void, - aPropertyName: - *mut root::nsIAtom, - aPropertyValue: - *mut ::std::os::raw::c_void, - aData: - *mut ::std::os::raw::c_void)>; - /** - * Callback type for property destructors. |aObject| is the object - * the property is being removed for, |aPropertyName| is the property - * being removed, |aPropertyValue| is the value of the property, and |aData| - * is the opaque destructor data that was passed to SetProperty(). - **/ - pub type NSPropertyDtorFunc = root::NSPropertyFunc; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsIFrame { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsPropertyOwner { - pub mObject: *const ::std::os::raw::c_void, - } - #[test] - fn bindgen_test_layout_nsPropertyOwner() { - assert_eq!(::std::mem::size_of::<nsPropertyOwner>() , 8usize , concat - ! ( "Size of: " , stringify ! ( nsPropertyOwner ) )); - assert_eq! (::std::mem::align_of::<nsPropertyOwner>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsPropertyOwner ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsPropertyOwner ) ) . mObject as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsPropertyOwner ) , - "::" , stringify ! ( mObject ) )); - } - impl Clone for nsPropertyOwner { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug)] pub struct nsPropertyTable { pub mPropertyList: *mut root::nsPropertyTable_PropertyList, @@ -29632,23 +23360,8 @@ pub mod root { "Alignment of field: " , stringify ! ( nsPropertyTable ) , "::" , stringify ! ( mPropertyList ) )); } - /** - * An array of observers. Like a normal array, but supports iterators that are - * stable even if the array is modified during iteration. - * The template parameter T is the observer type the array will hold; - * N is the number of built-in storage slots that come with the array. - * NOTE: You probably want to use nsTObserverArray, unless you specifically - * want built-in storage. See below. - * @see nsTObserverArray, nsTArray - */ - #[repr(C)] - #[derive(Debug)] - pub struct nsTObserverArray_base { - pub mIterators: *mut root::nsTObserverArray_base_Iterator_base, - } pub type nsTObserverArray_base_index_type = usize; pub type nsTObserverArray_base_size_type = usize; - pub type nsTObserverArray_base_diff_type = isize; #[repr(C)] #[derive(Debug, Copy)] pub struct nsTObserverArray_base_Iterator_base { @@ -29682,73 +23395,47 @@ pub mod root { impl Clone for nsTObserverArray_base_Iterator_base { fn clone(&self) -> Self { *self } } - #[test] - fn bindgen_test_layout_nsTObserverArray_base() { - assert_eq!(::std::mem::size_of::<nsTObserverArray_base>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsTObserverArray_base ) )); - assert_eq! (::std::mem::align_of::<nsTObserverArray_base>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsTObserverArray_base ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsTObserverArray_base ) ) . - mIterators as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsTObserverArray_base ) , "::" , stringify ! ( mIterators - ) )); - } + pub type nsAutoTObserverArray_elem_type<T> = T; + pub type nsAutoTObserverArray_array_type<T> = root::nsTArray<T>; #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsTObserverArray { + #[derive(Debug)] + pub struct nsAutoTObserverArray_Iterator { + pub _base: root::nsTObserverArray_base_Iterator_base, + pub mArray: *mut root::nsAutoTObserverArray_Iterator_array_type, } - pub type nsTObserverArray_base_type = u8; - pub type nsTObserverArray_size_type = - root::nsTObserverArray_base_size_type; - /** - * It is used by the application to initialize a runtime and run scripts. - * A script runtime would implement this interface. - */ + pub type nsAutoTObserverArray_Iterator_array_type = u8; #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIScriptContext { - pub _base: root::nsISupports, + #[derive(Debug)] + pub struct nsAutoTObserverArray_ForwardIterator { + pub _base: root::nsAutoTObserverArray_Iterator, } + pub type nsAutoTObserverArray_ForwardIterator_array_type = u8; + pub type nsAutoTObserverArray_ForwardIterator_base_type = + root::nsAutoTObserverArray_Iterator; #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIScriptContext_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIScriptContext() { - assert_eq!(::std::mem::size_of::<nsIScriptContext>() , 8usize , concat - ! ( "Size of: " , stringify ! ( nsIScriptContext ) )); - assert_eq! (::std::mem::align_of::<nsIScriptContext>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIScriptContext ) )); - } - impl Clone for nsIScriptContext { - fn clone(&self) -> Self { *self } + #[derive(Debug)] + pub struct nsAutoTObserverArray_EndLimitedIterator { + pub _base: root::nsAutoTObserverArray_ForwardIterator, + pub mEnd: root::nsAutoTObserverArray_ForwardIterator, } + pub type nsAutoTObserverArray_EndLimitedIterator_array_type = u8; + pub type nsAutoTObserverArray_EndLimitedIterator_base_type = + root::nsAutoTObserverArray_Iterator; #[repr(C)] #[derive(Debug)] - pub struct nsPIDOMWindowOuter { - pub _base: [u64; 31usize], + pub struct nsAutoTObserverArray_BackwardIterator { + pub _base: root::nsAutoTObserverArray_Iterator, } + pub type nsAutoTObserverArray_BackwardIterator_array_type = u8; + pub type nsAutoTObserverArray_BackwardIterator_base_type = + root::nsAutoTObserverArray_Iterator; #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsPIDOMWindowOuter_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsPIDOMWindowOuter() { - assert_eq!(::std::mem::size_of::<nsPIDOMWindowOuter>() , 248usize , - concat ! ( "Size of: " , stringify ! ( nsPIDOMWindowOuter ) - )); - assert_eq! (::std::mem::align_of::<nsPIDOMWindowOuter>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsPIDOMWindowOuter ) )); + pub struct nsTObserverArray { } + pub type nsTObserverArray_base_type = u8; + pub type nsTObserverArray_size_type = + root::nsTObserverArray_base_size_type; #[repr(C)] #[derive(Debug)] pub struct nsIGlobalObject { @@ -29872,20 +23559,14 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsCSSSelectorList { - _unused: [u8; 0], - } - #[repr(C)] + #[derive(Debug)] pub struct nsDOMAttributeMap { pub _base: root::nsIDOMMozNamedAttrMap, pub _base_1: root::nsWrapperCache, pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub _mOwningThread: root::nsAutoOwningThread, pub mContent: root::nsCOMPtr<root::mozilla::dom::Element>, - /** - * Cache of Attrs. - */ + /// Cache of Attrs. pub mAttributeCache: root::nsDOMAttributeMap_AttrCache, } pub type nsDOMAttributeMap_Attr = root::mozilla::dom::Attr; @@ -29926,25 +23607,18 @@ pub mod root { concat ! ( "Alignment of " , stringify ! ( nsDOMAttributeMap ) )); } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIAnimationObserver { - _unused: [u8; 0], - } - /** - * Mutation observer interface - * - * See nsINode::AddMutationObserver, nsINode::RemoveMutationObserver for how to - * attach or remove your observers. - * - * WARNING: During these notifications, you are not allowed to perform - * any mutations to the current or any other document, or start a - * network load. If you need to perform such operations do that - * during the _last_ nsIDocumentObserver::EndUpdate notification. The - * expection for this is ParentChainChanged, where mutations should be - * done from an async event, as the notification might not be - * surrounded by BeginUpdate/EndUpdate calls. - */ + /// Mutation observer interface + /// + /// See nsINode::AddMutationObserver, nsINode::RemoveMutationObserver for how to + /// attach or remove your observers. + /// + /// WARNING: During these notifications, you are not allowed to perform + /// any mutations to the current or any other document, or start a + /// network load. If you need to perform such operations do that + /// during the _last_ nsIDocumentObserver::EndUpdate notification. The + /// expection for this is ParentChainChanged, where mutations should be + /// done from an async event, as the notification might not be + /// surrounded by BeginUpdate/EndUpdate calls. #[repr(C)] #[derive(Debug, Copy)] pub struct nsIMutationObserver { @@ -29967,30 +23641,1264 @@ pub mod root { impl Clone for nsIMutationObserver { fn clone(&self) -> Self { *self } } - /** - * An internal interface for a reasonably fast indexOf. - */ + /// Presentation shell interface. Presentation shells are the + /// controlling point for managing the presentation of a document. The + /// presentation shell holds a live reference to the document, the + /// presentation context, the style manager, the style set and the root + /// frame. <p> + /// + /// When this object is Release'd, it will release the document, the + /// presentation context, the style manager, the style set and the root + /// frame. #[repr(C)] - #[derive(Debug)] - pub struct nsINodeList { - pub _base: root::nsIDOMNodeList, - pub _base_1: root::nsWrapperCache, + pub struct nsIPresShell { + pub _base: root::nsISupports, + pub mDocument: root::nsCOMPtr<root::nsIDocument>, + pub mPresContext: root::RefPtr<root::nsPresContext>, + pub mStyleSet: root::mozilla::StyleSetHandle, + pub mFrameConstructor: *mut root::nsCSSFrameConstructor, + pub mViewManager: *mut root::nsViewManager, + pub mFrameArena: root::nsPresArena, + pub mSelection: root::RefPtr<root::nsFrameSelection>, + pub mFrameManager: *mut root::nsFrameManagerBase, + pub mForwardingContainer: u64, + pub mDocAccessible: *mut root::mozilla::a11y::DocAccessible, + pub mReflowContinueTimer: root::nsCOMPtr<root::nsITimer>, + pub mDrawEventTargetFrame: *mut root::nsIFrame, + pub mAllocatedPointers: [u64; 6usize], + pub mPaintCount: u64, + pub mScrollPositionClampingScrollPortSize: root::nsSize, + pub mAutoWeakFrames: *mut root::AutoWeakFrame, + pub mWeakFrames: [u64; 6usize], + pub mCanvasBackgroundColor: root::nscolor, + pub mResolution: [u32; 2usize], + pub mSelectionFlags: i16, + pub mRenderFlags: root::nsIPresShell_RenderFlags, + pub _bitfield_1: [u8; 2usize], + pub mPresShellId: u32, + pub mFontSizeInflationEmPerLine: u32, + pub mFontSizeInflationMinTwips: u32, + pub mFontSizeInflationLineThreshold: u32, + pub mFontSizeInflationForceEnabled: bool, + pub mFontSizeInflationDisabledInMasterProcess: bool, + pub mFontSizeInflationEnabled: bool, + pub mFontSizeInflationEnabledIsDirty: bool, + pub mPaintingIsFrozen: bool, + pub mIsNeverPainting: bool, + pub mInFlush: bool, } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsINodeList_COMTypeInfo { + pub struct nsIPresShell_COMTypeInfo { pub _address: u8, } + pub type nsIPresShell_LayerManager = root::mozilla::layers::LayerManager; + pub type nsIPresShell_SourceSurface = root::mozilla::gfx::SourceSurface; + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_eRenderFlag { + STATE_IGNORING_VIEWPORT_SCROLLING = 1, + STATE_DRAWWINDOW_NOT_FLUSHING = 2, + } + pub type nsIPresShell_RenderFlags = u8; + #[repr(u32)] + /// Gets nearest scrollable frame from the specified content node. The frame + /// is scrollable with overflow:scroll or overflow:auto in some direction when + /// aDirection is eEither. Otherwise, this returns a nearest frame that is + /// scrollable in the specified direction. + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_ScrollDirection { + eHorizontal = 0, + eVertical = 1, + eEither = 2, + } + #[repr(u32)] + /// Tell the pres shell that a frame needs to be marked dirty and needs + /// Reflow. It's OK if this is an ancestor of the frame needing reflow as + /// long as the ancestor chain between them doesn't cross a reflow root. + /// + /// The bit to add should be NS_FRAME_IS_DIRTY, NS_FRAME_HAS_DIRTY_CHILDREN + /// or nsFrameState(0); passing 0 means that dirty bits won't be set on the + /// frame or its ancestors/descendants, but that intrinsic widths will still + /// be marked dirty. Passing aIntrinsicDirty = eResize and aBitToAdd = 0 + /// would result in no work being done, so don't do that. + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_IntrinsicDirty { + eResize = 0, + eTreeChange = 1, + eStyleChange = 2, + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_ReflowRootHandling { + ePositionOrSizeChange = 0, + eNoPositionOrSizeChange = 1, + eInferFromBitToAdd = 2, + } + pub const nsIPresShell_SCROLL_TOP: root::nsIPresShell__bindgen_ty_1 = + nsIPresShell__bindgen_ty_1::SCROLL_TOP; + pub const nsIPresShell_SCROLL_BOTTOM: root::nsIPresShell__bindgen_ty_1 = + nsIPresShell__bindgen_ty_1::SCROLL_BOTTOM; + pub const nsIPresShell_SCROLL_LEFT: root::nsIPresShell__bindgen_ty_1 = + nsIPresShell__bindgen_ty_1::SCROLL_TOP; + pub const nsIPresShell_SCROLL_RIGHT: root::nsIPresShell__bindgen_ty_1 = + nsIPresShell__bindgen_ty_1::SCROLL_BOTTOM; + pub const nsIPresShell_SCROLL_CENTER: root::nsIPresShell__bindgen_ty_1 = + nsIPresShell__bindgen_ty_1::SCROLL_CENTER; + pub const nsIPresShell_SCROLL_MINIMUM: root::nsIPresShell__bindgen_ty_1 = + nsIPresShell__bindgen_ty_1::SCROLL_MINIMUM; + #[repr(i32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell__bindgen_ty_1 { + SCROLL_TOP = 0, + SCROLL_BOTTOM = 100, + SCROLL_CENTER = 50, + SCROLL_MINIMUM = -1, + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_WhenToScroll { + SCROLL_ALWAYS = 0, + SCROLL_IF_NOT_VISIBLE = 1, + SCROLL_IF_NOT_FULLY_VISIBLE = 2, + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsIPresShell_ScrollAxis { + pub _bindgen_opaque_blob: u32, + } #[test] - fn bindgen_test_layout_nsINodeList() { - assert_eq!(::std::mem::size_of::<nsINodeList>() , 32usize , concat ! ( - "Size of: " , stringify ! ( nsINodeList ) )); - assert_eq! (::std::mem::align_of::<nsINodeList>() , 8usize , concat ! - ( "Alignment of " , stringify ! ( nsINodeList ) )); + fn bindgen_test_layout_nsIPresShell_ScrollAxis() { + assert_eq!(::std::mem::size_of::<nsIPresShell_ScrollAxis>() , 4usize , + concat ! ( + "Size of: " , stringify ! ( nsIPresShell_ScrollAxis ) )); + assert_eq! (::std::mem::align_of::<nsIPresShell_ScrollAxis>() , 4usize + , concat ! ( + "Alignment of " , stringify ! ( nsIPresShell_ScrollAxis ) + )); + } + impl Clone for nsIPresShell_ScrollAxis { + fn clone(&self) -> Self { *self } + } + pub const nsIPresShell_SCROLL_FIRST_ANCESTOR_ONLY: + root::nsIPresShell__bindgen_ty_2 = + nsIPresShell__bindgen_ty_2::SCROLL_FIRST_ANCESTOR_ONLY; + pub const nsIPresShell_SCROLL_OVERFLOW_HIDDEN: + root::nsIPresShell__bindgen_ty_2 = + nsIPresShell__bindgen_ty_2::SCROLL_OVERFLOW_HIDDEN; + pub const nsIPresShell_SCROLL_NO_PARENT_FRAMES: + root::nsIPresShell__bindgen_ty_2 = + nsIPresShell__bindgen_ty_2::SCROLL_NO_PARENT_FRAMES; + pub const nsIPresShell_SCROLL_SMOOTH: root::nsIPresShell__bindgen_ty_2 = + nsIPresShell__bindgen_ty_2::SCROLL_SMOOTH; + pub const nsIPresShell_SCROLL_SMOOTH_AUTO: + root::nsIPresShell__bindgen_ty_2 = + nsIPresShell__bindgen_ty_2::SCROLL_SMOOTH_AUTO; + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell__bindgen_ty_2 { + SCROLL_FIRST_ANCESTOR_ONLY = 1, + SCROLL_OVERFLOW_HIDDEN = 2, + SCROLL_NO_PARENT_FRAMES = 4, + SCROLL_SMOOTH = 8, + SCROLL_SMOOTH_AUTO = 16, + } + pub const nsIPresShell_RENDER_IS_UNTRUSTED: + root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_IS_UNTRUSTED; + pub const nsIPresShell_RENDER_IGNORE_VIEWPORT_SCROLLING: + root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_IGNORE_VIEWPORT_SCROLLING; + pub const nsIPresShell_RENDER_CARET: root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_CARET; + pub const nsIPresShell_RENDER_USE_WIDGET_LAYERS: + root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_USE_WIDGET_LAYERS; + pub const nsIPresShell_RENDER_ASYNC_DECODE_IMAGES: + root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_ASYNC_DECODE_IMAGES; + pub const nsIPresShell_RENDER_DOCUMENT_RELATIVE: + root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_DOCUMENT_RELATIVE; + pub const nsIPresShell_RENDER_DRAWWINDOW_NOT_FLUSHING: + root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_DRAWWINDOW_NOT_FLUSHING; + #[repr(u32)] + /// Render the document into an arbitrary gfxContext + /// Designed for getting a picture of a document or a piece of a document + /// Note that callers will generally want to call FlushPendingNotifications + /// to get an up-to-date view of the document + /// @param aRect is the region to capture into the offscreen buffer, in the + /// root frame's coordinate system (if aIgnoreViewportScrolling is false) + /// or in the root scrolled frame's coordinate system + /// (if aIgnoreViewportScrolling is true). The coordinates are in appunits. + /// @param aFlags see below; + /// set RENDER_IS_UNTRUSTED if the contents may be passed to malicious + /// agents. E.g. we might choose not to paint the contents of sensitive widgets + /// such as the file name in a file upload widget, and we might choose not + /// to paint themes. + /// set RENDER_IGNORE_VIEWPORT_SCROLLING to ignore + /// clipping and scrollbar painting due to scrolling in the viewport + /// set RENDER_CARET to draw the caret if one would be visible + /// (by default the caret is never drawn) + /// set RENDER_USE_LAYER_MANAGER to force rendering to go through + /// the layer manager for the window. This may be unexpectedly slow + /// (if the layer manager must read back data from the GPU) or low-quality + /// (if the layer manager reads back pixel data and scales it + /// instead of rendering using the appropriate scaling). It may also + /// slow everything down if the area rendered does not correspond to the + /// normal visible area of the window. + /// set RENDER_ASYNC_DECODE_IMAGES to avoid having images synchronously + /// decoded during rendering. + /// (by default images decode synchronously with RenderDocument) + /// set RENDER_DOCUMENT_RELATIVE to render the document as if there has been + /// no scrolling and interpret |aRect| relative to the document instead of the + /// CSS viewport. Only considered if RENDER_IGNORE_VIEWPORT_SCROLLING is set + /// or the document is in ignore viewport scrolling mode + /// (nsIPresShell::SetIgnoreViewportScrolling/IgnoringViewportScrolling). + /// @param aBackgroundColor a background color to render onto + /// @param aRenderedContext the gfxContext to render to. We render so that + /// one CSS pixel in the source document is rendered to one unit in the current + /// transform. + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell__bindgen_ty_3 { + RENDER_IS_UNTRUSTED = 1, + RENDER_IGNORE_VIEWPORT_SCROLLING = 2, + RENDER_CARET = 4, + RENDER_USE_WIDGET_LAYERS = 8, + RENDER_ASYNC_DECODE_IMAGES = 16, + RENDER_DOCUMENT_RELATIVE = 32, + RENDER_DRAWWINDOW_NOT_FLUSHING = 64, + } + pub const nsIPresShell_RENDER_IS_IMAGE: root::nsIPresShell__bindgen_ty_4 = + nsIPresShell__bindgen_ty_4::RENDER_IS_IMAGE; + pub const nsIPresShell_RENDER_AUTO_SCALE: root::nsIPresShell__bindgen_ty_4 + = + nsIPresShell__bindgen_ty_4::RENDER_AUTO_SCALE; + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell__bindgen_ty_4 { + RENDER_IS_IMAGE = 256, + RENDER_AUTO_SCALE = 128, + } + pub const nsIPresShell_FORCE_DRAW: root::nsIPresShell__bindgen_ty_5 = + nsIPresShell__bindgen_ty_5::FORCE_DRAW; + pub const nsIPresShell_ADD_FOR_SUBDOC: root::nsIPresShell__bindgen_ty_5 = + nsIPresShell__bindgen_ty_5::ADD_FOR_SUBDOC; + pub const nsIPresShell_APPEND_UNSCROLLED_ONLY: + root::nsIPresShell__bindgen_ty_5 = + nsIPresShell__bindgen_ty_5::APPEND_UNSCROLLED_ONLY; + #[repr(u32)] + /// Add a solid color item to the bottom of aList with frame aFrame and bounds + /// aBounds. Checks first if this needs to be done by checking if aFrame is a + /// canvas frame (if the FORCE_DRAW flag is passed then this check is skipped). + /// aBackstopColor is composed behind the background color of the canvas, it is + /// transparent by default. + /// We attempt to make the background color part of the scrolled canvas (to reduce + /// transparent layers), and if async scrolling is enabled (and the background + /// is opaque) then we add a second, unscrolled item to handle the checkerboarding + /// case. + /// ADD_FOR_SUBDOC shoud be specified when calling this for a subdocument, and + /// LayoutUseContainersForRootFrame might cause the whole list to be scrolled. In + /// that case the second unscrolled item will be elided. + /// APPEND_UNSCROLLED_ONLY only attempts to add the unscrolled item, so that we + /// can add it manually after LayoutUseContainersForRootFrame has built the + /// scrolling ContainerLayer. + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell__bindgen_ty_5 { + FORCE_DRAW = 1, + ADD_FOR_SUBDOC = 2, + APPEND_UNSCROLLED_ONLY = 4, } - /** - * A class that implements nsIWeakReference - */ + #[repr(C)] + #[derive(Debug)] + pub struct nsIPresShell_PointerCaptureInfo { + pub mPendingContent: root::nsCOMPtr<root::nsIContent>, + pub mOverrideContent: root::nsCOMPtr<root::nsIContent>, + } + #[test] + fn bindgen_test_layout_nsIPresShell_PointerCaptureInfo() { + assert_eq!(::std::mem::size_of::<nsIPresShell_PointerCaptureInfo>() , + 16usize , concat ! ( + "Size of: " , stringify ! ( nsIPresShell_PointerCaptureInfo + ) )); + assert_eq! (::std::mem::align_of::<nsIPresShell_PointerCaptureInfo>() + , 8usize , concat ! ( + "Alignment of " , stringify ! ( + nsIPresShell_PointerCaptureInfo ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell_PointerCaptureInfo ) ) . + mPendingContent as * const _ as usize } , 0usize , concat + ! ( + "Alignment of field: " , stringify ! ( + nsIPresShell_PointerCaptureInfo ) , "::" , stringify ! ( + mPendingContent ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell_PointerCaptureInfo ) ) . + mOverrideContent as * const _ as usize } , 8usize , concat + ! ( + "Alignment of field: " , stringify ! ( + nsIPresShell_PointerCaptureInfo ) , "::" , stringify ! ( + mOverrideContent ) )); + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsIPresShell_PointerInfo { + pub mPointerType: u16, + pub mActiveState: bool, + pub mPrimaryState: bool, + pub mPreventMouseEventByContent: bool, + } + #[test] + fn bindgen_test_layout_nsIPresShell_PointerInfo() { + assert_eq!(::std::mem::size_of::<nsIPresShell_PointerInfo>() , 6usize + , concat ! ( + "Size of: " , stringify ! ( nsIPresShell_PointerInfo ) )); + assert_eq! (::std::mem::align_of::<nsIPresShell_PointerInfo>() , + 2usize , concat ! ( + "Alignment of " , stringify ! ( nsIPresShell_PointerInfo ) + )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . + mPointerType as * const _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( + nsIPresShell_PointerInfo ) , "::" , stringify ! ( + mPointerType ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . + mActiveState as * const _ as usize } , 2usize , concat ! ( + "Alignment of field: " , stringify ! ( + nsIPresShell_PointerInfo ) , "::" , stringify ! ( + mActiveState ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . + mPrimaryState as * const _ as usize } , 3usize , concat ! + ( + "Alignment of field: " , stringify ! ( + nsIPresShell_PointerInfo ) , "::" , stringify ! ( + mPrimaryState ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . + mPreventMouseEventByContent as * const _ as usize } , + 4usize , concat ! ( + "Alignment of field: " , stringify ! ( + nsIPresShell_PointerInfo ) , "::" , stringify ! ( + mPreventMouseEventByContent ) )); + } + impl Clone for nsIPresShell_PointerInfo { + fn clone(&self) -> Self { *self } + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_PaintFlags { + PAINT_LAYERS = 1, + PAINT_COMPOSITE = 2, + PAINT_SYNC_DECODE_IMAGES = 4, + } + #[repr(u32)] + /// Ensures that the refresh driver is running, and schedules a view + /// manager flush on the next tick. + /// + /// @param aType PAINT_DELAYED_COMPRESS : Schedule a paint to be executed after a delay, and + /// put FrameLayerBuilder in 'compressed' mode that avoids short cut optimizations. + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_PaintType { + PAINT_DEFAULT = 0, + PAINT_DELAYED_COMPRESS = 1, + } + extern "C" { + #[link_name = "_ZN12nsIPresShell12gCaptureInfoE"] + pub static mut nsIPresShell_gCaptureInfo: root::CapturingContentInfo; + } + extern "C" { + #[link_name = "_ZN12nsIPresShell14gKeyDownTargetE"] + pub static mut nsIPresShell_gKeyDownTarget: *mut root::nsIContent; + } + #[test] + fn bindgen_test_layout_nsIPresShell() { + assert_eq!(::std::mem::size_of::<nsIPresShell>() , 5456usize , concat + ! ( "Size of: " , stringify ! ( nsIPresShell ) )); + assert_eq! (::std::mem::align_of::<nsIPresShell>() , 8usize , concat ! + ( "Alignment of " , stringify ! ( nsIPresShell ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mDocument as * + const _ as usize } , 8usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mDocument ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mPresContext as * + const _ as usize } , 16usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mPresContext ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mStyleSet as * + const _ as usize } , 24usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mStyleSet ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mFrameConstructor + as * const _ as usize } , 32usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFrameConstructor ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mViewManager as * + const _ as usize } , 40usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mViewManager ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mFrameArena as * + const _ as usize } , 48usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFrameArena ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mSelection as * + const _ as usize } , 5240usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mSelection ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mFrameManager as * + const _ as usize } , 5248usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFrameManager ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mForwardingContainer as * const _ as usize } , 5256usize , + concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mForwardingContainer ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mDocAccessible as + * const _ as usize } , 5264usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mDocAccessible ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mReflowContinueTimer as * const _ as usize } , 5272usize , + concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mReflowContinueTimer ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mDrawEventTargetFrame as * const _ as usize } , 5280usize + , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mDrawEventTargetFrame ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mAllocatedPointers + as * const _ as usize } , 5288usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mAllocatedPointers ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mPaintCount as * + const _ as usize } , 5336usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mPaintCount ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mScrollPositionClampingScrollPortSize as * const _ as + usize } , 5344usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mScrollPositionClampingScrollPortSize + ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mAutoWeakFrames as + * const _ as usize } , 5352usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mAutoWeakFrames ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mWeakFrames as * + const _ as usize } , 5360usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mWeakFrames ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mCanvasBackgroundColor as * const _ as usize } , 5408usize + , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mCanvasBackgroundColor ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mResolution as * + const _ as usize } , 5412usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mResolution ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mSelectionFlags as + * const _ as usize } , 5420usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mSelectionFlags ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mRenderFlags as * + const _ as usize } , 5422usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mRenderFlags ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mPresShellId as * + const _ as usize } , 5428usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mPresShellId ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationEmPerLine as * const _ as usize } , + 5432usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFontSizeInflationEmPerLine ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationMinTwips as * const _ as usize } , + 5436usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFontSizeInflationMinTwips ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationLineThreshold as * const _ as usize } , + 5440usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFontSizeInflationLineThreshold ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationForceEnabled as * const _ as usize } , + 5444usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFontSizeInflationForceEnabled ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationDisabledInMasterProcess as * const _ as + usize } , 5445usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( + mFontSizeInflationDisabledInMasterProcess ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationEnabled as * const _ as usize } , + 5446usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFontSizeInflationEnabled ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationEnabledIsDirty as * const _ as usize } , + 5447usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFontSizeInflationEnabledIsDirty ) + )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mPaintingIsFrozen + as * const _ as usize } , 5448usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mPaintingIsFrozen ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mIsNeverPainting + as * const _ as usize } , 5449usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mIsNeverPainting ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mInFlush as * + const _ as usize } , 5450usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mInFlush ) )); + } + impl nsIPresShell { + #[inline] + pub fn mDidInitialize(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 1u64 as u16; + let val = (unit_field_val & mask) >> 0usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mDidInitialize(&mut self, val: bool) { + let mask = 1u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mIsDestroying(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 2u64 as u16; + let val = (unit_field_val & mask) >> 1usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mIsDestroying(&mut self, val: bool) { + let mask = 2u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mIsReflowing(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 4u64 as u16; + let val = (unit_field_val & mask) >> 2usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mIsReflowing(&mut self, val: bool) { + let mask = 4u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mPaintingSuppressed(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 8u64 as u16; + let val = (unit_field_val & mask) >> 3usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mPaintingSuppressed(&mut self, val: bool) { + let mask = 8u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mIsActive(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 16u64 as u16; + let val = (unit_field_val & mask) >> 4usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mIsActive(&mut self, val: bool) { + let mask = 16u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mFrozen(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 32u64 as u16; + let val = (unit_field_val & mask) >> 5usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mFrozen(&mut self, val: bool) { + let mask = 32u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mIsFirstPaint(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 64u64 as u16; + let val = (unit_field_val & mask) >> 6usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mIsFirstPaint(&mut self, val: bool) { + let mask = 64u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mObservesMutationsForPrint(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 128u64 as u16; + let val = (unit_field_val & mask) >> 7usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mObservesMutationsForPrint(&mut self, val: bool) { + let mask = 128u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mSuppressInterruptibleReflows(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 256u64 as u16; + let val = (unit_field_val & mask) >> 8usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mSuppressInterruptibleReflows(&mut self, val: bool) { + let mask = 256u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 8usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mScrollPositionClampingScrollPortSizeSet(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 512u64 as u16; + let val = (unit_field_val & mask) >> 9usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mScrollPositionClampingScrollPortSizeSet(&mut self, + val: bool) { + let mask = 512u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 9usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mNeedLayoutFlush(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 1024u64 as u16; + let val = (unit_field_val & mask) >> 10usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mNeedLayoutFlush(&mut self, val: bool) { + let mask = 1024u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 10usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mNeedStyleFlush(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 2048u64 as u16; + let val = (unit_field_val & mask) >> 11usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mNeedStyleFlush(&mut self, val: bool) { + let mask = 2048u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 11usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mObservingStyleFlushes(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 4096u64 as u16; + let val = (unit_field_val & mask) >> 12usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mObservingStyleFlushes(&mut self, val: bool) { + let mask = 4096u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 12usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mObservingLayoutFlushes(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 8192u64 as u16; + let val = (unit_field_val & mask) >> 13usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mObservingLayoutFlushes(&mut self, val: bool) { + let mask = 8192u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 13usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mNeedThrottledAnimationFlush(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 16384u64 as u16; + let val = (unit_field_val & mask) >> 14usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mNeedThrottledAnimationFlush(&mut self, val: bool) { + let mask = 16384u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 14usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn new_bitfield_1(mDidInitialize: bool, mIsDestroying: bool, + mIsReflowing: bool, mPaintingSuppressed: bool, + mIsActive: bool, mFrozen: bool, + mIsFirstPaint: bool, + mObservesMutationsForPrint: bool, + mSuppressInterruptibleReflows: bool, + mScrollPositionClampingScrollPortSizeSet: bool, + mNeedLayoutFlush: bool, mNeedStyleFlush: bool, + mObservingStyleFlushes: bool, + mObservingLayoutFlushes: bool, + mNeedThrottledAnimationFlush: bool) -> u16 { + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + 0 + } + | + ((mDidInitialize + as + u8 + as + u16) + << + 0usize) + & + (1u64 + as + u16)) + } + | + ((mIsDestroying + as + u8 + as + u16) + << + 1usize) + & + (2u64 + as + u16)) + } | + ((mIsReflowing + as + u8 + as + u16) + << + 2usize) + & + (4u64 + as + u16)) + } | + ((mPaintingSuppressed + as + u8 + as + u16) + << + 3usize) + & + (8u64 + as + u16)) + } | + ((mIsActive + as u8 + as + u16) + << + 4usize) + & + (16u64 + as + u16)) + } | + ((mFrozen as u8 + as u16) << + 5usize) & + (32u64 as + u16)) + } | + ((mIsFirstPaint as u8 + as u16) << + 6usize) & + (64u64 as u16)) + } | + ((mObservesMutationsForPrint + as u8 as u16) << + 7usize) & + (128u64 as u16)) + } | + ((mSuppressInterruptibleReflows + as u8 as u16) << 8usize) + & (256u64 as u16)) + } | + ((mScrollPositionClampingScrollPortSizeSet + as u8 as u16) << 9usize) & + (512u64 as u16)) + } | + ((mNeedLayoutFlush as u8 as u16) << + 10usize) & (1024u64 as u16)) + } | + ((mNeedStyleFlush as u8 as u16) << 11usize) & + (2048u64 as u16)) + } | + ((mObservingStyleFlushes as u8 as u16) << 12usize) + & (4096u64 as u16)) + } | + ((mObservingLayoutFlushes as u8 as u16) << 13usize) & + (8192u64 as u16)) + } | + ((mNeedThrottledAnimationFlush as u8 as u16) << 14usize) & + (16384u64 as u16)) + } + } + /// A class that implements nsIWeakReference #[repr(C)] #[derive(Debug)] pub struct nsNodeWeakReference { @@ -30031,57 +24939,62 @@ pub mod root { pub struct nsDOMMutationObserver { _unused: [u8; 0], } - pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_HAS_LISTENERMANAGER; - pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_HAS_PROPERTIES; - pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_IS_ANONYMOUS_ROOT; - pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; - pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_IS_NATIVE_ANONYMOUS_ROOT; - pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_FORCE_XBL_BINDINGS; - pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_MAY_BE_IN_BINDING_MNGR; - pub const NODE_IS_EDITABLE: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_IS_EDITABLE; - pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_IS_NATIVE_ANONYMOUS; - pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_IS_IN_SHADOW_TREE; - pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_HAS_EMPTY_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_HAS_SLOW_SELECTOR; - pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_HAS_EDGE_CHILD_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; - pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_ALL_SELECTOR_FLAGS; - pub const NODE_NEEDS_FRAME: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_NEEDS_FRAME; - pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_DESCENDANTS_NEED_FRAMES; - pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_HAS_ACCESSKEY; - pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_HAS_DIRECTION_RTL; - pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_HAS_DIRECTION_LTR; - pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_ALL_DIRECTION_FLAGS; - pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_CHROME_ONLY_ACCESS; - pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; - pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_85 = - _bindgen_ty_85::NODE_TYPE_SPECIFIC_BITS_OFFSET; + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct nsRange { + _unused: [u8; 0], + } + pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_LISTENERMANAGER; + pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_PROPERTIES; + pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_ANONYMOUS_ROOT; + pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; + pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_NATIVE_ANONYMOUS_ROOT; + pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_FORCE_XBL_BINDINGS; + pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_MAY_BE_IN_BINDING_MNGR; + pub const NODE_IS_EDITABLE: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_EDITABLE; + pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_NATIVE_ANONYMOUS; + pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_IN_SHADOW_TREE; + pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_EMPTY_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_SLOW_SELECTOR; + pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_EDGE_CHILD_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; + pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_ALL_SELECTOR_FLAGS; + pub const NODE_NEEDS_FRAME: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_NEEDS_FRAME; + pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_DESCENDANTS_NEED_FRAMES; + pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_ACCESSKEY; + pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_DIRECTION_RTL; + pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_DIRECTION_LTR; + pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_ALL_DIRECTION_FLAGS; + pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_CHROME_ONLY_ACCESS; + pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; + pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_85 { + pub enum _bindgen_ty_18 { NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_PROPERTIES = 8, NODE_IS_ANONYMOUS_ROOT = 16, @@ -30107,12 +25020,10 @@ pub mod root { NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS = 4194304, NODE_TYPE_SPECIFIC_BITS_OFFSET = 21, } - /** - * Class used to detect unexpected mutations. To use the class create an - * nsMutationGuard on the stack before unexpected mutations could occur. - * You can then at any time call Mutated to check if any unexpected mutations - * have occurred. - */ + /// Class used to detect unexpected mutations. To use the class create an + /// nsMutationGuard on the stack before unexpected mutations could occur. + /// You can then at any time call Mutated to check if any unexpected mutations + /// have occurred. #[repr(C)] #[derive(Debug, Copy)] pub struct nsMutationGuard { @@ -30140,16 +25051,7 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsRuleWalker { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsTextFragment { - _unused: [u8; 0], - } - #[repr(C)] + #[derive(Debug)] pub struct nsXBLBinding { pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub _mOwningThread: root::nsAutoOwningThread, @@ -30262,200 +25164,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] - pub struct nsISelectionDisplay { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsISelectionDisplay_COMTypeInfo { - pub _address: u8, - } - pub const nsISelectionDisplay_DISPLAY_TEXT: - root::nsISelectionDisplay__bindgen_ty_1 = - nsISelectionDisplay__bindgen_ty_1::DISPLAY_TEXT; - pub const nsISelectionDisplay_DISPLAY_IMAGES: - root::nsISelectionDisplay__bindgen_ty_1 = - nsISelectionDisplay__bindgen_ty_1::DISPLAY_IMAGES; - pub const nsISelectionDisplay_DISPLAY_FRAMES: - root::nsISelectionDisplay__bindgen_ty_1 = - nsISelectionDisplay__bindgen_ty_1::DISPLAY_FRAMES; - pub const nsISelectionDisplay_DISPLAY_ALL: - root::nsISelectionDisplay__bindgen_ty_1 = - nsISelectionDisplay__bindgen_ty_1::DISPLAY_ALL; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsISelectionDisplay__bindgen_ty_1 { - DISPLAY_TEXT = 1, - DISPLAY_IMAGES = 2, - DISPLAY_FRAMES = 4, - DISPLAY_ALL = 7, - } - #[test] - fn bindgen_test_layout_nsISelectionDisplay() { - assert_eq!(::std::mem::size_of::<nsISelectionDisplay>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsISelectionDisplay ) )); - assert_eq! (::std::mem::align_of::<nsISelectionDisplay>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsISelectionDisplay ) )); - } - impl Clone for nsISelectionDisplay { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsISelection { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsISelectionController { - pub _base: root::nsISelectionDisplay, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsISelectionController_COMTypeInfo { - pub _address: u8, - } - pub const nsISelectionController_SELECTION_NONE: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_NONE; - pub const nsISelectionController_SELECTION_NORMAL: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_NORMAL; - pub const nsISelectionController_SELECTION_SPELLCHECK: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_SPELLCHECK; - pub const nsISelectionController_SELECTION_IME_RAWINPUT: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_IME_RAWINPUT; - pub const nsISelectionController_SELECTION_IME_SELECTEDRAWTEXT: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_IME_SELECTEDRAWTEXT; - pub const nsISelectionController_SELECTION_IME_CONVERTEDTEXT: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_IME_CONVERTEDTEXT; - pub const nsISelectionController_SELECTION_IME_SELECTEDCONVERTEDTEXT: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_IME_SELECTEDCONVERTEDTEXT; - pub const nsISelectionController_SELECTION_ACCESSIBILITY: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_ACCESSIBILITY; - pub const nsISelectionController_SELECTION_FIND: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_FIND; - pub const nsISelectionController_SELECTION_URLSECONDARY: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_URLSECONDARY; - pub const nsISelectionController_SELECTION_URLSTRIKEOUT: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_URLSTRIKEOUT; - pub const nsISelectionController_NUM_SELECTIONTYPES: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::NUM_SELECTIONTYPES; - pub const nsISelectionController_SELECTION_ANCHOR_REGION: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_NONE; - pub const nsISelectionController_SELECTION_FOCUS_REGION: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_NORMAL; - pub const nsISelectionController_SELECTION_WHOLE_SELECTION: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_SPELLCHECK; - pub const nsISelectionController_NUM_SELECTION_REGIONS: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::NUM_SELECTION_REGIONS; - pub const nsISelectionController_SELECTION_OFF: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_NONE; - pub const nsISelectionController_SELECTION_HIDDEN: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_NORMAL; - pub const nsISelectionController_SELECTION_ON: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_SPELLCHECK; - pub const nsISelectionController_SELECTION_DISABLED: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::NUM_SELECTION_REGIONS; - pub const nsISelectionController_SELECTION_ATTENTION: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_IME_RAWINPUT; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsISelectionController__bindgen_ty_1 { - SELECTION_NONE = 0, - SELECTION_NORMAL = 1, - SELECTION_SPELLCHECK = 2, - SELECTION_IME_RAWINPUT = 4, - SELECTION_IME_SELECTEDRAWTEXT = 8, - SELECTION_IME_CONVERTEDTEXT = 16, - SELECTION_IME_SELECTEDCONVERTEDTEXT = 32, - SELECTION_ACCESSIBILITY = 64, - SELECTION_FIND = 128, - SELECTION_URLSECONDARY = 256, - SELECTION_URLSTRIKEOUT = 512, - NUM_SELECTIONTYPES = 11, - NUM_SELECTION_REGIONS = 3, - } - pub const nsISelectionController_SCROLL_SYNCHRONOUS: - root::nsISelectionController__bindgen_ty_2 = - nsISelectionController__bindgen_ty_2::SCROLL_SYNCHRONOUS; - pub const nsISelectionController_SCROLL_FIRST_ANCESTOR_ONLY: - root::nsISelectionController__bindgen_ty_2 = - nsISelectionController__bindgen_ty_2::SCROLL_FIRST_ANCESTOR_ONLY; - pub const nsISelectionController_SCROLL_CENTER_VERTICALLY: - root::nsISelectionController__bindgen_ty_2 = - nsISelectionController__bindgen_ty_2::SCROLL_CENTER_VERTICALLY; - pub const nsISelectionController_SCROLL_OVERFLOW_HIDDEN: - root::nsISelectionController__bindgen_ty_2 = - nsISelectionController__bindgen_ty_2::SCROLL_OVERFLOW_HIDDEN; - pub const nsISelectionController_SCROLL_FOR_CARET_MOVE: - root::nsISelectionController__bindgen_ty_2 = - nsISelectionController__bindgen_ty_2::SCROLL_FOR_CARET_MOVE; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsISelectionController__bindgen_ty_2 { - SCROLL_SYNCHRONOUS = 2, - SCROLL_FIRST_ANCESTOR_ONLY = 4, - SCROLL_CENTER_VERTICALLY = 16, - SCROLL_OVERFLOW_HIDDEN = 32, - SCROLL_FOR_CARET_MOVE = 64, - } - pub const nsISelectionController_MOVE_LEFT: - root::nsISelectionController__bindgen_ty_3 = - nsISelectionController__bindgen_ty_3::MOVE_LEFT; - pub const nsISelectionController_MOVE_RIGHT: - root::nsISelectionController__bindgen_ty_3 = - nsISelectionController__bindgen_ty_3::MOVE_RIGHT; - pub const nsISelectionController_MOVE_UP: - root::nsISelectionController__bindgen_ty_3 = - nsISelectionController__bindgen_ty_3::MOVE_UP; - pub const nsISelectionController_MOVE_DOWN: - root::nsISelectionController__bindgen_ty_3 = - nsISelectionController__bindgen_ty_3::MOVE_DOWN; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsISelectionController__bindgen_ty_3 { - MOVE_LEFT = 0, - MOVE_RIGHT = 1, - MOVE_UP = 2, - MOVE_DOWN = 3, - } - #[test] - fn bindgen_test_layout_nsISelectionController() { - assert_eq!(::std::mem::size_of::<nsISelectionController>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsISelectionController ) )); - assert_eq! (::std::mem::align_of::<nsISelectionController>() , 8usize - , concat ! ( - "Alignment of " , stringify ! ( nsISelectionController ) - )); - } - impl Clone for nsISelectionController { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] pub struct nsFrameManagerBase { pub mPresShell: *mut root::nsIPresShell, pub mRootFrame: *mut root::nsIFrame, @@ -30530,14 +25238,12 @@ pub mod root { fn clone(&self) -> Self { *self } } pub type nsWeakPtr = root::nsCOMPtr<root::nsIWeakReference>; - /** - * templated hashtable class maps keys to reference pointers. - * See nsBaseHashtable for complete declaration. - * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h - * for a complete specification. - * @param PtrType the reference-type being wrapped - * @see nsDataHashtable, nsClassHashtable - */ + /// templated hashtable class maps keys to reference pointers. + /// See nsBaseHashtable for complete declaration. + /// @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h + /// for a complete specification. + /// @param PtrType the reference-type being wrapped + /// @see nsDataHashtable, nsClassHashtable #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsRefPtrHashtable { @@ -30545,14 +25251,12 @@ pub mod root { pub type nsRefPtrHashtable_KeyType = [u8; 0usize]; pub type nsRefPtrHashtable_UserDataType<PtrType> = *mut PtrType; pub type nsRefPtrHashtable_base_type = u8; - /** - * templated hashtable class maps keys to C++ object pointers. - * See nsBaseHashtable for complete declaration. - * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h - * for a complete specification. - * @param Class the class-type being wrapped - * @see nsInterfaceHashtable, nsClassHashtable - */ + /// templated hashtable class maps keys to C++ object pointers. + /// See nsBaseHashtable for complete declaration. + /// @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h + /// for a complete specification. + /// @param Class the class-type being wrapped + /// @see nsInterfaceHashtable, nsClassHashtable #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsClassHashtable { @@ -30624,11 +25328,6 @@ pub mod root { "::" , stringify ! ( mArenaRefPtrs ) )); } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsArenaMemoryStats { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct imgIRequest { pub _base: root::nsIRequest, @@ -30774,255 +25473,6 @@ pub mod root { impl Clone for imgINotificationObserver { fn clone(&self) -> Self { *self } } - pub type nsFrameState_size_t = u64; - pub const nsFrameState_NS_STATE_FLEX_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER: - root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_NS_STATE_FLEX_IS_LEGACY_WEBKIT_BOX: - root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_NS_STATE_FLEX_SYNTHESIZE_BASELINE: - root::nsFrameState = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER: - root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_NS_STATE_GRID_DID_PUSH_ITEMS: root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_NS_STATE_GRID_GENERATE_COMPUTED_VALUES: - root::nsFrameState = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_NS_STATE_GRID_SYNTHESIZE_BASELINE: - root::nsFrameState = - nsFrameState::NS_STATE_AUTO_STRETCH; - pub const nsFrameState_NS_STATE_IS_OUTER_SVG: root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_NS_STATE_SVG_CLIPPATH_CHILD: root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_NS_STATE_SVG_POSITIONING_DIRTY: root::nsFrameState - = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES: - root::nsFrameState = - nsFrameState::NS_STATE_AUTO_STRETCH; - pub const nsFrameState_NS_STATE_SVG_TEXT_IN_REFLOW: root::nsFrameState = - nsFrameState::NS_STATE_IS_ROOT; - pub const nsFrameState_TEXT_FIRST_LETTER: root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_TEXT_START_OF_LINE: root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_TEXT_END_OF_LINE: root::nsFrameState = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_TEXT_HYPHEN_BREAK: root::nsFrameState = - nsFrameState::NS_STATE_AUTO_STRETCH; - pub const nsFrameState_TEXT_TRIMMED_TRAILING_WHITESPACE: - root::nsFrameState = - nsFrameState::NS_STATE_IS_ROOT; - pub const nsFrameState_TEXT_JUSTIFICATION_ENABLED: root::nsFrameState = - nsFrameState::NS_STATE_CURRENTLY_IN_DEBUG; - pub const nsFrameState_TEXT_SELECTION_UNDERLINE_OVERFLOWED: - root::nsFrameState = - nsFrameState::NS_STATE_SET_TO_DEBUG; - pub const nsFrameState_TEXT_IS_ONLY_WHITESPACE: root::nsFrameState = - nsFrameState::NS_STATE_DEBUG_WAS_SET; - pub const nsFrameState_TEXT_ISNOT_ONLY_WHITESPACE: root::nsFrameState = - nsFrameState::NS_STATE_MENU_HAS_POPUP_LIST; - pub const nsFrameState_TEXT_IN_TEXTRUN_USER_DATA: root::nsFrameState = - nsFrameState::NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK; - pub const nsFrameState_TEXT_OFFSETS_NEED_FIXING: root::nsFrameState = - nsFrameState::NS_STATE_EQUAL_SIZE; - pub const nsFrameState_TEXT_HAS_NONCOLLAPSED_CHARACTERS: - root::nsFrameState = - nsFrameState::NS_STATE_IS_DIRECTION_NORMAL; - pub const nsFrameState_TEXT_IS_IN_TOKEN_MATHML: root::nsFrameState = - nsFrameState::NS_FRAME_IS_PUSHED_FLOAT; - pub const nsFrameState_TEXT_IN_UNINFLATED_TEXTRUN_USER_DATA: - root::nsFrameState = - nsFrameState::NS_FRAME_MOUSE_THROUGH_ALWAYS; - pub const nsFrameState_TEXT_HAS_FONT_INFLATION: root::nsFrameState = - nsFrameState::NS_FRAME_MOUSE_THROUGH_NEVER; - pub const nsFrameState_NS_BLOCK_NEEDS_BIDI_RESOLUTION: root::nsFrameState - = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_NS_BLOCK_HAS_PUSHED_FLOATS: root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_NS_BLOCK_MARGIN_ROOT: root::nsFrameState = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_NS_BLOCK_FLOAT_MGR: root::nsFrameState = - nsFrameState::NS_STATE_AUTO_STRETCH; - pub const nsFrameState_NS_BLOCK_HAS_LINE_CURSOR: root::nsFrameState = - nsFrameState::NS_STATE_IS_ROOT; - pub const nsFrameState_NS_BLOCK_HAS_OVERFLOW_LINES: root::nsFrameState = - nsFrameState::NS_STATE_CURRENTLY_IN_DEBUG; - pub const nsFrameState_NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS: - root::nsFrameState = - nsFrameState::NS_STATE_SET_TO_DEBUG; - pub const nsFrameState_NS_BLOCK_HAS_CLEAR_CHILDREN: root::nsFrameState = - nsFrameState::NS_STATE_DEBUG_WAS_SET; - pub const nsFrameState_NS_BLOCK_CLIP_PAGINATED_OVERFLOW: - root::nsFrameState = - nsFrameState::NS_STATE_MENU_HAS_POPUP_LIST; - pub const nsFrameState_NS_BLOCK_HAS_FIRST_LETTER_STYLE: root::nsFrameState - = - nsFrameState::NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK; - pub const nsFrameState_NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET: - root::nsFrameState = - nsFrameState::NS_STATE_EQUAL_SIZE; - pub const nsFrameState_NS_BLOCK_FRAME_HAS_INSIDE_BULLET: - root::nsFrameState = - nsFrameState::NS_STATE_IS_DIRECTION_NORMAL; - pub const nsFrameState_NS_BLOCK_LOOK_FOR_DIRTY_FRAMES: root::nsFrameState - = - nsFrameState::NS_FRAME_MOUSE_THROUGH_NEVER; - pub const nsFrameState_NS_BLOCK_FRAME_INTRINSICS_INFLATED: - root::nsFrameState = - nsFrameState::TEXT_NO_RENDERED_GLYPHS; - pub const nsFrameState_NS_BLOCK_HAS_FIRST_LETTER_CHILD: root::nsFrameState - = - nsFrameState::TEXT_IN_OFFSET_CACHE; - pub const nsFrameState_BULLET_FRAME_HAS_FONT_INFLATION: root::nsFrameState - = - nsFrameState::TEXT_NO_RENDERED_GLYPHS; - pub const nsFrameState_BULLET_FRAME_IMAGE_LOADING: root::nsFrameState = - nsFrameState::TEXT_IN_OFFSET_CACHE; - pub const nsFrameState_NS_SCROLLFRAME_INVALIDATE_CONTENTS_ON_SCROLL: - root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_IMAGE_SIZECONSTRAINED: root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_IMAGE_GOTINITIALREFLOW: root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET: - root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_NS_INLINE_FRAME_BIDI_VISUAL_IS_FIRST: - root::nsFrameState = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_NS_INLINE_FRAME_BIDI_VISUAL_IS_LAST: - root::nsFrameState = - nsFrameState::NS_STATE_AUTO_STRETCH; - pub const nsFrameState_NS_RUBY_TEXT_FRAME_AUTOHIDE: root::nsFrameState = - nsFrameState::NS_STATE_IS_ROOT; - pub const nsFrameState_NS_RUBY_TEXT_CONTAINER_IS_SPAN: root::nsFrameState - = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_PLACEHOLDER_FOR_FLOAT: root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_PLACEHOLDER_FOR_ABSPOS: root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_PLACEHOLDER_FOR_FIXEDPOS: root::nsFrameState = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_PLACEHOLDER_FOR_POPUP: root::nsFrameState = - nsFrameState::NS_STATE_AUTO_STRETCH; - pub const nsFrameState_PLACEHOLDER_FOR_TOPLAYER: root::nsFrameState = - nsFrameState::NS_STATE_IS_ROOT; - pub const nsFrameState_PLACEHOLDER_STATICPOS_NEEDS_CSSALIGN: - root::nsFrameState = - nsFrameState::NS_STATE_CURRENTLY_IN_DEBUG; - pub const nsFrameState_PLACEHOLDER_LINE_IS_EMPTY_SO_FAR: - root::nsFrameState = - nsFrameState::NS_STATE_SET_TO_DEBUG; - pub const nsFrameState_PLACEHOLDER_HAVE_LINE_IS_EMPTY_SO_FAR: - root::nsFrameState = - nsFrameState::NS_STATE_DEBUG_WAS_SET; - pub const nsFrameState_NS_TABLE_CELL_HAS_PCT_OVER_BSIZE: - root::nsFrameState = - nsFrameState::NS_STATE_MENU_HAS_POPUP_LIST; - pub const nsFrameState_NS_TABLE_CELL_HAD_SPECIAL_REFLOW: - root::nsFrameState = - nsFrameState::NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK; - pub const nsFrameState_NS_TABLE_CELL_CONTENT_EMPTY: root::nsFrameState = - nsFrameState::NS_STATE_IS_DIRECTION_NORMAL; - pub const nsFrameState_NS_REPEATED_ROW_OR_ROWGROUP: root::nsFrameState = - nsFrameState::NS_STATE_MENU_HAS_POPUP_LIST; - pub const nsFrameState_NS_ROW_HAS_CELL_WITH_STYLE_BSIZE: - root::nsFrameState = - nsFrameState::NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK; - pub const nsFrameState_NS_TABLE_ROW_HAS_UNPAGINATED_BSIZE: - root::nsFrameState = - nsFrameState::NS_STATE_EQUAL_SIZE; - pub const nsFrameState_NS_ROWGROUP_HAS_ROW_CURSOR: root::nsFrameState = - nsFrameState::NS_STATE_DEBUG_WAS_SET; - pub const nsFrameState_NS_ROWGROUP_HAS_STYLE_BSIZE: root::nsFrameState = - nsFrameState::NS_STATE_EQUAL_SIZE; - pub const nsFrameState_NS_ROWGROUP_REPEATABLE: root::nsFrameState = - nsFrameState::NS_STATE_IS_DIRECTION_NORMAL; - pub const nsFrameState_NS_TABLE_PART_HAS_FIXED_BACKGROUND: - root::nsFrameState = - nsFrameState::NS_STATE_MENU_HAS_POPUP_LIST; - #[repr(u64)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsFrameState { - NS_FRAME_IN_REFLOW = 1, - NS_FRAME_FIRST_REFLOW = 2, - NS_FRAME_IS_FLUID_CONTINUATION = 4, - NS_FRAME_ANONYMOUSCONTENTCREATOR_CONTENT = 8, - NS_FRAME_EXTERNAL_REFERENCE = 16, - NS_FRAME_CONTAINS_RELATIVE_BSIZE = 32, - NS_FRAME_GENERATED_CONTENT = 64, - NS_FRAME_IS_OVERFLOW_CONTAINER = 128, - NS_FRAME_OUT_OF_FLOW = 256, - NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN = 512, - NS_FRAME_IS_DIRTY = 1024, - NS_FRAME_TOO_DEEP_IN_FRAME_TREE = 2048, - NS_FRAME_HAS_DIRTY_CHILDREN = 4096, - NS_FRAME_HAS_VIEW = 8192, - NS_FRAME_INDEPENDENT_SELECTION = 16384, - NS_FRAME_PART_OF_IBSPLIT = 32768, - NS_FRAME_MAY_BE_TRANSFORMED = 65536, - NS_FRAME_IS_BIDI = 131072, - NS_FRAME_HAS_CHILD_WITH_VIEW = 262144, - NS_FRAME_REFLOW_ROOT = 524288, - NS_FRAME_IS_PUSHED_FLOAT = 4294967296, - NS_FRAME_DRAWING_AS_PAINTSERVER = 8589934592, - NS_FRAME_DESCENDANT_INTRINSIC_ISIZE_DEPENDS_ON_BSIZE = 17179869184, - NS_FRAME_SIMPLE_EVENT_REGIONS = 34359738368, - NS_FRAME_UPDATE_LAYER_TREE = 68719476736, - NS_FRAME_HAS_ABSPOS_CHILDREN = 137438953472, - NS_FRAME_PAINTED_THEBES = 274877906944, - NS_FRAME_IN_CONSTRAINED_BSIZE = 549755813888, - NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO = 1099511627776, - NS_FRAME_FONT_INFLATION_CONTAINER = 2199023255552, - NS_FRAME_FONT_INFLATION_FLOW_ROOT = 4398046511104, - NS_FRAME_SVG_LAYOUT = 8796093022208, - NS_FRAME_MAY_HAVE_GENERATED_CONTENT = 17592186044416, - NS_FRAME_NO_COMPONENT_ALPHA = 35184372088832, - NS_FRAME_VISIBILITY_IS_TRACKED = 70368744177664, - NS_FRAME_IS_SVG_TEXT = 140737488355328, - NS_FRAME_NEEDS_PAINT = 281474976710656, - NS_FRAME_DESCENDANT_NEEDS_PAINT = 562949953421312, - NS_FRAME_IN_POPUP = 1125899906842624, - NS_FRAME_ALL_DESCENDANTS_NEED_PAINT = 2251799813685248, - NS_FRAME_HAS_INVALID_RECT = 4503599627370496, - NS_FRAME_IS_NONDISPLAY = 9007199254740992, - NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY = 18014398509481984, - NS_FRAME_OWNS_ANON_BOXES = 36028797018963968, - NS_FRAME_HAS_CSS_COUNTER_STYLE = 72057594037927936, - NS_FRAME_SIMPLE_DISPLAYLIST = 144115188075855872, - NS_FRAME_MATHML_SCRIPT_DESCENDANT = 288230376151711744, - NS_FRAME_IS_IN_SINGLE_CHAR_MI = 576460752303423488, - NS_STATE_BOX_CHILD_RESERVED = 1048576, - NS_STATE_STACK_NOT_POSITIONED = 2097152, - NS_STATE_IS_HORIZONTAL = 4194304, - NS_STATE_AUTO_STRETCH = 8388608, - NS_STATE_IS_ROOT = 16777216, - NS_STATE_CURRENTLY_IN_DEBUG = 33554432, - NS_STATE_SET_TO_DEBUG = 67108864, - NS_STATE_DEBUG_WAS_SET = 134217728, - NS_STATE_MENU_HAS_POPUP_LIST = 268435456, - NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK = 536870912, - NS_STATE_EQUAL_SIZE = 1073741824, - NS_STATE_IS_DIRECTION_NORMAL = 2147483648, - NS_FRAME_MOUSE_THROUGH_ALWAYS = 1152921504606846976, - NS_FRAME_MOUSE_THROUGH_NEVER = 2305843009213693952, - TEXT_NO_RENDERED_GLYPHS = 4611686018427387904, - TEXT_IN_OFFSET_CACHE = 9223372036854775808, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct gfxContext { - _unused: [u8; 0], - } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsDocShell { @@ -31035,41 +25485,11 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsView { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIPageSequenceFrame { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsCanvasFrame { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsCaret { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsFrameSelection { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsILayoutHistoryState { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIReflowCallback { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsCSSFrameConstructor { _unused: [u8; 0], } @@ -31083,151 +25503,17 @@ pub mod root { pub struct WeakFrame { _unused: [u8; 0], } - /** - * Interface for frames that are scrollable. This interface exposes - * APIs for examining scroll state, observing changes to scroll state, - * and triggering scrolling. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIScrollableFrame { - pub _base: root::nsIScrollbarMediator, - } - pub type nsIScrollableFrame_CSSIntPoint = root::mozilla::CSSIntPoint; - pub type nsIScrollableFrame_ContainerLayerParameters = - root::mozilla::ContainerLayerParameters; - pub type nsIScrollableFrame_FrameMetrics = - root::mozilla::layers::FrameMetrics; - pub type nsIScrollableFrame_ScrollSnapInfo = - root::mozilla::layers::ScrollSnapInfo; - pub type nsIScrollableFrame_Has_NS_DECL_QUERYFRAME_TARGET = - root::nsIScrollableFrame; - pub const nsIScrollableFrame_HORIZONTAL: - root::nsIScrollableFrame__bindgen_ty_1 = - nsIScrollableFrame__bindgen_ty_1::HORIZONTAL; - pub const nsIScrollableFrame_VERTICAL: - root::nsIScrollableFrame__bindgen_ty_1 = - nsIScrollableFrame__bindgen_ty_1::VERTICAL; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIScrollableFrame__bindgen_ty_1 { - HORIZONTAL = 1, - VERTICAL = 2, - } - #[repr(u32)] - /** - * When a scroll operation is requested, we ask for instant, smooth, - * smooth msd, or normal scrolling. - * - * SMOOTH scrolls have a symmetrical acceleration and deceleration curve - * modeled with a set of splines that guarantee that the destination will be - * reached over a fixed time interval. SMOOTH will only be smooth if smooth - * scrolling is actually enabled. This behavior is utilized by keyboard and - * mouse wheel scrolling events. - * - * SMOOTH_MSD implements a physically based model that approximates the - * behavior of a mass-spring-damper system. SMOOTH_MSD scrolls have a - * non-symmetrical acceleration and deceleration curve, can potentially - * overshoot the destination on intermediate frames, and complete over a - * variable time interval. SMOOTH_MSD will only be smooth if cssom-view - * smooth-scrolling is enabled. - * - * INSTANT is always synchronous, NORMAL can be asynchronous. - * - * If an INSTANT scroll request happens while a SMOOTH or async scroll is - * already in progress, the async scroll is interrupted and we instantly - * scroll to the destination. - * - * If an INSTANT or SMOOTH scroll request happens while a SMOOTH_MSD scroll - * is already in progress, the SMOOTH_MSD scroll is interrupted without - * first scrolling to the destination. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIScrollableFrame_ScrollMode { - INSTANT = 0, - SMOOTH = 1, - SMOOTH_MSD = 2, - NORMAL = 3, - } - #[repr(u32)] - /** - * Some platforms (OSX) may generate additional scrolling events even - * after the user has stopped scrolling, simulating a momentum scrolling - * effect resulting from fling gestures. - * SYNTHESIZED_MOMENTUM_EVENT indicates that the scrolling is being requested - * by such a synthesized event and may be ignored if another scroll has - * been started since the last actual user input. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIScrollableFrame_ScrollMomentum { - NOT_MOMENTUM = 0, - SYNTHESIZED_MOMENTUM_EVENT = 1, - } - #[repr(u32)] - /** - * When scrolling by a relative amount, we can choose various units. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIScrollableFrame_ScrollUnit { - DEVICE_PIXELS = 0, - LINES = 1, - PAGES = 2, - WHOLE = 3, - } - extern "C" { - #[link_name = "_ZN18nsIScrollableFrame9kFrameIIDE"] - pub static nsIScrollableFrame_kFrameIID: root::nsQueryFrame_FrameIID; - } - #[test] - fn bindgen_test_layout_nsIScrollableFrame() { - assert_eq!(::std::mem::size_of::<nsIScrollableFrame>() , 8usize , - concat ! ( "Size of: " , stringify ! ( nsIScrollableFrame ) - )); - assert_eq! (::std::mem::align_of::<nsIScrollableFrame>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIScrollableFrame ) )); - } - impl Clone for nsIScrollableFrame { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsDisplayList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsDisplayListBuilder { - _unused: [u8; 0], - } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsRefreshDriver { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsARefreshObserver { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsAPostRefreshObserver { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsAccessibilityService { - _unused: [u8; 0], - } - /** - * The signature of the timer callback function passed to initWithFuncCallback. - * This is the function that will get called when the timer expires if the - * timer is initialized via initWithFuncCallback. - * - * @param aTimer the timer which has expired - * @param aClosure opaque parameter passed to initWithFuncCallback - */ + /// The signature of the timer callback function passed to initWithFuncCallback. + /// This is the function that will get called when the timer expires if the + /// timer is initialized via initWithFuncCallback. + /// + /// @param aTimer the timer which has expired + /// @param aClosure opaque parameter passed to initWithFuncCallback #[repr(C)] #[derive(Debug, Copy)] pub struct nsITimer { @@ -31274,6 +25560,7 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug)] pub struct CapturingContentInfo { pub mAllowed: bool, pub mPointerLock: bool, @@ -31321,15 +25608,6 @@ pub mod root { CapturingContentInfo ) , "::" , stringify ! ( mContent ) )); } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsRectVisibility { - nsRectVisibility_kVisible = 0, - nsRectVisibility_kAboveViewport = 1, - nsRectVisibility_kBelowViewport = 2, - nsRectVisibility_kLeftOfViewport = 3, - nsRectVisibility_kRightOfViewport = 4, - } #[repr(C)] #[derive(Debug, Copy)] pub struct nsIObserver { @@ -31392,78 +25670,12 @@ pub mod root { impl Clone for nsIEventTarget { fn clone(&self) -> Self { *self } } - pub type nsTimerCallbackFunc = - ::std::option::Option<unsafe extern "C" fn(aTimer: - *mut root::nsITimer, - aClosure: - *mut ::std::os::raw::c_void)>; - /** - * The signature of the timer name callback function passed to - * initWithNameableFuncCallback. - * This is the function that will get called when timer profiling is enabled - * via the "TimerFirings" log module. - * - * @param aTimer the timer which has expired - * @param aAnonymize whether the name should avoid including privacy sensitive info - * @param aClosure opaque parameter passed to initWithFuncCallback - * @param aBuf a buffer in which to put the name - * @param aLen the length of the buffer - */ - pub type nsTimerNameCallbackFunc = - ::std::option::Option<unsafe extern "C" fn(aTimer: - *mut root::nsITimer, - aAnonymize: bool, - aClosure: - *mut ::std::os::raw::c_void, - aBuf: - *mut ::std::os::raw::c_char, - aLen: usize)>; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsITimerCallback { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsITimerCallback_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsITimerCallback() { - assert_eq!(::std::mem::size_of::<nsITimerCallback>() , 8usize , concat - ! ( "Size of: " , stringify ! ( nsITimerCallback ) )); - assert_eq! (::std::mem::align_of::<nsITimerCallback>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsITimerCallback ) )); - } - impl Clone for nsITimerCallback { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIWidget { - _unused: [u8; 0], - } - #[repr(u32)] - /** - * sizemode is an adjunct to widget size - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsSizeMode { - nsSizeMode_Normal = 0, - nsSizeMode_Minimized = 1, - nsSizeMode_Maximized = 2, - nsSizeMode_Fullscreen = 3, - nsSizeMode_Invalid = 4, - } - /** - * templated hashtable class maps keys to interface pointers. - * See nsBaseHashtable for complete declaration. - * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h - * for a complete specification. - * @param Interface the interface-type being wrapped - * @see nsDataHashtable, nsClassHashtable - */ + /// templated hashtable class maps keys to interface pointers. + /// See nsBaseHashtable for complete declaration. + /// @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h + /// for a complete specification. + /// @param Interface the interface-type being wrapped + /// @see nsDataHashtable, nsClassHashtable #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsInterfaceHashtable { @@ -31502,11 +25714,6 @@ pub mod root { nsLanguageAtomService ) , "::" , stringify ! ( mLocaleLanguage ) )); } - /** - * Currently needs to be 'double' for Cairo compatibility. Could - * become 'float', perhaps, in some configurations. - */ - pub type gfxFloat = f64; #[repr(C)] #[derive(Debug, Copy)] pub struct nsINamed { @@ -31547,34 +25754,16 @@ pub mod root { impl Clone for nsIRunnable { fn clone(&self) -> Self { *self } } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsISerialEventTarget { - pub _base: root::nsIEventTarget, - } + pub type nsRunnableMethod_BaseType = u8; #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsISerialEventTarget_COMTypeInfo { + pub struct nsRunnableMethod_ReturnTypeEnforcer { pub _address: u8, } - #[test] - fn bindgen_test_layout_nsISerialEventTarget() { - assert_eq!(::std::mem::size_of::<nsISerialEventTarget>() , 16usize , - concat ! ( - "Size of: " , stringify ! ( nsISerialEventTarget ) )); - assert_eq! (::std::mem::align_of::<nsISerialEventTarget>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsISerialEventTarget ) )); - } - impl Clone for nsISerialEventTarget { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug)] - pub struct nsRevocableEventPtr<T> { - pub mEvent: root::RefPtr<T>, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } + pub type nsRunnableMethod_ReturnTypeEnforcer_ReturnTypeIsSafe = + ::std::os::raw::c_int; + pub type nsRunnableMethod_check = + root::nsRunnableMethod_ReturnTypeEnforcer; #[repr(C)] #[derive(Debug)] pub struct nsPIDOMWindowInner { @@ -31594,17 +25783,10 @@ pub mod root { concat ! ( "Alignment of " , stringify ! ( nsPIDOMWindowInner ) )); } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsGlobalWindow { - _unused: [u8; 0], - } - /** - * The global object which keeps a script context for each supported script - * language. This often used to store per-window global state. - * This is a heavyweight interface implemented only by DOM globals, and - * it might go away some time in the future. - */ + /// The global object which keeps a script context for each supported script + /// language. This often used to store per-window global state. + /// This is a heavyweight interface implemented only by DOM globals, and + /// it might go away some time in the future. #[repr(C)] #[derive(Debug)] pub struct nsIScriptGlobalObject { @@ -31626,11 +25808,6 @@ pub mod root { )); } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIInterfaceInfo { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIXPConnectJSObjectHolder { pub _base: root::nsISupports, @@ -31679,11 +25856,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsISimpleEnumerator { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsIControllers { _unused: [u8; 0], } @@ -31708,28 +25880,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy)] - pub struct mozIDOMWindowProxy { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct mozIDOMWindowProxy_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_mozIDOMWindowProxy() { - assert_eq!(::std::mem::size_of::<mozIDOMWindowProxy>() , 8usize , - concat ! ( "Size of: " , stringify ! ( mozIDOMWindowProxy ) - )); - assert_eq! (::std::mem::align_of::<mozIDOMWindowProxy>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( mozIDOMWindowProxy ) )); - } - impl Clone for mozIDOMWindowProxy { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug)] pub struct nsICSSDeclaration { pub _base: root::nsIDOMCSSStyleDeclaration, @@ -31749,15 +25899,6 @@ pub mod root { concat ! ( "Alignment of " , stringify ! ( nsICSSDeclaration ) )); } - pub type SuspendTypes = u32; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum UIStateChangeType { - UIStateChangeType_NoChange = 0, - UIStateChangeType_Set = 1, - UIStateChangeType_Clear = 2, - UIStateChangeType_Invalid = 3, - } #[repr(C)] pub struct nsPIDOMWindow__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] @@ -31823,160 +25964,6 @@ pub mod root { eCompatibility_AlmostStandards = 2, eCompatibility_NavQuirks = 3, } - /** - * Information details about a characterdata change. Basically, we - * view all changes as replacements of a length of text at some offset - * with some other text (of possibly some other length). - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct CharacterDataChangeInfo { - /** - * True if this character data change is just an append. - */ - pub mAppend: bool, - /** - * The offset in the text where the change occurred. - */ - pub mChangeStart: u32, - /** - * The offset such that mChangeEnd - mChangeStart is equal to the length of - * the text we removed. If this was a pure insert or append, this is equal to - * mChangeStart. - */ - pub mChangeEnd: u32, - /** - * The length of the text that was inserted in place of the removed text. If - * this was a pure text removal, this is 0. - */ - pub mReplaceLength: u32, - /** - * Used for splitText() and normalize(), otherwise null. - */ - pub mDetails: *mut root::CharacterDataChangeInfo_Details, - } - /** - * The net result is that mChangeStart characters at the beginning of the - * text remained as they were. The next mChangeEnd - mChangeStart characters - * were removed, and mReplaceLength characters were inserted in their place. - * The text that used to begin at mChangeEnd now begins at - * mChangeStart + mReplaceLength. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct CharacterDataChangeInfo_Details { - pub mType: root::CharacterDataChangeInfo_Details__bindgen_ty_1, - /** - * For eMerge it's the text node that will be removed, for eSplit it's the - * new text node. - */ - pub mNextSibling: *mut root::nsIContent, - } - pub const CharacterDataChangeInfo_Details_eMerge: - root::CharacterDataChangeInfo_Details__bindgen_ty_1 = - CharacterDataChangeInfo_Details__bindgen_ty_1::eMerge; - pub const CharacterDataChangeInfo_Details_eSplit: - root::CharacterDataChangeInfo_Details__bindgen_ty_1 = - CharacterDataChangeInfo_Details__bindgen_ty_1::eSplit; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum CharacterDataChangeInfo_Details__bindgen_ty_1 { - eMerge = 0, - eSplit = 1, - } - #[test] - fn bindgen_test_layout_CharacterDataChangeInfo_Details() { - assert_eq!(::std::mem::size_of::<CharacterDataChangeInfo_Details>() , - 16usize , concat ! ( - "Size of: " , stringify ! ( CharacterDataChangeInfo_Details - ) )); - assert_eq! (::std::mem::align_of::<CharacterDataChangeInfo_Details>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - CharacterDataChangeInfo_Details ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo_Details ) ) . - mType as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo_Details ) , "::" , stringify ! ( - mType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo_Details ) ) . - mNextSibling as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo_Details ) , "::" , stringify ! ( - mNextSibling ) )); - } - impl Clone for CharacterDataChangeInfo_Details { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_CharacterDataChangeInfo() { - assert_eq!(::std::mem::size_of::<CharacterDataChangeInfo>() , 24usize - , concat ! ( - "Size of: " , stringify ! ( CharacterDataChangeInfo ) )); - assert_eq! (::std::mem::align_of::<CharacterDataChangeInfo>() , 8usize - , concat ! ( - "Alignment of " , stringify ! ( CharacterDataChangeInfo ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo ) ) . mAppend - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo ) , "::" , stringify ! ( mAppend ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo ) ) . - mChangeStart as * const _ as usize } , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo ) , "::" , stringify ! ( - mChangeStart ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo ) ) . - mChangeEnd as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo ) , "::" , stringify ! ( - mChangeEnd ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo ) ) . - mReplaceLength as * const _ as usize } , 12usize , concat - ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo ) , "::" , stringify ! ( - mReplaceLength ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo ) ) . - mDetails as * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo ) , "::" , stringify ! ( mDetails - ) )); - } - impl Clone for CharacterDataChangeInfo { - fn clone(&self) -> Self { *self } - } - pub type nsUpdateType = u32; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIDocumentObserver { - pub _base: root::nsIMutationObserver, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDocumentObserver_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIDocumentObserver() { - assert_eq!(::std::mem::size_of::<nsIDocumentObserver>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsIDocumentObserver ) )); - assert_eq! (::std::mem::align_of::<nsIDocumentObserver>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIDocumentObserver ) )); - } - impl Clone for nsIDocumentObserver { - fn clone(&self) -> Self { *self } - } #[repr(C)] #[derive(Debug, Copy)] pub struct nsIRequestObserver { @@ -31999,132 +25986,7 @@ pub mod root { impl Clone for nsIRequestObserver { fn clone(&self) -> Self { *self } } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsScanner { - _unused: [u8; 0], - } - /*************************************************************** - Notes: - ***************************************************************/ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsITokenizer { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsITokenizer_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsITokenizer() { - assert_eq!(::std::mem::size_of::<nsITokenizer>() , 8usize , concat ! ( - "Size of: " , stringify ! ( nsITokenizer ) )); - assert_eq! (::std::mem::align_of::<nsITokenizer>() , 8usize , concat ! - ( "Alignment of " , stringify ! ( nsITokenizer ) )); - } - impl Clone for nsITokenizer { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsDTDMode { - eDTDMode_unknown = 0, - eDTDMode_quirks = 1, - eDTDMode_almost_standards = 2, - eDTDMode_full_standards = 3, - eDTDMode_autodetect = 4, - eDTDMode_fragment = 5, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIContentSink { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct CParserContext { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIDTD { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDTD_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIDTD() { - assert_eq!(::std::mem::size_of::<nsIDTD>() , 8usize , concat ! ( - "Size of: " , stringify ! ( nsIDTD ) )); - assert_eq! (::std::mem::align_of::<nsIDTD>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( nsIDTD ) )); - } - impl Clone for nsIDTD { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsParserBase { - pub _base: root::nsISupports, - } - #[test] - fn bindgen_test_layout_nsParserBase() { - assert_eq!(::std::mem::size_of::<nsParserBase>() , 8usize , concat ! ( - "Size of: " , stringify ! ( nsParserBase ) )); - assert_eq! (::std::mem::align_of::<nsParserBase>() , 8usize , concat ! - ( "Alignment of " , stringify ! ( nsParserBase ) )); - } - impl Clone for nsParserBase { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum eParserCommands { - eViewNormal = 0, - eViewSource = 1, - eViewFragment = 2, - eViewErrors = 3, - } - /** - * This GECKO-INTERNAL interface is on track to being REMOVED (or refactored - * to the point of being near-unrecognizable). - * - * Please DO NOT #include this file in comm-central code, in your XULRunner - * app or binary extensions. - * - * Please DO NOT #include this into new files even inside Gecko. It is more - * likely than not that #including this header is the wrong thing to do. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIParser { - pub _base: root::nsParserBase, - } - pub type nsIParser_Encoding = root::mozilla::Encoding; - pub type nsIParser_NotNull<T> = root::mozilla::NotNull<T>; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIParser_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIParser() { - assert_eq!(::std::mem::size_of::<nsIParser>() , 8usize , concat ! ( - "Size of: " , stringify ! ( nsIParser ) )); - assert_eq! (::std::mem::align_of::<nsIParser>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( nsIParser ) )); - } - impl Clone for nsIParser { - fn clone(&self) -> Self { *self } - } - /** - * Hashtable key class to use with nsTHashtable/nsBaseHashtable - */ + /// Hashtable key class to use with nsTHashtable/nsBaseHashtable #[repr(C)] #[derive(Debug)] pub struct nsURIHashKey { @@ -32155,11 +26017,9 @@ pub mod root { pub struct nsContentList { _unused: [u8; 0], } - /** - * Data used to track the expiration state of an object. We promise that this - * is 32 bits so that objects that includes this as a field can pad and align - * efficiently. - */ + /// Data used to track the expiration state of an object. We promise that this + /// is 32 bits so that objects that includes this as a field can pad and align + /// efficiently. #[repr(C)] #[derive(Debug, Copy)] pub struct nsExpirationState { @@ -32281,21 +26141,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct gfxUserFontSet { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsDOMNavigationTiming { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsFrameLoader { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsHTMLCSSStyleSheet { _unused: [u8; 0], } @@ -32314,14 +26159,7 @@ pub mod root { pub struct nsIDocumentEncoder { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMNodeFilter { - _unused: [u8; 0], - } - /** - * An internal interface - */ + /// An internal interface #[repr(C)] #[derive(Debug, Copy)] pub struct nsIHTMLCollection { @@ -32356,39 +26194,9 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsRange { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsSMILAnimationController { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsSVGElement { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsTextNode { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsWindowSizes { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsDOMCaretPosition { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsViewportInfo { - _unused: [u8; 0], - } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum HSTSPrimingState { @@ -32440,9 +26248,7 @@ pub mod root { pub struct nsITheme { _unused: [u8; 0], } - /** - * Interface used for handling clicks on links - */ + /// Interface used for handling clicks on links #[repr(C)] #[derive(Debug, Copy)] pub struct nsILinkHandler { @@ -32465,11 +26271,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct gfxUserFontEntry { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct gfxTextPerfMetrics { _unused: [u8; 0], } @@ -32495,118 +26296,6 @@ pub mod root { } pub const kPresContext_DefaultVariableFont_ID: u8 = 0; pub const kPresContext_DefaultFixedFont_ID: u8 = 1; - #[repr(C)] - pub struct nsRootPresContext { - pub _base: root::nsPresContext, - pub mNotifyDidPaintTimers: [u64; 10usize], - pub mApplyPluginGeometryTimer: root::nsCOMPtr<root::nsITimer>, - pub mRegisteredPlugins: [u64; 6usize], - pub mWillPaintObservers: root::nsTArray<root::nsCOMPtr<root::nsIRunnable>>, - pub mWillPaintFallbackEvent: root::nsRevocableEventPtr<root::nsRootPresContext_RunWillPaintObservers>, - pub mDOMGeneration: u32, - } - #[repr(C)] - #[derive(Debug)] - pub struct nsRootPresContext_RunWillPaintObservers { - pub _base: root::mozilla::Runnable, - pub mPresContext: *mut root::nsRootPresContext, - } - #[test] - fn bindgen_test_layout_nsRootPresContext_RunWillPaintObservers() { - assert_eq!(::std::mem::size_of::<nsRootPresContext_RunWillPaintObservers>() - , 48usize , concat ! ( - "Size of: " , stringify ! ( - nsRootPresContext_RunWillPaintObservers ) )); - assert_eq! (::std::mem::align_of::<nsRootPresContext_RunWillPaintObservers>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsRootPresContext_RunWillPaintObservers ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const nsRootPresContext_RunWillPaintObservers ) - ) . mPresContext as * const _ as usize } , 40usize , - concat ! ( - "Alignment of field: " , stringify ! ( - nsRootPresContext_RunWillPaintObservers ) , "::" , - stringify ! ( mPresContext ) )); - } - #[repr(C)] - #[derive(Debug)] - pub struct nsRootPresContext_NotifyDidPaintTimer { - pub mTransactionId: u64, - pub mTimer: root::nsCOMPtr<root::nsITimer>, - } - #[test] - fn bindgen_test_layout_nsRootPresContext_NotifyDidPaintTimer() { - assert_eq!(::std::mem::size_of::<nsRootPresContext_NotifyDidPaintTimer>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - nsRootPresContext_NotifyDidPaintTimer ) )); - assert_eq! (::std::mem::align_of::<nsRootPresContext_NotifyDidPaintTimer>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsRootPresContext_NotifyDidPaintTimer ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const nsRootPresContext_NotifyDidPaintTimer ) ) - . mTransactionId as * const _ as usize } , 0usize , concat - ! ( - "Alignment of field: " , stringify ! ( - nsRootPresContext_NotifyDidPaintTimer ) , "::" , stringify - ! ( mTransactionId ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const nsRootPresContext_NotifyDidPaintTimer ) ) - . mTimer as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsRootPresContext_NotifyDidPaintTimer ) , "::" , stringify - ! ( mTimer ) )); - } - #[test] - fn bindgen_test_layout_nsRootPresContext() { - assert_eq!(::std::mem::size_of::<nsRootPresContext>() , 1488usize , - concat ! ( "Size of: " , stringify ! ( nsRootPresContext ) - )); - assert_eq! (::std::mem::align_of::<nsRootPresContext>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsRootPresContext ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRootPresContext ) ) . - mNotifyDidPaintTimers as * const _ as usize } , 1328usize - , concat ! ( - "Alignment of field: " , stringify ! ( nsRootPresContext ) - , "::" , stringify ! ( mNotifyDidPaintTimers ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRootPresContext ) ) . - mApplyPluginGeometryTimer as * const _ as usize } , - 1408usize , concat ! ( - "Alignment of field: " , stringify ! ( nsRootPresContext ) - , "::" , stringify ! ( mApplyPluginGeometryTimer ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRootPresContext ) ) . - mRegisteredPlugins as * const _ as usize } , 1416usize , - concat ! ( - "Alignment of field: " , stringify ! ( nsRootPresContext ) - , "::" , stringify ! ( mRegisteredPlugins ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRootPresContext ) ) . - mWillPaintObservers as * const _ as usize } , 1464usize , - concat ! ( - "Alignment of field: " , stringify ! ( nsRootPresContext ) - , "::" , stringify ! ( mWillPaintObservers ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRootPresContext ) ) . - mWillPaintFallbackEvent as * const _ as usize } , - 1472usize , concat ! ( - "Alignment of field: " , stringify ! ( nsRootPresContext ) - , "::" , stringify ! ( mWillPaintFallbackEvent ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRootPresContext ) ) . - mDOMGeneration as * const _ as usize } , 1480usize , - concat ! ( - "Alignment of field: " , stringify ! ( nsRootPresContext ) - , "::" , stringify ! ( mDOMGeneration ) )); - } #[repr(i16)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsCSSKeyword { @@ -33884,21 +27573,6 @@ pub mod root { } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsCSSFontDesc { - eCSSFontDesc_UNKNOWN = -1, - eCSSFontDesc_Family = 0, - eCSSFontDesc_Style = 1, - eCSSFontDesc_Weight = 2, - eCSSFontDesc_Stretch = 3, - eCSSFontDesc_Src = 4, - eCSSFontDesc_UnicodeRange = 5, - eCSSFontDesc_FontFeatureSettings = 6, - eCSSFontDesc_FontLanguageOverride = 7, - eCSSFontDesc_Display = 8, - eCSSFontDesc_COUNT = 9, - } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsCSSCounterDesc { eCSSCounterDesc_UNKNOWN = -1, eCSSCounterDesc_System = 0, @@ -33957,30 +27631,8 @@ pub mod root { eStyleStruct_Effects = 23, nsStyleStructID_Length = 24, } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIProperties { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIProperties_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIProperties() { - assert_eq!(::std::mem::size_of::<nsIProperties>() , 8usize , concat ! - ( "Size of: " , stringify ! ( nsIProperties ) )); - assert_eq! (::std::mem::align_of::<nsIProperties>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( nsIProperties ) )); - } - impl Clone for nsIProperties { - fn clone(&self) -> Self { *self } - } #[repr(u32)] - /** - * Types of animatable values. - */ + /// Types of animatable values. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsStyleAnimType { eStyleAnimType_Custom = 0, @@ -35003,44 +28655,42 @@ pub mod root { impl Clone for nsCSSProps { fn clone(&self) -> Self { *self } } - /** - * Class to safely handle main-thread-only pointers off the main thread. - * - * Classes like XPCWrappedJS are main-thread-only, which means that it is - * forbidden to call methods on instances of these classes off the main thread. - * For various reasons (see bug 771074), this restriction recently began to - * apply to AddRef/Release as well. - * - * This presents a problem for consumers that wish to hold a callback alive - * on non-main-thread code. A common example of this is the proxy callback - * pattern, where non-main-thread code holds a strong-reference to the callback - * object, and dispatches new Runnables (also with a strong reference) to the - * main thread in order to execute the callback. This involves several AddRef - * and Release calls on the other thread, which is (now) verboten. - * - * The basic idea of this class is to introduce a layer of indirection. - * nsMainThreadPtrHolder is a threadsafe reference-counted class that internally - * maintains one strong reference to the main-thread-only object. It must be - * instantiated on the main thread (so that the AddRef of the underlying object - * happens on the main thread), but consumers may subsequently pass references - * to the holder anywhere they please. These references are meant to be opaque - * when accessed off-main-thread (assertions enforce this). - * - * The semantics of RefPtr<nsMainThreadPtrHolder<T> > would be cumbersome, so - * we also introduce nsMainThreadPtrHandle<T>, which is conceptually identical - * to the above (though it includes various convenience methods). The basic - * pattern is as follows. - * - * // On the main thread: - * nsCOMPtr<nsIFooCallback> callback = ...; - * nsMainThreadPtrHandle<nsIFooCallback> callbackHandle = - * new nsMainThreadPtrHolder<nsIFooCallback>(callback); - * // Pass callbackHandle to structs/classes that might be accessed on other - * // threads. - * - * All structs and classes that might be accessed on other threads should store - * an nsMainThreadPtrHandle<T> rather than an nsCOMPtr<T>. - */ + /// Class to safely handle main-thread-only pointers off the main thread. + /// + /// Classes like XPCWrappedJS are main-thread-only, which means that it is + /// forbidden to call methods on instances of these classes off the main thread. + /// For various reasons (see bug 771074), this restriction recently began to + /// apply to AddRef/Release as well. + /// + /// This presents a problem for consumers that wish to hold a callback alive + /// on non-main-thread code. A common example of this is the proxy callback + /// pattern, where non-main-thread code holds a strong-reference to the callback + /// object, and dispatches new Runnables (also with a strong reference) to the + /// main thread in order to execute the callback. This involves several AddRef + /// and Release calls on the other thread, which is (now) verboten. + /// + /// The basic idea of this class is to introduce a layer of indirection. + /// nsMainThreadPtrHolder is a threadsafe reference-counted class that internally + /// maintains one strong reference to the main-thread-only object. It must be + /// instantiated on the main thread (so that the AddRef of the underlying object + /// happens on the main thread), but consumers may subsequently pass references + /// to the holder anywhere they please. These references are meant to be opaque + /// when accessed off-main-thread (assertions enforce this). + /// + /// The semantics of RefPtr<nsMainThreadPtrHolder<T> > would be cumbersome, so + /// we also introduce nsMainThreadPtrHandle<T>, which is conceptually identical + /// to the above (though it includes various convenience methods). The basic + /// pattern is as follows. + /// + /// // On the main thread: + /// nsCOMPtr<nsIFooCallback> callback = ...; + /// nsMainThreadPtrHandle<nsIFooCallback> callbackHandle = + /// new nsMainThreadPtrHolder<nsIFooCallback>(callback); + /// // Pass callbackHandle to structs/classes that might be accessed on other + /// // threads. + /// + /// All structs and classes that might be accessed on other threads should store + /// an nsMainThreadPtrHandle<T> rather than an nsCOMPtr<T>. #[repr(C)] #[derive(Debug)] pub struct nsMainThreadPtrHolder<T> { @@ -35073,14 +28723,13 @@ pub mod root { pub mURI: root::RefPtr<root::mozilla::image::ImageURL>, pub mListener: *mut root::imgINotificationObserver, pub mLoadGroup: root::nsCOMPtr<root::nsILoadGroup>, + pub mTabGroup: root::RefPtr<root::mozilla::dom::TabGroup>, + pub mEventTarget: root::nsCOMPtr<root::nsIEventTarget>, pub mLoadFlags: root::nsLoadFlags, pub mLockCount: u32, pub mAnimationConsumers: u32, - pub mCanceled: bool, - pub mIsInLoadGroup: bool, - pub mListenerIsStrongRef: bool, - pub mDecodeRequested: bool, - pub mDeferNotifications: bool, + pub _bitfield_1: u8, + pub __bindgen_padding_0: [u8; 3usize], } pub type imgRequestProxy_Image = root::mozilla::image::Image; pub type imgRequestProxy_ImageURL = root::mozilla::image::ImageURL; @@ -35119,13 +28768,311 @@ pub mod root { } #[test] fn bindgen_test_layout_imgRequestProxy() { - assert_eq!(::std::mem::size_of::<imgRequestProxy>() , 120usize , + assert_eq!(::std::mem::size_of::<imgRequestProxy>() , 128usize , concat ! ( "Size of: " , stringify ! ( imgRequestProxy ) )); assert_eq! (::std::mem::align_of::<imgRequestProxy>() , 8usize , concat ! ( "Alignment of " , stringify ! ( imgRequestProxy ) )); } + impl imgRequestProxy { + #[inline] + pub fn mCanceled(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 1u64 as u8; + let val = (unit_field_val & mask) >> 0usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mCanceled(&mut self, val: bool) { + let mask = 1u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn mIsInLoadGroup(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 2u64 as u8; + let val = (unit_field_val & mask) >> 1usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mIsInLoadGroup(&mut self, val: bool) { + let mask = 2u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn mListenerIsStrongRef(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 4u64 as u8; + let val = (unit_field_val & mask) >> 2usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mListenerIsStrongRef(&mut self, val: bool) { + let mask = 4u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn mDecodeRequested(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 8u64 as u8; + let val = (unit_field_val & mask) >> 3usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mDecodeRequested(&mut self, val: bool) { + let mask = 8u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn mDeferNotifications(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 16u64 as u8; + let val = (unit_field_val & mask) >> 4usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mDeferNotifications(&mut self, val: bool) { + let mask = 16u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn mHadListener(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 32u64 as u8; + let val = (unit_field_val & mask) >> 5usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mHadListener(&mut self, val: bool) { + let mask = 32u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn mHadDispatch(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 64u64 as u8; + let val = (unit_field_val & mask) >> 6usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mHadDispatch(&mut self, val: bool) { + let mask = 64u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn new_bitfield_1(mCanceled: bool, mIsInLoadGroup: bool, + mListenerIsStrongRef: bool, + mDecodeRequested: bool, + mDeferNotifications: bool, mHadListener: bool, + mHadDispatch: bool) -> u8 { + ({ + ({ + ({ + ({ + ({ + ({ + ({ 0 } | + ((mCanceled as u8 as u8) << + 0usize) & (1u64 as u8)) + } | + ((mIsInLoadGroup as u8 as u8) << + 1usize) & (2u64 as u8)) + } | + ((mListenerIsStrongRef as u8 as u8) << + 2usize) & (4u64 as u8)) + } | + ((mDecodeRequested as u8 as u8) << 3usize) & + (8u64 as u8)) + } | + ((mDeferNotifications as u8 as u8) << 4usize) & + (16u64 as u8)) + } | ((mHadListener as u8 as u8) << 5usize) & (32u64 as u8)) + } | ((mHadDispatch as u8 as u8) << 6usize) & (64u64 as u8)) + } + } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsCSSUnit { @@ -35819,10 +29766,7 @@ pub mod root { } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsCSSValue_Serialization { - eNormalized = 0, - eAuthorSpecified = 1, - } + pub enum nsCSSValue_Serialization { eNormalized = 0, } #[repr(C)] #[derive(Debug, Copy)] pub struct nsCSSValue__bindgen_ty_1 { @@ -36149,466 +30093,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIAsyncVerifyRedirectCallback { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIAsyncVerifyRedirectCallback_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIAsyncVerifyRedirectCallback() { - assert_eq!(::std::mem::size_of::<nsIAsyncVerifyRedirectCallback>() , - 8usize , concat ! ( - "Size of: " , stringify ! ( nsIAsyncVerifyRedirectCallback - ) )); - assert_eq! (::std::mem::align_of::<nsIAsyncVerifyRedirectCallback>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsIAsyncVerifyRedirectCallback ) )); - } - impl Clone for nsIAsyncVerifyRedirectCallback { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIChannelEventSink { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIChannelEventSink_COMTypeInfo { - pub _address: u8, - } - pub const nsIChannelEventSink_REDIRECT_TEMPORARY: - root::nsIChannelEventSink__bindgen_ty_1 = - nsIChannelEventSink__bindgen_ty_1::REDIRECT_TEMPORARY; - pub const nsIChannelEventSink_REDIRECT_PERMANENT: - root::nsIChannelEventSink__bindgen_ty_1 = - nsIChannelEventSink__bindgen_ty_1::REDIRECT_PERMANENT; - pub const nsIChannelEventSink_REDIRECT_INTERNAL: - root::nsIChannelEventSink__bindgen_ty_1 = - nsIChannelEventSink__bindgen_ty_1::REDIRECT_INTERNAL; - pub const nsIChannelEventSink_REDIRECT_STS_UPGRADE: - root::nsIChannelEventSink__bindgen_ty_1 = - nsIChannelEventSink__bindgen_ty_1::REDIRECT_STS_UPGRADE; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIChannelEventSink__bindgen_ty_1 { - REDIRECT_TEMPORARY = 1, - REDIRECT_PERMANENT = 2, - REDIRECT_INTERNAL = 4, - REDIRECT_STS_UPGRADE = 8, - } - #[test] - fn bindgen_test_layout_nsIChannelEventSink() { - assert_eq!(::std::mem::size_of::<nsIChannelEventSink>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsIChannelEventSink ) )); - assert_eq! (::std::mem::align_of::<nsIChannelEventSink>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIChannelEventSink ) )); - } - impl Clone for nsIChannelEventSink { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIThreadRetargetableStreamListener { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIThreadRetargetableStreamListener_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIThreadRetargetableStreamListener() { - assert_eq!(::std::mem::size_of::<nsIThreadRetargetableStreamListener>() - , 8usize , concat ! ( - "Size of: " , stringify ! ( - nsIThreadRetargetableStreamListener ) )); - assert_eq! (::std::mem::align_of::<nsIThreadRetargetableStreamListener>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsIThreadRetargetableStreamListener ) )); - } - impl Clone for nsIThreadRetargetableStreamListener { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct PRCallOnceType { - pub initialized: root::PRIntn, - pub inProgress: root::PRInt32, - pub status: root::PRStatus, - } - #[test] - fn bindgen_test_layout_PRCallOnceType() { - assert_eq!(::std::mem::size_of::<PRCallOnceType>() , 12usize , concat - ! ( "Size of: " , stringify ! ( PRCallOnceType ) )); - assert_eq! (::std::mem::align_of::<PRCallOnceType>() , 4usize , concat - ! ( "Alignment of " , stringify ! ( PRCallOnceType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const PRCallOnceType ) ) . initialized as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( PRCallOnceType ) , - "::" , stringify ! ( initialized ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const PRCallOnceType ) ) . inProgress as * - const _ as usize } , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( PRCallOnceType ) , - "::" , stringify ! ( inProgress ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const PRCallOnceType ) ) . status as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( PRCallOnceType ) , - "::" , stringify ! ( status ) )); - } - impl Clone for PRCallOnceType { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct imgCacheValidator { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct imgLoader { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct imgCacheEntry { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIApplicationCache { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug)] - pub struct imgRequest { - pub _base: root::nsIStreamListener, - pub _base_1: root::nsIThreadRetargetableStreamListener, - pub _base_2: root::nsIChannelEventSink, - pub _base_3: root::nsIInterfaceRequestor, - pub _base_4: root::nsIAsyncVerifyRedirectCallback, - pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt, - pub _mOwningThread: root::nsAutoOwningThread, - pub mLoader: *mut root::imgLoader, - pub mRequest: root::nsCOMPtr<root::nsIRequest>, - pub mURI: root::RefPtr<root::mozilla::image::ImageURL>, - pub mCurrentURI: root::nsCOMPtr<root::nsIURI>, - pub mLoadingPrincipal: root::nsCOMPtr<root::nsIPrincipal>, - pub mPrincipal: root::nsCOMPtr<root::nsIPrincipal>, - pub mProperties: root::nsCOMPtr<root::nsIProperties>, - pub mSecurityInfo: root::nsCOMPtr<root::nsISupports>, - pub mChannel: root::nsCOMPtr<root::nsIChannel>, - pub mPrevChannelSink: root::nsCOMPtr<root::nsIInterfaceRequestor>, - pub mApplicationCache: root::nsCOMPtr<root::nsIApplicationCache>, - pub mTimedChannel: root::nsCOMPtr<root::nsITimedChannel>, - pub mContentType: root::nsCString, - pub mCacheEntry: root::RefPtr<root::imgCacheEntry>, - /// The key under which this imgRequest is stored in the image cache. - pub mCacheKey: root::imgRequest_ImageCacheKey, - pub mLoadId: *mut ::std::os::raw::c_void, - /// Raw pointer to the first proxy that was added to this imgRequest. Use only - /// pointer comparisons; there's no guarantee this will remain valid. - pub mFirstProxy: *mut ::std::os::raw::c_void, - pub mValidator: *mut root::imgCacheValidator, - pub mRedirectCallback: root::nsCOMPtr<root::nsIAsyncVerifyRedirectCallback>, - pub mNewRedirectChannel: root::nsCOMPtr<root::nsIChannel>, - pub mInnerWindowId: u64, - pub mCORSMode: i32, - pub mReferrerPolicy: root::imgRequest_ReferrerPolicy, - pub mImageErrorCode: root::nsresult, - pub mBoostCategoriesRequested: u32, - pub mMutex: root::mozilla::Mutex, - pub mProgressTracker: root::RefPtr<root::mozilla::image::ProgressTracker>, - pub mImage: root::RefPtr<root::mozilla::image::Image>, - pub _bitfield_1: u8, - pub __bindgen_padding_0: [u8; 7usize], - } - pub type imgRequest_Image = root::mozilla::image::Image; - pub type imgRequest_ImageCacheKey = root::mozilla::image::ImageCacheKey; - pub type imgRequest_ImageURL = root::mozilla::image::ImageURL; - pub type imgRequest_ProgressTracker = - root::mozilla::image::ProgressTracker; - pub use self::super::root::mozilla::net::ReferrerPolicy as - imgRequest_ReferrerPolicy; - pub type imgRequest_HasThreadSafeRefCnt = root::mozilla::TrueType; - #[test] - fn bindgen_test_layout_imgRequest() { - assert_eq!(::std::mem::size_of::<imgRequest>() , 416usize , concat ! ( - "Size of: " , stringify ! ( imgRequest ) )); - assert_eq! (::std::mem::align_of::<imgRequest>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( imgRequest ) )); - } - impl imgRequest { - #[inline] - pub fn mIsMultiPartChannel(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 1u64 as u8; - let val = (unit_field_val & mask) >> 0usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsMultiPartChannel(&mut self, val: bool) { - let mask = 1u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 0usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mGotData(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 2u64 as u8; - let val = (unit_field_val & mask) >> 1usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mGotData(&mut self, val: bool) { - let mask = 2u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 1usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mIsInCache(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 4u64 as u8; - let val = (unit_field_val & mask) >> 2usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsInCache(&mut self, val: bool) { - let mask = 4u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 2usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mDecodeRequested(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 8u64 as u8; - let val = (unit_field_val & mask) >> 3usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mDecodeRequested(&mut self, val: bool) { - let mask = 8u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 3usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mNewPartPending(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 16u64 as u8; - let val = (unit_field_val & mask) >> 4usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mNewPartPending(&mut self, val: bool) { - let mask = 16u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 4usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mHadInsecureRedirect(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 32u64 as u8; - let val = (unit_field_val & mask) >> 5usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mHadInsecureRedirect(&mut self, val: bool) { - let mask = 32u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 5usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn new_bitfield_1(mIsMultiPartChannel: bool, mGotData: bool, - mIsInCache: bool, mDecodeRequested: bool, - mNewPartPending: bool, - mHadInsecureRedirect: bool) -> u8 { - ({ - ({ - ({ - ({ - ({ - ({ 0 } | - ((mIsMultiPartChannel as u8 as u8) - << 0usize) & (1u64 as u8)) - } | - ((mGotData as u8 as u8) << 1usize) & - (2u64 as u8)) - } | - ((mIsInCache as u8 as u8) << 2usize) & - (4u64 as u8)) - } | - ((mDecodeRequested as u8 as u8) << 3usize) & - (8u64 as u8)) - } | - ((mNewPartPending as u8 as u8) << 4usize) & - (16u64 as u8)) - } | - ((mHadInsecureRedirect as u8 as u8) << 5usize) & - (32u64 as u8)) - } - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ProxyBehaviour { _unused: [u8; 0], @@ -36732,35 +30216,33 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStyleGradient ) , "::" , stringify ! ( mRefCnt ) )); } - /** - * A wrapper for an imgRequestProxy that supports off-main-thread creation - * and equality comparison. - * - * An nsStyleImageRequest can be created in two ways: - * - * 1. Using the constructor that takes an imgRequestProxy. This must - * be called from the main thread. The nsStyleImageRequest is - * immediately considered "resolved", and the get() method that - * returns the imgRequestProxy can be called. - * - * 2. Using the constructor that takes the URL, base URI, referrer - * and principal that can be used to inititiate an image load and - * produce an imgRequestProxy later. This can be called from - * any thread. The nsStyleImageRequest is not considered "resolved" - * at this point, and the Resolve() method must be called later - * to initiate the image load and make calls to get() valid. - * - * Calls to TrackImage(), UntrackImage(), LockImage(), UnlockImage() and - * RequestDiscard() are made to the imgRequestProxy and ImageTracker as - * appropriate, according to the mode flags passed in to the constructor. - * - * The main thread constructor takes a pointer to the css::ImageValue that - * is the specified url() value, while the off-main-thread constructor - * creates a new css::ImageValue to represent the url() information passed - * to the constructor. This ImageValue is held on to for the comparisons done - * in DefinitelyEquals(), so that we don't need to call into the non-OMT-safe - * Equals() on the nsIURI objects returned from imgRequestProxy::GetURI(). - */ + /// A wrapper for an imgRequestProxy that supports off-main-thread creation + /// and equality comparison. + /// + /// An nsStyleImageRequest can be created in two ways: + /// + /// 1. Using the constructor that takes an imgRequestProxy. This must + /// be called from the main thread. The nsStyleImageRequest is + /// immediately considered "resolved", and the get() method that + /// returns the imgRequestProxy can be called. + /// + /// 2. Using the constructor that takes the URL, base URI, referrer + /// and principal that can be used to inititiate an image load and + /// produce an imgRequestProxy later. This can be called from + /// any thread. The nsStyleImageRequest is not considered "resolved" + /// at this point, and the Resolve() method must be called later + /// to initiate the image load and make calls to get() valid. + /// + /// Calls to TrackImage(), UntrackImage(), LockImage(), UnlockImage() and + /// RequestDiscard() are made to the imgRequestProxy and ImageTracker as + /// appropriate, according to the mode flags passed in to the constructor. + /// + /// The main thread constructor takes a pointer to the css::ImageValue that + /// is the specified url() value, while the off-main-thread constructor + /// creates a new css::ImageValue to represent the url() information passed + /// to the constructor. This ImageValue is held on to for the comparisons done + /// in DefinitelyEquals(), so that we don't need to call into the non-OMT-safe + /// Equals() on the nsIURI objects returned from imgRequestProxy::GetURI(). #[repr(C)] #[derive(Debug)] pub struct nsStyleImageRequest { @@ -36863,16 +30345,14 @@ pub mod root { CachedBorderImageData ) , "::" , stringify ! ( mSubImages ) )); } - /** - * Represents a paintable image of one of the following types. - * (1) A real image loaded from an external source. - * (2) A CSS linear or radial gradient. - * (3) An element within a document, or an <img>, <video>, or <canvas> element - * not in a document. - * (*) Optionally a crop rect can be set to paint a partial (rectangular) - * region of an image. (Currently, this feature is only supported with an - * image of type (1)). - */ + /// Represents a paintable image of one of the following types. + /// (1) A real image loaded from an external source. + /// (2) A CSS linear or radial gradient. + /// (3) An element within a document, or an <img>, <video>, or <canvas> element + /// not in a document. + /// (*) Optionally a crop rect can be set to paint a partial (rectangular) + /// region of an image. (Currently, this feature is only supported with an + /// image of type (1)). #[repr(C)] #[derive(Debug)] pub struct nsStyleImage { @@ -37407,11 +30887,9 @@ pub mod root { "Alignment of field: " , stringify ! ( nsCSSShadowArray ) , "::" , stringify ! ( mArray ) )); } - /** - * An object that allows sharing of arrays that store 'quotes' property - * values. This is particularly important for inheritance, where we want - * to share the same 'quotes' value with a parent style context. - */ + /// An object that allows sharing of arrays that store 'quotes' property + /// values. This is particularly important for inheritance, where we want + /// to share the same 'quotes' value with a parent style context. #[repr(C)] #[derive(Debug)] pub struct nsStyleQuoteValues { @@ -38083,6 +31561,13 @@ pub mod root { eStyleSVGFallbackType_None = 1, eStyleSVGFallbackType_Color = 2, } + #[repr(u8)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsStyleSVGOpacitySource { + eStyleSVGOpacitySource_Normal = 0, + eStyleSVGOpacitySource_ContextFillOpacity = 1, + eStyleSVGOpacitySource_ContextStrokeOpacity = 2, + } #[repr(C)] #[derive(Debug)] pub struct nsStyleSVGPaint { @@ -38210,15 +31695,13 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStyleFilter ) , "::" , stringify ! ( mFilterParameter ) )); } - /** - * These *_Simple types are used to map Gecko types to layout-equivalent but - * simpler Rust types, to aid Rust binding generation. - * - * If something in this types or the assertions below needs to change, ask - * bholley, heycam or emilio before! - * - * <div rustbindgen="true" replaces="nsPoint"> - */ + /// These *_Simple types are used to map Gecko types to layout-equivalent but + /// simpler Rust types, to aid Rust binding generation. + /// + /// If something in this types or the assertions below needs to change, ask + /// bholley, heycam or emilio before! + /// + /// <div rustbindgen="true" replaces="nsPoint"> #[repr(C)] #[derive(Debug, Copy)] pub struct nsPoint { @@ -38245,9 +31728,7 @@ pub mod root { impl Clone for nsPoint { fn clone(&self) -> Self { *self } } - /** - * <div rustbindgen="true" replaces="nsMargin"> - */ + /// <div rustbindgen="true" replaces="nsMargin"> #[repr(C)] #[derive(Debug, Copy)] pub struct nsMargin { @@ -38286,9 +31767,7 @@ pub mod root { impl Clone for nsMargin { fn clone(&self) -> Self { *self } } - /** - * <div rustbindgen="true" replaces="nsRect"> - */ + /// <div rustbindgen="true" replaces="nsRect"> #[repr(C)] #[derive(Debug, Copy)] pub struct nsRect { @@ -38327,9 +31806,7 @@ pub mod root { impl Clone for nsRect { fn clone(&self) -> Self { *self } } - /** - * <div rustbindgen="true" replaces="nsSize"> - */ + /// <div rustbindgen="true" replaces="nsSize"> #[repr(C)] #[derive(Debug, Copy)] pub struct nsSize { @@ -38356,20 +31833,16 @@ pub mod root { impl Clone for nsSize { fn clone(&self) -> Self { *self } } - /** - * <div rustbindgen replaces="nsTArray"></div> - */ + /// <div rustbindgen replaces="nsTArray"></div> #[repr(C)] #[derive(Debug)] pub struct nsTArray<T> { pub mBuffer: *mut T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } - /** - * <div rustbindgen replaces="nsCOMArray"></div> - * - * mozilla::ArrayIterator doesn't work well with bindgen. - */ + /// <div rustbindgen replaces="nsCOMArray"></div> + /// + /// mozilla::ArrayIterator doesn't work well with bindgen. #[repr(C)] #[derive(Debug)] pub struct nsCOMArray { @@ -38382,11 +31855,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct RawServoAnimationValueMap { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct RawServoStyleSheetContents { _unused: [u8; 0], } @@ -38449,15 +31917,11 @@ pub mod root { pub type RawGeckoGfxMatrix4x4 = [root::mozilla::gfx::Float; 16usize]; pub type RawGeckoStyleChildrenIterator = root::mozilla::dom::StyleChildrenIterator; - pub type RawServoDeclarationBlockBorrowed = - *const root::RawServoDeclarationBlock; pub type ServoStyleContextBorrowed = *const root::mozilla::ServoStyleContext; pub type ServoStyleContextBorrowedOrNull = *const root::mozilla::ServoStyleContext; pub type ServoComputedDataBorrowed = *const root::ServoComputedData; - pub type RawServoAnimationValueMapBorrowedMut = - *mut root::RawServoAnimationValueMap; pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode; pub type RawGeckoNodeBorrowedOrNull = *const root::RawGeckoNode; pub type RawGeckoElementBorrowed = *const root::RawGeckoElement; @@ -38779,31 +32243,6 @@ pub mod root { pub struct CSSRuleListImpl { _unused: [u8; 0], } - /** - * An nsMediaQueryResultCacheKey records what feature/value combinations - * a set of media query results are valid for. This allows the caller - * to quickly learn whether a prior result of media query evaluation is - * still valid (e.g., due to a window size change) without rerunning all - * of the evaluation and rebuilding the list of rules. - * - * This object may not be used after any media rules in any of the - * sheets it was given to have been modified. However, this is - * generally not a problem since ClearRuleCascades is called on the - * sheet whenever this happens, and these objects are stored inside the - * rule cascades. (FIXME: We're not actually doing this all the time.) - * - * The implementation could be further optimized in the future to store - * ranges (combinations of less-than, less-than-or-equal, greater-than, - * greater-than-or-equal, equal, not-equal, present, not-present) for - * each feature rather than simply storing the list of expressions. - * However, this requires combining any such ranges. - */ - #[repr(C)] - #[derive(Debug)] - pub struct nsMediaQueryResultCacheKey { - pub mMedium: root::nsCOMPtr<root::nsIAtom>, - pub mFeatureCache: root::nsTArray<root::nsMediaQueryResultCacheKey_FeatureEntry>, - } #[repr(C)] #[derive(Debug)] pub struct nsMediaQueryResultCacheKey_ExpressionEntry { @@ -38871,33 +32310,7 @@ pub mod root { nsMediaQueryResultCacheKey_FeatureEntry ) , "::" , stringify ! ( mExpressions ) )); } - #[test] - fn bindgen_test_layout_nsMediaQueryResultCacheKey() { - assert_eq!(::std::mem::size_of::<nsMediaQueryResultCacheKey>() , - 16usize , concat ! ( - "Size of: " , stringify ! ( nsMediaQueryResultCacheKey ) - )); - assert_eq! (::std::mem::align_of::<nsMediaQueryResultCacheKey>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( nsMediaQueryResultCacheKey - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsMediaQueryResultCacheKey ) ) . - mMedium as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsMediaQueryResultCacheKey ) , "::" , stringify ! ( - mMedium ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsMediaQueryResultCacheKey ) ) . - mFeatureCache as * const _ as usize } , 8usize , concat ! - ( - "Alignment of field: " , stringify ! ( - nsMediaQueryResultCacheKey ) , "::" , stringify ! ( - mFeatureCache ) )); - } - /** - * Utility class to provide scaling defined in a keySplines element. - */ + /// Utility class to provide scaling defined in a keySplines element. #[repr(C)] #[derive(Debug, Copy)] pub struct nsSMILKeySpline { @@ -38956,108 +32369,15 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsSVGAngle { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsSVGIntegerPair { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsSVGLength2 { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsSVGNumberPair { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsSVGViewBox { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsStyledElement { - _unused: [u8; 0], - } - /** - * A class used to construct a nsString from a nsStringBuffer (we might - * want to move this to nsString at some point). - * - * WARNING: Note that nsCheapString doesn't take an explicit length -- it - * assumes the string is maximally large, given the nsStringBuffer's storage - * size. This means the given string buffer *must* be sized exactly correctly - * for the string it contains (including one byte for a null terminator). If - * it has any unused storage space, then that will result in bogus characters - * at the end of our nsCheapString. - */ - #[repr(C)] - #[derive(Debug)] - pub struct nsCheapString { - pub _base: ::nsstring::nsStringRepr, - } - #[test] - fn bindgen_test_layout_nsCheapString() { - assert_eq!(::std::mem::size_of::<nsCheapString>() , 16usize , concat ! - ( "Size of: " , stringify ! ( nsCheapString ) )); - assert_eq! (::std::mem::align_of::<nsCheapString>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( nsCheapString ) )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsMappedAttributes { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsMappedAttributeElement { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsXBLDocumentInfo { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ElementRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct PseudoElementRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AnonBoxRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct XULTreeRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct StateRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct PseudoElementStateRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AttributeRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIStyleRuleProcessor { pub _base: root::nsISupports, @@ -39135,6 +32455,7 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug)] pub struct nsIAttribute { pub _base: root::nsINode, pub mAttrMap: root::RefPtr<root::nsDOMAttributeMap>, @@ -39156,17 +32477,15 @@ pub mod root { "Alignment of field: " , stringify ! ( nsIAttribute ) , "::" , stringify ! ( mAttrMap ) )); } - /** - * There are two advantages to inheriting from nsStubMutationObserver - * rather than directly from nsIMutationObserver: - * 1. smaller compiled code size (since there's no need for the code - * for the empty virtual function implementations for every - * nsIMutationObserver implementation) - * 2. the performance of document's loop over observers benefits from - * the fact that more of the functions called are the same (which - * can reduce instruction cache misses and perhaps improve branch - * prediction) - */ + /// There are two advantages to inheriting from nsStubMutationObserver + /// rather than directly from nsIMutationObserver: + /// 1. smaller compiled code size (since there's no need for the code + /// for the empty virtual function implementations for every + /// nsIMutationObserver implementation) + /// 2. the performance of document's loop over observers benefits from + /// the fact that more of the functions called are the same (which + /// can reduce instruction cache misses and perhaps improve branch + /// prediction) #[repr(C)] #[derive(Debug, Copy)] pub struct nsStubMutationObserver { @@ -39185,20 +32504,14 @@ pub mod root { impl Clone for nsStubMutationObserver { fn clone(&self) -> Self { *self } } - /** - * Structure used as a key for caching Attrs in nsDOMAttributeMap's mAttributeCache. - */ + /// Structure used as a key for caching Attrs in nsDOMAttributeMap's mAttributeCache. #[repr(C)] #[derive(Debug, Copy)] pub struct nsAttrKey { - /** - * The namespace of the attribute - */ + /// The namespace of the attribute pub mNamespaceID: i32, - /** - * The atom for attribute, stored as void*, to make sure that we only use it - * for the hashcode, and we can never dereference it. - */ + /// The atom for attribute, stored as void*, to make sure that we only use it + /// for the hashcode, and we can never dereference it. pub mLocalName: *mut ::std::os::raw::c_void, } #[test] @@ -39221,9 +32534,7 @@ pub mod root { impl Clone for nsAttrKey { fn clone(&self) -> Self { *self } } - /** - * PLDHashEntryHdr implementation for nsAttrKey. - */ + /// PLDHashEntryHdr implementation for nsAttrKey. #[repr(C)] #[derive(Debug)] pub struct nsAttrHashKey { @@ -39250,64 +32561,8 @@ pub mod root { "::" , stringify ! ( mKey ) )); } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsScrollbarFrame { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIScrollbarMediator { - pub _base: root::nsQueryFrame, - } - pub type nsIScrollbarMediator_Has_NS_DECL_QUERYFRAME_TARGET = - root::nsIScrollbarMediator; - #[repr(u32)] - /** - * When set to ENABLE_SNAP, additional scrolling will be performed after the - * scroll operation to maintain the constraints set by CSS Scroll snapping. - * The additional scrolling may include asynchronous smooth scrolls that - * continue to animate after the initial scroll position has been set. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIScrollbarMediator_ScrollSnapMode { - DISABLE_SNAP = 0, - ENABLE_SNAP = 1, - } - extern "C" { - #[link_name = "_ZN20nsIScrollbarMediator9kFrameIIDE"] - pub static nsIScrollbarMediator_kFrameIID: - root::nsQueryFrame_FrameIID; - } - #[test] - fn bindgen_test_layout_nsIScrollbarMediator() { - assert_eq!(::std::mem::size_of::<nsIScrollbarMediator>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsIScrollbarMediator ) )); - assert_eq! (::std::mem::align_of::<nsIScrollbarMediator>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIScrollbarMediator ) )); - } - impl Clone for nsIScrollbarMediator { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsBoxLayoutState { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIScrollPositionListener { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsSMILValue { - _unused: [u8; 0], - } - #[repr(C)] pub struct nsISMILAttr__bindgen_vtable(::std::os::raw::c_void); - //////////////////////////////////////////////////////////////////////// + /// #[repr(C)] #[derive(Debug)] pub struct nsISMILAttr { @@ -39320,56 +32575,46 @@ pub mod root { assert_eq! (::std::mem::align_of::<nsISMILAttr>() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsISMILAttr ) )); } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct mozAutoDocUpdate { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsAttrValueOrString { - _unused: [u8; 0], - } - pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_3; + pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_1; pub const ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO: - root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_87 + root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_3; + pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_20 = - _bindgen_ty_87::ELEMENT_SHARED_RESTYLE_BIT_3; + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_3; pub const ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT: - root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; - pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_PENDING_RESTYLE_FLAGS; - pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; - pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_ALL_RESTYLE_FLAGS; - pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_87 = - _bindgen_ty_87::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; + root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; + pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_PENDING_RESTYLE_FLAGS; + pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; + pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_ALL_RESTYLE_FLAGS; + pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_87 { + pub enum _bindgen_ty_20 { ELEMENT_SHARED_RESTYLE_BIT_1 = 8388608, ELEMENT_SHARED_RESTYLE_BIT_2 = 16777216, ELEMENT_SHARED_RESTYLE_BIT_3 = 33554432, @@ -39406,35 +32651,33 @@ pub mod root { impl Clone for LookAndFeelInt { fn clone(&self) -> Self { *self } } - /** - * An object implementing |nsIStyleRule| (henceforth, a rule) represents - * immutable stylistic information that either applies or does not apply - * to a given element. It belongs to an object or group of objects that - * implement |nsIStyleSheet| and |nsIStyleRuleProcessor| (henceforth, a - * sheet). - * - * A rule becomes relevant to the computation of style data when - * |nsIStyleRuleProcessor::RulesMatching| creates a rule node that - * points to the rule. (A rule node, |nsRuleNode|, is a node in the - * rule tree, which is a lexicographic tree indexed by rules. The path - * from the root of the rule tree to the |nsRuleNode| for a given - * |nsStyleContext| contains exactly the rules that match the element - * that the style context is for, in priority (weight, origin, - * specificity) order.) - * - * The computation of style data uses the rule tree, which calls - * |nsIStyleRule::MapRuleInfoInto| below. - * - * It is worth emphasizing that the data represented by a rule - * implementation are immutable. When the data need to be changed, a - * new rule object must be created. Failing to do this will lead to - * bugs in the handling of dynamic style changes, since the rule tree - * caches the results of |MapRuleInfoInto|. - * - * |nsIStyleRule| objects are owned by |nsRuleNode| objects (in addition - * to typically being owned by their sheet), which are in turn garbage - * collected (with the garbage collection roots being style contexts). - */ + /// An object implementing |nsIStyleRule| (henceforth, a rule) represents + /// immutable stylistic information that either applies or does not apply + /// to a given element. It belongs to an object or group of objects that + /// implement |nsIStyleSheet| and |nsIStyleRuleProcessor| (henceforth, a + /// sheet). + /// + /// A rule becomes relevant to the computation of style data when + /// |nsIStyleRuleProcessor::RulesMatching| creates a rule node that + /// points to the rule. (A rule node, |nsRuleNode|, is a node in the + /// rule tree, which is a lexicographic tree indexed by rules. The path + /// from the root of the rule tree to the |nsRuleNode| for a given + /// |nsStyleContext| contains exactly the rules that match the element + /// that the style context is for, in priority (weight, origin, + /// specificity) order.) + /// + /// The computation of style data uses the rule tree, which calls + /// |nsIStyleRule::MapRuleInfoInto| below. + /// + /// It is worth emphasizing that the data represented by a rule + /// implementation are immutable. When the data need to be changed, a + /// new rule object must be created. Failing to do this will lead to + /// bugs in the handling of dynamic style changes, since the rule tree + /// caches the results of |MapRuleInfoInto|. + /// + /// |nsIStyleRule| objects are owned by |nsRuleNode| objects (in addition + /// to typically being owned by their sheet), which are in turn garbage + /// collected (with the garbage collection roots being style contexts). #[repr(C)] #[derive(Debug, Copy)] pub struct nsIStyleRule { @@ -39759,19 +33002,9 @@ pub mod root { pub const SERVO_CSS_PSEUDO_ELEMENT_FLAGS_mozPlaceholder: u32 = 8; pub const SERVO_CSS_PSEUDO_ELEMENT_FLAGS_placeholder: u32 = 8; pub const SERVO_CSS_PSEUDO_ELEMENT_FLAGS_mozColorSwatch: u32 = 12; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ElementDependentRuleProcessorData { - _unused: [u8; 0], - } pub type nsBindingList = root::nsTArray<root::RefPtr<root::nsXBLBinding>>; #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsRuleData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsCSSFontFeatureValuesRule { _unused: [u8; 0], } @@ -39804,11 +33037,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsROCSSPrimitiveValue { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIDOMCSSFontFaceRule { pub _base: root::nsISupports, @@ -39982,65 +33210,8 @@ pub mod root { "Alignment of field: " , stringify ! ( nsMediaList ) , "::" , stringify ! ( mArray ) )); } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct __va_list_tag { - pub gp_offset: ::std::os::raw::c_uint, - pub fp_offset: ::std::os::raw::c_uint, - pub overflow_arg_area: *mut ::std::os::raw::c_void, - pub reg_save_area: *mut ::std::os::raw::c_void, - } - #[test] - fn bindgen_test_layout___va_list_tag() { - assert_eq!(::std::mem::size_of::<__va_list_tag>() , 24usize , concat ! - ( "Size of: " , stringify ! ( __va_list_tag ) )); - assert_eq! (::std::mem::align_of::<__va_list_tag>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( __va_list_tag ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __va_list_tag ) ) . gp_offset as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( __va_list_tag ) , - "::" , stringify ! ( gp_offset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __va_list_tag ) ) . fp_offset as * - const _ as usize } , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( __va_list_tag ) , - "::" , stringify ! ( fp_offset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __va_list_tag ) ) . overflow_arg_area - as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( __va_list_tag ) , - "::" , stringify ! ( overflow_arg_area ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __va_list_tag ) ) . reg_save_area as - * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( __va_list_tag ) , - "::" , stringify ! ( reg_save_area ) )); - } - impl Clone for __va_list_tag { - fn clone(&self) -> Self { *self } - } - pub type __builtin_va_list = [root::__va_list_tag; 1usize]; - #[test] - fn __bindgen_test_layout_IntegralConstant_instantiation_90() { - assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! ( - "Size of template specialization: " , stringify ! ( u8 ) - )); - assert_eq!(::std::mem::align_of::<u8>() , 1usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( u8 - ) )); - } #[test] - fn __bindgen_test_layout_IntegralConstant_instantiation_91() { - assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! ( - "Size of template specialization: " , stringify ! ( u8 ) - )); - assert_eq!(::std::mem::align_of::<u8>() , 1usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( u8 - ) )); - } - #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_92() { + fn __bindgen_test_layout_nsCharTraits_open0_char16_t_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCharTraits>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40051,7 +33222,7 @@ pub mod root { root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout_nsReadingIterator_instantiation_93() { + fn __bindgen_test_layout_nsReadingIterator_open0_char16_t_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsReadingIterator<u16>>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40062,7 +33233,7 @@ pub mod root { root::nsReadingIterator<u16> ) )); } #[test] - fn __bindgen_test_layout_nsWritingIterator_instantiation_94() { + fn __bindgen_test_layout_nsWritingIterator_open0_char16_t_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsWritingIterator<u16>>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40073,7 +33244,7 @@ pub mod root { root::nsWritingIterator<u16> ) )); } #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_95() { + fn __bindgen_test_layout_nsCharTraits_open0_char_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCharTraits>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40084,7 +33255,7 @@ pub mod root { root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout_nsReadingIterator_instantiation_96() { + fn __bindgen_test_layout_nsReadingIterator_open0_char_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsReadingIterator<::std::os::raw::c_char>>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40095,7 +33266,7 @@ pub mod root { root::nsReadingIterator<::std::os::raw::c_char> ) )); } #[test] - fn __bindgen_test_layout_nsWritingIterator_instantiation_97() { + fn __bindgen_test_layout_nsWritingIterator_open0_char_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsWritingIterator<::std::os::raw::c_char>>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40106,7 +33277,7 @@ pub mod root { root::nsWritingIterator<::std::os::raw::c_char> ) )); } #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_98() { + fn __bindgen_test_layout_nsCharTraits_open0_char16_t_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsCharTraits>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40117,7 +33288,7 @@ pub mod root { root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_99() { + fn __bindgen_test_layout_nsCharTraits_open0_char_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsCharTraits>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40128,25 +33299,7 @@ pub mod root { root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_221270_instantiation_100() { - assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! ( - "Size of template specialization: " , stringify ! ( u8 ) - )); - assert_eq!(::std::mem::align_of::<u8>() , 1usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( u8 - ) )); - } - #[test] - fn __bindgen_test_layout__bindgen_ty_id_221306_instantiation_101() { - assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! ( - "Size of template specialization: " , stringify ! ( u8 ) - )); - assert_eq!(::std::mem::align_of::<u8>() , 1usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( u8 - ) )); - } - #[test] - fn __bindgen_test_layout_nsTArray_instantiation_102() { + fn __bindgen_test_layout_nsTArray_open0_nsCString_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCString>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40157,73 +33310,53 @@ pub mod root { root::nsTArray<root::nsCString> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_103() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::jsid>>() , - 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::jsid> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::jsid>>() , - 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::jsid> ) )); - } - #[test] - fn __bindgen_test_layout_Handle_instantiation_104() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_DeletePolicy_open1_JSErrorNotes_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::mozilla::UniquePtr<root::JSErrorNotes> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::JSErrorNotes>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::mozilla::UniquePtr<root::JSErrorNotes> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_105() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , + concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::<root::JS::DeletePolicy>() , 1usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_106() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsISupports_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsISupports>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsCOMPtr<root::nsISupports> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsISupports>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - } - #[test] - fn __bindgen_test_layout_Rooted_instantiation_107() { - assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! - ( - "Size of template specialization: " , stringify ! ( - [u64; 3usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 3usize]>() , 8usize , concat ! - ( - "Alignment of template specialization: " , stringify ! ( - [u64; 3usize] ) )); + root::nsCOMPtr<root::nsISupports> ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_108() { - assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , - concat ! ( + fn __bindgen_test_layout_nsTArray_open0_CSSVariableValues_Variable_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::CSSVariableValues_Variable>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::DeletePolicy ) )); - assert_eq!(::std::mem::align_of::<root::JS::DeletePolicy>() , 1usize , - concat ! ( + root::nsTArray<root::mozilla::CSSVariableValues_Variable> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::CSSVariableValues_Variable>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::DeletePolicy ) )); + root::nsTArray<root::mozilla::CSSVariableValues_Variable> ) + )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_109() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40234,7 +33367,7 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_110() { + fn __bindgen_test_layout_nsTArray_open0_FontFamilyName_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::FontFamilyName>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40245,7 +33378,18 @@ pub mod root { root::nsTArray<root::mozilla::FontFamilyName> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_111() { + fn __bindgen_test_layout_nsTArray_open0_FontFamilyName_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::FontFamilyName>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::FontFamilyName> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::FontFamilyName>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::FontFamilyName> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_unsigned_int_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<::std::os::raw::c_uint>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40256,7 +33400,7 @@ pub mod root { root::nsTArray<::std::os::raw::c_uint> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_112() { + fn __bindgen_test_layout_nsTArray_open0_unsigned_int_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<::std::os::raw::c_uint>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40267,381 +33411,376 @@ pub mod root { root::nsTArray<::std::os::raw::c_uint> ) )); } #[test] - fn __bindgen_test_layout_PointTyped_instantiation_113() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_gfxFontFeatureValueSet_ValueList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::gfxFontFeatureValueSet_ValueList>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::nsTArray<root::gfxFontFeatureValueSet_ValueList> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::gfxFontFeatureValueSet_ValueList>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::nsTArray<root::gfxFontFeatureValueSet_ValueList> ) + )); } #[test] - fn __bindgen_test_layout_IntPointTyped_instantiation_114() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_unsigned_int_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::std::os::raw::c_uint>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::nsTArray<::std::os::raw::c_uint> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::std::os::raw::c_uint>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::nsTArray<::std::os::raw::c_uint> ) )); } #[test] - fn __bindgen_test_layout_SizeTyped_instantiation_115() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_unsigned_int_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::std::os::raw::c_uint>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::nsTArray<::std::os::raw::c_uint> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::std::os::raw::c_uint>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::nsTArray<::std::os::raw::c_uint> ) )); } #[test] - fn __bindgen_test_layout_RectTyped_instantiation_116() { - assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_gfxAlternateValue_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::gfxAlternateValue>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 4usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat ! - ( + root::nsTArray<root::gfxAlternateValue> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::gfxAlternateValue>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 4usize] ) )); + root::nsTArray<root::gfxAlternateValue> ) )); } #[test] - fn __bindgen_test_layout_IntPointTyped_instantiation_117() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_gfxFontFeatureValueSet_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::gfxFontFeatureValueSet>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::RefPtr<root::gfxFontFeatureValueSet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::gfxFontFeatureValueSet>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::RefPtr<root::gfxFontFeatureValueSet> ) )); } #[test] - fn __bindgen_test_layout_IntSizeTyped_instantiation_118() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_gfxFontFeature_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::gfxFontFeature>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::nsTArray<root::gfxFontFeature> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::gfxFontFeature>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::nsTArray<root::gfxFontFeature> ) )); } #[test] - fn __bindgen_test_layout_IntRectTyped_instantiation_119() { - assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_FontVariation_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::gfx::FontVariation>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 4usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat ! - ( + root::nsTArray<root::mozilla::gfx::FontVariation> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::gfx::FontVariation>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 4usize] ) )); + root::nsTArray<root::mozilla::gfx::FontVariation> ) )); } #[test] - fn __bindgen_test_layout_MarginTyped_instantiation_120() { - assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_203903_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsCSSSelector>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 4usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat ! - ( + root::nsTArray<*mut root::nsCSSSelector> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsCSSSelector>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 4usize] ) )); + root::nsTArray<*mut root::nsCSSSelector> ) )); } #[test] - fn __bindgen_test_layout_RectTyped_instantiation_121() { - assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 4usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat ! - ( + root::nsCOMPtr<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 4usize] ) )); + root::nsCOMPtr<root::nsIAtom> ) )); } #[test] - fn __bindgen_test_layout_IntRectTyped_instantiation_122() { - assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_nsStyleImageRequest_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsStyleImageRequest>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 4usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat ! - ( - "Alignment of template specialization: " , stringify ! ( - [u32; 4usize] ) )); - } - #[test] - fn __bindgen_test_layout_ScaleFactor_instantiation_123() { - assert_eq!(::std::mem::size_of::<u32>() , 4usize , concat ! ( - "Size of template specialization: " , stringify ! ( u32 ) - )); - assert_eq!(::std::mem::align_of::<u32>() , 4usize , concat ! ( + root::RefPtr<root::nsStyleImageRequest> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsStyleImageRequest>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u32 ) )); + root::RefPtr<root::nsStyleImageRequest> ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_124() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_nsStyleQuoteValues_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsStyleQuoteValues>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::RefPtr<root::nsStyleQuoteValues> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsStyleQuoteValues>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::RefPtr<root::nsStyleQuoteValues> ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_125() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_nsCSSShadowArray_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsCSSShadowArray>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::RefPtr<root::nsCSSShadowArray> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsCSSShadowArray>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::RefPtr<root::nsCSSShadowArray> ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_126() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_nsCursorImage_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCursorImage>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::nsTArray<root::nsCursorImage> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCursorImage>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::nsTArray<root::nsCursorImage> ) )); } #[test] - fn __bindgen_test_layout_BaseTimeDuration_instantiation_127() { - assert_eq!(::std::mem::size_of::<root::mozilla::BaseTimeDuration>() , - 8usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_URLValue_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::URLValue>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::BaseTimeDuration ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::BaseTimeDuration>() , - 8usize , concat ! ( + root::RefPtr<root::mozilla::css::URLValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::URLValue>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::BaseTimeDuration ) )); + root::RefPtr<root::mozilla::css::URLValue> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_128() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIContent>>() + fn __bindgen_test_layout_RefPtr_open0_URLValue_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::URLValue>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIContent> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIContent>>() + root::RefPtr<root::mozilla::css::URLValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::URLValue>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIContent> ) )); + root::RefPtr<root::mozilla::css::URLValue> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_129() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIContent>>() + fn __bindgen_test_layout_RefPtr_open0_URLValue_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::URLValue>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIContent> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIContent>>() + root::RefPtr<root::mozilla::css::URLValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::URLValue>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIContent> ) )); + root::RefPtr<root::mozilla::css::URLValue> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_130() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_nsTArray_open0_nsStyleCoord_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCoord>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::nsTArray<root::nsStyleCoord> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleCoord>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::nsTArray<root::nsStyleCoord> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_131() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIAtom_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsIAtom>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) - )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + root::nsTArray<root::nsCOMPtr<root::nsIAtom>> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr<root::nsIAtom>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) - )); + root::nsTArray<root::nsCOMPtr<root::nsIAtom>> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_132() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() - , 8usize , concat ! ( + root::nsCOMPtr<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::nsCOMPtr<root::nsIAtom> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_133() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + fn __bindgen_test_layout_RefPtr_open0_GridTemplateAreasValue_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::GridTemplateAreasValue>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + root::RefPtr<root::mozilla::css::GridTemplateAreasValue> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::GridTemplateAreasValue>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + root::RefPtr<root::mozilla::css::GridTemplateAreasValue> ) )); } #[test] - fn __bindgen_test_layout_WeakPtr_instantiation_134() { - assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) - )); - assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMArray_open0_nsIAtom_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMArray>() , 8usize , concat + ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMArray ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMArray>() , 8usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsCOMArray ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_135() { - assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<::std::os::raw::c_void>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_Position_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::Position>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsPtrHashKey<::std::os::raw::c_void> ) )); - assert_eq!(::std::mem::align_of::<root::nsPtrHashKey<::std::os::raw::c_void>>() + root::nsTArray<root::mozilla::Position> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::Position>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsPtrHashKey<::std::os::raw::c_void> ) )); + root::nsTArray<root::mozilla::Position> ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_136() { - assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<root::WeakFrame>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_nsCSSValueSharedList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsCSSValueSharedList>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsPtrHashKey<root::WeakFrame> ) )); - assert_eq!(::std::mem::align_of::<root::nsPtrHashKey<root::WeakFrame>>() + root::RefPtr<root::nsCSSValueSharedList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsCSSValueSharedList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsPtrHashKey<root::WeakFrame> ) )); + root::RefPtr<root::nsCSSValueSharedList> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_137() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsStyleAutoArray_open0_StyleTransition_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsStyleAutoArray<root::mozilla::StyleTransition>>() + , 48usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::nsStyleAutoArray<root::mozilla::StyleTransition> ) + )); + assert_eq!(::std::mem::align_of::<root::nsStyleAutoArray<root::mozilla::StyleTransition>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::nsStyleAutoArray<root::mozilla::StyleTransition> ) + )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_138() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsStyleAutoArray_open0_StyleAnimation_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsStyleAutoArray<root::mozilla::StyleAnimation>>() + , 64usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::nsStyleAutoArray<root::mozilla::StyleAnimation> ) )); + assert_eq!(::std::mem::align_of::<root::nsStyleAutoArray<root::mozilla::StyleAnimation>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsStyleAutoArray<root::mozilla::StyleAnimation> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_139() { - assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIAtom>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsStyleContentData_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleContentData>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsCOMPtr<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIAtom>>() , - 8usize , concat ! ( + root::nsTArray<root::nsStyleContentData> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleContentData>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsCOMPtr<root::nsIAtom> ) )); + root::nsTArray<root::nsStyleContentData> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_140() { - assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsStyleCounterData_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCounterData>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<::nsstring::nsStringRepr> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , - 8usize , concat ! ( + root::nsTArray<root::nsStyleCounterData> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleCounterData>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<::nsstring::nsStringRepr> ) )); + root::nsTArray<root::nsStyleCounterData> ) )); } #[test] - fn __bindgen_test_layout_TErrorResult_instantiation_141() { - assert_eq!(::std::mem::size_of::<root::mozilla::binding_danger::TErrorResult>() - , 32usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsStyleCounterData_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCounterData>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::binding_danger::TErrorResult ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::binding_danger::TErrorResult>() + root::nsTArray<root::nsStyleCounterData> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleCounterData>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::binding_danger::TErrorResult ) )); + root::nsTArray<root::nsStyleCounterData> ) )); } #[test] - fn __bindgen_test_layout_TErrorResult_instantiation_142() { - assert_eq!(::std::mem::size_of::<root::mozilla::binding_danger::TErrorResult>() - , 32usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_nsCSSValueSharedList_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsCSSValueSharedList>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::binding_danger::TErrorResult ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::binding_danger::TErrorResult>() + root::RefPtr<root::nsCSSValueSharedList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsCSSValueSharedList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::binding_danger::TErrorResult ) )); + root::RefPtr<root::nsCSSValueSharedList> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_143() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStringBuffer>>() + fn __bindgen_test_layout_nsTArray_open0_nsStyleFilter_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleFilter>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStringBuffer> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStringBuffer>>() + root::nsTArray<root::nsStyleFilter> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleFilter>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStringBuffer> ) )); + root::nsTArray<root::nsStyleFilter> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_144() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_nsCSSShadowArray_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsCSSShadowArray>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::nsCSSShadowArray> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsCSSShadowArray>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::nsCSSShadowArray> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_145() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_146() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_TErrorResult_open0_AssertAndSuppressCleanupPolicy_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::binding_danger::TErrorResult>() + , 32usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::mozilla::binding_danger::TErrorResult ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::binding_danger::TErrorResult>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_147() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_205688_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40652,18 +33791,7 @@ pub mod root { root::nsTArray<*mut root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_148() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - } - #[test] - fn __bindgen_test_layout_RefPtr_instantiation_149() { + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40674,106 +33802,102 @@ pub mod root { root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_150() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_MediaList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::MediaList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::dom::MediaList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::MediaList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::dom::MediaList> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_151() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_152() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_nsTArray_open0_StyleSetHandle_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::StyleSetHandle>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::nsTArray<root::mozilla::StyleSetHandle> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::StyleSetHandle>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsTArray<root::mozilla::StyleSetHandle> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_153() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_RefPtr_open0_nsChildContentList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsChildContentList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::RefPtr<root::nsChildContentList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsChildContentList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::RefPtr<root::nsChildContentList> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_154() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsINode>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsINode> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsINode>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_UniquePtr_open0_nsTHashtable_open1_nsPtrHashKey_open2_nsRange_close2_close1_DefaultDelete_open1_nsTHashtable_open2_nsPtrHashKey_open3_nsRange_close3_close2_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsINode> ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_155() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_nsTHashtable_open1_nsPtrHashKey_open2_nsRange_close2_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_156() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_UniquePtr_open0_nsTHashtable_open1_nsPtrHashKey_open2_nsRange_close2_close1_DefaultDelete_open1_nsTHashtable_open2_nsPtrHashKey_open3_nsRange_close3_close2_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_157() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_nsTHashtable_open1_nsPtrHashKey_open2_nsRange_close2_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_158() { - assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , - concat ! ( + fn __bindgen_test_layout_RefPtr_open0_NodeInfo_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::NodeInfo>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::DeletePolicy ) )); - assert_eq!(::std::mem::align_of::<root::JS::DeletePolicy>() , 1usize , - concat ! ( + root::RefPtr<root::mozilla::dom::NodeInfo> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::NodeInfo>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::DeletePolicy ) )); + root::RefPtr<root::mozilla::dom::NodeInfo> ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_159() { + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_Note_DeletePolicy_open1_JSErrorNotes_Note_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes_Note>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40784,7 +33908,7 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes_Note> ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_160() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_Note_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40795,7 +33919,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_161() { + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_DeletePolicy_open1_JSErrorNotes_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40806,7 +33930,7 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes> ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_162() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40817,7 +33941,18 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_163() { + fn __bindgen_test_layout_iterator_open0_input_iterator_tag_UniquePtr_open1_JSErrorNotes_Note_DeletePolicy_open2_JSErrorNotes_Note_close2_close1_long__bindgen_ty_id_211246__bindgen_ty_id_211253_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::std::iterator>() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::std::iterator ) )); + assert_eq!(::std::mem::align_of::<root::std::iterator>() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::std::iterator ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_Note_DeletePolicy_open1_JSErrorNotes_Note_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes_Note>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40828,7 +33963,7 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes_Note> ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_164() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_Note_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40839,7 +33974,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_165() { + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_Note_DeletePolicy_open1_JSErrorNotes_Note_close1_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes_Note>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40850,7 +33985,7 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes_Note> ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_166() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_Note_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40861,7 +33996,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_167() { + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_Note_DeletePolicy_open1_JSErrorNotes_Note_close1_close0_instantiation_3() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes_Note>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40872,18 +34007,7 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes_Note> ) )); } #[test] - fn __bindgen_test_layout_iterator_instantiation_168() { - assert_eq!(::std::mem::size_of::<root::std::iterator>() , 1usize , - concat ! ( - "Size of template specialization: " , stringify ! ( - root::std::iterator ) )); - assert_eq!(::std::mem::align_of::<root::std::iterator>() , 1usize , - concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::std::iterator ) )); - } - #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_169() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_Note_close0_instantiation_3() { assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40894,7 +34018,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_170() { + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_Note_DeletePolicy_open1_JSErrorNotes_Note_close1_close0_instantiation_4() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes_Note>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40905,7 +34029,7 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes_Note> ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_171() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_Note_close0_instantiation_4() { assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40916,7 +34040,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_172() { + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_Note_DeletePolicy_open1_JSErrorNotes_Note_close1_close0_instantiation_5() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes_Note>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40927,40 +34051,29 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes_Note> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_173() { - assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIPrincipal>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsCOMPtr<root::nsIPrincipal> ) )); - assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIPrincipal>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsCOMPtr<root::nsIPrincipal> ) )); - } - #[test] - fn __bindgen_test_layout_Handle_instantiation_174() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_Note_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , + concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::<root::JS::DeletePolicy>() , 1usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_175() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIPrincipal>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsCOMPtr<root::nsIPrincipal> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIPrincipal>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsCOMPtr<root::nsIPrincipal> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_176() { + fn __bindgen_test_layout_nsTArray_open0_nsCString_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCString>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40971,7 +34084,7 @@ pub mod root { root::nsTArray<root::nsCString> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_177() { + fn __bindgen_test_layout_nsTArray_open0_nsCString_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCString>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40982,64 +34095,18 @@ pub mod root { root::nsTArray<root::nsCString> ) )); } #[test] - fn __bindgen_test_layout_Heap_instantiation_178() { - assert_eq!(::std::mem::size_of::<root::JS::Heap<root::JS::Value>>() , - 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::Heap<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Heap<root::JS::Value>>() , - 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::JS::Heap<root::JS::Value> ) )); - } - #[test] - fn __bindgen_test_layout_Heap_instantiation_179() { - assert_eq!(::std::mem::size_of::<root::JS::Heap<*mut root::JSObject>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIDocument_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIDocument>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Heap<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Heap<*mut root::JSObject>>() + root::nsCOMPtr<root::nsIDocument> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIDocument>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Heap<*mut root::JSObject> ) )); - } - #[test] - fn __bindgen_test_layout_TenuredHeap_instantiation_180() { - assert_eq!(::std::mem::size_of::<root::JS::TenuredHeap>() , 8usize , - concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::TenuredHeap ) )); - assert_eq!(::std::mem::align_of::<root::JS::TenuredHeap>() , 8usize , - concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::JS::TenuredHeap ) )); + root::nsCOMPtr<root::nsIDocument> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_181() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - } - #[test] - fn __bindgen_test_layout_NotNull_instantiation_182() { - assert_eq!(::std::mem::size_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); - assert_eq!(::std::mem::align_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); - } - #[test] - fn __bindgen_test_layout_nsTArray_instantiation_183() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_AnonymousContent_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41052,18 +34119,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_184() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - } - #[test] - fn __bindgen_test_layout_nsTArray_instantiation_185() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_StyleSheet_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41076,7 +34132,7 @@ pub mod root { )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_186() { + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41087,7 +34143,7 @@ pub mod root { root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_187() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_StyleSheet_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41100,29 +34156,29 @@ pub mod root { )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_188() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::dom::Element> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() + root::RefPtr<root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::dom::Element> ) )); + root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_189() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_213736_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::Element> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() + root::nsTArray<*mut root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::Element> ) )); + root::nsTArray<*mut root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_190() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_Element_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::Element>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41135,18 +34191,18 @@ pub mod root { )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_191() { - assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIObserver>>() + fn __bindgen_test_layout_RefPtr_open0_Element_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsCOMPtr<root::nsIObserver> ) )); - assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIObserver>>() + root::RefPtr<root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsCOMPtr<root::nsIObserver> ) )); + root::RefPtr<root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_192() { + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIObserver_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsIObserver>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41157,7 +34213,7 @@ pub mod root { root::nsTArray<root::nsCOMPtr<root::nsIObserver>> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_193() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIObserver_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIObserver>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41168,174 +34224,354 @@ pub mod root { root::nsCOMPtr<root::nsIObserver> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_194() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIDocument>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIObserver_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIObserver>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIDocument> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIDocument>>() + root::nsCOMPtr<root::nsIObserver> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIObserver>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIDocument> ) )); + root::nsCOMPtr<root::nsIObserver> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_195() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_214038_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::nsTArray<*mut root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsTArray<*mut root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_196() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_Element_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::Element>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::nsTArray<root::RefPtr<root::mozilla::dom::Element>> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::Element>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::nsTArray<root::RefPtr<root::mozilla::dom::Element>> ) + )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_197() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() + fn __bindgen_test_layout_RefPtr_open0_Element_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::dom::Element> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() + root::RefPtr<root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::dom::Element> ) )); + root::RefPtr<root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_198() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIDocument>>() + fn __bindgen_test_layout_nsAutoPtr_open0_nsIDocument_SelectorCache_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::nsIDocument_SelectorCache>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIDocument> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIDocument>>() + root::nsAutoPtr<root::nsIDocument_SelectorCache> ) )); + assert_eq!(::std::mem::align_of::<root::nsAutoPtr<root::nsIDocument_SelectorCache>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIDocument> ) )); + root::nsAutoPtr<root::nsIDocument_SelectorCache> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_199() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_URLExtraData_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::URLExtraData>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::URLExtraData> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::URLExtraData>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::URLExtraData> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_200() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsContentList>>() + fn __bindgen_test_layout_NotNull_open0__bindgen_ty_id_214580_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsContentList> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsContentList>>() + root::mozilla::NotNull<*const root::mozilla::Encoding> ) + )); + assert_eq!(::std::mem::align_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsContentList> ) )); + root::mozilla::NotNull<*const root::mozilla::Encoding> ) + )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_201() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsContentList>>() + fn __bindgen_test_layout_RefPtr_open0_Loader_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::Loader>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsContentList> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsContentList>>() + root::RefPtr<root::mozilla::css::Loader> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::Loader>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsContentList> ) )); + root::RefPtr<root::mozilla::css::Loader> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_202() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsINode>>() + fn __bindgen_test_layout_RefPtr_open0_ImageLoader_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::ImageLoader>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsINode> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsINode>>() + root::RefPtr<root::mozilla::css::ImageLoader> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::ImageLoader>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsINode> ) )); + root::RefPtr<root::mozilla::css::ImageLoader> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_203() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() + fn __bindgen_test_layout_RefPtr_open0_nsHTMLStyleSheet_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsHTMLStyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::Element> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() + root::RefPtr<root::nsHTMLStyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsHTMLStyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::Element> ) )); + root::RefPtr<root::nsHTMLStyleSheet> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_204() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::Element>>>() + fn __bindgen_test_layout_RefPtr_open0_nsHTMLCSSStyleSheet_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsHTMLCSSStyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::dom::Element>> ) + root::RefPtr<root::nsHTMLCSSStyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsHTMLCSSStyleSheet>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsHTMLCSSStyleSheet> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_ImageTracker_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::ImageTracker>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::ImageTracker> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::ImageTracker>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::ImageTracker> ) )); + } + #[test] + fn __bindgen_test_layout_nsAutoPtr_open0_nsTHashtable_open1_nsPtrHashKey_open2_nsISupports_close2_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::Element>>>() + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + u64 ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_Link_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::mozilla::dom::Link>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::mozilla::dom::Link> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::mozilla::dom::Link>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::dom::Element>> ) + root::nsCOMPtr<root::mozilla::dom::Link> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_nsSMILAnimationController_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsSMILAnimationController>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsSMILAnimationController> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsSMILAnimationController>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsSMILAnimationController> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsAutoPtr_open1_nsPropertyTable_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsAutoPtr<root::nsPropertyTable>>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsAutoPtr<root::nsPropertyTable>> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsAutoPtr<root::nsPropertyTable>>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsAutoPtr<root::nsPropertyTable>> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_205() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIHTMLCollection_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIHTMLCollection>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsCOMPtr<root::nsIHTMLCollection> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIHTMLCollection>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsCOMPtr<root::nsIHTMLCollection> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_206() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_RefPtr_open0_FontFaceSet_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::FontFaceSet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::RefPtr<root::mozilla::dom::FontFaceSet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::FontFaceSet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::RefPtr<root::mozilla::dom::FontFaceSet> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_207() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIRunnable>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIScriptGlobalObject_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIScriptGlobalObject>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIRunnable>>() + root::nsCOMPtr<root::nsIScriptGlobalObject> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIScriptGlobalObject>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); + root::nsCOMPtr<root::nsIScriptGlobalObject> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_208() { - assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::mozilla::dom::Link>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIDocument_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIDocument>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsCOMPtr<root::mozilla::dom::Link> ) )); - assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::mozilla::dom::Link>>() + root::nsCOMPtr<root::nsIDocument> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIDocument>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsCOMPtr<root::mozilla::dom::Link> ) )); + root::nsCOMPtr<root::nsIDocument> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIChannel_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIChannel>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIChannel> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIChannel>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIChannel> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsISupports_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsISupports>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsISupports> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsISupports>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsISupports> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIChannel_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIChannel>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIChannel> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIChannel>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIChannel> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_209() { + fn __bindgen_test_layout_nsCOMArray_open0_nsINode_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMArray>() , 8usize , concat + ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMArray ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMArray>() , 8usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMArray ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIDocument_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIDocument>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIDocument> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIDocument>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIDocument> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIWeakReference_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsIWeakReference>>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsCOMPtr<root::nsIWeakReference>> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr<root::nsIWeakReference>>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsCOMPtr<root::nsIWeakReference>> ) + )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIWeakReference_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIWeakReference>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41346,130 +34582,231 @@ pub mod root { root::nsCOMPtr<root::nsIWeakReference> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_210() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIDocumentEncoder_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIDocumentEncoder>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::nsCOMPtr<root::nsIDocumentEncoder> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIDocumentEncoder>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::nsCOMPtr<root::nsIDocumentEncoder> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_211() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + fn __bindgen_test_layout_nsTArray_open0_nsIDocument_FrameRequest_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsIDocument_FrameRequest>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) - )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + root::nsTArray<root::nsIDocument_FrameRequest> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsIDocument_FrameRequest>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) - )); + root::nsTArray<root::nsIDocument_FrameRequest> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_212() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIStructuredCloneContainer_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIStructuredCloneContainer>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() + root::nsCOMPtr<root::nsIStructuredCloneContainer> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIStructuredCloneContainer>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + root::nsCOMPtr<root::nsIStructuredCloneContainer> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIVariant_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIVariant>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIVariant> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIVariant>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIVariant> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_213() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_XPathEvaluator_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::XPathEvaluator>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::dom::XPathEvaluator> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::XPathEvaluator>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::dom::XPathEvaluator> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_214() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_AnonymousContent_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>> + ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_215() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_LinkedList_open0_MediaQueryList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::LinkedList>() , + 24usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::LinkedList ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::LinkedList>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::LinkedList ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_DocGroup_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DocGroup>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::RefPtr<root::mozilla::dom::DocGroup> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DocGroup>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::RefPtr<root::mozilla::dom::DocGroup> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_216() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_RefPtr_open0_CSSRuleListImpl_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::CSSRuleListImpl>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::RefPtr<root::CSSRuleListImpl> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::CSSRuleListImpl>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::RefPtr<root::CSSRuleListImpl> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_217() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_RefPtr_open0_Element_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::RefPtr<root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::RefPtr<root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_218() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_RefPtr_open0_ServoCSSRuleList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::ServoCSSRuleList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::RefPtr<root::mozilla::ServoCSSRuleList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::ServoCSSRuleList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::RefPtr<root::mozilla::ServoCSSRuleList> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_StyleSheet_close1_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::StyleSheet> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_214995_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_6() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_219() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_7() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIPrincipal>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::nsCOMPtr<root::nsIPrincipal> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIPrincipal>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::nsCOMPtr<root::nsIPrincipal> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_220() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::RefPtr<root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::RefPtr<root::mozilla::StyleSheet> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsCString_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCString>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsCString> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCString>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsCString> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_221() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_ServoStyleSheet_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::ServoStyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41482,7 +34819,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_222() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_215401_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41493,29 +34830,29 @@ pub mod root { root::nsTArray<*mut root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_223() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_RefPtr_open0_RawServoAnimationValue_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoAnimationValue>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::RefPtr<root::RawServoAnimationValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::RawServoAnimationValue>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::RefPtr<root::RawServoAnimationValue> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_224() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoAnimationValue>>() + fn __bindgen_test_layout_UniquePtr_open0_RawServoStyleSet_DefaultDelete_open1_RawServoStyleSet_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::RawServoStyleSet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::RawServoAnimationValue> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::RawServoAnimationValue>>() + root::mozilla::UniquePtr<root::RawServoStyleSet> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::RawServoStyleSet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::RawServoAnimationValue> ) )); + root::mozilla::UniquePtr<root::RawServoStyleSet> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_225() { + fn __bindgen_test_layout_DefaultDelete_open0_RawServoStyleSet_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41526,7 +34863,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_226() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_ServoStyleSheet_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::ServoStyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41539,29 +34876,18 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_227() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsStyleContext>>() + fn __bindgen_test_layout_nsTArray_open0_PostTraversalTask_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::PostTraversalTask>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsStyleContext>>() + root::nsTArray<root::mozilla::PostTraversalTask> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::PostTraversalTask>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::nsStyleContext> ) )); + root::nsTArray<root::mozilla::PostTraversalTask> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_228() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - } - #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_229() { + fn __bindgen_test_layout_UniquePtr_open0_nsISMILAttr_DefaultDelete_open1_nsISMILAttr_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsISMILAttr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41572,18 +34898,18 @@ pub mod root { root::mozilla::UniquePtr<root::nsISMILAttr> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_230() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_nsISMILAttr_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_231() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41594,108 +34920,96 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_232() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_216375_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<*mut root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_233() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsAutoPtr_open0_nsTHashtable_open1_nsRefPtrHashKey_open2_nsIContent_close2_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_234() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsRefPtrHashKey_open0_nsIContent_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIContent>>() + , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsRefPtrHashKey<root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIContent>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsRefPtrHashKey<root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_235() { - assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::mozilla::dom::DOMIntersectionObserver>>() - , 16usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::mozilla::dom::DOMIntersectionObserver> - ) )); - assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::mozilla::dom::DOMIntersectionObserver>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsAutoPtr_open0_nsInterfaceHashtable_open1_nsISupportsHashKey_nsIXPConnectWrappedJS_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::mozilla::dom::DOMIntersectionObserver> - ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_nsDataHashtable_instantiation_236() { - assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! - ( - "Size of template specialization: " , stringify ! ( - [u64; 6usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 6usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsAutoPtr_open0_nsRefPtrHashtable_open1_nsURIHashKey_nsXBLDocumentInfo_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 6usize] ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_237() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsAutoPtr_open0_nsInterfaceHashtable_open1_nsURIHashKey_nsIStreamListener_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_238() { - assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIContent>>() - , 16usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIContent> ) )); - assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIContent>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_nsRunnableMethod_open1_nsBindingManager_void_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIContent> ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_nsTHashtable_instantiation_239() { - assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! - ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 6usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 6usize]>() , 8usize , concat ! - ( + root::nsCOMPtr<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 6usize] ) )); + root::nsCOMPtr<root::nsIAtom> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_240() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_nsCSSFontFaceRule_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsCSSFontFaceRule>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::nsCSSFontFaceRule> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsCSSFontFaceRule>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::nsCSSFontFaceRule> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_241() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_216680_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41706,7 +35020,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_242() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_216685_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41717,29 +35031,29 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_243() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_RefPtr_open0_nsStyleContext_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsStyleContext>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::RefPtr<root::nsStyleContext> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsStyleContext>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::RefPtr<root::nsStyleContext> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_244() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + root::nsCOMPtr<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsCOMPtr<root::nsIAtom> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_245() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIStyleRule_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIStyleRule>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41750,18 +35064,7 @@ pub mod root { root::nsCOMPtr<root::nsIStyleRule> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_246() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::CSSStyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::CSSStyleSheet> ) )); - } - #[test] - fn __bindgen_test_layout_nsTArray_instantiation_247() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_CSSStyleSheet_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::CSSStyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41774,7 +35077,18 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_248() { + fn __bindgen_test_layout_RefPtr_open0_CSSStyleSheet_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::CSSStyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::CSSStyleSheet> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_217178_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41785,7 +35099,20 @@ pub mod root { root::nsTArray<*mut root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_249() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_CSSStyleSheet_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::CSSStyleSheet>>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::RefPtr<root::mozilla::CSSStyleSheet>> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::CSSStyleSheet>>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::RefPtr<root::mozilla::CSSStyleSheet>> + ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_CSSStyleSheet_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41796,20 +35123,20 @@ pub mod root { root::RefPtr<root::mozilla::CSSStyleSheet> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_250() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::CSSStyleSheet>>>() + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIStyleRuleProcessor_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsIStyleRuleProcessor>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::CSSStyleSheet>> + root::nsTArray<root::nsCOMPtr<root::nsIStyleRuleProcessor>> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::CSSStyleSheet>>>() + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr<root::nsIStyleRuleProcessor>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::CSSStyleSheet>> + root::nsTArray<root::nsCOMPtr<root::nsIStyleRuleProcessor>> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_251() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIStyleRuleProcessor_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIStyleRuleProcessor>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41820,97 +35147,117 @@ pub mod root { root::nsCOMPtr<root::nsIStyleRuleProcessor> ) )); } #[test] - fn __bindgen_test_layout_SupportsWeakPtr_instantiation_252() { - assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) - )); - assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsRect_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsRect>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsRect> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsRect>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsTArray<root::nsRect> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_253() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIDocument_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIDocument>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::nsCOMPtr<root::nsIDocument> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIDocument>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::nsCOMPtr<root::nsIDocument> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_254() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsRect>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_nsDeviceContext_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsDeviceContext>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::nsRect> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsRect>>() , - 8usize , concat ! ( + root::RefPtr<root::nsDeviceContext> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsDeviceContext>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::nsRect> ) )); + root::RefPtr<root::nsDeviceContext> ) )); } #[test] - fn __bindgen_test_layout_NotNull_instantiation_255() { - assert_eq!(::std::mem::size_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + fn __bindgen_test_layout_RefPtr_open0_EventStateManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::EventStateManager>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); - assert_eq!(::std::mem::align_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + root::RefPtr<root::mozilla::EventStateManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::EventStateManager>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); + root::RefPtr<root::mozilla::EventStateManager> ) )); } #[test] - fn __bindgen_test_layout_NotNull_instantiation_256() { - assert_eq!(::std::mem::size_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + fn __bindgen_test_layout_RefPtr_open0_nsRefreshDriver_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsRefreshDriver>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); - assert_eq!(::std::mem::align_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + root::RefPtr<root::nsRefreshDriver> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsRefreshDriver>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); + root::RefPtr<root::nsRefreshDriver> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_257() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsITimer>>() + fn __bindgen_test_layout_RefPtr_open0_EffectCompositor_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::EffectCompositor>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsITimer> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsITimer>>() + root::RefPtr<root::mozilla::EffectCompositor> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::EffectCompositor>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsITimer> ) )); + root::RefPtr<root::mozilla::EffectCompositor> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_258() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_nsTransitionManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsTransitionManager>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + root::RefPtr<root::nsTransitionManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsTransitionManager>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); + root::RefPtr<root::nsTransitionManager> ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_259() { - assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIAtom>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_nsAnimationManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsAnimationManager>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIAtom>>() + root::RefPtr<root::nsAnimationManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsAnimationManager>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIAtom> ) )); + root::RefPtr<root::nsAnimationManager> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_RestyleManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::RestyleManager>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::RestyleManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::RestyleManager>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::RestyleManager> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_CounterStyleManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::CounterStyleManager>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::CounterStyleManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::CounterStyleManager>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::CounterStyleManager> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_260() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_4() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIAtom>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41921,150 +35268,194 @@ pub mod root { root::nsCOMPtr<root::nsIAtom> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_261() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsIAtom>>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::nsCOMPtr<root::nsIAtom>> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr<root::nsIAtom>>>() - , 8usize , concat ! ( + root::nsCOMPtr<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::nsCOMPtr<root::nsIAtom>> ) )); + root::nsCOMPtr<root::nsIAtom> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_262() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsITheme_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsITheme>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() - , 8usize , concat ! ( + root::nsCOMPtr<root::nsITheme> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsITheme>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::nsCOMPtr<root::nsITheme> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_263() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrintSettings_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIPrintSettings>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + root::nsCOMPtr<root::nsIPrintSettings> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIPrintSettings>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::nsCOMPtr<root::nsIPrintSettings> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_264() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsITimer_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsITimer>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + root::nsCOMPtr<root::nsITimer> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsITimer>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::nsCOMPtr<root::nsITimer> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_265() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + fn __bindgen_test_layout_UniquePtr_open0_nsBidi_DefaultDelete_open1_nsBidi_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsBidi>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + root::mozilla::UniquePtr<root::nsBidi> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsBidi>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::mozilla::UniquePtr<root::nsBidi> ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_open0_nsBidi_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsRect_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsRect>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsRect> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsRect>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsRect> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_266() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + fn __bindgen_test_layout_nsAutoPtr_open0_gfxTextPerfMetrics_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::gfxTextPerfMetrics>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + root::nsAutoPtr<root::gfxTextPerfMetrics> ) )); + assert_eq!(::std::mem::align_of::<root::nsAutoPtr<root::gfxTextPerfMetrics>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::nsAutoPtr<root::gfxTextPerfMetrics> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_267() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsAutoPtr_open0_gfxMissingFontRecorder_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::gfxMissingFontRecorder>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsAutoPtr<root::gfxMissingFontRecorder> ) )); + assert_eq!(::std::mem::align_of::<root::nsAutoPtr<root::gfxMissingFontRecorder>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsAutoPtr<root::gfxMissingFontRecorder> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_268() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsRefPtrHashKey_open0_nsIAtom_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIAtom>>() + , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsRefPtrHashKey<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIAtom>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsRefPtrHashKey<root::nsIAtom> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_269() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIAtom_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsIAtom>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsTArray<root::nsCOMPtr<root::nsIAtom>> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr<root::nsIAtom>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<root::nsCOMPtr<root::nsIAtom>> ) )); } #[test] - fn __bindgen_test_layout_nsPIDOMWindow_instantiation_270() { - assert_eq!(::std::mem::size_of::<[u64; 31usize]>() , 248usize , concat - ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_6() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 31usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 31usize]>() , 8usize , concat - ! ( + root::nsCOMPtr<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIAtom> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIPrincipal>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIPrincipal> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIPrincipal>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 31usize] ) )); + root::nsCOMPtr<root::nsIPrincipal> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_271() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIContent>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIPrincipal>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIContent> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIContent>>() + root::nsCOMPtr<root::nsIPrincipal> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIPrincipal>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIContent> ) )); + root::nsCOMPtr<root::nsIPrincipal> ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_272() { - assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_nsBindingManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsBindingManager>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 6usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 6usize]>() , 8usize , concat ! - ( + root::RefPtr<root::nsBindingManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsBindingManager>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 6usize] ) )); + root::RefPtr<root::nsBindingManager> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_273() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_nsNodeInfoManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsNodeInfoManager>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::nsNodeInfoManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsNodeInfoManager>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::nsNodeInfoManager> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_274() { + fn __bindgen_test_layout_nsTArray_open0_nsCString_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCString>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsCString> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCString>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsCString> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_3() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42075,183 +35466,211 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_275() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsCOMPtr_open0_Element_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsCOMPtr<root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsCOMPtr<root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_276() { - assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::nsINode>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_StyleSheet_close1_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::nsINode> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::OwningNonNull<root::nsINode>>() + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::nsINode> ) )); + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_277() { - assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::nsINode>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_6() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::nsINode> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::OwningNonNull<root::nsINode>>() + root::RefPtr<root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::nsINode> ) )); + root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_278() { - assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::nsINode>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_StyleSheet_close1_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::nsINode> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::OwningNonNull<root::nsINode>>() + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::nsINode> ) )); + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_279() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_7() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::RefPtr<root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_280() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIContent_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIContent>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::nsCOMPtr<root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIContent>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::nsCOMPtr<root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_281() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIContent_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIContent>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsCOMPtr<root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIContent>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsCOMPtr<root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_282() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIDocument_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIDocument>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsCOMPtr<root::nsIDocument> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIDocument>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsCOMPtr<root::nsIDocument> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_283() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::jsid>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_nsPresContext_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsPresContext>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::jsid> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::jsid>>() , - 8usize , concat ! ( + root::RefPtr<root::nsPresContext> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsPresContext>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::jsid> ) )); + root::RefPtr<root::nsPresContext> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_284() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::PropertyDescriptor>>() + fn __bindgen_test_layout_RefPtr_open0_nsFrameSelection_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsFrameSelection>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::PropertyDescriptor> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::PropertyDescriptor>>() + root::RefPtr<root::nsFrameSelection> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsFrameSelection>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::PropertyDescriptor> ) )); + root::RefPtr<root::nsFrameSelection> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_285() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::jsid>>() , + fn __bindgen_test_layout_nsCOMPtr_open0_nsITimer_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsITimer>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::jsid> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::jsid>>() , + root::nsCOMPtr<root::nsITimer> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsITimer>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::jsid> ) )); + root::nsCOMPtr<root::nsITimer> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_286() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::PropertyDescriptor>>() + fn __bindgen_test_layout_nsPtrHashKey_open0_void_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<::std::os::raw::c_void>>() + , 16usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsPtrHashKey<::std::os::raw::c_void> ) )); + assert_eq!(::std::mem::align_of::<root::nsPtrHashKey<::std::os::raw::c_void>>() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsPtrHashKey<::std::os::raw::c_void> ) )); + } + #[test] + fn __bindgen_test_layout_nsPtrHashKey_open0_WeakFrame_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<root::WeakFrame>>() + , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::PropertyDescriptor> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::PropertyDescriptor>>() + root::nsPtrHashKey<root::WeakFrame> ) )); + assert_eq!(::std::mem::align_of::<root::nsPtrHashKey<root::WeakFrame>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::PropertyDescriptor> ) )); + root::nsPtrHashKey<root::WeakFrame> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_287() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsISupports_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsISupports>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsCOMPtr<root::nsISupports> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsISupports>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsCOMPtr<root::nsISupports> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_288() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIContent_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIContent>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIContent>>() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIContent> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_nsXBLBinding_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsXBLBinding>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::nsXBLBinding> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsXBLBinding>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::nsXBLBinding> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_289() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_XBLChildrenElement_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::XBLChildrenElement>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::dom::XBLChildrenElement> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::XBLChildrenElement>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::dom::XBLChildrenElement> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_290() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_XBLChildrenElement_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::XBLChildrenElement>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<*mut root::JSObject>>() + root::nsTArray<root::RefPtr<root::mozilla::dom::XBLChildrenElement>> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::XBLChildrenElement>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<*mut root::JSObject> ) )); + root::nsTArray<root::RefPtr<root::mozilla::dom::XBLChildrenElement>> + ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_291() { + fn __bindgen_test_layout_RefPtr_open0_XBLChildrenElement_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::XBLChildrenElement>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42262,204 +35681,229 @@ pub mod root { root::RefPtr<root::mozilla::dom::XBLChildrenElement> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_292() { - assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIWeakReference>>() + fn __bindgen_test_layout_RefPtr_open0_nsAnonymousContentList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsAnonymousContentList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsCOMPtr<root::nsIWeakReference> ) )); - assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIWeakReference>>() + root::RefPtr<root::nsAnonymousContentList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsAnonymousContentList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsCOMPtr<root::nsIWeakReference> ) )); + root::RefPtr<root::nsAnonymousContentList> ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_293() { - assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<::std::os::raw::c_void>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_8() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsPtrHashKey<::std::os::raw::c_void> ) )); - assert_eq!(::std::mem::align_of::<root::nsPtrHashKey<::std::os::raw::c_void>>() - , 8usize , concat ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsPtrHashKey<::std::os::raw::c_void> ) )); + root::nsCOMPtr<root::nsIURI> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_294() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIRunnable>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_9() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIPrincipal>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIRunnable>>() + root::nsCOMPtr<root::nsIPrincipal> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIPrincipal>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); + root::nsCOMPtr<root::nsIPrincipal> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_295() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIRunnable>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIWeakReference_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIWeakReference>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIRunnable>>() + root::nsCOMPtr<root::nsIWeakReference> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIWeakReference>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); + root::nsCOMPtr<root::nsIWeakReference> ) )); } #[test] - fn __bindgen_test_layout_NotNull_instantiation_296() { - assert_eq!(::std::mem::size_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_220037_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut ::std::os::raw::c_void>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); - assert_eq!(::std::mem::align_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + root::nsTArray<*mut ::std::os::raw::c_void> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut ::std::os::raw::c_void>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); + root::nsTArray<*mut ::std::os::raw::c_void> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_297() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsPtrHashKey_open0_void_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<::std::os::raw::c_void>>() + , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::nsPtrHashKey<::std::os::raw::c_void> ) )); + assert_eq!(::std::mem::align_of::<root::nsPtrHashKey<::std::os::raw::c_void>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::nsPtrHashKey<::std::os::raw::c_void> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_298() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() + fn __bindgen_test_layout_StaticRefPtr_open0_nsIContent_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::mozilla::StaticRefPtr<root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::nsIContent>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::mozilla::StaticRefPtr<root::nsIContent> ) )); } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct _bindgen_ty_53 { - pub _address: u8, + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_7() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIAtom> ) )); } - impl Clone for _bindgen_ty_53 { - fn clone(&self) -> Self { *self } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIGlobalObject_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIGlobalObject>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIGlobalObject> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIGlobalObject>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIGlobalObject> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_299() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIRunnable>>() + fn __bindgen_test_layout_UniquePtr_open0_TimeoutManager_DefaultDelete_open1_TimeoutManager_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::mozilla::dom::TimeoutManager>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIRunnable>>() + root::mozilla::UniquePtr<root::mozilla::dom::TimeoutManager> + ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::mozilla::dom::TimeoutManager>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); + root::mozilla::UniquePtr<root::mozilla::dom::TimeoutManager> + ) )); } #[test] - fn __bindgen_test_layout_nsPIDOMWindow_instantiation_300() { - assert_eq!(::std::mem::size_of::<[u64; 31usize]>() , 248usize , concat - ! ( + fn __bindgen_test_layout_DefaultDelete_open0_TimeoutManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 31usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 31usize]>() , 8usize , concat - ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 31usize] ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_301() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_226379_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::dom::AudioContext>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsTArray<*mut root::mozilla::dom::AudioContext> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::dom::AudioContext>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsTArray<*mut root::mozilla::dom::AudioContext> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_302() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0_ErrorNote_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::xpc::ErrorNote>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsTArray<root::xpc::ErrorNote> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::xpc::ErrorNote>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsTArray<root::xpc::ErrorNote> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_303() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::CSSValue>>() + fn __bindgen_test_layout_RefPtr_open0_CallbackObject_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::CallbackObject>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::CSSValue> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::CSSValue>>() + root::RefPtr<root::mozilla::dom::CallbackObject> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::CallbackObject>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::CSSValue> ) )); + root::RefPtr<root::mozilla::dom::CallbackObject> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_304() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_227540_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::JS::Heap<*mut root::JSObject>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + root::JS::Heap<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::<root::JS::Heap<*mut root::JSObject>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); + root::JS::Heap<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_305() { - assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! - ( + fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_227544_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::JS::Heap<*mut root::JSObject>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 6usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 6usize]>() , 8usize , concat ! - ( + root::JS::Heap<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::<root::JS::Heap<*mut root::JSObject>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 6usize] ) )); + root::JS::Heap<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Rooted_instantiation_306() { - assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! - ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIGlobalObject_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIGlobalObject>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 3usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 3usize]>() , 8usize , concat ! - ( + root::nsCOMPtr<root::nsIGlobalObject> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIGlobalObject>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 3usize] ) )); + root::nsCOMPtr<root::nsIGlobalObject> ) )); } #[test] - fn __bindgen_test_layout_Rooted_instantiation_307() { - assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! - ( + fn __bindgen_test_layout_TenuredHeap_open0__bindgen_ty_id_227551_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::JS::TenuredHeap>() , 8usize , + concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 3usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 3usize]>() , 8usize , concat ! - ( + root::JS::TenuredHeap ) )); + assert_eq!(::std::mem::align_of::<root::JS::TenuredHeap>() , 8usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 3usize] ) )); + root::JS::TenuredHeap ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_308() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsISupports>>() + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsISupports_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsISupports>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsISupports> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsISupports>>() + root::nsTArray<root::nsCOMPtr<root::nsISupports>> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr<root::nsISupports>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsISupports> ) )); + root::nsTArray<root::nsCOMPtr<root::nsISupports>> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_309() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsISupports_close0_instantiation_3() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsISupports>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42470,7 +35914,7 @@ pub mod root { root::nsCOMPtr<root::nsISupports> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_310() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIRunnable>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42481,75 +35925,75 @@ pub mod root { root::nsCOMPtr<root::nsIRunnable> ) )); } #[test] - fn __bindgen_test_layout_NotNull_instantiation_311() { - assert_eq!(::std::mem::size_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsIRunnable>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); - assert_eq!(::std::mem::align_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + root::nsTArray<root::nsCOMPtr<root::nsIRunnable>> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr<root::nsIRunnable>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); + root::nsTArray<root::nsCOMPtr<root::nsIRunnable>> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_312() { - assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIRunnable>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<::nsstring::nsStringRepr> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , - 8usize , concat ! ( + root::nsCOMPtr<root::nsIRunnable> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIRunnable>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<::nsstring::nsStringRepr> ) )); + root::nsCOMPtr<root::nsIRunnable> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_313() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0_CycleCollectedJSContext_RunInMetastableStateData_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::CycleCollectedJSContext_RunInMetastableStateData>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::nsTArray<root::mozilla::CycleCollectedJSContext_RunInMetastableStateData> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::CycleCollectedJSContext_RunInMetastableStateData>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::nsTArray<root::mozilla::CycleCollectedJSContext_RunInMetastableStateData> + ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_314() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_229008_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsISupports>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsTArray<*mut root::nsISupports> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsISupports>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsTArray<*mut root::nsISupports> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_315() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_316() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_10() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsCOMPtr<root::nsIURI> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_317() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_5() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42560,18 +36004,20 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_318() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_SheetLoadData_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>> + ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_319() { + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_8() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42582,86 +36028,123 @@ pub mod root { root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_320() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_nsAutoPtr_open0_Loader_Sheets_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::mozilla::css::Loader_Sheets>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::nsAutoPtr<root::mozilla::css::Loader_Sheets> ) )); + assert_eq!(::std::mem::align_of::<root::nsAutoPtr<root::mozilla::css::Loader_Sheets>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::nsAutoPtr<root::mozilla::css::Loader_Sheets> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_321() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_RefPtr_open0_DocGroup_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DocGroup>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::RefPtr<root::mozilla::dom::DocGroup> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DocGroup>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::RefPtr<root::mozilla::dom::DocGroup> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_322() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIConsoleReportCollector_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIConsoleReportCollector>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>> + root::nsCOMPtr<root::nsIConsoleReportCollector> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIConsoleReportCollector>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIConsoleReportCollector> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_double_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<f64>>() , 8usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<f64> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<f64>>() , 8usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<f64> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_DOMIntersectionObserverEntry_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>>>() + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>> + root::nsTArray<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_323() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_RefPtr_open0_DOMIntersectionObserverEntry_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry> + ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry> + ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_324() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsPIDOMWindowInner_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsPIDOMWindowInner>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + root::nsCOMPtr<root::nsPIDOMWindowInner> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsPIDOMWindowInner>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::nsCOMPtr<root::nsPIDOMWindowInner> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_nsIDocument_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsIDocument>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsIDocument> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsIDocument>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsIDocument> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_325() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_RefPtr_open0_IntersectionCallback_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::IntersectionCallback>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::RefPtr<root::mozilla::dom::IntersectionCallback> ) + )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::IntersectionCallback>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::RefPtr<root::mozilla::dom::IntersectionCallback> ) + )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_326() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_Element_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_327() { + fn __bindgen_test_layout_nsTArray_open0_double_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<f64>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42672,20 +36155,18 @@ pub mod root { root::nsTArray<f64> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_328() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_230383_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry> - ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>() + root::nsTArray<*mut root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry> - ) )); + root::nsTArray<*mut root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_329() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_DOMIntersectionObserverEntry_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42698,7 +36179,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_330() { + fn __bindgen_test_layout_RefPtr_open0_DOMIntersectionObserverEntry_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42711,7 +36192,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_331() { + fn __bindgen_test_layout_UniquePtr_open0_ProfilerBacktrace_ProfilerBacktraceDestructor_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::ProfilerBacktrace>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42722,7 +36203,7 @@ pub mod root { root::mozilla::UniquePtr<root::ProfilerBacktrace> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_332() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_6() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42733,119 +36214,187 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_333() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_8() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIAtom> ) )); + } + #[test] + fn __bindgen_test_layout_nsAutoPtr_open0_LangGroupFontPrefs_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::mozilla::LangGroupFontPrefs>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::nsAutoPtr<root::mozilla::LangGroupFontPrefs> ) )); + assert_eq!(::std::mem::align_of::<root::nsAutoPtr<root::mozilla::LangGroupFontPrefs>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::nsAutoPtr<root::mozilla::LangGroupFontPrefs> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_334() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_OwningNonNull_open0_EffectCompositor_AnimationStyleRuleProcessor_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>() + , 16usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor> + ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor> + ) )); + } + #[test] + fn __bindgen_test_layout_nsRefPtrHashKey_open0_nsIAtom_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIAtom>>() + , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsRefPtrHashKey<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIAtom>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsRefPtrHashKey<root::nsIAtom> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_335() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_232806_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::CounterStyle>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::nsTArray<*mut root::mozilla::CounterStyle> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::CounterStyle>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::nsTArray<*mut root::mozilla::CounterStyle> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_336() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsIRunnable>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsTArray<root::nsCOMPtr<root::nsIRunnable>> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr<root::nsIRunnable>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsTArray<root::nsCOMPtr<root::nsIRunnable>> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_337() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIRunnable>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::nsCOMPtr<root::nsIRunnable> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIRunnable>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::nsCOMPtr<root::nsIRunnable> ) )); } #[test] - fn __bindgen_test_layout_nsDataHashtable_instantiation_338() { - assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_7() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 6usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 6usize]>() , 8usize , concat ! - ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 6usize] ) )); + root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_339() { - assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_UniquePtr_open0_URLParams_DefaultDelete_open1_URLParams_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::mozilla::dom::URLParams>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor> - ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>() + root::mozilla::UniquePtr<root::mozilla::dom::URLParams> ) + )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::mozilla::dom::URLParams>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor> - ) )); + root::mozilla::UniquePtr<root::mozilla::dom::URLParams> ) + )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_340() { - assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIAtom>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_URLParams_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIAtom>>() + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_8() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_URLParams_Param_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::dom::URLParams_Param>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::dom::URLParams_Param> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::dom::URLParams_Param>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIAtom> ) )); + root::nsTArray<root::mozilla::dom::URLParams_Param> ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_341() { - assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIContent>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_UniquePtr_open0_const_char_XREAppData_NSFreePolicy_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<::std::os::raw::c_char>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIContent> ) )); - assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIContent>>() + root::mozilla::UniquePtr<::std::os::raw::c_char> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<::std::os::raw::c_char>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIContent> ) )); + root::mozilla::UniquePtr<::std::os::raw::c_char> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_342() { - assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIRunnable>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIEventTarget_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIEventTarget>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsCOMPtr<root::nsIRunnable> ) )); - assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIRunnable>>() + root::nsCOMPtr<root::nsIEventTarget> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIEventTarget>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsCOMPtr<root::nsIRunnable> ) )); + root::nsCOMPtr<root::nsIEventTarget> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_343() { + fn __bindgen_test_layout_RefPtr_open0_imgRequestProxy_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::imgRequestProxy>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::imgRequestProxy> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::imgRequestProxy>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::imgRequestProxy> ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_open0_ProxyBehaviour_DefaultDelete_open1_ProxyBehaviour_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::ProxyBehaviour>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr<root::ProxyBehaviour> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::ProxyBehaviour>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr<root::ProxyBehaviour> ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_open0_ProxyBehaviour_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42856,84 +36405,84 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_344() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + fn __bindgen_test_layout_RefPtr_open0_ImageURL_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::image::ImageURL>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + root::RefPtr<root::mozilla::image::ImageURL> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::image::ImageURL>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); + root::RefPtr<root::mozilla::image::ImageURL> ) )); } #[test] - fn __bindgen_test_layout_nsMainThreadPtrHolder_instantiation_345() { - assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHolder<root::nsIURI>>() - , 40usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsILoadGroup_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsILoadGroup>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsMainThreadPtrHolder<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::nsMainThreadPtrHolder<root::nsIURI>>() + root::nsCOMPtr<root::nsILoadGroup> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsILoadGroup>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsMainThreadPtrHolder<root::nsIURI> ) )); + root::nsCOMPtr<root::nsILoadGroup> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_346() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + fn __bindgen_test_layout_RefPtr_open0_TabGroup_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::TabGroup>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + root::RefPtr<root::mozilla::dom::TabGroup> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::TabGroup>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); + root::RefPtr<root::mozilla::dom::TabGroup> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_347() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIEventTarget_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIEventTarget>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::nsCOMPtr<root::nsIEventTarget> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIEventTarget>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsCOMPtr<root::nsIEventTarget> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_348() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsMainThreadPtrHolder_open0_nsIURI_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHolder<root::nsIURI>>() + , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::nsMainThreadPtrHolder<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsMainThreadPtrHolder<root::nsIURI>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsMainThreadPtrHolder<root::nsIURI> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_349() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + fn __bindgen_test_layout_nsMainThreadPtrHandle_open0_nsIURI_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHandle<root::nsIURI>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + root::nsMainThreadPtrHandle<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsMainThreadPtrHandle<root::nsIURI>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); + root::nsMainThreadPtrHandle<root::nsIURI> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_350() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + fn __bindgen_test_layout_RefPtr_open0_URLExtraData_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::URLExtraData>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + root::RefPtr<root::mozilla::URLExtraData> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::URLExtraData>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); + root::RefPtr<root::mozilla::URLExtraData> ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_351() { + fn __bindgen_test_layout_nsPtrHashKey_open0_nsIDocument_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<root::nsIDocument>>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42944,29 +36493,73 @@ pub mod root { root::nsPtrHashKey<root::nsIDocument> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_352() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() + fn __bindgen_test_layout_nsTArray_open0_GridNamedArea_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::css::GridNamedArea>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::nsTArray<root::mozilla::css::GridNamedArea> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::css::GridNamedArea>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::nsTArray<root::mozilla::css::GridNamedArea> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_353() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_9() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); + root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_354() { + fn __bindgen_test_layout_nsTArray_open0_nsCSSValueGradientStop_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCSSValueGradientStop>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsCSSValueGradientStop> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCSSValueGradientStop>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsCSSValueGradientStop> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_11() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_12() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIURI>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIURI> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIPrincipal>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIPrincipal> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIPrincipal>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIPrincipal> ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_open0_nsCSSValueList_DefaultDelete_open1_nsCSSValueList_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValueList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42977,7 +36570,7 @@ pub mod root { root::mozilla::UniquePtr<root::nsCSSValueList> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_355() { + fn __bindgen_test_layout_DefaultDelete_open0_nsCSSValueList_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42988,7 +36581,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_356() { + fn __bindgen_test_layout_UniquePtr_open0_nsCSSValuePairList_DefaultDelete_open1_nsCSSValuePairList_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42999,27 +36592,29 @@ pub mod root { root::mozilla::UniquePtr<root::nsCSSValuePairList> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_357() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStringBuffer>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_nsCSSValuePairList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStringBuffer> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStringBuffer>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStringBuffer> ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_SupportsWeakPtr_instantiation_358() { - assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) - )); - assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_10() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_359() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_11() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43030,7 +36625,7 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_360() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_12() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43041,73 +36636,73 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_361() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_nsTArray_open0_nsStyleGradientStop_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleGradientStop>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::nsTArray<root::nsStyleGradientStop> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleGradientStop>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsTArray<root::nsStyleGradientStop> ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_362() { - assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_imgRequestProxy_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::imgRequestProxy>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 3usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 3usize]>() , 4usize , concat ! - ( + root::RefPtr<root::imgRequestProxy> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::imgRequestProxy>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 3usize] ) )); + root::RefPtr<root::imgRequestProxy> ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_363() { - assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_ImageValue_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::ImageValue>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 3usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 3usize]>() , 4usize , concat ! - ( + root::RefPtr<root::mozilla::css::ImageValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::ImageValue>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 3usize] ) )); + root::RefPtr<root::mozilla::css::ImageValue> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_364() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleImageRequest>>() + fn __bindgen_test_layout_RefPtr_open0_ImageTracker_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::ImageTracker>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleImageRequest> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleImageRequest>>() + root::RefPtr<root::mozilla::dom::ImageTracker> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::ImageTracker>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleImageRequest> ) )); + root::RefPtr<root::mozilla::dom::ImageTracker> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_365() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() + fn __bindgen_test_layout_RefPtr_open0_DocGroup_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DocGroup>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::RefPtr<root::mozilla::dom::DocGroup> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DocGroup>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::RefPtr<root::mozilla::dom::DocGroup> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_366() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + fn __bindgen_test_layout_nsCOMArray_open0_imgIContainer_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMArray>() , 8usize , concat + ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + root::nsCOMArray ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMArray>() , 8usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); + root::nsCOMArray ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_367() { + fn __bindgen_test_layout_UniquePtr_open0_nsStyleSides_DefaultDelete_open1_nsStyleSides_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsStyleSides>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43118,7 +36713,7 @@ pub mod root { root::mozilla::UniquePtr<root::nsStyleSides> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_368() { + fn __bindgen_test_layout_DefaultDelete_open0_nsStyleSides_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43129,7 +36724,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_369() { + fn __bindgen_test_layout_UniquePtr_open0_nsStyleSides_DefaultDelete_open1_nsStyleSides_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsStyleSides>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43140,29 +36735,29 @@ pub mod root { root::mozilla::UniquePtr<root::nsStyleSides> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_370() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_nsStyleSides_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_371() { - assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! - ( + fn __bindgen_test_layout_UniquePtr_open0_CachedBorderImageData_DefaultDelete_open1_CachedBorderImageData_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::CachedBorderImageData>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 3usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 3usize]>() , 4usize , concat ! - ( + root::mozilla::UniquePtr<root::CachedBorderImageData> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::CachedBorderImageData>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 3usize] ) )); + root::mozilla::UniquePtr<root::CachedBorderImageData> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_372() { + fn __bindgen_test_layout_DefaultDelete_open0_CachedBorderImageData_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43173,7 +36768,18 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_373() { + fn __bindgen_test_layout_UniquePtr_open0_nsStyleSides_DefaultDelete_open1_nsStyleSides_close1_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsStyleSides>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr<root::nsStyleSides> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsStyleSides>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr<root::nsStyleSides> ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_open0_nsStyleSides_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43184,18 +36790,20 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_pair_instantiation_374() { - assert_eq!(::std::mem::size_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>() - , 32usize , concat ! ( + fn __bindgen_test_layout_nsStyleAutoArray_open0_nsStyleImageLayers_Layer_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsStyleAutoArray<root::nsStyleImageLayers_Layer>>() + , 104usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); - assert_eq!(::std::mem::align_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>() + root::nsStyleAutoArray<root::nsStyleImageLayers_Layer> ) + )); + assert_eq!(::std::mem::align_of::<root::nsStyleAutoArray<root::nsStyleImageLayers_Layer>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); + root::nsStyleAutoArray<root::nsStyleImageLayers_Layer> ) + )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_375() { + fn __bindgen_test_layout_nsTArray_open0_pair_open1_nsString_nsString_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>>() , 8usize , concat ! ( @@ -43210,7 +36818,62 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_376() { + fn __bindgen_test_layout_pair_open0_nsString_nsString_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>() + , 32usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsTArray_open1_nsString_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsTArray<::nsstring::nsStringRepr>>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsTArray<::nsstring::nsStringRepr>> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsTArray<::nsstring::nsStringRepr>>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsTArray<::nsstring::nsStringRepr>> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_13() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsStyleCoord_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCoord>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsStyleCoord> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleCoord>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsStyleCoord> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsStyleCoord_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCoord>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsStyleCoord> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleCoord>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsStyleCoord> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_14() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43221,7 +36884,40 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_377() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_15() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_9() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIAtom> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsStyleCoord_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCoord>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsStyleCoord> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleCoord>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsStyleCoord> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsStyleCoord_close0_instantiation_4() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCoord>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43232,7 +36928,7 @@ pub mod root { root::nsTArray<root::nsStyleCoord> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_378() { + fn __bindgen_test_layout_nsTArray_open0_nsStyleCoord_close0_instantiation_5() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCoord>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43243,7 +36939,73 @@ pub mod root { root::nsTArray<root::nsStyleCoord> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_379() { + fn __bindgen_test_layout_RefPtr_open0_URLValue_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::URLValue>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::css::URLValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::URLValue>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::css::URLValue> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_nsStyleImageRequest_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsStyleImageRequest>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsStyleImageRequest> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsStyleImageRequest>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsStyleImageRequest> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_235361_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsISupports>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsISupports> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsISupports>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsISupports> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_ServoAttrSnapshot_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::ServoAttrSnapshot>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::ServoAttrSnapshot> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::ServoAttrSnapshot>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::ServoAttrSnapshot> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_PropertyValuePair_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::PropertyValuePair>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::PropertyValuePair> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::PropertyValuePair>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::PropertyValuePair> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_RawServoDeclarationBlock_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoDeclarationBlock>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::RawServoDeclarationBlock> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::RawServoDeclarationBlock>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::RawServoDeclarationBlock> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_RawServoAnimationValue_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoAnimationValue>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43254,7 +37016,7 @@ pub mod root { root::RefPtr<root::RawServoAnimationValue> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_380() { + fn __bindgen_test_layout_nsTArray_open0_PropertyValuePair_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::PropertyValuePair>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43265,7 +37027,7 @@ pub mod root { root::nsTArray<root::mozilla::PropertyValuePair> ) )); } #[test] - fn __bindgen_test_layout_nsStyleAutoArray_instantiation_381() { + fn __bindgen_test_layout_nsStyleAutoArray_open0_StyleAnimation_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsStyleAutoArray<root::mozilla::StyleAnimation>>() , 64usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43276,7 +37038,18 @@ pub mod root { root::nsStyleAutoArray<root::mozilla::StyleAnimation> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_382() { + fn __bindgen_test_layout_UniquePtr_open0_nsCSSValueList_DefaultDelete_open1_nsCSSValueList_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValueList>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr<root::nsCSSValueList> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsCSSValueList>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr<root::nsCSSValueList> ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_open0_nsCSSValueList_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43287,18 +37060,18 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_383() { - assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValueList>>() + fn __bindgen_test_layout_UniquePtr_open0_nsCSSValuePairList_DefaultDelete_open1_nsCSSValuePairList_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::UniquePtr<root::nsCSSValueList> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsCSSValueList>>() + root::mozilla::UniquePtr<root::nsCSSValuePairList> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::UniquePtr<root::nsCSSValueList> ) )); + root::mozilla::UniquePtr<root::nsCSSValuePairList> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_384() { + fn __bindgen_test_layout_DefaultDelete_open0_nsCSSValuePairList_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43309,29 +37082,31 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_385() { - assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList>>() + fn __bindgen_test_layout_RefPtr_open0_RawServoAnimationValue_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoAnimationValue>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::UniquePtr<root::nsCSSValuePairList> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList>>() + root::RefPtr<root::RawServoAnimationValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::RawServoAnimationValue>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::UniquePtr<root::nsCSSValuePairList> ) )); + root::RefPtr<root::RawServoAnimationValue> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_386() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_StyleSheet_close1_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_387() { + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_9() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43342,77 +37117,66 @@ pub mod root { root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_NonNull_instantiation_388() { - assert_eq!(::std::mem::size_of::<root::mozilla::dom::NonNull<root::mozilla::dom::Element>>() - , 16usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::dom::NonNull<root::mozilla::dom::Element> ) - )); - assert_eq!(::std::mem::align_of::<root::mozilla::dom::NonNull<root::mozilla::dom::Element>>() + fn __bindgen_test_layout_RefPtr_open0_RawServoStyleSheetContents_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoStyleSheetContents>>() , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::dom::NonNull<root::mozilla::dom::Element> ) - )); - } - #[test] - fn __bindgen_test_layout_NonNull_instantiation_389() { - assert_eq!(::std::mem::size_of::<root::mozilla::dom::NonNull<root::mozilla::dom::CSSPseudoElement>>() - , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::dom::NonNull<root::mozilla::dom::CSSPseudoElement> - ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::dom::NonNull<root::mozilla::dom::CSSPseudoElement>>() + root::RefPtr<root::RawServoStyleSheetContents> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::RawServoStyleSheetContents>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::dom::NonNull<root::mozilla::dom::CSSPseudoElement> - ) )); + root::RefPtr<root::RawServoStyleSheetContents> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_390() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_URLExtraData_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::URLExtraData>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::URLExtraData> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::URLExtraData>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::URLExtraData> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_391() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0_nsMediaQueryResultCacheKey_ExpressionEntry_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsMediaQueryResultCacheKey_ExpressionEntry>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsTArray<root::nsMediaQueryResultCacheKey_ExpressionEntry> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsMediaQueryResultCacheKey_ExpressionEntry>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsTArray<root::nsMediaQueryResultCacheKey_ExpressionEntry> + ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_392() { - assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat - ! ( + fn __bindgen_test_layout_nsTArray_open0_nsMediaQueryResultCacheKey_FeatureEntry_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsMediaQueryResultCacheKey_FeatureEntry>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 18usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 18usize]>() , 8usize , concat - ! ( + root::nsTArray<root::nsMediaQueryResultCacheKey_FeatureEntry> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsMediaQueryResultCacheKey_FeatureEntry>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 18usize] ) )); + root::nsTArray<root::nsMediaQueryResultCacheKey_FeatureEntry> + ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_393() { - assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat - ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation_6() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIPrincipal>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 18usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 18usize]>() , 8usize , concat - ! ( + root::nsCOMPtr<root::nsIPrincipal> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIPrincipal>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 18usize] ) )); + root::nsCOMPtr<root::nsIPrincipal> ) )); } #[test] - fn __bindgen_test_layout_BaseTimeDuration_instantiation_394() { + fn __bindgen_test_layout_BaseTimeDuration_open0_StickyTimeDurationValueCalculator_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::BaseTimeDuration>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43423,7 +37187,7 @@ pub mod root { root::mozilla::BaseTimeDuration ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_395() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_13() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIURI>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43434,40 +37198,106 @@ pub mod root { root::nsCOMPtr<root::nsIURI> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_396() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_243166_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsIContent>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_243171_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + root::nsTArray<*mut root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_397() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIContent_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIContent>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIContent>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIContent> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsICSSDeclaration_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsICSSDeclaration>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + root::nsCOMPtr<root::nsICSSDeclaration> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsICSSDeclaration>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::nsCOMPtr<root::nsICSSDeclaration> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_398() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() + fn __bindgen_test_layout_RefPtr_open0_DeclarationBlock_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::DeclarationBlock>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::nsIContent> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsIContent>>() + root::RefPtr<root::mozilla::DeclarationBlock> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::DeclarationBlock>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::nsIContent> ) )); + root::RefPtr<root::mozilla::DeclarationBlock> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_399() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIControllers_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIControllers>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIControllers> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIControllers>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIControllers> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_nsLabelsNodeList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsLabelsNodeList>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsLabelsNodeList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsLabelsNodeList>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsLabelsNodeList> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_ShadowRoot_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::ShadowRoot>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::ShadowRoot> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::ShadowRoot>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::ShadowRoot> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_ShadowRoot_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::ShadowRoot>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::ShadowRoot> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::ShadowRoot>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::ShadowRoot> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_243284_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43478,7 +37308,18 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_400() { + fn __bindgen_test_layout_RefPtr_open0_nsXBLBinding_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsXBLBinding>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsXBLBinding> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsXBLBinding>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsXBLBinding> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIContent_close0_instantiation_4() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43489,7 +37330,18 @@ pub mod root { root::nsCOMPtr<root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_401() { + fn __bindgen_test_layout_RefPtr_open0_CustomElementData_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::CustomElementData>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::CustomElementData> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::CustomElementData>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::CustomElementData> ) )); + } + #[test] + fn __bindgen_test_layout_nsRefPtrHashKey_open0_DOMIntersectionObserver_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::mozilla::dom::DOMIntersectionObserver>>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43502,201 +37354,213 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_402() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsISupports_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsISupports>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + root::nsCOMPtr<root::nsISupports> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsISupports>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); + root::nsCOMPtr<root::nsISupports> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_403() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsICSSDeclaration_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsICSSDeclaration>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + root::nsCOMPtr<root::nsICSSDeclaration> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsICSSDeclaration>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::nsCOMPtr<root::nsICSSDeclaration> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_404() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() + fn __bindgen_test_layout_RefPtr_open0_nsDOMAttributeMap_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsDOMAttributeMap>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect> - ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() + root::RefPtr<root::nsDOMAttributeMap> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsDOMAttributeMap>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect> - ) )); + root::RefPtr<root::nsDOMAttributeMap> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_405() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_nsContentList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsContentList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::nsContentList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsContentList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::nsContentList> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_406() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_nsDOMTokenList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsDOMTokenList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::nsDOMTokenList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsDOMTokenList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::nsDOMTokenList> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_407() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() + fn __bindgen_test_layout_UniquePtr_open0_FragmentOrElement_nsExtendedDOMSlots_DefaultDelete_open1_FragmentOrElement_nsExtendedDOMSlots_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::mozilla::dom::FragmentOrElement_nsExtendedDOMSlots>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::DOMRect> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() + root::mozilla::UniquePtr<root::mozilla::dom::FragmentOrElement_nsExtendedDOMSlots> + ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::mozilla::dom::FragmentOrElement_nsExtendedDOMSlots>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::DOMRect> ) )); + root::mozilla::UniquePtr<root::mozilla::dom::FragmentOrElement_nsExtendedDOMSlots> + ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_408() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_FragmentOrElement_nsExtendedDOMSlots_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_409() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_nsDOMAttributeMap_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsDOMAttributeMap>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::RefPtr<root::nsDOMAttributeMap> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsDOMAttributeMap>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::RefPtr<root::nsDOMAttributeMap> ) )); } #[test] - fn __bindgen_test_layout_Sequence_instantiation_410() { - assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) - )); - assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_DisplayItemClip_RoundedRect_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect> + ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_411() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0_DisplayItemClip_RoundedRect_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect> + ) )); } #[test] - fn __bindgen_test_layout_Sequence_instantiation_412() { - assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) - )); - assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsPoint_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsPoint>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsPoint> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsPoint>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsTArray<root::nsPoint> ) )); } #[test] - fn __bindgen_test_layout_Sequence_instantiation_413() { - assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_DOMRect_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::DOMRect>>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::RefPtr<root::mozilla::dom::DOMRect>> ) )); - assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::DOMRect>>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsTArray<root::RefPtr<root::mozilla::dom::DOMRect>> ) + )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_414() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_DOMRect_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::RefPtr<root::mozilla::dom::DOMRect> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::RefPtr<root::mozilla::dom::DOMRect> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_415() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsISupports_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsISupports>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsCOMPtr<root::nsISupports> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsISupports>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsCOMPtr<root::nsISupports> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_416() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_DOMRect_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::RefPtr<root::mozilla::dom::DOMRect> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::RefPtr<root::mozilla::dom::DOMRect> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_417() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_DOMRect_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::RefPtr<root::mozilla::dom::DOMRect> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::RefPtr<root::mozilla::dom::DOMRect> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_418() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_DOMRect_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::RefPtr<root::mozilla::dom::DOMRect> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::RefPtr<root::mozilla::dom::DOMRect> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_419() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_Element_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_420() { + fn __bindgen_test_layout_nsRefPtrHashKey_open0_Element_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::mozilla::dom::Element>>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43707,29 +37571,42 @@ pub mod root { root::nsRefPtrHashKey<root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_nsClassHashtable_instantiation_421() { - assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! - ( + fn __bindgen_test_layout_nsAutoPtr_open0_ExplicitChildIterator_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::mozilla::dom::ExplicitChildIterator>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 6usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 6usize]>() , 8usize , concat ! - ( + root::nsAutoPtr<root::mozilla::dom::ExplicitChildIterator> + ) )); + assert_eq!(::std::mem::align_of::<root::nsAutoPtr<root::mozilla::dom::ExplicitChildIterator>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 6usize] ) )); + root::nsAutoPtr<root::mozilla::dom::ExplicitChildIterator> + ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_422() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_244896_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsTArray<*mut root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_423() { + fn __bindgen_test_layout_RefPtr_open0_Element_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::Element> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_245058_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43740,7 +37617,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_424() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_245063_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43751,7 +37628,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_425() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_16() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43762,18 +37639,18 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_426() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsXBLBinding>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_RawServoMediaList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoMediaList>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::nsXBLBinding> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsXBLBinding>>() + root::RefPtr<root::RawServoMediaList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::RawServoMediaList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::nsXBLBinding> ) )); + root::RefPtr<root::RawServoMediaList> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_427() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_nsXBLBinding_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::nsXBLBinding>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43784,7 +37661,18 @@ pub mod root { root::nsTArray<root::RefPtr<root::nsXBLBinding>> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_428() { + fn __bindgen_test_layout_RefPtr_open0_nsXBLBinding_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsXBLBinding>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsXBLBinding> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsXBLBinding>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsXBLBinding> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_gfxFontFeature_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::gfxFontFeature>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43795,7 +37683,7 @@ pub mod root { root::nsTArray<root::gfxFontFeature> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_429() { + fn __bindgen_test_layout_nsTArray_open0_FontVariation_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::gfx::FontVariation>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43806,40 +37694,62 @@ pub mod root { root::nsTArray<root::mozilla::gfx::FontVariation> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_430() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::CSSValue>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_247114_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::CSSValue> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::CSSValue>>() + root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::CSSValue> ) )); + root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_431() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_247122_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_432() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_10() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIAtom>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr<root::nsIAtom> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsMediaExpression_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsMediaExpression>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() + root::nsTArray<root::nsMediaExpression> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsMediaExpression>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); + root::nsTArray<root::nsMediaExpression> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsAutoPtr_open1_nsMediaQuery_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsAutoPtr<root::nsMediaQuery>>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsAutoPtr<root::nsMediaQuery>> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsAutoPtr<root::nsMediaQuery>>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsAutoPtr<root::nsMediaQuery>> ) )); } #[test] - fn __bindgen_test_layout_nsAutoPtr_instantiation_433() { + fn __bindgen_test_layout_nsAutoPtr_open0_nsMediaQuery_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::nsMediaQuery>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( diff --git a/components/style/gecko/generated/structs_release.rs b/components/style/gecko/generated/structs_release.rs index 1bd450faae8..9a8144f55eb 100644 --- a/components/style/gecko/generated/structs_release.rs +++ b/components/style/gecko/generated/structs_release.rs @@ -1052,6 +1052,7 @@ pub mod root { } pub type pair_first_type<_T1> = _T1; pub type pair_second_type<_T2> = _T2; + pub type conditional_type<_If> = _If; #[repr(C)] #[derive(Debug, Copy)] pub struct input_iterator_tag { @@ -1071,40 +1072,113 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug, Copy)] + pub struct forward_iterator_tag { + pub _address: u8, + } + #[test] + fn bindgen_test_layout_forward_iterator_tag() { + assert_eq!(::std::mem::size_of::<forward_iterator_tag>() , 1usize + , concat ! ( + "Size of: " , stringify ! ( forward_iterator_tag ) )); + assert_eq! (::std::mem::align_of::<forward_iterator_tag>() , + 1usize , concat ! ( + "Alignment of " , stringify ! ( forward_iterator_tag ) + )); + } + impl Clone for forward_iterator_tag { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct bidirectional_iterator_tag { + pub _address: u8, + } + #[test] + fn bindgen_test_layout_bidirectional_iterator_tag() { + assert_eq!(::std::mem::size_of::<bidirectional_iterator_tag>() , + 1usize , concat ! ( + "Size of: " , stringify ! ( bidirectional_iterator_tag + ) )); + assert_eq! (::std::mem::align_of::<bidirectional_iterator_tag>() , + 1usize , concat ! ( + "Alignment of " , stringify ! ( + bidirectional_iterator_tag ) )); + } + impl Clone for bidirectional_iterator_tag { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct random_access_iterator_tag { + pub _address: u8, + } + #[test] + fn bindgen_test_layout_random_access_iterator_tag() { + assert_eq!(::std::mem::size_of::<random_access_iterator_tag>() , + 1usize , concat ! ( + "Size of: " , stringify ! ( random_access_iterator_tag + ) )); + assert_eq! (::std::mem::align_of::<random_access_iterator_tag>() , + 1usize , concat ! ( + "Alignment of " , stringify ! ( + random_access_iterator_tag ) )); + } + impl Clone for random_access_iterator_tag { + fn clone(&self) -> Self { *self } + } + #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct iterator { pub _address: u8, } - pub type iterator_iterator_category<_Category> = _Category; pub type iterator_value_type<_Tp> = _Tp; pub type iterator_difference_type<_Distance> = _Distance; pub type iterator_pointer<_Pointer> = _Pointer; pub type iterator_reference<_Reference> = _Reference; - #[repr(C)] - pub struct iterator_traits { - pub _address: u8, - } - #[repr(C)] - pub struct reverse_iterator<_Iterator> { - pub current: _Iterator, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iterator>>, - } - pub type reverse_iterator___traits_type = root::std::iterator_traits; - pub type reverse_iterator_iterator_type<_Iterator> = _Iterator; - pub type reverse_iterator_difference_type = - root::std::reverse_iterator___traits_type; - pub type reverse_iterator_pointer = - root::std::reverse_iterator___traits_type; - pub type reverse_iterator_reference = - root::std::reverse_iterator___traits_type; + pub type iterator_iterator_category<_Category> = _Category; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct atomic { } - } - pub mod __gnu_cxx { - #[allow(unused_imports)] - use self::super::super::root; + pub type atomic___base = u8; + pub type __bit_iterator_difference_type = [u8; 0usize]; + pub type __bit_iterator_value_type = bool; + pub type __bit_iterator_pointer = u8; + pub type __bit_iterator_reference = u8; + pub type __bit_iterator_iterator_category = + root::std::random_access_iterator_tag; + pub type __bit_iterator___storage_type = [u8; 0usize]; + pub type __bit_iterator___storage_pointer = [u8; 0usize]; + #[repr(C)] + pub struct __bit_const_reference { + pub __seg_: root::std::__bit_const_reference___storage_pointer, + pub __mask_: root::std::__bit_const_reference___storage_type, + } + pub type __bit_const_reference___storage_type = [u8; 0usize]; + pub type __bit_const_reference___storage_pointer = [u8; 0usize]; + pub type __bit_reference___storage_type = [u8; 0usize]; + pub type __bit_reference___storage_pointer = [u8; 0usize]; + pub type __bitset_difference_type = isize; + pub type __bitset_size_type = usize; + pub type __bitset___storage_type = root::std::__bitset_size_type; + pub type __bitset___self = u8; + pub type __bitset___storage_pointer = + *mut root::std::__bitset___storage_type; + pub type __bitset___const_storage_pointer = + *const root::std::__bitset___storage_type; + pub const __bitset___bits_per_word: ::std::os::raw::c_uint = 64; + pub type __bitset_reference = u8; + pub type __bitset_const_reference = root::std::__bit_const_reference; + pub type __bitset_iterator = u8; + pub type __bitset_const_iterator = u8; + extern "C" { + #[link_name = "__n_words"] + pub static bitset___n_words: ::std::os::raw::c_uint; + } + pub type bitset_base = u8; + pub type bitset_reference = root::std::bitset_base; + pub type bitset_const_reference = root::std::bitset_base; } pub mod mozilla { #[allow(unused_imports)] @@ -1124,7 +1198,9 @@ pub mod root { impl Clone for fallible_t { fn clone(&self) -> Self { *self } } - /** Convenient aliases. */ + pub type IntegralConstant_ValueType<T> = T; + pub type IntegralConstant_Type = u8; + /// Convenient aliases. pub type TrueType = u8; pub type FalseType = u8; pub mod detail { @@ -1282,12 +1358,10 @@ pub mod root { } #[repr(u16)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum StringClassFlags { FIXED = 1, } - /** - * LinkedList supports refcounted elements using this adapter class. Clients - * using LinkedList<RefPtr<T>> will get a data structure that holds a strong - * reference to T as long as T is in the list. - */ + pub enum StringClassFlags { FIXED = 1, NULL_TERMINATED = 2, } + /// LinkedList supports refcounted elements using this adapter class. Clients + /// using LinkedList<RefPtr<T>> will get a data structure that holds a strong + /// reference to T as long as T is in the list. #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct LinkedListElementTraits { @@ -1301,38 +1375,15 @@ pub mod root { #[derive(Debug, Copy, Clone)] pub struct WeakReference { } - #[repr(C)] - #[derive(Debug)] - pub struct MutexImpl { - pub platformData_: [*mut ::std::os::raw::c_void; 5usize], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct MutexImpl_PlatformData { - _unused: [u8; 0], - } - #[test] - fn bindgen_test_layout_MutexImpl() { - assert_eq!(::std::mem::size_of::<MutexImpl>() , 40usize , - concat ! ( "Size of: " , stringify ! ( MutexImpl ) - )); - assert_eq! (::std::mem::align_of::<MutexImpl>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( MutexImpl ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const MutexImpl ) ) . platformData_ - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( MutexImpl ) - , "::" , stringify ! ( platformData_ ) )); - } } + pub type Conditional_Type<A> = A; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum ArenaObjectID { eArenaObjectID_DummyBeforeFirstObjectID = 173, - eArenaObjectID_nsLineBox = 174, - eArenaObjectID_nsRuleNode = 175, - eArenaObjectID_GeckoStyleContext = 176, + eArenaObjectID_GeckoStyleContext = 174, + eArenaObjectID_nsLineBox = 175, + eArenaObjectID_nsRuleNode = 176, eArenaObjectID_DisplayItemData = 177, eArenaObjectID_nsInheritedStyleData = 178, eArenaObjectID_nsResetStyleData = 179, @@ -1371,19 +1422,17 @@ pub mod root { eArenaObjectID_nsStyleEffects = 212, eArenaObjectID_COUNT = 213, } - /** - * A default deletion policy using plain old operator delete. - * - * Note that this type can be specialized, but authors should beware of the risk - * that the specialization may at some point cease to match (either because it - * gets moved to a different compilation unit or the signature changes). If the - * non-specialized (|delete|-based) version compiles for that type but does the - * wrong thing, bad things could happen. - * - * This is a non-issue for types which are always incomplete (i.e. opaque handle - * types), since |delete|-ing such a type will always trigger a compilation - * error. - */ + /// A default deletion policy using plain old operator delete. + /// + /// Note that this type can be specialized, but authors should beware of the risk + /// that the specialization may at some point cease to match (either because it + /// gets moved to a different compilation unit or the signature changes). If the + /// non-specialized (|delete|-based) version compiles for that type but does the + /// wrong thing, bad things could happen. + /// + /// This is a non-issue for types which are always incomplete (i.e. opaque handle + /// types), since |delete|-ing such a type will always trigger a compilation + /// error. #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DefaultDelete { @@ -1399,6 +1448,12 @@ pub mod root { pub mCurrent: IteratorT, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<IteratorT>>, } + pub type Array_iterator<T> = *mut T; + pub type Array_const_iterator<T> = *mut T; + pub type Array_reverse_iterator<T> = + root::mozilla::ReverseIterator<T>; + pub type Array_const_reverse_iterator<T> = + root::mozilla::ReverseIterator<T>; pub mod css { #[allow(unused_imports)] use self::super::super::super::root; @@ -1497,36 +1552,34 @@ pub mod root { mErrorColNumber ) )); } #[repr(u8)] - /** - * Enum defining the mode in which a sheet is to be parsed. This is - * usually, but not always, the same as the cascade level at which the - * sheet will apply (see nsStyleSet.h). Most of the Loader APIs only - * support loading of author sheets. - * - * Author sheets are the normal case: styles embedded in or linked - * from HTML pages. They are also the most restricted. - * - * User sheets can do anything author sheets can do, and also get - * access to a few CSS extensions that are not yet suitable for - * exposure on the public Web, but are very useful for expressing - * user style overrides, such as @-moz-document rules. - * - * XXX: eUserSheetFeatures was added in bug 1035091, but some patches in - * that bug never landed to use this enum value. Currently, all the features - * in user sheet are also available in author sheet. - * - * Agent sheets have access to all author- and user-sheet features - * plus more extensions that are necessary for internal use but, - * again, not yet suitable for exposure on the public Web. Some of - * these are outright unsafe to expose; in particular, incorrect - * styling of anonymous box pseudo-elements can violate layout - * invariants. - * - * Agent sheets that do not use any unsafe rules could use - * eSafeAgentSheetFeatures when creating the sheet. This enum value allows - * Servo backend to recognize the sheets as the agent level, but Gecko - * backend will parse it under _author_ level. - */ + /// Enum defining the mode in which a sheet is to be parsed. This is + /// usually, but not always, the same as the cascade level at which the + /// sheet will apply (see nsStyleSet.h). Most of the Loader APIs only + /// support loading of author sheets. + /// + /// Author sheets are the normal case: styles embedded in or linked + /// from HTML pages. They are also the most restricted. + /// + /// User sheets can do anything author sheets can do, and also get + /// access to a few CSS extensions that are not yet suitable for + /// exposure on the public Web, but are very useful for expressing + /// user style overrides, such as @-moz-document rules. + /// + /// XXX: eUserSheetFeatures was added in bug 1035091, but some patches in + /// that bug never landed to use this enum value. Currently, all the features + /// in user sheet are also available in author sheet. + /// + /// Agent sheets have access to all author- and user-sheet features + /// plus more extensions that are necessary for internal use but, + /// again, not yet suitable for exposure on the public Web. Some of + /// these are outright unsafe to expose; in particular, incorrect + /// styling of anonymous box pseudo-elements can violate layout + /// invariants. + /// + /// Agent sheets that do not use any unsafe rules could use + /// eSafeAgentSheetFeatures when creating the sheet. This enum value allows + /// Servo backend to recognize the sheets as the agent level, but Gecko + /// backend will parse it under _author_ level. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum SheetParsingMode { eAuthorSheetFeatures = 0, @@ -1642,6 +1695,7 @@ pub mod root { ( "Alignment of " , stringify ! ( Rule ) )); } #[repr(C)] + #[derive(Debug)] pub struct Loader { pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub mSheets: root::nsAutoPtr<root::mozilla::css::Loader_Sheets>, @@ -2135,9 +2189,7 @@ pub mod root { ComplexColorValue ) , "::" , stringify ! ( mRefCnt ) )); } - /********************* - * Style sheet reuse * - *********************/ + /// Style sheet reuse * #[repr(C)] #[derive(Debug)] pub struct LoaderReusableStyleSheets { @@ -2166,16 +2218,9 @@ pub mod root { pub struct SheetLoadData { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ImportRule { - _unused: [u8; 0], - } #[repr(i32)] - /** - * Enum defining the type of URL matching function for a @-moz-document rule - * condition. - */ + /// Enum defining the type of URL matching function for a @-moz-document rule + /// condition. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum URLMatchingFunction { eURL = 0, @@ -2190,7 +2235,7 @@ pub mod root { } } #[repr(C)] - #[derive(Debug)] + #[derive(Debug, Copy)] pub struct ThreadSafeAutoRefCnt { pub mValue: u64, } @@ -2211,6 +2256,9 @@ pub mod root { ThreadSafeAutoRefCnt ) , "::" , stringify ! ( mValue ) )); } + impl Clone for ThreadSafeAutoRefCnt { + fn clone(&self) -> Self { *self } + } #[repr(C)] #[derive(Debug)] pub struct OwningNonNull<T> { @@ -2223,6 +2271,15 @@ pub mod root { pub mRawPtr: *mut T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } + pub type EnumeratedArray_ArrayType = u8; + pub type EnumeratedArray_iterator = + root::mozilla::EnumeratedArray_ArrayType; + pub type EnumeratedArray_const_iterator = + root::mozilla::EnumeratedArray_ArrayType; + pub type EnumeratedArray_reverse_iterator = + root::mozilla::EnumeratedArray_ArrayType; + pub type EnumeratedArray_const_reverse_iterator = + root::mozilla::EnumeratedArray_ArrayType; #[repr(C)] #[derive(Debug)] pub struct LinkedListElement { @@ -2265,87 +2322,15 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct AlignedStorage2 { - pub u: root::mozilla::AlignedStorage2_U, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AlignedStorage2_U { - pub mBytes: root::__BindgenUnionField<*mut ::std::os::raw::c_char>, - pub mDummy: root::__BindgenUnionField<u64>, - pub bindgen_union_field: u64, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct Maybe { } pub type Maybe_ValueType<T> = T; pub mod gfx { #[allow(unused_imports)] use self::super::super::super::root; - pub type IntRegion = [u64; 3usize]; pub type Float = f32; #[repr(C)] #[derive(Debug, Copy)] - pub struct Color { - pub _bindgen_opaque_blob: [u32; 4usize], - } - #[test] - fn bindgen_test_layout_Color() { - assert_eq!(::std::mem::size_of::<Color>() , 16usize , concat ! - ( "Size of: " , stringify ! ( Color ) )); - assert_eq! (::std::mem::align_of::<Color>() , 4usize , concat - ! ( "Alignment of " , stringify ! ( Color ) )); - } - impl Clone for Color { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct PointTyped { - } - pub type PointTyped_Coord = u8; - pub type PointTyped_Super = u8; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SizeTyped { - } - pub type SizeTyped_Super = u8; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct IntPointTyped { - } - pub type IntPointTyped_ToInt = u32; - pub type IntPointTyped_Coord = u8; - pub type IntPointTyped_Super = u8; - pub type IntPoint = [u32; 2usize]; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct IntSizeTyped { - } - pub type IntSizeTyped_ToInt = u32; - pub type IntSizeTyped_Super = u8; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct RectTyped { - } - pub type RectTyped_Super = u8; - pub type IntMargin = [u32; 4usize]; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct MarginTyped { - } - pub type MarginTyped_Super = u8; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct IntRectTyped { - } - pub type IntRectTyped_Super = u8; - pub type IntRectTyped_Self = u8; - pub type IntRectTyped_ToInt = u32; - pub type IntRect = [u32; 4usize]; - #[repr(C)] - #[derive(Debug, Copy)] pub struct FontVariation { pub mTag: u32, pub mValue: f32, @@ -2376,1012 +2361,18 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct ScaleFactor { - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ScaleFactors2D { - } - pub type Matrix4x4 = [u32; 16usize]; - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct SourceSurface { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DrawTarget { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Path { - _unused: [u8; 0], - } } pub mod layers { #[allow(unused_imports)] use self::super::super::super::root; - /** - * The viewport and displayport metrics for the painted frame at the - * time of a layer-tree transaction. These metrics are especially - * useful for shadow layers, because the metrics values are updated - * atomically with new pixels. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct FrameMetrics { - pub mScrollId: root::mozilla::layers::FrameMetrics_ViewID, - pub mPresShellResolution: f32, - pub mCompositionBounds: root::mozilla::ParentLayerRect, - pub mDisplayPort: root::mozilla::CSSRect, - pub mCriticalDisplayPort: root::mozilla::CSSRect, - pub mScrollableRect: root::mozilla::CSSRect, - pub mCumulativeResolution: root::mozilla::LayoutDeviceToLayerScale2D, - pub mDevPixelsPerCSSPixel: root::mozilla::CSSToLayoutDeviceScale, - pub mScrollOffset: root::mozilla::CSSPoint, - pub mZoom: root::mozilla::CSSToParentLayerScale2D, - pub mScrollGeneration: u32, - pub mSmoothScrollOffset: root::mozilla::CSSPoint, - pub mRootCompositionSize: root::mozilla::CSSSize, - pub mDisplayPortMargins: root::mozilla::ScreenMargin, - pub mPresShellId: u32, - pub mViewport: root::mozilla::CSSRect, - pub mExtraResolution: root::mozilla::ScreenToLayerScale2D, - pub mPaintRequestTime: root::mozilla::TimeStamp, - pub mScrollUpdateType: root::mozilla::layers::FrameMetrics_ScrollOffsetUpdateType, - pub _bitfield_1: u8, - pub __bindgen_padding_0: [u16; 3usize], - } - pub type FrameMetrics_ViewID = u64; - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum FrameMetrics_ScrollOffsetUpdateType { - eNone = 0, - eMainThread = 1, - ePending = 2, - eUserAction = 3, - eRestore = 4, - } - extern "C" { - #[link_name = - "_ZN7mozilla6layers12FrameMetrics14NULL_SCROLL_IDE"] - pub static FrameMetrics_NULL_SCROLL_ID: - root::mozilla::layers::FrameMetrics_ViewID; - } - pub const FrameMetrics_START_SCROLL_ID: - root::mozilla::layers::FrameMetrics_ViewID = - 2; - pub const FrameMetrics_sScrollOffsetUpdateTypeCount: usize = 5; - extern "C" { - #[link_name = - "_ZN7mozilla6layers12FrameMetrics30sHighestScrollOffsetUpdateTypeE"] - pub static FrameMetrics_sHighestScrollOffsetUpdateType: - root::mozilla::layers::FrameMetrics_ScrollOffsetUpdateType; - } - #[test] - fn bindgen_test_layout_FrameMetrics() { - assert_eq!(::std::mem::size_of::<FrameMetrics>() , 184usize , - concat ! ( - "Size of: " , stringify ! ( FrameMetrics ) )); - assert_eq! (::std::mem::align_of::<FrameMetrics>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( FrameMetrics ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . mScrollId - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( mScrollId ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mPresShellResolution as * const _ as usize } , - 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mPresShellResolution ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mCompositionBounds as * const _ as usize } , - 12usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mCompositionBounds ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mDisplayPort as * const _ as usize } , 28usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( mDisplayPort - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mCriticalDisplayPort as * const _ as usize } , - 44usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mCriticalDisplayPort ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mScrollableRect as * const _ as usize } , 60usize - , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mScrollableRect ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mCumulativeResolution as * const _ as usize } , - 76usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mCumulativeResolution ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mDevPixelsPerCSSPixel as * const _ as usize } , - 84usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mDevPixelsPerCSSPixel ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mScrollOffset as * const _ as usize } , 88usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mScrollOffset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . mZoom as * - const _ as usize } , 96usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( mZoom ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mScrollGeneration as * const _ as usize } , - 104usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mScrollGeneration ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mSmoothScrollOffset as * const _ as usize } , - 108usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mSmoothScrollOffset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mRootCompositionSize as * const _ as usize } , - 116usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mRootCompositionSize ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mDisplayPortMargins as * const _ as usize } , - 124usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mDisplayPortMargins ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mPresShellId as * const _ as usize } , 140usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( mPresShellId - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . mViewport - as * const _ as usize } , 144usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( mViewport ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mExtraResolution as * const _ as usize } , - 160usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mExtraResolution ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mPaintRequestTime as * const _ as usize } , - 168usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mPaintRequestTime ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FrameMetrics ) ) . - mScrollUpdateType as * const _ as usize } , - 176usize , concat ! ( - "Alignment of field: " , stringify ! ( - FrameMetrics ) , "::" , stringify ! ( - mScrollUpdateType ) )); - } - impl Clone for FrameMetrics { - fn clone(&self) -> Self { *self } - } - impl FrameMetrics { - #[inline] - pub fn mIsRootContent(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 1u64 as u8; - let val = (unit_field_val & mask) >> 0usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsRootContent(&mut self, val: bool) { - let mask = 1u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 0usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mDoSmoothScroll(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 2u64 as u8; - let val = (unit_field_val & mask) >> 1usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mDoSmoothScroll(&mut self, val: bool) { - let mask = 2u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 1usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mUseDisplayPortMargins(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 4u64 as u8; - let val = (unit_field_val & mask) >> 2usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mUseDisplayPortMargins(&mut self, val: bool) { - let mask = 4u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 2usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mIsScrollInfoLayer(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 8u64 as u8; - let val = (unit_field_val & mask) >> 3usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsScrollInfoLayer(&mut self, val: bool) { - let mask = 8u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 3usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn new_bitfield_1(mIsRootContent: bool, - mDoSmoothScroll: bool, - mUseDisplayPortMargins: bool, - mIsScrollInfoLayer: bool) -> u8 { - ({ - ({ - ({ - ({ 0 } | - ((mIsRootContent as u8 as u8) << - 0usize) & (1u64 as u8)) - } | - ((mDoSmoothScroll as u8 as u8) << 1usize) & - (2u64 as u8)) - } | - ((mUseDisplayPortMargins as u8 as u8) << 2usize) - & (4u64 as u8)) - } | - ((mIsScrollInfoLayer as u8 as u8) << 3usize) & - (8u64 as u8)) - } - } - #[repr(C)] - #[derive(Debug)] - pub struct ScrollSnapInfo { - pub mScrollSnapTypeX: u8, - pub mScrollSnapTypeY: u8, - pub mScrollSnapIntervalX: [u32; 2usize], - pub mScrollSnapIntervalY: [u32; 2usize], - pub mScrollSnapDestination: root::nsPoint, - pub mScrollSnapCoordinates: root::nsTArray<root::nsPoint>, - } - #[test] - fn bindgen_test_layout_ScrollSnapInfo() { - assert_eq!(::std::mem::size_of::<ScrollSnapInfo>() , 40usize , - concat ! ( - "Size of: " , stringify ! ( ScrollSnapInfo ) )); - assert_eq! (::std::mem::align_of::<ScrollSnapInfo>() , 8usize - , concat ! ( - "Alignment of " , stringify ! ( ScrollSnapInfo ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollSnapInfo ) ) . - mScrollSnapTypeX as * const _ as usize } , 0usize - , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollSnapInfo ) , "::" , stringify ! ( - mScrollSnapTypeX ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollSnapInfo ) ) . - mScrollSnapTypeY as * const _ as usize } , 1usize - , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollSnapInfo ) , "::" , stringify ! ( - mScrollSnapTypeY ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollSnapInfo ) ) . - mScrollSnapIntervalX as * const _ as usize } , - 4usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollSnapInfo ) , "::" , stringify ! ( - mScrollSnapIntervalX ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollSnapInfo ) ) . - mScrollSnapIntervalY as * const _ as usize } , - 12usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollSnapInfo ) , "::" , stringify ! ( - mScrollSnapIntervalY ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollSnapInfo ) ) . - mScrollSnapDestination as * const _ as usize } , - 20usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollSnapInfo ) , "::" , stringify ! ( - mScrollSnapDestination ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollSnapInfo ) ) . - mScrollSnapCoordinates as * const _ as usize } , - 32usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollSnapInfo ) , "::" , stringify ! ( - mScrollSnapCoordinates ) )); - } - /** - * A clip that applies to a layer, that may be scrolled by some of the - * scroll frames associated with the layer. - */ - #[repr(C)] - #[derive(Debug)] - pub struct LayerClip { - pub mClipRect: root::mozilla::ParentLayerIntRect, - pub mMaskLayerIndex: [u64; 2usize], - } - #[test] - fn bindgen_test_layout_LayerClip() { - assert_eq!(::std::mem::size_of::<LayerClip>() , 32usize , - concat ! ( "Size of: " , stringify ! ( LayerClip ) - )); - assert_eq! (::std::mem::align_of::<LayerClip>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( LayerClip ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const LayerClip ) ) . mClipRect as - * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( LayerClip ) - , "::" , stringify ! ( mClipRect ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const LayerClip ) ) . - mMaskLayerIndex as * const _ as usize } , 16usize - , concat ! ( - "Alignment of field: " , stringify ! ( LayerClip ) - , "::" , stringify ! ( mMaskLayerIndex ) )); - } - /** - * Metadata about a scroll frame that's stored in the layer tree for use by - * the compositor (including APZ). This includes the scroll frame's FrameMetrics, - * as well as other metadata. We don't put the other metadata into FrameMetrics - * to avoid FrameMetrics becoming too bloated (as a FrameMetrics is e.g. sent - * over IPC for every repaint request for every active scroll frame). - */ - #[repr(C)] - #[derive(Debug)] - pub struct ScrollMetadata { - pub mMetrics: root::mozilla::layers::FrameMetrics, - pub mSnapInfo: root::mozilla::layers::ScrollSnapInfo, - pub mScrollParentId: root::mozilla::layers::ScrollMetadata_ViewID, - pub mBackgroundColor: root::mozilla::gfx::Color, - pub mContentDescription: root::nsCString, - pub mLineScrollAmount: root::mozilla::LayoutDeviceIntSize, - pub mPageScrollAmount: root::mozilla::LayoutDeviceIntSize, - pub mScrollClip: [u64; 5usize], - pub _bitfield_1: u8, - pub __bindgen_padding_0: [u8; 7usize], - } - pub type ScrollMetadata_ViewID = - root::mozilla::layers::FrameMetrics_ViewID; - extern "C" { - #[link_name = - "_ZN7mozilla6layers14ScrollMetadata13sNullMetadataE"] - pub static mut ScrollMetadata_sNullMetadata: - root::mozilla::StaticAutoPtr<root::mozilla::layers::ScrollMetadata>; - } - #[test] - fn bindgen_test_layout_ScrollMetadata() { - assert_eq!(::std::mem::size_of::<ScrollMetadata>() , 328usize - , concat ! ( - "Size of: " , stringify ! ( ScrollMetadata ) )); - assert_eq! (::std::mem::align_of::<ScrollMetadata>() , 8usize - , concat ! ( - "Alignment of " , stringify ! ( ScrollMetadata ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . mMetrics - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( mMetrics ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mSnapInfo as * const _ as usize } , 184usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( mSnapInfo - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mScrollParentId as * const _ as usize } , 224usize - , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( - mScrollParentId ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mBackgroundColor as * const _ as usize } , - 232usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( - mBackgroundColor ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mContentDescription as * const _ as usize } , - 248usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( - mContentDescription ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mLineScrollAmount as * const _ as usize } , - 264usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( - mLineScrollAmount ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mPageScrollAmount as * const _ as usize } , - 272usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( - mPageScrollAmount ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollMetadata ) ) . - mScrollClip as * const _ as usize } , 280usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ScrollMetadata ) , "::" , stringify ! ( - mScrollClip ) )); - } - impl ScrollMetadata { - #[inline] - pub fn mHasScrollgrab(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 1u64 as u8; - let val = (unit_field_val & mask) >> 0usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mHasScrollgrab(&mut self, val: bool) { - let mask = 1u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 0usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mAllowVerticalScrollWithWheel(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 2u64 as u8; - let val = (unit_field_val & mask) >> 1usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mAllowVerticalScrollWithWheel(&mut self, - val: bool) { - let mask = 2u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 1usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mIsLayersIdRoot(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 4u64 as u8; - let val = (unit_field_val & mask) >> 2usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsLayersIdRoot(&mut self, val: bool) { - let mask = 4u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 2usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mUsesContainerScrolling(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 8u64 as u8; - let val = (unit_field_val & mask) >> 3usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mUsesContainerScrolling(&mut self, val: bool) { - let mask = 8u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 3usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mForceDisableApz(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 16u64 as u8; - let val = (unit_field_val & mask) >> 4usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mForceDisableApz(&mut self, val: bool) { - let mask = 16u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as - *const _ as - *const u8, - &mut unit_field_val as - *mut u8 as - *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 4usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as - *const _ as - *const u8, - &mut self._bitfield_1 - as *mut _ as - *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn new_bitfield_1(mHasScrollgrab: bool, - mAllowVerticalScrollWithWheel: bool, - mIsLayersIdRoot: bool, - mUsesContainerScrolling: bool, - mForceDisableApz: bool) -> u8 { - ({ - ({ - ({ - ({ - ({ 0 } | - ((mHasScrollgrab as u8 as u8) << - 0usize) & (1u64 as u8)) - } | - ((mAllowVerticalScrollWithWheel as u8 - as u8) << 1usize) & - (2u64 as u8)) - } | - ((mIsLayersIdRoot as u8 as u8) << 2usize) & - (4u64 as u8)) - } | - ((mUsesContainerScrolling as u8 as u8) << - 3usize) & (8u64 as u8)) - } | - ((mForceDisableApz as u8 as u8) << 4usize) & - (16u64 as u8)) - } - } - /** - * This class is used for communicating information about the currently focused - * element of a document and the scrollable frames to use when keyboard scrolling - * it. It is created on the main thread at paint-time, but is then passed over - * IPC to the compositor/APZ code. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct FocusTarget { - pub mSequenceNumber: u64, - pub mFocusHasKeyEventListeners: bool, - pub mType: root::mozilla::layers::FocusTarget_FocusTargetType, - pub mData: root::mozilla::layers::FocusTarget_FocusTargetData, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct FocusTarget_ScrollTargets { - pub mHorizontal: root::mozilla::layers::FrameMetrics_ViewID, - pub mVertical: root::mozilla::layers::FrameMetrics_ViewID, - } - #[test] - fn bindgen_test_layout_FocusTarget_ScrollTargets() { - assert_eq!(::std::mem::size_of::<FocusTarget_ScrollTargets>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - FocusTarget_ScrollTargets ) )); - assert_eq! (::std::mem::align_of::<FocusTarget_ScrollTargets>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - FocusTarget_ScrollTargets ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget_ScrollTargets ) ) - . mHorizontal as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FocusTarget_ScrollTargets ) , "::" , stringify ! ( - mHorizontal ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget_ScrollTargets ) ) - . mVertical as * const _ as usize } , 8usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FocusTarget_ScrollTargets ) , "::" , stringify ! ( - mVertical ) )); - } - impl Clone for FocusTarget_ScrollTargets { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum FocusTarget_FocusTargetType { - eNone = 0, - eRefLayer = 1, - eScrollLayer = 2, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct FocusTarget_FocusTargetData { - pub mRefLayerId: root::__BindgenUnionField<u64>, - pub mScrollTargets: root::__BindgenUnionField<root::mozilla::layers::FocusTarget_ScrollTargets>, - pub bindgen_union_field: [u64; 2usize], - } - #[test] - fn bindgen_test_layout_FocusTarget_FocusTargetData() { - assert_eq!(::std::mem::size_of::<FocusTarget_FocusTargetData>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - FocusTarget_FocusTargetData ) )); - assert_eq! (::std::mem::align_of::<FocusTarget_FocusTargetData>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - FocusTarget_FocusTargetData ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget_FocusTargetData ) - ) . mRefLayerId as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FocusTarget_FocusTargetData ) , "::" , stringify ! - ( mRefLayerId ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget_FocusTargetData ) - ) . mScrollTargets as * const _ as usize } , - 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - FocusTarget_FocusTargetData ) , "::" , stringify ! - ( mScrollTargets ) )); - } - impl Clone for FocusTarget_FocusTargetData { - fn clone(&self) -> Self { *self } - } - pub const FocusTarget_sFocusTargetTypeCount: usize = 3; - extern "C" { - #[link_name = - "_ZN7mozilla6layers11FocusTarget23sHighestFocusTargetTypeE"] - pub static FocusTarget_sHighestFocusTargetType: - root::mozilla::layers::FocusTarget_FocusTargetType; - } - #[test] - fn bindgen_test_layout_FocusTarget() { - assert_eq!(::std::mem::size_of::<FocusTarget>() , 32usize , - concat ! ( - "Size of: " , stringify ! ( FocusTarget ) )); - assert_eq! (::std::mem::align_of::<FocusTarget>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( FocusTarget ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget ) ) . - mSequenceNumber as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( FocusTarget - ) , "::" , stringify ! ( mSequenceNumber ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget ) ) . - mFocusHasKeyEventListeners as * const _ as usize } - , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( FocusTarget - ) , "::" , stringify ! ( - mFocusHasKeyEventListeners ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget ) ) . mType as * - const _ as usize } , 12usize , concat ! ( - "Alignment of field: " , stringify ! ( FocusTarget - ) , "::" , stringify ! ( mType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FocusTarget ) ) . mData as * - const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( FocusTarget - ) , "::" , stringify ! ( mData ) )); - } - impl Clone for FocusTarget { - fn clone(&self) -> Self { *self } - } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct LayerManager { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ContainerLayer { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Layer { - _unused: [u8; 0], - } } pub mod dom { #[allow(unused_imports)] @@ -3409,106 +2400,6 @@ pub mod root { #[allow(unused_imports)] use self::super::super::super::super::root; #[repr(C)] - #[derive(Debug)] - pub struct FastErrorResult { - pub _base: root::mozilla::binding_danger::TErrorResult, - } - #[test] - fn bindgen_test_layout_FastErrorResult() { - assert_eq!(::std::mem::size_of::<FastErrorResult>() , - 16usize , concat ! ( - "Size of: " , stringify ! ( FastErrorResult ) - )); - assert_eq! (::std::mem::align_of::<FastErrorResult>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( - FastErrorResult ) )); - } - #[repr(C)] - pub struct FakeString { - pub mData: *mut root::mozilla::detail::nsStringRepr_char_type, - pub mLength: root::mozilla::detail::nsStringRepr_size_type, - pub mDataFlags: root::mozilla::detail::nsStringRepr_DataFlags, - pub mClassFlags: root::mozilla::detail::nsStringRepr_ClassFlags, - pub mInlineStorage: [root::mozilla::detail::nsStringRepr_char_type; 64usize], - } - #[repr(C)] - #[derive(Debug)] - pub struct FakeString_StringAsserter { - pub _base: ::nsstring::nsStringRepr, - } - #[test] - fn bindgen_test_layout_FakeString_StringAsserter() { - assert_eq!(::std::mem::size_of::<FakeString_StringAsserter>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - FakeString_StringAsserter ) )); - assert_eq! (::std::mem::align_of::<FakeString_StringAsserter>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - FakeString_StringAsserter ) )); - } - pub const FakeString_sInlineCapacity: usize = 64; - #[test] - fn bindgen_test_layout_FakeString() { - assert_eq!(::std::mem::size_of::<FakeString>() , 144usize - , concat ! ( - "Size of: " , stringify ! ( FakeString ) )); - assert_eq! (::std::mem::align_of::<FakeString>() , 8usize - , concat ! ( - "Alignment of " , stringify ! ( FakeString ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const FakeString ) ) . mData as - * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - FakeString ) , "::" , stringify ! ( mData ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const FakeString ) ) . mLength - as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - FakeString ) , "::" , stringify ! ( mLength ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const FakeString ) ) . - mDataFlags as * const _ as usize } , 12usize , - concat ! ( - "Alignment of field: " , stringify ! ( - FakeString ) , "::" , stringify ! ( mDataFlags - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FakeString ) ) . - mClassFlags as * const _ as usize } , 14usize - , concat ! ( - "Alignment of field: " , stringify ! ( - FakeString ) , "::" , stringify ! ( - mClassFlags ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const FakeString ) ) . - mInlineStorage as * const _ as usize } , - 16usize , concat ! ( - "Alignment of field: " , stringify ! ( - FakeString ) , "::" , stringify ! ( - mInlineStorage ) )); - } - #[repr(C)] - #[derive(Debug)] - pub struct FastElementCreationOptions { - pub _base: root::mozilla::dom::ElementCreationOptions, - } - #[test] - fn bindgen_test_layout_FastElementCreationOptions() { - assert_eq!(::std::mem::size_of::<FastElementCreationOptions>() - , 56usize , concat ! ( - "Size of: " , stringify ! ( - FastElementCreationOptions ) )); - assert_eq! (::std::mem::align_of::<FastElementCreationOptions>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - FastElementCreationOptions ) )); - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct RecordEntry<KeyType, ValueType> { pub mKey: KeyType, @@ -3517,127 +2408,6 @@ pub mod root { pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<ValueType>>, } } - /** - * A class for representing string return values. This can be either passed to - * callees that have an nsString or nsAString out param or passed to a callee - * that actually knows about this class and can work with it. Such a callee may - * call SetStringBuffer or SetEphemeralStringBuffer or SetOwnedString or - * SetOwnedAtom on this object. It's only OK to call - * SetStringBuffer/SetOwnedString/SetOwnedAtom if the caller of the method in - * question plans to keep holding a strong ref to the stringbuffer involved, - * whether it's a raw nsStringBuffer, or stored inside the string or atom being - * passed. In the string/atom cases that means the caller must own the string - * or atom, and not mutate it (in the string case) for the lifetime of the - * DOMString. - * - * The proper way to store a value in this class is to either to do nothing - * (which leaves this as an empty string), to call - * SetStringBuffer/SetEphemeralStringBuffer with a non-null stringbuffer, to - * call SetOwnedString, to call SetOwnedAtom, to call SetNull(), or to call - * AsAString() and set the value in the resulting nsString. These options are - * mutually exclusive! Don't do more than one of them. - * - * The proper way to extract a value is to check IsNull(). If not null, then - * check HasStringBuffer(). If that's true, check for a zero length, and if the - * length is nonzero call StringBuffer(). If the length is zero this is the - * empty string. If HasStringBuffer() returns false, call AsAString() and get - * the value from that. - */ - #[repr(C)] - #[derive(Debug)] - pub struct DOMString { - pub mString: [u64; 21usize], - pub mStringBuffer: *mut root::nsStringBuffer, - pub mLength: u32, - pub mIsNull: bool, - pub mStringBufferOwned: bool, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum DOMString_NullHandling { - eTreatNullAsNull = 0, - eTreatNullAsEmpty = 1, - eNullNotExpected = 2, - } - #[test] - fn bindgen_test_layout_DOMString() { - assert_eq!(::std::mem::size_of::<DOMString>() , 184usize , - concat ! ( "Size of: " , stringify ! ( DOMString ) - )); - assert_eq! (::std::mem::align_of::<DOMString>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( DOMString ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DOMString ) ) . mString as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( DOMString ) - , "::" , stringify ! ( mString ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DOMString ) ) . mStringBuffer - as * const _ as usize } , 168usize , concat ! ( - "Alignment of field: " , stringify ! ( DOMString ) - , "::" , stringify ! ( mStringBuffer ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DOMString ) ) . mLength as * - const _ as usize } , 176usize , concat ! ( - "Alignment of field: " , stringify ! ( DOMString ) - , "::" , stringify ! ( mLength ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DOMString ) ) . mIsNull as * - const _ as usize } , 180usize , concat ! ( - "Alignment of field: " , stringify ! ( DOMString ) - , "::" , stringify ! ( mIsNull ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DOMString ) ) . - mStringBufferOwned as * const _ as usize } , - 181usize , concat ! ( - "Alignment of field: " , stringify ! ( DOMString ) - , "::" , stringify ! ( mStringBufferOwned ) )); - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct DictionaryBase { - pub mIsAnyMemberPresent: bool, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct DictionaryBase_FastDictionaryInitializer { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_DictionaryBase_FastDictionaryInitializer() { - assert_eq!(::std::mem::size_of::<DictionaryBase_FastDictionaryInitializer>() - , 1usize , concat ! ( - "Size of: " , stringify ! ( - DictionaryBase_FastDictionaryInitializer ) )); - assert_eq! (::std::mem::align_of::<DictionaryBase_FastDictionaryInitializer>() - , 1usize , concat ! ( - "Alignment of " , stringify ! ( - DictionaryBase_FastDictionaryInitializer ) )); - } - impl Clone for DictionaryBase_FastDictionaryInitializer { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_DictionaryBase() { - assert_eq!(::std::mem::size_of::<DictionaryBase>() , 1usize , - concat ! ( - "Size of: " , stringify ! ( DictionaryBase ) )); - assert_eq! (::std::mem::align_of::<DictionaryBase>() , 1usize - , concat ! ( - "Alignment of " , stringify ! ( DictionaryBase ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const DictionaryBase ) ) . - mIsAnyMemberPresent as * const _ as usize } , - 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - DictionaryBase ) , "::" , stringify ! ( - mIsAnyMemberPresent ) )); - } - impl Clone for DictionaryBase { - fn clone(&self) -> Self { *self } - } #[repr(C)] #[derive(Debug, Copy)] pub struct AllOwningUnionBase { @@ -3697,141 +2467,18 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct Optional { - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct NonNull<T> { - pub ptr: *mut T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct Sequence { } #[repr(C)] - #[derive(Debug, Copy)] - pub struct ParentObject { - pub mObject: *const root::nsISupports, - pub mWrapperCache: *const root::nsWrapperCache, - pub mUseXBLScope: bool, - } - #[test] - fn bindgen_test_layout_ParentObject() { - assert_eq!(::std::mem::size_of::<ParentObject>() , 24usize , - concat ! ( - "Size of: " , stringify ! ( ParentObject ) )); - assert_eq! (::std::mem::align_of::<ParentObject>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( ParentObject ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ParentObject ) ) . mObject as - * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - ParentObject ) , "::" , stringify ! ( mObject ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ParentObject ) ) . - mWrapperCache as * const _ as usize } , 8usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ParentObject ) , "::" , stringify ! ( - mWrapperCache ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ParentObject ) ) . - mUseXBLScope as * const _ as usize } , 16usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ParentObject ) , "::" , stringify ! ( mUseXBLScope - ) )); - } - impl Clone for ParentObject { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Nullable { } - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum CSSStyleSheetParsingMode { - Author = 0, - User = 1, - Agent = 2, - EndGuard_ = 3, - } - #[repr(C)] - #[derive(Debug)] - pub struct OriginAttributesDictionary { - pub _base: root::mozilla::dom::DictionaryBase, - pub mAppId: u32, - pub mFirstPartyDomain: ::nsstring::nsStringRepr, - pub mInIsolatedMozBrowser: bool, - pub mPrivateBrowsingId: u32, - pub mUserContextId: u32, - } - #[test] - fn bindgen_test_layout_OriginAttributesDictionary() { - assert_eq!(::std::mem::size_of::<OriginAttributesDictionary>() - , 40usize , concat ! ( - "Size of: " , stringify ! ( - OriginAttributesDictionary ) )); - assert_eq! (::std::mem::align_of::<OriginAttributesDictionary>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - OriginAttributesDictionary ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OriginAttributesDictionary ) - ) . mAppId as * const _ as usize } , 4usize , - concat ! ( - "Alignment of field: " , stringify ! ( - OriginAttributesDictionary ) , "::" , stringify ! - ( mAppId ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OriginAttributesDictionary ) - ) . mFirstPartyDomain as * const _ as usize } , - 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - OriginAttributesDictionary ) , "::" , stringify ! - ( mFirstPartyDomain ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OriginAttributesDictionary ) - ) . mInIsolatedMozBrowser as * const _ as usize } - , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( - OriginAttributesDictionary ) , "::" , stringify ! - ( mInIsolatedMozBrowser ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OriginAttributesDictionary ) - ) . mPrivateBrowsingId as * const _ as usize } , - 28usize , concat ! ( - "Alignment of field: " , stringify ! ( - OriginAttributesDictionary ) , "::" , stringify ! - ( mPrivateBrowsingId ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OriginAttributesDictionary ) - ) . mUserContextId as * const _ as usize } , - 32usize , concat ! ( - "Alignment of field: " , stringify ! ( - OriginAttributesDictionary ) , "::" , stringify ! - ( mUserContextId ) )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Promise { - _unused: [u8; 0], - } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CSSImportRule { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct CSSRuleList { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug)] pub struct MediaList { pub _base: root::nsIDOMMediaList, @@ -3922,6 +2569,7 @@ pub mod root { ) , "::" , stringify ! ( mEmpty ) )); } #[repr(C)] + #[derive(Debug)] pub struct Element { pub _base: root::mozilla::dom::FragmentOrElement, pub mState: root::mozilla::EventStates, @@ -3932,10 +2580,8 @@ pub mod root { pub struct Element_COMTypeInfo { pub _address: u8, } - /** - * StyleStateLocks is used to specify which event states should be locked, - * and whether they should be locked to on or off. - */ + /// StyleStateLocks is used to specify which event states should be locked, + /// and whether they should be locked to on or off. #[repr(C)] #[derive(Debug, Copy)] pub struct Element_StyleStateLocks { @@ -4027,14 +2673,12 @@ pub mod root { pub struct ShadowRoot { _unused: [u8; 0], } - /** - * Struct that stores info on an attribute. The name and value must either both - * be null or both be non-null. - * - * Note that, just as the pointers returned by GetAttrNameAt, the pointers that - * this struct hold are only valid until the element or its attributes are - * mutated (directly or via script). - */ + /// Struct that stores info on an attribute. The name and value must either both + /// be null or both be non-null. + /// + /// Note that, just as the pointers returned by GetAttrNameAt, the pointers that + /// this struct hold are only valid until the element or its attributes are + /// mutated (directly or via script). #[repr(C)] #[derive(Debug, Copy)] pub struct BorrowedAttrInfo { @@ -4067,6 +2711,7 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug)] pub struct NodeInfo { pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub mDocument: *mut root::nsIDocument, @@ -4097,19 +2742,21 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug)] + #[derive(Debug, Copy)] pub struct NodeInfo_NodeInfoInner { - pub mName: root::nsCOMPtr, - pub mPrefix: root::nsCOMPtr, + pub mName: *const root::nsIAtom, + pub mPrefix: *mut root::nsIAtom, pub mNamespaceID: i32, pub mNodeType: u16, pub mNameString: *const root::nsAString, - pub mExtraName: root::nsCOMPtr, + pub mExtraName: *mut root::nsIAtom, + pub mHash: root::PLHashNumber, + pub mHashInitialized: bool, } #[test] fn bindgen_test_layout_NodeInfo_NodeInfoInner() { assert_eq!(::std::mem::size_of::<NodeInfo_NodeInfoInner>() , - 40usize , concat ! ( + 48usize , concat ! ( "Size of: " , stringify ! ( NodeInfo_NodeInfoInner ) )); assert_eq! (::std::mem::align_of::<NodeInfo_NodeInfoInner>() , @@ -4158,6 +2805,23 @@ pub mod root { "Alignment of field: " , stringify ! ( NodeInfo_NodeInfoInner ) , "::" , stringify ! ( mExtraName ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const NodeInfo_NodeInfoInner ) ) . + mHash as * const _ as usize } , 40usize , concat ! + ( + "Alignment of field: " , stringify ! ( + NodeInfo_NodeInfoInner ) , "::" , stringify ! ( + mHash ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const NodeInfo_NodeInfoInner ) ) . + mHashInitialized as * const _ as usize } , 44usize + , concat ! ( + "Alignment of field: " , stringify ! ( + NodeInfo_NodeInfoInner ) , "::" , stringify ! ( + mHashInitialized ) )); + } + impl Clone for NodeInfo_NodeInfoInner { + fn clone(&self) -> Self { *self } } extern "C" { #[link_name = @@ -4167,7 +2831,7 @@ pub mod root { } #[test] fn bindgen_test_layout_NodeInfo() { - assert_eq!(::std::mem::size_of::<NodeInfo>() , 112usize , + assert_eq!(::std::mem::size_of::<NodeInfo>() , 120usize , concat ! ( "Size of: " , stringify ! ( NodeInfo ) )); assert_eq! (::std::mem::align_of::<NodeInfo>() , 8usize , @@ -4190,22 +2854,22 @@ pub mod root { , "::" , stringify ! ( mInner ) )); assert_eq! (unsafe { & ( * ( 0 as * const NodeInfo ) ) . mOwnerManager - as * const _ as usize } , 56usize , concat ! ( + as * const _ as usize } , 64usize , concat ! ( "Alignment of field: " , stringify ! ( NodeInfo ) , "::" , stringify ! ( mOwnerManager ) )); assert_eq! (unsafe { & ( * ( 0 as * const NodeInfo ) ) . mQualifiedName - as * const _ as usize } , 64usize , concat ! ( + as * const _ as usize } , 72usize , concat ! ( "Alignment of field: " , stringify ! ( NodeInfo ) , "::" , stringify ! ( mQualifiedName ) )); assert_eq! (unsafe { & ( * ( 0 as * const NodeInfo ) ) . mNodeName as * - const _ as usize } , 80usize , concat ! ( + const _ as usize } , 88usize , concat ! ( "Alignment of field: " , stringify ! ( NodeInfo ) , "::" , stringify ! ( mNodeName ) )); assert_eq! (unsafe { & ( * ( 0 as * const NodeInfo ) ) . mLocalName as - * const _ as usize } , 96usize , concat ! ( + * const _ as usize } , 104usize , concat ! ( "Alignment of field: " , stringify ! ( NodeInfo ) , "::" , stringify ! ( mLocalName ) )); } @@ -4231,47 +2895,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct AddEventListenerOptionsOrBoolean { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Event { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventListener { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventListenerOptionsOrBoolean { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug)] - pub struct EventHandlerNonNull { - pub _base: root::mozilla::dom::CallbackFunction, - } - #[test] - fn bindgen_test_layout_EventHandlerNonNull() { - assert_eq!(::std::mem::size_of::<EventHandlerNonNull>() , - 48usize , concat ! ( - "Size of: " , stringify ! ( EventHandlerNonNull ) - )); - assert_eq! (::std::mem::align_of::<EventHandlerNonNull>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( - EventHandlerNonNull ) )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AccessibleNode { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct BoxQuadOptions { _unused: [u8; 0], } @@ -4351,9 +2974,7 @@ pub mod root { #[repr(C)] #[derive(Debug, Copy)] pub struct OwningNodeOrString_Value { - pub mNode: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub mString: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub bindgen_union_field: [u64; 2usize], + pub _bindgen_opaque_blob: [u64; 2usize], } #[test] fn bindgen_test_layout_OwningNodeOrString_Value() { @@ -4365,20 +2986,6 @@ pub mod root { , 8usize , concat ! ( "Alignment of " , stringify ! ( OwningNodeOrString_Value ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OwningNodeOrString_Value ) ) - . mNode as * const _ as usize } , 0usize , concat - ! ( - "Alignment of field: " , stringify ! ( - OwningNodeOrString_Value ) , "::" , stringify ! ( - mNode ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const OwningNodeOrString_Value ) ) - . mString as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - OwningNodeOrString_Value ) , "::" , stringify ! ( - mString ) )); } impl Clone for OwningNodeOrString_Value { fn clone(&self) -> Self { *self } @@ -4410,11 +3017,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct Text { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct TextOrElementOrDocument { _unused: [u8; 0], } @@ -4425,25 +3027,10 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct GetRootNodeOptions { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Touch { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Selection { + pub struct TabGroup { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug)] - pub struct UnionMember { - pub mStorage: root::mozilla::AlignedStorage2, - } - #[repr(C)] pub struct DispatcherTrait__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] #[derive(Debug, Copy)] @@ -4658,11 +3245,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct Performance { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct ServiceWorkerRegistration { _unused: [u8; 0], } @@ -4673,26 +3255,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct CustomElementRegistry { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Location { - _unused: [u8; 0], - } - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum LargeAllocStatus { - NONE = 0, - SUCCESS = 1, - NON_GET = 2, - NON_E10S = 3, - NOT_ONLY_TOPLEVEL_IN_TABGROUP = 4, - NON_WIN32 = 5, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct PrefSetting { _unused: [u8; 0], } @@ -4937,30 +3499,6 @@ pub mod root { } #[repr(C)] #[derive(Debug)] - pub struct CallbackObjectHolder { - pub mPtrBits: usize, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct CallbackObjectHolderBase { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_CallbackObjectHolderBase() { - assert_eq!(::std::mem::size_of::<CallbackObjectHolderBase>() , - 1usize , concat ! ( - "Size of: " , stringify ! ( - CallbackObjectHolderBase ) )); - assert_eq! (::std::mem::align_of::<CallbackObjectHolderBase>() - , 1usize , concat ! ( - "Alignment of " , stringify ! ( - CallbackObjectHolderBase ) )); - } - impl Clone for CallbackObjectHolderBase { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug)] pub struct CallbackFunction { pub _base: root::mozilla::dom::CallbackObject, } @@ -4994,125 +3532,6 @@ pub mod root { Prerender = 2, EndGuard_ = 3, } - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum FlashClassification { - Unclassified = 0, - Unknown = 1, - Allowed = 2, - Denied = 3, - EndGuard_ = 4, - } - #[repr(C)] - #[derive(Debug)] - pub struct ElementCreationOptions { - pub _base: root::mozilla::dom::DictionaryBase, - pub mIs: [u64; 3usize], - pub mPseudo: [u64; 3usize], - } - #[test] - fn bindgen_test_layout_ElementCreationOptions() { - assert_eq!(::std::mem::size_of::<ElementCreationOptions>() , - 56usize , concat ! ( - "Size of: " , stringify ! ( ElementCreationOptions - ) )); - assert_eq! (::std::mem::align_of::<ElementCreationOptions>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( - ElementCreationOptions ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ElementCreationOptions ) ) . - mIs as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - ElementCreationOptions ) , "::" , stringify ! ( - mIs ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ElementCreationOptions ) ) . - mPseudo as * const _ as usize } , 32usize , concat - ! ( - "Alignment of field: " , stringify ! ( - ElementCreationOptions ) , "::" , stringify ! ( - mPseudo ) )); - } - #[repr(C)] - #[derive(Debug)] - pub struct ElementCreationOptionsOrString { - pub mType: root::mozilla::dom::ElementCreationOptionsOrString_Type, - pub mValue: root::mozilla::dom::ElementCreationOptionsOrString_Value, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum ElementCreationOptionsOrString_Type { - eUninitialized = 0, - eElementCreationOptions = 1, - eString = 2, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ElementCreationOptionsOrString_Value { - pub mElementCreationOptions: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub mString: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub bindgen_union_field: [u64; 18usize], - } - #[test] - fn bindgen_test_layout_ElementCreationOptionsOrString_Value() { - assert_eq!(::std::mem::size_of::<ElementCreationOptionsOrString_Value>() - , 144usize , concat ! ( - "Size of: " , stringify ! ( - ElementCreationOptionsOrString_Value ) )); - assert_eq! (::std::mem::align_of::<ElementCreationOptionsOrString_Value>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - ElementCreationOptionsOrString_Value ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const ElementCreationOptionsOrString_Value - ) ) . mElementCreationOptions as * const _ as - usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - ElementCreationOptionsOrString_Value ) , "::" , - stringify ! ( mElementCreationOptions ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const ElementCreationOptionsOrString_Value - ) ) . mString as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ElementCreationOptionsOrString_Value ) , "::" , - stringify ! ( mString ) )); - } - impl Clone for ElementCreationOptionsOrString_Value { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_ElementCreationOptionsOrString() { - assert_eq!(::std::mem::size_of::<ElementCreationOptionsOrString>() - , 152usize , concat ! ( - "Size of: " , stringify ! ( - ElementCreationOptionsOrString ) )); - assert_eq! (::std::mem::align_of::<ElementCreationOptionsOrString>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - ElementCreationOptionsOrString ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const ElementCreationOptionsOrString ) - ) . mType as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ElementCreationOptionsOrString ) , "::" , - stringify ! ( mType ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const ElementCreationOptionsOrString ) - ) . mValue as * const _ as usize } , 8usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ElementCreationOptionsOrString ) , "::" , - stringify ! ( mValue ) )); - } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Animation { @@ -5124,6 +3543,7 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] + #[derive(Debug)] pub struct Attr { pub _base: root::nsIAttribute, pub _base_1: root::nsIDOMAttr, @@ -5167,41 +3587,7 @@ pub mod root { ( "Alignment of " , stringify ! ( Attr ) )); } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct BoxObject { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct CDATASection { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Comment { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DocumentFragment { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DocumentTimeline { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DocumentType { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DOMImplementation { - _unused: [u8; 0], - } - #[repr(C)] + #[derive(Debug)] pub struct DOMIntersectionObserver { pub _base: root::nsISupports, pub _base_1: root::nsWrapperCache, @@ -5261,16 +3647,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct DOMStringList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ElementRegistrationOptions { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct FontFaceSet { _unused: [u8; 0], } @@ -5302,11 +3678,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct HTMLBodyElement { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct Link { _unused: [u8; 0], } @@ -5317,147 +3688,95 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct NodeFilter { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct NodeIterator { - _unused: [u8; 0], - } - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum OrientationType { } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ProcessingInstruction { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ScriptLoader { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct StyleSheetList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGSVGElement { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct TouchList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct TreeWalker { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct XPathEvaluator { _unused: [u8; 0], } + pub type Record_EntryType<KeyType, ValueType> = + root::mozilla::dom::binding_detail::RecordEntry<KeyType, + ValueType>; #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct XPathExpression { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct XPathNSResolver { - _unused: [u8; 0], + #[derive(Debug)] + pub struct URLParams { + pub mParams: root::nsTArray<root::mozilla::dom::URLParams_Param>, } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct XPathResult { - _unused: [u8; 0], - } - pub type NodeFilterHolder = - root::mozilla::dom::CallbackObjectHolder; - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum ScrollBehavior { - Auto = 0, - Instant = 1, - Smooth = 2, - EndGuard_ = 3, - } + pub struct URLParams_ForEachIterator__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] #[derive(Debug, Copy)] - pub struct ScrollOptions { - pub _base: root::mozilla::dom::DictionaryBase, - pub mBehavior: root::mozilla::dom::ScrollBehavior, + pub struct URLParams_ForEachIterator { + pub vtable_: *const URLParams_ForEachIterator__bindgen_vtable, } #[test] - fn bindgen_test_layout_ScrollOptions() { - assert_eq!(::std::mem::size_of::<ScrollOptions>() , 2usize , - concat ! ( - "Size of: " , stringify ! ( ScrollOptions ) )); - assert_eq! (::std::mem::align_of::<ScrollOptions>() , 1usize , - concat ! ( - "Alignment of " , stringify ! ( ScrollOptions ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollOptions ) ) . mBehavior - as * const _ as usize } , 1usize , concat ! ( - "Alignment of field: " , stringify ! ( - ScrollOptions ) , "::" , stringify ! ( mBehavior ) - )); + fn bindgen_test_layout_URLParams_ForEachIterator() { + assert_eq!(::std::mem::size_of::<URLParams_ForEachIterator>() + , 8usize , concat ! ( + "Size of: " , stringify ! ( + URLParams_ForEachIterator ) )); + assert_eq! (::std::mem::align_of::<URLParams_ForEachIterator>() + , 8usize , concat ! ( + "Alignment of " , stringify ! ( + URLParams_ForEachIterator ) )); } - impl Clone for ScrollOptions { + impl Clone for URLParams_ForEachIterator { fn clone(&self) -> Self { *self } } #[repr(C)] #[derive(Debug)] - pub struct ScrollToOptions { - pub _base: root::mozilla::dom::ScrollOptions, - pub mLeft: [u64; 2usize], - pub mTop: [u64; 2usize], + pub struct URLParams_Param { + pub mKey: ::nsstring::nsStringRepr, + pub mValue: ::nsstring::nsStringRepr, } #[test] - fn bindgen_test_layout_ScrollToOptions() { - assert_eq!(::std::mem::size_of::<ScrollToOptions>() , 40usize + fn bindgen_test_layout_URLParams_Param() { + assert_eq!(::std::mem::size_of::<URLParams_Param>() , 32usize , concat ! ( - "Size of: " , stringify ! ( ScrollToOptions ) )); - assert_eq! (::std::mem::align_of::<ScrollToOptions>() , 8usize + "Size of: " , stringify ! ( URLParams_Param ) )); + assert_eq! (::std::mem::align_of::<URLParams_Param>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( ScrollToOptions ) + "Alignment of " , stringify ! ( URLParams_Param ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ScrollToOptions ) ) . mLeft - as * const _ as usize } , 8usize , concat ! ( + & ( * ( 0 as * const URLParams_Param ) ) . mKey as + * const _ as usize } , 0usize , concat ! ( "Alignment of field: " , stringify ! ( - ScrollToOptions ) , "::" , stringify ! ( mLeft ) + URLParams_Param ) , "::" , stringify ! ( mKey ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ScrollToOptions ) ) . mTop as - * const _ as usize } , 24usize , concat ! ( + & ( * ( 0 as * const URLParams_Param ) ) . mValue + as * const _ as usize } , 16usize , concat ! ( "Alignment of field: " , stringify ! ( - ScrollToOptions ) , "::" , stringify ! ( mTop ) + URLParams_Param ) , "::" , stringify ! ( mValue ) )); } - /** - * StyleChildrenIterator traverses the children of the element from the - * perspective of the style system, particularly the children we need to - * traverse during restyle. - * - * At present, this is identical to AllChildrenIterator with - * (eAllChildren | eSkipDocumentLevelNativeAnonymousContent). We used to have - * detect and skip any native anonymous children that are used to implement some - * special magic in here that went away, but we keep the separate class so - * we can reintroduce special magic back if needed. - * - * Note: it assumes that no mutation of the DOM or frame tree takes place during - * iteration, and will break horribly if that is not true. - * - * We require this to be memmovable since Rust code can create and move - * StyleChildrenIterators. - */ + #[test] + fn bindgen_test_layout_URLParams() { + assert_eq!(::std::mem::size_of::<URLParams>() , 8usize , + concat ! ( "Size of: " , stringify ! ( URLParams ) + )); + assert_eq! (::std::mem::align_of::<URLParams>() , 8usize , + concat ! ( + "Alignment of " , stringify ! ( URLParams ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const URLParams ) ) . mParams as * + const _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( URLParams ) + , "::" , stringify ! ( mParams ) )); + } + /// StyleChildrenIterator traverses the children of the element from the + /// perspective of the style system, particularly the children we need to + /// traverse during restyle. + /// + /// At present, this is identical to AllChildrenIterator with + /// (eAllChildren | eSkipDocumentLevelNativeAnonymousContent). We used to have + /// detect and skip any native anonymous children that are used to implement some + /// special magic in here that went away, but we keep the separate class so + /// we can reintroduce special magic back if needed. + /// + /// Note: it assumes that no mutation of the DOM or frame tree takes place during + /// iteration, and will break horribly if that is not true. + /// + /// We require this to be memmovable since Rust code can create and move + /// StyleChildrenIterators. #[repr(C)] #[derive(Debug)] pub struct StyleChildrenIterator { @@ -5482,11 +3801,6 @@ pub mod root { Accumulate = 2, EndGuard_ = 3, } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct CSSPseudoElement { - _unused: [u8; 0], - } #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum IterationCompositeOperation { @@ -5495,81 +3809,6 @@ pub mod root { EndGuard_ = 2, } #[repr(C)] - #[derive(Debug)] - pub struct ElementOrCSSPseudoElement { - pub mType: root::mozilla::dom::ElementOrCSSPseudoElement_Type, - pub mValue: root::mozilla::dom::ElementOrCSSPseudoElement_Value, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum ElementOrCSSPseudoElement_Type { - eUninitialized = 0, - eElement = 1, - eCSSPseudoElement = 2, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ElementOrCSSPseudoElement_Value { - pub mElement: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub mCSSPseudoElement: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub bindgen_union_field: u64, - } - #[test] - fn bindgen_test_layout_ElementOrCSSPseudoElement_Value() { - assert_eq!(::std::mem::size_of::<ElementOrCSSPseudoElement_Value>() - , 8usize , concat ! ( - "Size of: " , stringify ! ( - ElementOrCSSPseudoElement_Value ) )); - assert_eq! (::std::mem::align_of::<ElementOrCSSPseudoElement_Value>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - ElementOrCSSPseudoElement_Value ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const ElementOrCSSPseudoElement_Value ) - ) . mElement as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ElementOrCSSPseudoElement_Value ) , "::" , - stringify ! ( mElement ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const ElementOrCSSPseudoElement_Value ) - ) . mCSSPseudoElement as * const _ as usize } , - 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - ElementOrCSSPseudoElement_Value ) , "::" , - stringify ! ( mCSSPseudoElement ) )); - } - impl Clone for ElementOrCSSPseudoElement_Value { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_ElementOrCSSPseudoElement() { - assert_eq!(::std::mem::size_of::<ElementOrCSSPseudoElement>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - ElementOrCSSPseudoElement ) )); - assert_eq! (::std::mem::align_of::<ElementOrCSSPseudoElement>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - ElementOrCSSPseudoElement ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ElementOrCSSPseudoElement ) ) - . mType as * const _ as usize } , 0usize , concat - ! ( - "Alignment of field: " , stringify ! ( - ElementOrCSSPseudoElement ) , "::" , stringify ! ( - mType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ElementOrCSSPseudoElement ) ) - . mValue as * const _ as usize } , 8usize , concat - ! ( - "Alignment of field: " , stringify ! ( - ElementOrCSSPseudoElement ) , "::" , stringify ! ( - mValue ) )); - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct XBLChildrenElement { _unused: [u8; 0], @@ -5580,12 +3819,11 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] + #[derive(Debug)] pub struct FragmentOrElement { pub _base: root::nsIContent, pub mRefCnt: root::nsCycleCollectingAutoRefCnt, - /** - * Array containing all attributes and children for this element - */ + /// Array containing all attributes and children for this element pub mAttrsAndChildren: root::nsAttrAndChildArray, } pub type FragmentOrElement_HasThreadSafeRefCnt = @@ -5609,70 +3847,43 @@ pub mod root { impl Clone for FragmentOrElement_cycleCollection { fn clone(&self) -> Self { *self } } - /** - * There are a set of DOM- and scripting-specific instance variables - * that may only be instantiated when a content object is accessed - * through the DOM. Rather than burn actual slots in the content - * objects for each of these instance variables, we put them off - * in a side structure that's only allocated when the content is - * accessed through the DOM. - */ + /// There are a set of DOM- and scripting-specific instance variables + /// that may only be instantiated when a content object is accessed + /// through the DOM. Rather than burn actual slots in the content + /// objects for each of these instance variables, we put them off + /// in a side structure that's only allocated when the content is + /// accessed through the DOM. #[repr(C)] + #[derive(Debug)] pub struct FragmentOrElement_nsExtendedDOMSlots { - /** - * SMIL Overridde style rules (for SMIL animation of CSS properties) - * @see Element::GetSMILOverrideStyle - */ + /// SMIL Overridde style rules (for SMIL animation of CSS properties) + /// @see Element::GetSMILOverrideStyle pub mSMILOverrideStyle: root::nsCOMPtr, - /** - * Holds any SMIL override style declaration for this element. - */ + /// Holds any SMIL override style declaration for this element. pub mSMILOverrideStyleDeclaration: root::RefPtr<root::mozilla::DeclarationBlock>, - /** - * The nearest enclosing content node with a binding that created us. - * @see FragmentOrElement::GetBindingParent - */ + /// The nearest enclosing content node with a binding that created us. + /// @see FragmentOrElement::GetBindingParent pub mBindingParent: *mut root::nsIContent, - /** - * The controllers of the XUL Element. - */ + /// The controllers of the XUL Element. pub mControllers: root::nsCOMPtr, - /** - * An object implementing the .labels property for this element. - */ + /// An object implementing the .labels property for this element. pub mLabelsList: root::RefPtr<root::nsLabelsNodeList>, - /** - * ShadowRoot bound to the element. - */ + /// ShadowRoot bound to the element. pub mShadowRoot: root::RefPtr<root::mozilla::dom::ShadowRoot>, - /** - * The root ShadowRoot of this element if it is in a shadow tree. - */ + /// The root ShadowRoot of this element if it is in a shadow tree. pub mContainingShadow: root::RefPtr<root::mozilla::dom::ShadowRoot>, - /** - * An array of web component insertion points to which this element - * is distributed. - */ + /// An array of web component insertion points to which this element + /// is distributed. pub mDestInsertionPoints: root::nsTArray<*mut root::nsIContent>, - /** - * XBL binding installed on the element. - */ + /// XBL binding installed on the element. pub mXBLBinding: root::RefPtr<root::nsXBLBinding>, - /** - * XBL binding installed on the lement. - */ + /// XBL binding installed on the lement. pub mXBLInsertionParent: root::nsCOMPtr, - /** - * Web components custom element data. - */ + /// Web components custom element data. pub mCustomElementData: root::RefPtr<root::mozilla::dom::CustomElementData>, - /** - * Registered Intersection Observers on the element. - */ + /// Registered Intersection Observers on the element. pub mRegisteredIntersectionObservers: [u64; 5usize], - /** - * For XUL to hold either frameloader or opener. - */ + /// For XUL to hold either frameloader or opener. pub mFrameLoaderOrOpener: root::nsCOMPtr, } #[test] @@ -5805,38 +4016,29 @@ pub mod root { stringify ! ( mFrameLoaderOrOpener ) )); } #[repr(C)] + #[derive(Debug)] pub struct FragmentOrElement_nsDOMSlots { pub _base: root::nsINode_nsSlots, - /** - * The .style attribute (an interface that forwards to the actual - * style rules) - * @see nsGenericHTMLElement::GetStyle - */ + /// The .style attribute (an interface that forwards to the actual + /// style rules) + /// @see nsGenericHTMLElement::GetStyle pub mStyle: root::nsCOMPtr, - /** - * The .dataset attribute. - * @see nsGenericHTMLElement::GetDataset - */ + /// The .dataset attribute. + /// @see nsGenericHTMLElement::GetDataset pub mDataset: *mut root::nsDOMStringMap, - /** - * An object implementing nsIDOMMozNamedAttrMap for this content (attributes) - * @see FragmentOrElement::GetAttributes - */ + /// An object implementing nsIDOMMozNamedAttrMap for this content (attributes) + /// @see FragmentOrElement::GetAttributes pub mAttributeMap: root::RefPtr<root::nsDOMAttributeMap>, - /** - * An object implementing the .children property for this element. - */ + /// An object implementing the .children property for this element. pub mChildrenList: root::RefPtr<root::nsContentList>, - /** - * An object implementing the .classList property for this element. - */ + /// An object implementing the .classList property for this element. pub mClassList: root::RefPtr<root::nsDOMTokenList>, pub mExtendedSlots: root::mozilla::UniquePtr<root::mozilla::dom::FragmentOrElement_nsExtendedDOMSlots>, } #[test] fn bindgen_test_layout_FragmentOrElement_nsDOMSlots() { assert_eq!(::std::mem::size_of::<FragmentOrElement_nsDOMSlots>() - , 96usize , concat ! ( + , 120usize , concat ! ( "Size of: " , stringify ! ( FragmentOrElement_nsDOMSlots ) )); assert_eq! (::std::mem::align_of::<FragmentOrElement_nsDOMSlots>() @@ -5846,7 +4048,7 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const FragmentOrElement_nsDOMSlots ) ) - . mStyle as * const _ as usize } , 48usize , + . mStyle as * const _ as usize } , 72usize , concat ! ( "Alignment of field: " , stringify ! ( FragmentOrElement_nsDOMSlots ) , "::" , stringify @@ -5854,7 +4056,7 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const FragmentOrElement_nsDOMSlots ) ) - . mDataset as * const _ as usize } , 56usize , + . mDataset as * const _ as usize } , 80usize , concat ! ( "Alignment of field: " , stringify ! ( FragmentOrElement_nsDOMSlots ) , "::" , stringify @@ -5862,7 +4064,7 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const FragmentOrElement_nsDOMSlots ) ) - . mAttributeMap as * const _ as usize } , 64usize + . mAttributeMap as * const _ as usize } , 88usize , concat ! ( "Alignment of field: " , stringify ! ( FragmentOrElement_nsDOMSlots ) , "::" , stringify @@ -5870,7 +4072,7 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const FragmentOrElement_nsDOMSlots ) ) - . mChildrenList as * const _ as usize } , 72usize + . mChildrenList as * const _ as usize } , 96usize , concat ! ( "Alignment of field: " , stringify ! ( FragmentOrElement_nsDOMSlots ) , "::" , stringify @@ -5878,7 +4080,7 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const FragmentOrElement_nsDOMSlots ) ) - . mClassList as * const _ as usize } , 80usize , + . mClassList as * const _ as usize } , 104usize , concat ! ( "Alignment of field: " , stringify ! ( FragmentOrElement_nsDOMSlots ) , "::" , stringify @@ -5886,8 +4088,8 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const FragmentOrElement_nsDOMSlots ) ) - . mExtendedSlots as * const _ as usize } , 88usize - , concat ! ( + . mExtendedSlots as * const _ as usize } , + 112usize , concat ! ( "Alignment of field: " , stringify ! ( FragmentOrElement_nsDOMSlots ) , "::" , stringify ! ( mExtendedSlots ) )); @@ -5923,11 +4125,6 @@ pub mod root { mAttrsAndChildren ) )); } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGAnimationElement { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug)] pub struct DOMRect { pub _base: root::mozilla::dom::DOMRectReadOnly, @@ -5947,88 +4144,6 @@ pub mod root { } #[repr(C)] #[derive(Debug)] - pub struct DOMRectList { - pub _base: root::nsIDOMClientRectList, - pub _base_1: root::nsWrapperCache, - pub mRefCnt: root::nsCycleCollectingAutoRefCnt, - pub mArray: root::nsTArray<root::RefPtr<root::mozilla::dom::DOMRect>>, - pub mParent: root::nsCOMPtr, - } - pub type DOMRectList_HasThreadSafeRefCnt = - root::mozilla::FalseType; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct DOMRectList_cycleCollection { - pub _base: root::nsXPCOMCycleCollectionParticipant, - } - #[test] - fn bindgen_test_layout_DOMRectList_cycleCollection() { - assert_eq!(::std::mem::size_of::<DOMRectList_cycleCollection>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - DOMRectList_cycleCollection ) )); - assert_eq! (::std::mem::align_of::<DOMRectList_cycleCollection>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - DOMRectList_cycleCollection ) )); - } - impl Clone for DOMRectList_cycleCollection { - fn clone(&self) -> Self { *self } - } - extern "C" { - #[link_name = - "_ZN7mozilla3dom11DOMRectList21_cycleCollectorGlobalE"] - pub static mut DOMRectList__cycleCollectorGlobal: - root::mozilla::dom::DOMRectList_cycleCollection; - } - #[test] - fn bindgen_test_layout_DOMRectList() { - assert_eq!(::std::mem::size_of::<DOMRectList>() , 56usize , - concat ! ( - "Size of: " , stringify ! ( DOMRectList ) )); - assert_eq! (::std::mem::align_of::<DOMRectList>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( DOMRectList ) )); - } - pub type DOMTokenListSupportedToken = - *const ::std::os::raw::c_char; - pub type DOMTokenListSupportedTokenArray = - *mut root::mozilla::dom::DOMTokenListSupportedToken; - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum ScrollLogicalPosition { - Start = 0, - End = 1, - EndGuard_ = 2, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ScrollIntoViewOptions { - pub _base: root::mozilla::dom::ScrollOptions, - pub mBlock: root::mozilla::dom::ScrollLogicalPosition, - } - #[test] - fn bindgen_test_layout_ScrollIntoViewOptions() { - assert_eq!(::std::mem::size_of::<ScrollIntoViewOptions>() , - 3usize , concat ! ( - "Size of: " , stringify ! ( ScrollIntoViewOptions ) - )); - assert_eq! (::std::mem::align_of::<ScrollIntoViewOptions>() , - 1usize , concat ! ( - "Alignment of " , stringify ! ( - ScrollIntoViewOptions ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ScrollIntoViewOptions ) ) . - mBlock as * const _ as usize } , 2usize , concat ! - ( - "Alignment of field: " , stringify ! ( - ScrollIntoViewOptions ) , "::" , stringify ! ( - mBlock ) )); - } - impl Clone for ScrollIntoViewOptions { - fn clone(&self) -> Self { *self } - } - #[repr(C)] pub struct DOMIntersectionObserverEntry { pub _base: root::nsISupports, pub _base_1: root::nsWrapperCache, @@ -6098,210 +4213,6 @@ pub mod root { IntersectionCallback ) )); } #[repr(C)] - #[derive(Debug)] - pub struct OwningDoubleOrDoubleSequence { - pub mType: root::mozilla::dom::OwningDoubleOrDoubleSequence_Type, - pub mValue: root::mozilla::dom::OwningDoubleOrDoubleSequence_Value, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum OwningDoubleOrDoubleSequence_Type { - eUninitialized = 0, - eDouble = 1, - eDoubleSequence = 2, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct OwningDoubleOrDoubleSequence_Value { - pub mDouble: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub mDoubleSequence: root::__BindgenUnionField<root::mozilla::dom::UnionMember>, - pub bindgen_union_field: u64, - } - #[test] - fn bindgen_test_layout_OwningDoubleOrDoubleSequence_Value() { - assert_eq!(::std::mem::size_of::<OwningDoubleOrDoubleSequence_Value>() - , 8usize , concat ! ( - "Size of: " , stringify ! ( - OwningDoubleOrDoubleSequence_Value ) )); - assert_eq! (::std::mem::align_of::<OwningDoubleOrDoubleSequence_Value>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - OwningDoubleOrDoubleSequence_Value ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const OwningDoubleOrDoubleSequence_Value ) - ) . mDouble as * const _ as usize } , 0usize , - concat ! ( - "Alignment of field: " , stringify ! ( - OwningDoubleOrDoubleSequence_Value ) , "::" , - stringify ! ( mDouble ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const OwningDoubleOrDoubleSequence_Value ) - ) . mDoubleSequence as * const _ as usize } , - 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - OwningDoubleOrDoubleSequence_Value ) , "::" , - stringify ! ( mDoubleSequence ) )); - } - impl Clone for OwningDoubleOrDoubleSequence_Value { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_OwningDoubleOrDoubleSequence() { - assert_eq!(::std::mem::size_of::<OwningDoubleOrDoubleSequence>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - OwningDoubleOrDoubleSequence ) )); - assert_eq! (::std::mem::align_of::<OwningDoubleOrDoubleSequence>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - OwningDoubleOrDoubleSequence ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const OwningDoubleOrDoubleSequence ) ) - . mType as * const _ as usize } , 0usize , concat - ! ( - "Alignment of field: " , stringify ! ( - OwningDoubleOrDoubleSequence ) , "::" , stringify - ! ( mType ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const OwningDoubleOrDoubleSequence ) ) - . mValue as * const _ as usize } , 8usize , concat - ! ( - "Alignment of field: " , stringify ! ( - OwningDoubleOrDoubleSequence ) , "::" , stringify - ! ( mValue ) )); - } - #[repr(C)] - pub struct IntersectionObserverInit { - pub _base: root::mozilla::dom::DictionaryBase, - pub mRoot: root::RefPtr<root::mozilla::dom::Element>, - pub mRootMargin: ::nsstring::nsStringRepr, - pub mThreshold: root::mozilla::dom::OwningDoubleOrDoubleSequence, - } - #[test] - fn bindgen_test_layout_IntersectionObserverInit() { - assert_eq!(::std::mem::size_of::<IntersectionObserverInit>() , - 48usize , concat ! ( - "Size of: " , stringify ! ( - IntersectionObserverInit ) )); - assert_eq! (::std::mem::align_of::<IntersectionObserverInit>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - IntersectionObserverInit ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const IntersectionObserverInit ) ) - . mRoot as * const _ as usize } , 8usize , concat - ! ( - "Alignment of field: " , stringify ! ( - IntersectionObserverInit ) , "::" , stringify ! ( - mRoot ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const IntersectionObserverInit ) ) - . mRootMargin as * const _ as usize } , 16usize , - concat ! ( - "Alignment of field: " , stringify ! ( - IntersectionObserverInit ) , "::" , stringify ! ( - mRootMargin ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const IntersectionObserverInit ) ) - . mThreshold as * const _ as usize } , 32usize , - concat ! ( - "Alignment of field: " , stringify ! ( - IntersectionObserverInit ) , "::" , stringify ! ( - mThreshold ) )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AnimationFilter { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct DOMMatrixReadOnly { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct UnrestrictedDoubleOrKeyframeAnimationOptions { - _unused: [u8; 0], - } - #[repr(C)] - pub struct DestinationInsertionPointList { - pub _base: root::nsINodeList, - pub mRefCnt: root::nsCycleCollectingAutoRefCnt, - pub mParent: root::RefPtr<root::mozilla::dom::Element>, - pub mDestinationPoints: root::nsCOMArray, - } - pub type DestinationInsertionPointList_HasThreadSafeRefCnt = - root::mozilla::FalseType; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct DestinationInsertionPointList_cycleCollection { - pub _base: root::nsXPCOMCycleCollectionParticipant, - } - #[test] - fn bindgen_test_layout_DestinationInsertionPointList_cycleCollection() { - assert_eq!(::std::mem::size_of::<DestinationInsertionPointList_cycleCollection>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - DestinationInsertionPointList_cycleCollection ) )); - assert_eq! (::std::mem::align_of::<DestinationInsertionPointList_cycleCollection>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - DestinationInsertionPointList_cycleCollection ) - )); - } - impl Clone for DestinationInsertionPointList_cycleCollection { - fn clone(&self) -> Self { *self } - } - extern "C" { - #[link_name = - "_ZN7mozilla3dom29DestinationInsertionPointList21_cycleCollectorGlobalE"] - pub static mut - DestinationInsertionPointList__cycleCollectorGlobal: - root::mozilla::dom::DestinationInsertionPointList_cycleCollection; - } - #[test] - fn bindgen_test_layout_DestinationInsertionPointList() { - assert_eq!(::std::mem::size_of::<DestinationInsertionPointList>() - , 56usize , concat ! ( - "Size of: " , stringify ! ( - DestinationInsertionPointList ) )); - assert_eq! (::std::mem::align_of::<DestinationInsertionPointList>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - DestinationInsertionPointList ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const DestinationInsertionPointList ) ) - . mRefCnt as * const _ as usize } , 32usize , - concat ! ( - "Alignment of field: " , stringify ! ( - DestinationInsertionPointList ) , "::" , stringify - ! ( mRefCnt ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const DestinationInsertionPointList ) ) - . mParent as * const _ as usize } , 40usize , - concat ! ( - "Alignment of field: " , stringify ! ( - DestinationInsertionPointList ) , "::" , stringify - ! ( mParent ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const DestinationInsertionPointList ) ) - . mDestinationPoints as * const _ as usize } , - 48usize , concat ! ( - "Alignment of field: " , stringify ! ( - DestinationInsertionPointList ) , "::" , stringify - ! ( mDestinationPoints ) )); - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Grid { _unused: [u8; 0], @@ -6393,15 +4304,13 @@ pub mod root { FlattenedChildIterator ) , "::" , stringify ! ( mXBLInvolved ) )); } - /** - * AllChildrenIterator traverses the children of an element including before / - * after content and optionally XBL children. The iterator can be initialized - * to start at the end by providing false for aStartAtBeginning in order to - * start iterating in reverse from the last child. - * - * Note: it assumes that no mutation of the DOM or frame tree takes place during - * iteration, and will break horribly if that is not true. - */ + /// AllChildrenIterator traverses the children of an element including before / + /// after content and optionally XBL children. The iterator can be initialized + /// to start at the end by providing false for aStartAtBeginning in order to + /// start iterating in reverse from the last child. + /// + /// Note: it assumes that no mutation of the DOM or frame tree takes place during + /// iteration, and will break horribly if that is not true. #[repr(C)] #[derive(Debug)] pub struct AllChildrenIterator { @@ -6468,41 +4377,14 @@ pub mod root { AllChildrenIterator ) , "::" , stringify ! ( mPhase ) )); } - /** - * CSSValue - a DOM object representing values in DOM computed style. - */ - #[repr(C)] - #[derive(Debug)] - pub struct CSSValue { - pub _base: root::nsISupports, - pub _base_1: root::nsWrapperCache, - } - #[test] - fn bindgen_test_layout_CSSValue() { - assert_eq!(::std::mem::size_of::<CSSValue>() , 32usize , - concat ! ( "Size of: " , stringify ! ( CSSValue ) - )); - assert_eq! (::std::mem::align_of::<CSSValue>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( CSSValue ) )); - } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct CSSVariableResolver { - _unused: [u8; 0], } #[repr(C)] #[derive(Debug)] pub struct CSSVariableValues { - /** - * Map of variable names to IDs. Variable IDs are indexes into - * mVariables. - */ + /// Map of variable names to IDs. Variable IDs are indexes into + /// mVariables. pub mVariableIDs: [u64; 5usize], - /** - * Array of variables, indexed by variable ID. - */ + /// Array of variables, indexed by variable ID. pub mVariables: root::nsTArray<root::mozilla::CSSVariableValues_Variable>, } #[repr(C)] @@ -6590,39 +4472,11 @@ pub mod root { Count = 9, Unknown = 255, } - /** - * StaticAutoPtr and StaticRefPtr are like nsAutoPtr and nsRefPtr, except they - * are suitable for use as global variables. - * - * In particular, a global instance of Static{Auto,Ref}Ptr doesn't cause the - * compiler to emit a static initializer (in release builds, anyway). - * - * In order to accomplish this, Static{Auto,Ref}Ptr must have a trivial - * constructor and destructor. As a consequence, it cannot initialize its raw - * pointer to 0 on construction, and it cannot delete/release its raw pointer - * upon destruction. - * - * Since the compiler guarantees that all global variables are initialized to - * 0, these trivial constructors are safe. Since we rely on this, the clang - * plugin, run as part of our "static analysis" builds, makes it a compile-time - * error to use Static{Auto,Ref}Ptr as anything except a global variable. - * - * Static{Auto,Ref}Ptr have a limited interface as compared to ns{Auto,Ref}Ptr; - * this is intentional, since their range of acceptable uses is smaller. - */ - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct StaticAutoPtr<T> { - pub mRawPtr: *mut T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } - /** - * This struct represents a combined color from a numeric color and - * the current foreground color (currentcolor keyword). - * Conceptually, the formula is "color * (1 - p) + currentcolor * p" - * where p is mForegroundRatio. See mozilla::LinearBlendColors for - * the actual algorithm. - */ + /// This struct represents a combined color from a numeric color and + /// the current foreground color (currentcolor keyword). + /// Conceptually, the formula is "color * (1 - p) + currentcolor * p" + /// where p is mForegroundRatio. See mozilla::LinearBlendColors for + /// the actual algorithm. #[repr(C)] #[derive(Debug, Copy)] pub struct StyleComplexColor { @@ -6692,11 +4546,9 @@ pub mod root { root::mozilla::FontFamilyType = FontFamilyType::eFamily_monospace; #[repr(u32)] - /** - * type of font family name, either a name (e.g. Helvetica) or a - * generic (e.g. serif, sans-serif), with the ability to distinguish - * between unquoted and quoted names for serializaiton - */ + /// type of font family name, either a name (e.g. Helvetica) or a + /// generic (e.g. serif, sans-serif), with the ability to distinguish + /// between unquoted and quoted names for serializaiton #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum FontFamilyType { eFamily_none = 0, @@ -6710,10 +4562,8 @@ pub mod root { eFamily_moz_variable = 8, eFamily_moz_fixed = 9, } - /** - * font family name, a string for the name if not a generic and - * a font type indicated named family or which generic family - */ + /// font family name, a string for the name if not a generic and + /// a font type indicated named family or which generic family #[repr(C)] #[derive(Debug)] pub struct FontFamilyName { @@ -6739,11 +4589,9 @@ pub mod root { "Alignment of field: " , stringify ! ( FontFamilyName ) , "::" , stringify ! ( mName ) )); } - /** - * font family list, array of font families and a default font type. - * font family names are either named strings or generics. the default - * font type is used to preserve the variable font fallback behavior - */ + /// font family list, array of font families and a default font type. + /// font family names are either named strings or generics. the default + /// font type is used to preserve the variable font fallback behavior #[repr(C)] #[derive(Debug)] pub struct FontFamilyList { @@ -6994,44 +4842,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct WritingMode { - _unused: [u8; 0], - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum LogicalSide { - eLogicalSideBStart = 0, - eLogicalSideBEnd = 1, - eLogicalSideIStart = 2, - eLogicalSideIEnd = 3, - } - /** - * Additional data used in conjunction with an nsRestyleHint to control the - * restyle process. - */ - #[repr(C)] - #[derive(Debug)] - pub struct RestyleHintData { - pub mSelectorsForDescendants: root::nsTArray<*mut root::nsCSSSelector>, - } - #[test] - fn bindgen_test_layout_RestyleHintData() { - assert_eq!(::std::mem::size_of::<RestyleHintData>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( RestyleHintData ) )); - assert_eq! (::std::mem::align_of::<RestyleHintData>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( RestyleHintData ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const RestyleHintData ) ) . - mSelectorsForDescendants as * const _ as usize } , - 0usize , concat ! ( - "Alignment of field: " , stringify ! ( RestyleHintData - ) , "::" , stringify ! ( mSelectorsForDescendants ) - )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct NotNull<T> { pub mBasePtr: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, @@ -7047,307 +4857,14 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct WidgetEvent { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct WidgetGUIEvent { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct WidgetInputEvent { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct WidgetPointerEvent { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventFlags { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct ShortcutKeyCandidate { _unused: [u8; 0], } - pub const FlushType_Frames: root::mozilla::FlushType = - FlushType::Style; - #[repr(u8)] - /** - * This is the enum used by nsIDocument::FlushPendingNotifications to - * decide what to flush. - * - * Please note that if you change these values, you should sync it with the - * flushTypeNames array inside PresShell::FlushPendingNotifications. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum FlushType { - None = 0, - Content = 1, - ContentAndNotify = 2, - Style = 3, - EnsurePresShellInitAndFrames = 4, - InterruptibleLayout = 5, - Layout = 6, - Display = 7, - Count = 8, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ChangesToFlush { - pub mFlushType: root::mozilla::FlushType, - pub mFlushAnimations: bool, - } - #[test] - fn bindgen_test_layout_ChangesToFlush() { - assert_eq!(::std::mem::size_of::<ChangesToFlush>() , 2usize , - concat ! ( "Size of: " , stringify ! ( ChangesToFlush ) - )); - assert_eq! (::std::mem::align_of::<ChangesToFlush>() , 1usize , - concat ! ( - "Alignment of " , stringify ! ( ChangesToFlush ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ChangesToFlush ) ) . mFlushType - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( ChangesToFlush - ) , "::" , stringify ! ( mFlushType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ChangesToFlush ) ) . - mFlushAnimations as * const _ as usize } , 1usize , - concat ! ( - "Alignment of field: " , stringify ! ( ChangesToFlush - ) , "::" , stringify ! ( mFlushAnimations ) )); - } - impl Clone for ChangesToFlush { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct CSSPixel { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_CSSPixel() { - assert_eq!(::std::mem::size_of::<CSSPixel>() , 1usize , concat ! ( - "Size of: " , stringify ! ( CSSPixel ) )); - assert_eq! (::std::mem::align_of::<CSSPixel>() , 1usize , concat ! - ( "Alignment of " , stringify ! ( CSSPixel ) )); - } - impl Clone for CSSPixel { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct LayoutDevicePixel { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_LayoutDevicePixel() { - assert_eq!(::std::mem::size_of::<LayoutDevicePixel>() , 1usize , - concat ! ( - "Size of: " , stringify ! ( LayoutDevicePixel ) )); - assert_eq! (::std::mem::align_of::<LayoutDevicePixel>() , 1usize , - concat ! ( - "Alignment of " , stringify ! ( LayoutDevicePixel ) - )); - } - impl Clone for LayoutDevicePixel { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct LayerPixel { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_LayerPixel() { - assert_eq!(::std::mem::size_of::<LayerPixel>() , 1usize , concat ! - ( "Size of: " , stringify ! ( LayerPixel ) )); - assert_eq! (::std::mem::align_of::<LayerPixel>() , 1usize , concat - ! ( "Alignment of " , stringify ! ( LayerPixel ) )); - } - impl Clone for LayerPixel { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ScreenPixel { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_ScreenPixel() { - assert_eq!(::std::mem::size_of::<ScreenPixel>() , 1usize , concat - ! ( "Size of: " , stringify ! ( ScreenPixel ) )); - assert_eq! (::std::mem::align_of::<ScreenPixel>() , 1usize , - concat ! ( - "Alignment of " , stringify ! ( ScreenPixel ) )); - } - impl Clone for ScreenPixel { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ParentLayerPixel { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_ParentLayerPixel() { - assert_eq!(::std::mem::size_of::<ParentLayerPixel>() , 1usize , - concat ! ( - "Size of: " , stringify ! ( ParentLayerPixel ) )); - assert_eq! (::std::mem::align_of::<ParentLayerPixel>() , 1usize , - concat ! ( - "Alignment of " , stringify ! ( ParentLayerPixel ) )); - } - impl Clone for ParentLayerPixel { - fn clone(&self) -> Self { *self } - } - pub type CSSPoint = [u32; 2usize]; - pub type CSSIntPoint = [u32; 2usize]; - pub type CSSSize = [u32; 2usize]; - pub type CSSRect = [u32; 4usize]; - pub type LayoutDeviceIntPoint = [u32; 2usize]; - pub type LayoutDeviceIntSize = [u32; 2usize]; - pub type LayoutDeviceIntRect = [u32; 4usize]; - pub type ScreenIntSize = u8; - pub type ScreenMargin = [u32; 4usize]; - pub type ParentLayerRect = [u32; 4usize]; - pub type ParentLayerIntRect = [u32; 4usize]; - pub type CSSToLayoutDeviceScale = u32; - pub type CSSToParentLayerScale2D = [u32; 2usize]; - pub type LayoutDeviceToLayerScale2D = [u32; 2usize]; - pub type ScreenToLayerScale2D = [u32; 2usize]; - pub type TimeStampValue = u64; - /** - * Instances of this class represent moments in time, or a special - * "null" moment. We do not use the non-monotonic system clock or - * local time, since they can be reset, causing apparent backward - * travel in time, which can confuse algorithms. Instead we measure - * elapsed time according to the system. This time can never go - * backwards (i.e. it never wraps around, at least not in less than - * five million years of system elapsed time). It might not advance - * while the system is sleeping. If TimeStamp::SetNow() is not called - * at all for hours or days, we might not notice the passage of some - * of that time. - * - * We deliberately do not expose a way to convert TimeStamps to some - * particular unit. All you can do is compute a difference between two - * TimeStamps to get a TimeDuration. You can also add a TimeDuration - * to a TimeStamp to get a new TimeStamp. You can't do something - * meaningless like add two TimeStamps. - * - * Internally this is implemented as either a wrapper around - * - high-resolution, monotonic, system clocks if they exist on this - * platform - * - PRIntervalTime otherwise. We detect wraparounds of - * PRIntervalTime and work around them. - * - * This class is similar to C++11's time_point, however it is - * explicitly nullable and provides an IsNull() method. time_point - * is initialized to the clock's epoch and provides a - * time_since_epoch() method that functions similiarly. i.e. - * t.IsNull() is equivalent to t.time_since_epoch() == decltype(t)::duration::zero(); - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct TimeStamp { - /** - * When built with PRIntervalTime, a value of 0 means this instance - * is "null". Otherwise, the low 32 bits represent a PRIntervalTime, - * and the high 32 bits represent a counter of the number of - * rollovers of PRIntervalTime that we've seen. This counter starts - * at 1 to avoid a real time colliding with the "null" value. - * - * PR_INTERVAL_MAX is set at 100,000 ticks per second. So the minimum - * time to wrap around is about 2^64/100000 seconds, i.e. about - * 5,849,424 years. - * - * When using a system clock, a value is system dependent. - */ - pub mValue: root::mozilla::TimeStampValue, - } - #[test] - fn bindgen_test_layout_TimeStamp() { - assert_eq!(::std::mem::size_of::<TimeStamp>() , 8usize , concat ! - ( "Size of: " , stringify ! ( TimeStamp ) )); - assert_eq! (::std::mem::align_of::<TimeStamp>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( TimeStamp ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const TimeStamp ) ) . mValue as * const - _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( TimeStamp ) , - "::" , stringify ! ( mValue ) )); - } - impl Clone for TimeStamp { - fn clone(&self) -> Self { *self } - } - /** - * Instances of this class represent the length of an interval of time. - * Negative durations are allowed, meaning the end is before the start. - * - * Internally the duration is stored as a int64_t in units of - * PR_TicksPerSecond() when building with NSPR interval timers, or a - * system-dependent unit when building with system clocks. The - * system-dependent unit must be constant, otherwise the semantics of - * this class would be broken. - * - * The ValueCalculator template parameter determines how arithmetic - * operations are performed on the integer count of ticks (mValue). - */ - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct BaseTimeDuration { - pub mValue: i64, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct BaseTimeDuration__SomethingVeryRandomHere { - pub _address: u8, - } - /** - * Perform arithmetic operations on the value of a BaseTimeDuration without - * doing strict checks on the range of values. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct TimeDurationValueCalculator { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_TimeDurationValueCalculator() { - assert_eq!(::std::mem::size_of::<TimeDurationValueCalculator>() , - 1usize , concat ! ( - "Size of: " , stringify ! ( TimeDurationValueCalculator - ) )); - assert_eq! (::std::mem::align_of::<TimeDurationValueCalculator>() - , 1usize , concat ! ( - "Alignment of " , stringify ! ( - TimeDurationValueCalculator ) )); - } - impl Clone for TimeDurationValueCalculator { - fn clone(&self) -> Self { *self } - } - /** - * Specialization of BaseTimeDuration that uses TimeDurationValueCalculator for - * arithmetic on the mValue member. - * - * Use this class for time durations that are *not* expected to hold values of - * Forever (or the negative equivalent) or when such time duration are *not* - * expected to be used in arithmetic operations. - */ - pub type TimeDuration = root::mozilla::BaseTimeDuration; - /** - * EventStates is the class used to represent the event states of nsIContent - * instances. These states are calculated by IntrinsicState() and - * ContentStatesChanged() has to be called when one of them changes thus - * informing the layout/style engine of the change. - * Event states are associated with pseudo-classes. - */ + /// EventStates is the class used to represent the event states of nsIContent + /// instances. These states are calculated by IntrinsicState() and + /// ContentStatesChanged() has to be called when one of them changes thus + /// informing the layout/style engine of the change. + /// Event states are associated with pseudo-classes. #[repr(C)] #[derive(Debug, Copy)] pub struct EventStates { @@ -7371,24 +4888,31 @@ pub mod root { impl Clone for EventStates { fn clone(&self) -> Self { *self } } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum LazyComputeBehavior { Allow = 0, Assert = 1, } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum TraversalRootBehavior { - Normal = 0, - UnstyledChildrenOnly = 1, - } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum TraversalRestyleBehavior { - Normal = 0, - ForNewlyBoundElement = 1, - ForReconstruct = 2, - ForThrottledAnimationFlush = 3, - ForCSSRuleChanges = 4, - } + pub const ServoTraversalFlags_Empty: + root::mozilla::ServoTraversalFlags = + 0; + pub const ServoTraversalFlags_AnimationOnly: + root::mozilla::ServoTraversalFlags = + 1; + pub const ServoTraversalFlags_ForCSSRuleChanges: + root::mozilla::ServoTraversalFlags = + 2; + pub const ServoTraversalFlags_UnstyledChildrenOnly: + root::mozilla::ServoTraversalFlags = + 4; + pub const ServoTraversalFlags_Forgetful: + root::mozilla::ServoTraversalFlags = + 8; + pub const ServoTraversalFlags_AggressivelyForgetful: + root::mozilla::ServoTraversalFlags = + 16; + pub const ServoTraversalFlags_ClearDirtyDescendants: + root::mozilla::ServoTraversalFlags = + 32; + pub const ServoTraversalFlags_ClearAnimationOnlyDirtyDescendants: + root::mozilla::ServoTraversalFlags = + 64; + pub type ServoTraversalFlags = u32; #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleRuleInclusion { All = 0, DefaultOnly = 1, } @@ -7442,7 +4966,7 @@ pub mod root { } #[test] fn bindgen_test_layout_ServoStyleContext() { - assert_eq!(::std::mem::size_of::<ServoStyleContext>() , 264usize , + assert_eq!(::std::mem::size_of::<ServoStyleContext>() , 256usize , concat ! ( "Size of: " , stringify ! ( ServoStyleContext ) )); assert_eq! (::std::mem::align_of::<ServoStyleContext>() , 8usize , @@ -7451,14 +4975,14 @@ pub mod root { )); assert_eq! (unsafe { & ( * ( 0 as * const ServoStyleContext ) ) . - mPresContext as * const _ as usize } , 32usize , + mPresContext as * const _ as usize } , 24usize , concat ! ( "Alignment of field: " , stringify ! ( ServoStyleContext ) , "::" , stringify ! ( mPresContext ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoStyleContext ) ) . mSource - as * const _ as usize } , 40usize , concat ! ( + as * const _ as usize } , 32usize , concat ! ( "Alignment of field: " , stringify ! ( ServoStyleContext ) , "::" , stringify ! ( mSource ) )); @@ -7887,11 +5411,90 @@ pub mod root { , "::" , stringify ! ( gecko ) )); } #[repr(u8)] - /** - * Enumeration that represents one of the two supported style system backends. - */ + /// Enumeration that represents one of the two supported style system backends. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleBackendType { None = 0, Gecko = 1, Servo = 2, } + pub type TimeStampValue = u64; + /// Instances of this class represent moments in time, or a special + /// "null" moment. We do not use the non-monotonic system clock or + /// local time, since they can be reset, causing apparent backward + /// travel in time, which can confuse algorithms. Instead we measure + /// elapsed time according to the system. This time can never go + /// backwards (i.e. it never wraps around, at least not in less than + /// five million years of system elapsed time). It might not advance + /// while the system is sleeping. If TimeStamp::SetNow() is not called + /// at all for hours or days, we might not notice the passage of some + /// of that time. + /// + /// We deliberately do not expose a way to convert TimeStamps to some + /// particular unit. All you can do is compute a difference between two + /// TimeStamps to get a TimeDuration. You can also add a TimeDuration + /// to a TimeStamp to get a new TimeStamp. You can't do something + /// meaningless like add two TimeStamps. + /// + /// Internally this is implemented as either a wrapper around + /// - high-resolution, monotonic, system clocks if they exist on this + /// platform + /// - PRIntervalTime otherwise. We detect wraparounds of + /// PRIntervalTime and work around them. + /// + /// This class is similar to C++11's time_point, however it is + /// explicitly nullable and provides an IsNull() method. time_point + /// is initialized to the clock's epoch and provides a + /// time_since_epoch() method that functions similiarly. i.e. + /// t.IsNull() is equivalent to t.time_since_epoch() == decltype(t)::duration::zero(); + #[repr(C)] + #[derive(Debug, Copy)] + pub struct TimeStamp { + /// When built with PRIntervalTime, a value of 0 means this instance + /// is "null". Otherwise, the low 32 bits represent a PRIntervalTime, + /// and the high 32 bits represent a counter of the number of + /// rollovers of PRIntervalTime that we've seen. This counter starts + /// at 1 to avoid a real time colliding with the "null" value. + /// + /// PR_INTERVAL_MAX is set at 100,000 ticks per second. So the minimum + /// time to wrap around is about 2^64/100000 seconds, i.e. about + /// 5,849,424 years. + /// + /// When using a system clock, a value is system dependent. + pub mValue: root::mozilla::TimeStampValue, + } + #[test] + fn bindgen_test_layout_TimeStamp() { + assert_eq!(::std::mem::size_of::<TimeStamp>() , 8usize , concat ! + ( "Size of: " , stringify ! ( TimeStamp ) )); + assert_eq! (::std::mem::align_of::<TimeStamp>() , 8usize , concat + ! ( "Alignment of " , stringify ! ( TimeStamp ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const TimeStamp ) ) . mValue as * const + _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( TimeStamp ) , + "::" , stringify ! ( mValue ) )); + } + impl Clone for TimeStamp { + fn clone(&self) -> Self { *self } + } + /// Instances of this class represent the length of an interval of time. + /// Negative durations are allowed, meaning the end is before the start. + /// + /// Internally the duration is stored as a int64_t in units of + /// PR_TicksPerSecond() when building with NSPR interval timers, or a + /// system-dependent unit when building with system clocks. The + /// system-dependent unit must be constant, otherwise the semantics of + /// this class would be broken. + /// + /// The ValueCalculator template parameter determines how arithmetic + /// operations are performed on the integer count of ticks (mValue). + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct BaseTimeDuration { + pub mValue: i64, + } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct BaseTimeDuration__SomethingVeryRandomHere { + pub _address: u8, + } #[repr(C)] #[derive(Debug, Copy)] pub struct MallocAllocPolicy { @@ -7910,6 +5513,32 @@ pub mod root { impl Clone for MallocAllocPolicy { fn clone(&self) -> Self { *self } } + pub type Vector_Impl = u8; + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct Vector_CapacityAndReserved { + pub mCapacity: usize, + } + pub type Vector_ElementType<T> = T; + pub const Vector_InlineLength: root::mozilla::Vector__bindgen_ty_1 = + Vector__bindgen_ty_1::InlineLength; + #[repr(i32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum Vector__bindgen_ty_1 { InlineLength = 0, } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct Vector_Range<T> { + pub mCur: *mut T, + pub mEnd: *mut T, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct Vector_ConstRange<T> { + pub mCur: *mut T, + pub mEnd: *mut T, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + } #[repr(C)] #[derive(Debug, Copy)] pub struct ErrorResult { @@ -7928,33 +5557,18 @@ pub mod root { impl Clone for ErrorResult { fn clone(&self) -> Self { *self } } - #[repr(C)] - #[derive(Debug)] - pub struct OOMReporter { - pub _base: root::mozilla::dom::binding_detail::FastErrorResult, - } - #[test] - fn bindgen_test_layout_OOMReporter() { - assert_eq!(::std::mem::size_of::<OOMReporter>() , 16usize , concat - ! ( "Size of: " , stringify ! ( OOMReporter ) )); - assert_eq! (::std::mem::align_of::<OOMReporter>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( OOMReporter ) )); - } pub mod binding_danger { #[allow(unused_imports)] use self::super::super::super::root; - /** - * Templated implementation class for various ErrorResult-like things. The - * instantiations differ only in terms of their cleanup policies (used in the - * destructor), which they can specify via the template argument. Note that - * this means it's safe to reinterpret_cast between the instantiations unless - * you plan to invoke the destructor through such a cast pointer. - * - * A cleanup policy consists of two booleans: whether to assert that we've been - * reported or suppressed, and whether to then go ahead and suppress the - * exception. - */ + /// Templated implementation class for various ErrorResult-like things. The + /// instantiations differ only in terms of their cleanup policies (used in the + /// destructor), which they can specify via the template argument. Note that + /// this means it's safe to reinterpret_cast between the instantiations unless + /// you plan to invoke the destructor through such a cast pointer. + /// + /// A cleanup policy consists of two booleans: whether to assert that we've been + /// reported or suppressed, and whether to then go ahead and suppress the + /// exception. #[repr(C)] #[derive(Debug)] pub struct TErrorResult { @@ -7981,27 +5595,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] - pub struct JustAssertCleanupPolicy { - pub _address: u8, - } - pub const JustAssertCleanupPolicy_assertHandled: bool = true; - pub const JustAssertCleanupPolicy_suppress: bool = false; - #[test] - fn bindgen_test_layout_JustAssertCleanupPolicy() { - assert_eq!(::std::mem::size_of::<JustAssertCleanupPolicy>() , - 1usize , concat ! ( - "Size of: " , stringify ! ( JustAssertCleanupPolicy - ) )); - assert_eq! (::std::mem::align_of::<JustAssertCleanupPolicy>() - , 1usize , concat ! ( - "Alignment of " , stringify ! ( - JustAssertCleanupPolicy ) )); - } - impl Clone for JustAssertCleanupPolicy { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] pub struct AssertAndSuppressCleanupPolicy { pub _address: u8, } @@ -8023,9 +5616,7 @@ pub mod root { fn clone(&self) -> Self { *self } } } - /** - * Superclass for data common to CSSStyleSheet and ServoStyleSheet. - */ + /// Superclass for data common to CSSStyleSheet and ServoStyleSheet. #[repr(C)] #[derive(Debug)] pub struct StyleSheet { @@ -8069,12 +5660,10 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(i32)] - /** - * The different changes that a stylesheet may go through. - * - * Used by the StyleSets in order to handle more efficiently some kinds of - * changes. - */ + /// The different changes that a stylesheet may go through. + /// + /// Used by the StyleSets in order to handle more efficiently some kinds of + /// changes. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleSheet_ChangeType { Added = 0, @@ -8137,42 +5726,6 @@ pub mod root { assert_eq! (::std::mem::align_of::<StyleSheet>() , 8usize , concat ! ( "Alignment of " , stringify ! ( StyleSheet ) )); } - #[repr(C)] - #[derive(Debug)] - pub struct OriginAttributes { - pub _base: root::mozilla::dom::OriginAttributesDictionary, - } - pub const OriginAttributes_STRIP_FIRST_PARTY_DOMAIN: - root::mozilla::OriginAttributes__bindgen_ty_1 = - OriginAttributes__bindgen_ty_1::STRIP_FIRST_PARTY_DOMAIN; - pub const OriginAttributes_STRIP_USER_CONTEXT_ID: - root::mozilla::OriginAttributes__bindgen_ty_1 = - OriginAttributes__bindgen_ty_1::STRIP_USER_CONTEXT_ID; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum OriginAttributes__bindgen_ty_1 { - STRIP_FIRST_PARTY_DOMAIN = 1, - STRIP_USER_CONTEXT_ID = 2, - } - extern "C" { - #[link_name = - "_ZN7mozilla16OriginAttributes20sFirstPartyIsolationE"] - pub static mut OriginAttributes_sFirstPartyIsolation: bool; - } - extern "C" { - #[link_name = - "_ZN7mozilla16OriginAttributes23sRestrictedOpenerAccessE"] - pub static mut OriginAttributes_sRestrictedOpenerAccess: bool; - } - #[test] - fn bindgen_test_layout_OriginAttributes() { - assert_eq!(::std::mem::size_of::<OriginAttributes>() , 40usize , - concat ! ( - "Size of: " , stringify ! ( OriginAttributes ) )); - assert_eq! (::std::mem::align_of::<OriginAttributes>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( OriginAttributes ) )); - } pub mod net { #[allow(unused_imports)] use self::super::super::super::root; @@ -8198,6 +5751,7 @@ pub mod root { CORS_USE_CREDENTIALS = 2, } #[repr(C)] + #[derive(Debug)] pub struct CSSStyleSheet { pub _base: root::mozilla::StyleSheet, pub mRuleCollection: root::RefPtr<root::CSSRuleListImpl>, @@ -8319,10 +5873,8 @@ pub mod root { "Alignment of field: " , stringify ! ( ServoStyleSheet ) , "::" , stringify ! ( mRuleList ) )); } - /** - * Smart pointer class that can hold a pointer to either an nsStyleSet - * or a ServoStyleSet. - */ + /// Smart pointer class that can hold a pointer to either an nsStyleSet + /// or a ServoStyleSet. #[repr(C)] #[derive(Debug, Copy)] pub struct StyleSetHandle { @@ -8371,10 +5923,9 @@ pub mod root { } #[repr(C)] pub struct StyleSheetInfo__bindgen_vtable(::std::os::raw::c_void); - /** - * Struct for data common to CSSStyleSheetInner and ServoStyleSheet. - */ + /// Struct for data common to CSSStyleSheetInner and ServoStyleSheet. #[repr(C)] + #[derive(Debug)] pub struct StyleSheetInfo { pub vtable_: *const StyleSheetInfo__bindgen_vtable, pub mSheetURI: root::nsCOMPtr, @@ -8504,174 +6055,20 @@ pub mod root { NotPseudo = 28, MAX = 29, } - /** - * The set of style sheets that apply to a document, backed by a Servo - * Stylist. A ServoStyleSet contains ServoStyleSheets. - */ - #[repr(C)] - pub struct ServoStyleSet { - pub mPresContext: *mut root::nsPresContext, - pub mRawSet: root::mozilla::UniquePtr<root::RawServoStyleSet>, - pub mSheets: [u64; 9usize], - pub mAuthorStyleDisabled: bool, - pub mStylistState: root::mozilla::StylistState, - pub mUserFontSetUpdateGeneration: u64, - pub mUserFontCacheUpdateGeneration: u32, - pub mNeedsRestyleAfterEnsureUniqueInner: bool, - pub mNonInheritingStyleContexts: [u64; 5usize], - pub mPostTraversalTasks: root::nsTArray<root::mozilla::PostTraversalTask>, - pub mStyleRuleMap: root::RefPtr<root::mozilla::ServoStyleRuleMap>, - pub mBindingManager: root::RefPtr<root::nsBindingManager>, - } - pub type ServoStyleSet_SnapshotTable = - root::mozilla::ServoElementSnapshotTable; #[repr(C)] - #[derive(Debug)] - pub struct ServoStyleSet_AutoSetInServoTraversal { - pub mSet: *mut root::mozilla::ServoStyleSet, - } - #[test] - fn bindgen_test_layout_ServoStyleSet_AutoSetInServoTraversal() { - assert_eq!(::std::mem::size_of::<ServoStyleSet_AutoSetInServoTraversal>() - , 8usize , concat ! ( - "Size of: " , stringify ! ( - ServoStyleSet_AutoSetInServoTraversal ) )); - assert_eq! (::std::mem::align_of::<ServoStyleSet_AutoSetInServoTraversal>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - ServoStyleSet_AutoSetInServoTraversal ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const ServoStyleSet_AutoSetInServoTraversal - ) ) . mSet as * const _ as usize } , 0usize , concat ! - ( - "Alignment of field: " , stringify ! ( - ServoStyleSet_AutoSetInServoTraversal ) , "::" , - stringify ! ( mSet ) )); - } - extern "C" { - #[link_name = "_ZN7mozilla13ServoStyleSet17sInServoTraversalE"] - pub static mut ServoStyleSet_sInServoTraversal: - *mut root::mozilla::ServoStyleSet; + #[derive(Debug, Copy)] + pub struct SeenPtrs { + pub _bindgen_opaque_blob: [u64; 5usize], } #[test] - fn bindgen_test_layout_ServoStyleSet() { - assert_eq!(::std::mem::size_of::<ServoStyleSet>() , 176usize , - concat ! ( "Size of: " , stringify ! ( ServoStyleSet ) - )); - assert_eq! (::std::mem::align_of::<ServoStyleSet>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( ServoStyleSet ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . mPresContext - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mPresContext ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . mRawSet as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mRawSet ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . mSheets as * - const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mSheets ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mAuthorStyleDisabled as * const _ as usize } , 88usize - , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mAuthorStyleDisabled ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . mStylistState - as * const _ as usize } , 89usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mStylistState ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mUserFontSetUpdateGeneration as * const _ as usize } , - 96usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mUserFontSetUpdateGeneration ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mUserFontCacheUpdateGeneration as * const _ as usize } - , 104usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mUserFontCacheUpdateGeneration - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mNeedsRestyleAfterEnsureUniqueInner as * const _ as - usize } , 108usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( - mNeedsRestyleAfterEnsureUniqueInner ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mNonInheritingStyleContexts as * const _ as usize } , - 112usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mNonInheritingStyleContexts ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mPostTraversalTasks as * const _ as usize } , 152usize - , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mPostTraversalTasks ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . mStyleRuleMap - as * const _ as usize } , 160usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mStyleRuleMap ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoStyleSet ) ) . - mBindingManager as * const _ as usize } , 168usize , - concat ! ( - "Alignment of field: " , stringify ! ( ServoStyleSet ) - , "::" , stringify ! ( mBindingManager ) )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventChainVisitor { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventChainPostVisitor { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventChainPreVisitor { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct EventListenerManager { - _unused: [u8; 0], + fn bindgen_test_layout_SeenPtrs() { + assert_eq!(::std::mem::size_of::<SeenPtrs>() , 40usize , concat ! + ( "Size of: " , stringify ! ( SeenPtrs ) )); + assert_eq! (::std::mem::align_of::<SeenPtrs>() , 8usize , concat ! + ( "Alignment of " , stringify ! ( SeenPtrs ) )); } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct TextEditor { - _unused: [u8; 0], - } - #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_2() { - assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::mozilla::URLExtraData>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::StaticRefPtr<root::mozilla::URLExtraData> - ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::mozilla::URLExtraData>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! - ( - root::mozilla::StaticRefPtr<root::mozilla::URLExtraData> - ) )); + impl Clone for SeenPtrs { + fn clone(&self) -> Self { *self } } #[repr(C)] #[derive(Debug)] @@ -8680,6 +6077,7 @@ pub mod root { pub mBaseURI: root::nsCOMPtr, pub mReferrer: root::nsCOMPtr, pub mPrincipal: root::nsCOMPtr, + pub mIsChrome: bool, } pub type URLExtraData_HasThreadSafeRefCnt = root::mozilla::TrueType; extern "C" { @@ -8689,7 +6087,7 @@ pub mod root { } #[test] fn bindgen_test_layout_URLExtraData() { - assert_eq!(::std::mem::size_of::<URLExtraData>() , 32usize , + assert_eq!(::std::mem::size_of::<URLExtraData>() , 40usize , concat ! ( "Size of: " , stringify ! ( URLExtraData ) )); assert_eq! (::std::mem::align_of::<URLExtraData>() , 8usize , @@ -8715,6 +6113,25 @@ pub mod root { * const _ as usize } , 24usize , concat ! ( "Alignment of field: " , stringify ! ( URLExtraData ) , "::" , stringify ! ( mPrincipal ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const URLExtraData ) ) . mIsChrome as * + const _ as usize } , 32usize , concat ! ( + "Alignment of field: " , stringify ! ( URLExtraData ) + , "::" , stringify ! ( mIsChrome ) )); + } + #[test] + fn __bindgen_test_layout_StaticRefPtr_open0_URLExtraData_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::mozilla::URLExtraData>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr<root::mozilla::URLExtraData> + ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::mozilla::URLExtraData>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! + ( + root::mozilla::StaticRefPtr<root::mozilla::URLExtraData> + ) )); } pub mod widget { #[allow(unused_imports)] @@ -8725,27 +6142,25 @@ pub mod root { _unused: [u8; 0], } } - pub type RawSelectionType = ::std::os::raw::c_short; - #[repr(i16)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum SelectionType { - eInvalid = -1, - eNone = 0, - eNormal = 1, - eSpellCheck = 2, - eIMERawClause = 4, - eIMESelectedRawClause = 8, - eIMEConvertedClause = 16, - eIMESelectedClause = 32, - eAccessibility = 64, - eFind = 128, - eURLSecondary = 256, - eURLStrikeout = 512, + #[repr(C)] + #[derive(Debug, Copy)] + pub struct ArenaAllocator_ArenaHeader { + /// The location in memory of the data portion of the arena. + pub offset: usize, + /// The location in memory of the end of the data portion of the arena. + pub tail: usize, + } + impl Clone for ArenaAllocator_ArenaHeader { + fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AccessibleCaretEventHub { - _unused: [u8; 0], + #[derive(Debug, Copy)] + pub struct ArenaAllocator_ArenaChunk { + pub header: root::mozilla::ArenaAllocator_ArenaHeader, + pub next: *mut root::mozilla::ArenaAllocator_ArenaChunk, + } + impl Clone for ArenaAllocator_ArenaChunk { + fn clone(&self) -> Self { *self } } pub mod a11y { #[allow(unused_imports)] @@ -8777,23 +6192,56 @@ pub mod root { assert_eq! (::std::mem::align_of::<Runnable>() , 8usize , concat ! ( "Alignment of " , stringify ! ( Runnable ) )); } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum TaskCategory { - UI = 0, - Network = 1, - Timer = 2, - Worker = 3, - IdleCallback = 4, - RefreshDriver = 5, - GarbageCollection = 6, - Other = 7, - Count = 8, + #[repr(C)] + #[derive(Debug)] + pub struct CycleCollectedJSContext_RunInMetastableStateData { + pub mRunnable: root::nsCOMPtr, + pub mRecursionDepth: u32, + } + #[test] + fn bindgen_test_layout_CycleCollectedJSContext_RunInMetastableStateData() { + assert_eq!(::std::mem::size_of::<CycleCollectedJSContext_RunInMetastableStateData>() + , 16usize , concat ! ( + "Size of: " , stringify ! ( + CycleCollectedJSContext_RunInMetastableStateData ) )); + assert_eq! (::std::mem::align_of::<CycleCollectedJSContext_RunInMetastableStateData>() + , 8usize , concat ! ( + "Alignment of " , stringify ! ( + CycleCollectedJSContext_RunInMetastableStateData ) )); + assert_eq! (unsafe { + & ( + * ( + 0 as * const + CycleCollectedJSContext_RunInMetastableStateData ) ) . + mRunnable as * const _ as usize } , 0usize , concat ! + ( + "Alignment of field: " , stringify ! ( + CycleCollectedJSContext_RunInMetastableStateData ) , + "::" , stringify ! ( mRunnable ) )); + assert_eq! (unsafe { + & ( + * ( + 0 as * const + CycleCollectedJSContext_RunInMetastableStateData ) ) . + mRecursionDepth as * const _ as usize } , 8usize , + concat ! ( + "Alignment of field: " , stringify ! ( + CycleCollectedJSContext_RunInMetastableStateData ) , + "::" , stringify ! ( mRecursionDepth ) )); } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct AbstractThread { - _unused: [u8; 0], + pub struct SegmentedVector_SegmentImpl_Storage { + pub mBuf: root::__BindgenUnionField<*mut ::std::os::raw::c_char>, + pub mAlign: root::__BindgenUnionField<u8>, + pub bindgen_union_field: u64, + } + pub type SegmentedVector_Segment = u8; + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct SegmentedVector_IterImpl { + pub mSegment: *mut root::mozilla::SegmentedVector_Segment, + pub mIndex: usize, } #[repr(i16)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -8873,7 +6321,7 @@ pub mod root { eUseCounter_ShowModalDialog = 71, eUseCounter_Window_Content = 72, eUseCounter_SyncXMLHttpRequest = 73, - eUseCounter_Window_Controllers = 74, + eUseCounter_Window_Cc_ontrollers = 74, eUseCounter_ImportXULIntoContent = 75, eUseCounter_PannerNodeDoppler = 76, eUseCounter_NavigatorGetUserMedia = 77, @@ -8891,11 +6339,6 @@ pub mod root { eUseCounter_Count = 89, } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct PendingAnimationTracker { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug)] pub struct ScrollbarStyles { pub mHorizontal: u8, @@ -9062,12 +6505,10 @@ pub mod root { LangGroupFontPrefs ) , "::" , stringify ! ( mNext ) )); } - /** - * Some functionality that has historically lived on nsPresContext does not - * actually need to be per-document. This singleton class serves as a host - * for that functionality. We delegate to it from nsPresContext where - * appropriate, and use it standalone in some cases as well. - */ + /// Some functionality that has historically lived on nsPresContext does not + /// actually need to be per-document. This singleton class serves as a host + /// for that functionality. We delegate to it from nsPresContext where + /// appropriate, and use it standalone in some cases as well. #[repr(C)] #[derive(Debug)] pub struct StaticPresData { @@ -9103,6 +6544,7 @@ pub mod root { )); } #[repr(C)] + #[derive(Debug)] pub struct EffectCompositor { pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub mPresContext: *mut root::nsPresContext, @@ -9306,74 +6748,24 @@ pub mod root { pub struct RestyleManager { _unused: [u8; 0], } - /** - * BlockingResourceBase - * Base class of resources that might block clients trying to acquire them. - * Does debugging and deadlock detection in DEBUG builds. - **/ #[repr(C)] - #[derive(Debug)] - pub struct BlockingResourceBase { + #[derive(Debug, Copy)] + pub struct XREAppData_NSFreePolicy { pub _address: u8, } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum BlockingResourceBase_BlockingResourceType { - eMutex = 0, - eReentrantMonitor = 1, - eCondVar = 2, - } - extern "C" { - #[link_name = - "_ZN7mozilla20BlockingResourceBase17kResourceTypeNameE"] - pub static mut BlockingResourceBase_kResourceTypeName: - [*const ::std::os::raw::c_char; 0usize]; - } #[test] - fn bindgen_test_layout_BlockingResourceBase() { - assert_eq!(::std::mem::size_of::<BlockingResourceBase>() , 1usize - , concat ! ( - "Size of: " , stringify ! ( BlockingResourceBase ) )); - assert_eq! (::std::mem::align_of::<BlockingResourceBase>() , + fn bindgen_test_layout_XREAppData_NSFreePolicy() { + assert_eq!(::std::mem::size_of::<XREAppData_NSFreePolicy>() , + 1usize , concat ! ( + "Size of: " , stringify ! ( XREAppData_NSFreePolicy ) + )); + assert_eq! (::std::mem::align_of::<XREAppData_NSFreePolicy>() , 1usize , concat ! ( - "Alignment of " , stringify ! ( BlockingResourceBase ) - )); - } - /** - * OffTheBooksMutex is identical to Mutex, except that OffTheBooksMutex doesn't - * include leak checking. Sometimes you want to intentionally "leak" a mutex - * until shutdown; in these cases, OffTheBooksMutex is for you. - */ - #[repr(C)] - #[derive(Debug)] - pub struct OffTheBooksMutex { - pub _base: root::mozilla::detail::MutexImpl, - } - #[test] - fn bindgen_test_layout_OffTheBooksMutex() { - assert_eq!(::std::mem::size_of::<OffTheBooksMutex>() , 40usize , - concat ! ( - "Size of: " , stringify ! ( OffTheBooksMutex ) )); - assert_eq! (::std::mem::align_of::<OffTheBooksMutex>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( OffTheBooksMutex ) )); - } - /** - * Mutex - * When possible, use MutexAutoLock/MutexAutoUnlock to lock/unlock this - * mutex within a scope, instead of calling Lock/Unlock directly. - */ - #[repr(C)] - #[derive(Debug)] - pub struct Mutex { - pub _base: root::mozilla::OffTheBooksMutex, + "Alignment of " , stringify ! ( + XREAppData_NSFreePolicy ) )); } - #[test] - fn bindgen_test_layout_Mutex() { - assert_eq!(::std::mem::size_of::<Mutex>() , 40usize , concat ! ( - "Size of: " , stringify ! ( Mutex ) )); - assert_eq! (::std::mem::align_of::<Mutex>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( Mutex ) )); + impl Clone for XREAppData_NSFreePolicy { + fn clone(&self) -> Self { *self } } pub mod image { #[allow(unused_imports)] @@ -9383,71 +6775,6 @@ pub mod root { pub struct ImageURL { _unused: [u8; 0], } - /** - * An ImageLib cache entry key. - * - * We key the cache on the initial URI (before any redirects), with some - * canonicalization applied. See ComputeHash() for the details. - * Controlled documents do not share their cache entries with - * non-controlled documents, or other controlled documents. - */ - #[repr(C)] - #[derive(Debug)] - pub struct ImageCacheKey { - pub mURI: root::RefPtr<root::mozilla::image::ImageURL>, - pub mBlobSerial: [u64; 2usize], - pub mOriginAttributes: root::mozilla::OriginAttributes, - pub mControlledDocument: *mut ::std::os::raw::c_void, - pub mHash: root::PLDHashNumber, - pub mIsChrome: bool, - } - #[test] - fn bindgen_test_layout_ImageCacheKey() { - assert_eq!(::std::mem::size_of::<ImageCacheKey>() , 80usize , - concat ! ( - "Size of: " , stringify ! ( ImageCacheKey ) )); - assert_eq! (::std::mem::align_of::<ImageCacheKey>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( ImageCacheKey ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const ImageCacheKey ) ) . mURI as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - ImageCacheKey ) , "::" , stringify ! ( mURI ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ImageCacheKey ) ) . - mBlobSerial as * const _ as usize } , 8usize , - concat ! ( - "Alignment of field: " , stringify ! ( - ImageCacheKey ) , "::" , stringify ! ( mBlobSerial - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ImageCacheKey ) ) . - mOriginAttributes as * const _ as usize } , - 24usize , concat ! ( - "Alignment of field: " , stringify ! ( - ImageCacheKey ) , "::" , stringify ! ( - mOriginAttributes ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ImageCacheKey ) ) . - mControlledDocument as * const _ as usize } , - 64usize , concat ! ( - "Alignment of field: " , stringify ! ( - ImageCacheKey ) , "::" , stringify ! ( - mControlledDocument ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ImageCacheKey ) ) . mHash as - * const _ as usize } , 72usize , concat ! ( - "Alignment of field: " , stringify ! ( - ImageCacheKey ) , "::" , stringify ! ( mHash ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ImageCacheKey ) ) . mIsChrome - as * const _ as usize } , 76usize , concat ! ( - "Alignment of field: " , stringify ! ( - ImageCacheKey ) , "::" , stringify ! ( mIsChrome ) - )); - } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Image { @@ -9460,18 +6787,16 @@ pub mod root { } #[repr(C)] pub struct IProgressObserver__bindgen_vtable(::std::os::raw::c_void); - /** - * An interface for observing changes to image state, as reported by - * ProgressTracker. - * - * This is the ImageLib-internal version of imgINotificationObserver, - * essentially, with implementation details that code outside of ImageLib - * shouldn't see. - * - * XXX(seth): It's preferable to avoid adding anything to this interface if - * possible. In the long term, it would be ideal to get to a place where we can - * just use the imgINotificationObserver interface internally as well. - */ + /// An interface for observing changes to image state, as reported by + /// ProgressTracker. + /// + /// This is the ImageLib-internal version of imgINotificationObserver, + /// essentially, with implementation details that code outside of ImageLib + /// shouldn't see. + /// + /// XXX(seth): It's preferable to avoid adding anything to this interface if + /// possible. In the long term, it would be ideal to get to a place where we can + /// just use the imgINotificationObserver interface internally as well. #[repr(C)] #[derive(Debug)] pub struct IProgressObserver { @@ -9489,17 +6814,6 @@ pub mod root { ) )); } } - pub type CounterValue = i32; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct NegativeType { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct PadType { - _unused: [u8; 0], - } #[repr(C)] pub struct CounterStyle__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] @@ -9801,6 +7115,16 @@ pub mod root { StyleShapeSource ) , "::" , stringify ! ( mReferenceBox ) )); } + /// <div rustbindgen="true" replaces="mozilla::UniquePtr"> + /// + /// TODO(Emilio): This is a workaround and we should be able to get rid of this + /// one. + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct UniquePtr<T> { + pub mPtr: *mut T, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + } pub const SERVO_PREF_ENABLED_align_content: bool = false; pub const SERVO_PREF_ENABLED_align_items: bool = false; pub const SERVO_PREF_ENABLED_align_self: bool = false; @@ -10180,13 +7504,11 @@ pub mod root { pub const SERVO_PREF_ENABLED_overflow_wrap: bool = false; pub const SERVO_PREF_ENABLED_writing_mode: bool = false; pub const SERVO_PREF_ENABLED_z_index: bool = false; - /** - * This class holds all non-tree-structural state of an element that might be - * used for selector matching eventually. - * - * This means the attributes, and the element state, such as :hover, :active, - * etc... - */ + /// This class holds all non-tree-structural state of an element that might be + /// used for selector matching eventually. + /// + /// This means the attributes, and the element state, such as :hover, :active, + /// etc... #[repr(C)] #[derive(Debug)] pub struct ServoElementSnapshot { @@ -10658,10 +7980,8 @@ pub mod root { AnimationPropertySegment ) , "::" , stringify ! ( mToComposite ) )); } - /** - * Stores the results of calculating the timing properties of an animation - * at a given sample time. - */ + /// Stores the results of calculating the timing properties of an animation + /// at a given sample time. #[repr(C)] #[derive(Debug)] pub struct ComputedTiming { @@ -10752,22 +8072,20 @@ pub mod root { "Alignment of field: " , stringify ! ( ComputedTiming ) , "::" , stringify ! ( mBeforeFlag ) )); } - /** - * A single keyframe. - * - * This is the canonical form in which keyframe effects are stored and - * corresponds closely to the type of objects returned via the getKeyframes() - * API. - * - * Before computing an output animation value, however, we flatten these frames - * down to a series of per-property value arrays where we also resolve any - * overlapping shorthands/longhands, convert specified CSS values to computed - * values, etc. - * - * When the target element or style context changes, however, we rebuild these - * per-property arrays from the original list of keyframes objects. As a result, - * these objects represent the master definition of the effect's values. - */ + /// A single keyframe. + /// + /// This is the canonical form in which keyframe effects are stored and + /// corresponds closely to the type of objects returned via the getKeyframes() + /// API. + /// + /// Before computing an output animation value, however, we flatten these frames + /// down to a series of per-property value arrays where we also resolve any + /// overlapping shorthands/longhands, convert specified CSS values to computed + /// values, etc. + /// + /// When the target element or style context changes, however, we rebuild these + /// per-property arrays from the original list of keyframes objects. As a result, + /// these objects represent the master definition of the effect's values. #[repr(C)] #[derive(Debug)] pub struct Keyframe { @@ -10810,9 +8128,7 @@ pub mod root { "Alignment of field: " , stringify ! ( Keyframe ) , "::" , stringify ! ( mPropertyValues ) )); } - /** - * A property-value pair specified on a keyframe. - */ + /// A property-value pair specified on a keyframe. #[repr(C)] #[derive(Debug)] pub struct PropertyValuePair { @@ -10881,7 +8197,7 @@ pub mod root { ( mValue ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_3() { + fn __bindgen_test_layout_DefaultDelete_open0_RawServoStyleSet_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -10891,18 +8207,14 @@ pub mod root { "Alignment of template specialization: " , stringify ! ( root::mozilla::DefaultDelete ) )); } - /** - * Utility class to handle animated style values - */ + /// Utility class to handle animated style values #[repr(C)] #[derive(Debug, Copy)] pub struct StyleAnimationValue { pub _bindgen_opaque_blob: [u64; 2usize], } #[repr(u32)] - /** - * The types and values for the values that we extract and animate. - */ + /// The types and values for the values that we extract and animate. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleAnimationValue_Unit { eUnit_Null = 0, @@ -11136,6 +8448,7 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] + #[derive(Debug)] pub struct ServoStyleSheetInner { pub _base: root::mozilla::StyleSheetInfo, pub mContents: root::RefPtr<root::RawServoStyleSheetContents>, @@ -11273,20 +8586,18 @@ pub mod root { impl Clone for ComputedTimingFunction { fn clone(&self) -> Self { *self } } - /** - * A ValueCalculator class that performs additional checks before performing - * arithmetic operations such that if either operand is Forever (or the - * negative equivalent) the result remains Forever (or the negative equivalent - * as appropriate). - * - * Currently this only checks if either argument to each operation is - * Forever/-Forever. However, it is possible that, for example, - * aA + aB > INT64_MAX (or < INT64_MIN). - * - * We currently don't check for that case since we don't expect that to - * happen often except under test conditions in which case the wrapping - * behavior is probably acceptable. - */ + /// A ValueCalculator class that performs additional checks before performing + /// arithmetic operations such that if either operand is Forever (or the + /// negative equivalent) the result remains Forever (or the negative equivalent + /// as appropriate). + /// + /// Currently this only checks if either argument to each operation is + /// Forever/-Forever. However, it is possible that, for example, + /// aA + aB > INT64_MAX (or < INT64_MIN). + /// + /// We currently don't check for that case since we don't expect that to + /// happen often except under test conditions in which case the wrapping + /// behavior is probably acceptable. #[repr(C)] #[derive(Debug, Copy)] pub struct StickyTimeDurationValueCalculator { @@ -11306,61 +8617,22 @@ pub mod root { impl Clone for StickyTimeDurationValueCalculator { fn clone(&self) -> Self { *self } } - /** - * Specialization of BaseTimeDuration that uses - * StickyTimeDurationValueCalculator for arithmetic on the mValue member. - * - * Use this class when you need a time duration that is expected to hold values - * of Forever (or the negative equivalent) *and* when you expect that - * time duration to be used in arithmetic operations (and not just value - * comparisons). - */ + /// Specialization of BaseTimeDuration that uses + /// StickyTimeDurationValueCalculator for arithmetic on the mValue member. + /// + /// Use this class when you need a time duration that is expected to hold values + /// of Forever (or the negative equivalent) *and* when you expect that + /// time duration to be used in arithmetic operations (and not just value + /// comparisons). pub type StickyTimeDuration = root::mozilla::BaseTimeDuration; #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct SVGLengthList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGNumberList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGPathData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGPointList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGAnimatedPreserveAspectRatio { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGStringList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct SVGTransformList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct DeclarationBlock { _unused: [u8; 0], } - /** - * A structure representing a single attribute name and value. - * - * This is pretty similar to the private nsAttrAndChildArray::InternalAttr. - */ + /// A structure representing a single attribute name and value. + /// + /// This is pretty similar to the private nsAttrAndChildArray::InternalAttr. #[repr(C)] #[derive(Debug)] pub struct ServoAttrSnapshot { @@ -11389,10 +8661,8 @@ pub mod root { )); } #[repr(u8)] - /** - * A bitflags enum class used to determine what data does a ServoElementSnapshot - * contains. - */ + /// A bitflags enum class used to determine what data does a ServoElementSnapshot + /// contains. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum ServoElementSnapshotFlags { State = 1, @@ -11434,30 +8704,6 @@ pub mod root { impl Clone for NonOwningAnimationTarget { fn clone(&self) -> Self { *self } } - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum Directionality { - eDir_NotSet = 0, - eDir_RTL = 1, - eDir_LTR = 2, - eDir_Auto = 3, - } - /** - * An DisplayItemClip represents the intersection of an optional rectangle - * with a list of rounded rectangles (which is often empty), all in appunits. - * It can represent everything CSS clipping can do to an element (except for - * SVG clip-path), including no clipping at all. - */ - #[repr(C)] - #[derive(Debug)] - pub struct DisplayItemClip { - pub mClipRect: root::nsRect, - pub mRoundedClipRects: root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>, - pub mHaveClipRect: bool, - } - pub type DisplayItemClip_Color = root::mozilla::gfx::Color; - pub type DisplayItemClip_DrawTarget = root::mozilla::gfx::DrawTarget; - pub type DisplayItemClip_Path = root::mozilla::gfx::Path; #[repr(C)] #[derive(Debug, Copy)] pub struct DisplayItemClip_RoundedRect { @@ -11490,37 +8736,6 @@ pub mod root { impl Clone for DisplayItemClip_RoundedRect { fn clone(&self) -> Self { *self } } - #[test] - fn bindgen_test_layout_DisplayItemClip() { - assert_eq!(::std::mem::size_of::<DisplayItemClip>() , 32usize , - concat ! ( - "Size of: " , stringify ! ( DisplayItemClip ) )); - assert_eq! (::std::mem::align_of::<DisplayItemClip>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( DisplayItemClip ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DisplayItemClip ) ) . mClipRect - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( DisplayItemClip - ) , "::" , stringify ! ( mClipRect ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DisplayItemClip ) ) . - mRoundedClipRects as * const _ as usize } , 16usize , - concat ! ( - "Alignment of field: " , stringify ! ( DisplayItemClip - ) , "::" , stringify ! ( mRoundedClipRects ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const DisplayItemClip ) ) . - mHaveClipRect as * const _ as usize } , 24usize , - concat ! ( - "Alignment of field: " , stringify ! ( DisplayItemClip - ) , "::" , stringify ! ( mHaveClipRect ) )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ContainerLayerParameters { - _unused: [u8; 0], - } #[repr(C)] #[derive(Debug)] pub struct ServoElementSnapshotTable { @@ -11700,9 +8915,7 @@ pub mod root { eIntID_ContextMenuOffsetHorizontal = 52, } #[repr(u32)] - /** - * Windows themes we currently detect. - */ + /// Windows themes we currently detect. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum LookAndFeel_WindowsTheme { eWindowsTheme_Generic = 0, @@ -11716,9 +8929,7 @@ pub mod root { eWindowsTheme_AeroLite = 8, } #[repr(u32)] - /** - * Operating system versions. - */ + /// Operating system versions. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum LookAndFeel_OperatingSystemVersion { eOperatingSystemVersion_Windows7 = 2, @@ -11829,6 +9040,53 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug, Copy)] + pub struct StylePrefs { + pub _address: u8, + } + extern "C" { + #[link_name = "_ZN7mozilla10StylePrefs19sFontDisplayEnabledE"] + pub static mut StylePrefs_sFontDisplayEnabled: bool; + } + extern "C" { + #[link_name = "_ZN7mozilla10StylePrefs19sOpentypeSVGEnabledE"] + pub static mut StylePrefs_sOpentypeSVGEnabled: bool; + } + extern "C" { + #[link_name = + "_ZN7mozilla10StylePrefs29sWebkitPrefixedAliasesEnabledE"] + pub static mut StylePrefs_sWebkitPrefixedAliasesEnabled: bool; + } + extern "C" { + #[link_name = + "_ZN7mozilla10StylePrefs30sWebkitDevicePixelRatioEnabledE"] + pub static mut StylePrefs_sWebkitDevicePixelRatioEnabled: bool; + } + extern "C" { + #[link_name = "_ZN7mozilla10StylePrefs20sMozGradientsEnabledE"] + pub static mut StylePrefs_sMozGradientsEnabled: bool; + } + extern "C" { + #[link_name = "_ZN7mozilla10StylePrefs22sControlCharVisibilityE"] + pub static mut StylePrefs_sControlCharVisibility: bool; + } + extern "C" { + #[link_name = + "_ZN7mozilla10StylePrefs28sFramesTimingFunctionEnabledE"] + pub static mut StylePrefs_sFramesTimingFunctionEnabled: bool; + } + #[test] + fn bindgen_test_layout_StylePrefs() { + assert_eq!(::std::mem::size_of::<StylePrefs>() , 1usize , concat ! + ( "Size of: " , stringify ! ( StylePrefs ) )); + assert_eq! (::std::mem::align_of::<StylePrefs>() , 1usize , concat + ! ( "Alignment of " , stringify ! ( StylePrefs ) )); + } + impl Clone for StylePrefs { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug)] pub struct PseudoElementHashEntry { pub _base: root::PLDHashEntryHdr, pub mElement: root::RefPtr<root::mozilla::dom::Element>, @@ -11868,16 +9126,6 @@ pub mod root { PseudoElementHashEntry ) , "::" , stringify ! ( mPseudoType ) )); } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct RestyleTracker { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AnimationPerformanceWarning { - _unused: [u8; 0], - } pub type CSSPseudoClassTypeBase = u8; #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -11992,14 +9240,12 @@ pub mod root { "Alignment of field: " , stringify ! ( ServoMediaList ) , "::" , stringify ! ( mRawList ) )); } - /** - * A PostTraversalTask is a task to be performed immediately after a Servo - * traversal. There are just a few tasks we need to perform, so we use this - * class rather than Runnables, to avoid virtual calls and some allocations. - * - * A PostTraversalTask is only safe to run immediately after the Servo - * traversal, since it can hold raw pointers to DOM objects. - */ + /// A PostTraversalTask is a task to be performed immediately after a Servo + /// traversal. There are just a few tasks we need to perform, so we use this + /// class rather than Runnables, to avoid virtual calls and some allocations. + /// + /// A PostTraversalTask is only safe to run immediately after the Servo + /// traversal, since it can hold raw pointers to DOM objects. #[repr(C)] #[derive(Debug, Copy)] pub struct PostTraversalTask { @@ -12047,22 +9293,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ServoStyleRuleMap { - _unused: [u8; 0], - } - #[repr(u8)] - /** - * A few flags used to track which kind of stylist state we may need to - * update. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum StylistState { - NotDirty = 0, - StyleSheetsDirty = 1, - FullyDirty = 2, - } - #[repr(C)] #[derive(Debug)] pub struct CSSFontFaceDescriptors { pub mFamily: root::nsCSSValue, @@ -12150,20 +9380,7 @@ pub mod root { CSSFontFaceDescriptors ) , "::" , stringify ! ( mDisplay ) )); } - /** - * <div rustbindgen="true" replaces="mozilla::UniquePtr"> - * - * TODO(Emilio): This is a workaround and we should be able to get rid of this - * one. - */ - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct UniquePtr<T> { - pub mPtr: *mut T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } } - pub type va_list = root::__builtin_va_list; #[repr(C)] #[derive(Debug, Copy)] pub struct InfallibleAllocPolicy { @@ -12182,18 +9399,15 @@ pub mod root { impl Clone for InfallibleAllocPolicy { fn clone(&self) -> Self { *self } } - /** - * MozRefCountType is Mozilla's reference count type. - * - * We use the same type to represent the refcount of RefCounted objects - * as well, in order to be able to use the leak detection facilities - * that are implemented by XPCOM. - * - * Note that this type is not in the mozilla namespace so that it is - * usable for both C and C++ code. - */ + /// MozRefCountType is Mozilla's reference count type. + /// + /// We use the same type to represent the refcount of RefCounted objects + /// as well, in order to be able to use the leak detection facilities + /// that are implemented by XPCOM. + /// + /// Note that this type is not in the mozilla namespace so that it is + /// usable for both C and C++ code. pub type MozRefCountType = usize; - pub type MozExternalRefCountType = u32; pub const nsresult_NS_ERROR_NO_INTERFACE: root::nsresult = nsresult::NS_NOINTERFACE; pub const nsresult_NS_ERROR_INVALID_ARG: root::nsresult = @@ -12721,349 +9935,6 @@ pub mod root { } pub type nsrefcnt = root::MozRefCountType; #[repr(C)] - pub struct nsQueryFrame__bindgen_vtable(::std::os::raw::c_void); - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsQueryFrame { - pub vtable_: *const nsQueryFrame__bindgen_vtable, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsQueryFrame_FrameIID { - BRFrame_id = 0, - DetailsFrame_id = 1, - nsAutoRepeatBoxFrame_id = 2, - nsBCTableCellFrame_id = 3, - nsBackdropFrame_id = 4, - nsBlockFrame_id = 5, - nsBox_id = 6, - nsBoxFrame_id = 7, - nsBulletFrame_id = 8, - nsButtonBoxFrame_id = 9, - nsCanvasFrame_id = 10, - nsColorControlFrame_id = 11, - nsColumnSetFrame_id = 12, - nsComboboxControlFrame_id = 13, - nsComboboxDisplayFrame_id = 14, - nsContinuingTextFrame_id = 15, - nsDateTimeControlFrame_id = 16, - nsDeckFrame_id = 17, - nsDocElementBoxFrame_id = 18, - nsFieldSetFrame_id = 19, - nsFileControlFrame_id = 20, - nsFirstLetterFrame_id = 21, - nsFirstLineFrame_id = 22, - nsFlexContainerFrame_id = 23, - nsFrame_id = 24, - nsGfxButtonControlFrame_id = 25, - nsGfxCheckboxControlFrame_id = 26, - nsGfxRadioControlFrame_id = 27, - nsGridContainerFrame_id = 28, - nsGridRowGroupFrame_id = 29, - nsGridRowLeafFrame_id = 30, - nsGroupBoxFrame_id = 31, - nsHTMLButtonControlFrame_id = 32, - nsHTMLCanvasFrame_id = 33, - nsHTMLFramesetBlankFrame_id = 34, - nsHTMLFramesetBorderFrame_id = 35, - nsHTMLFramesetFrame_id = 36, - nsHTMLScrollFrame_id = 37, - nsImageBoxFrame_id = 38, - nsImageControlFrame_id = 39, - nsImageFrame_id = 40, - nsInlineFrame_id = 41, - nsLeafBoxFrame_id = 42, - nsLegendFrame_id = 43, - nsListBoxBodyFrame_id = 44, - nsListControlFrame_id = 45, - nsListItemFrame_id = 46, - nsMathMLFrame_id = 47, - nsMathMLmactionFrame_id = 48, - nsMathMLmathBlockFrame_id = 49, - nsMathMLmathInlineFrame_id = 50, - nsMathMLmencloseFrame_id = 51, - nsMathMLmfencedFrame_id = 52, - nsMathMLmfracFrame_id = 53, - nsMathMLmmultiscriptsFrame_id = 54, - nsMathMLmoFrame_id = 55, - nsMathMLmpaddedFrame_id = 56, - nsMathMLmrootFrame_id = 57, - nsMathMLmrowFrame_id = 58, - nsMathMLmspaceFrame_id = 59, - nsMathMLmsqrtFrame_id = 60, - nsMathMLmtableFrame_id = 61, - nsMathMLmtableWrapperFrame_id = 62, - nsMathMLmtdFrame_id = 63, - nsMathMLmtdInnerFrame_id = 64, - nsMathMLmtrFrame_id = 65, - nsMathMLmunderoverFrame_id = 66, - nsMathMLsemanticsFrame_id = 67, - nsMathMLTokenFrame_id = 68, - nsMenuBarFrame_id = 69, - nsMenuFrame_id = 70, - nsMenuPopupFrame_id = 71, - nsMeterFrame_id = 72, - nsNumberControlFrame_id = 73, - nsPluginFrame_id = 74, - nsPageBreakFrame_id = 75, - nsPageContentFrame_id = 76, - nsPageFrame_id = 77, - nsPlaceholderFrame_id = 78, - nsPopupSetFrame_id = 79, - nsProgressFrame_id = 80, - nsProgressMeterFrame_id = 81, - nsRangeFrame_id = 82, - nsResizerFrame_id = 83, - nsRootBoxFrame_id = 84, - nsRubyBaseContainerFrame_id = 85, - nsRubyBaseFrame_id = 86, - nsRubyFrame_id = 87, - nsRubyTextContainerFrame_id = 88, - nsRubyTextFrame_id = 89, - nsScrollbarButtonFrame_id = 90, - nsScrollbarFrame_id = 91, - nsSelectsAreaFrame_id = 92, - nsSimplePageSequenceFrame_id = 93, - nsSliderFrame_id = 94, - nsSplitterFrame_id = 95, - nsStackFrame_id = 96, - nsSubDocumentFrame_id = 97, - nsSVGAFrame_id = 98, - nsSVGClipPathFrame_id = 99, - nsSVGContainerFrame_id = 100, - SVGFEContainerFrame_id = 101, - SVGFEImageFrame_id = 102, - SVGFELeafFrame_id = 103, - SVGFEUnstyledLeafFrame_id = 104, - nsSVGFilterFrame_id = 105, - nsSVGForeignObjectFrame_id = 106, - nsSVGGenericContainerFrame_id = 107, - nsSVGGFrame_id = 108, - nsSVGImageFrame_id = 109, - nsSVGInnerSVGFrame_id = 110, - nsSVGLinearGradientFrame_id = 111, - nsSVGMarkerFrame_id = 112, - nsSVGMarkerAnonChildFrame_id = 113, - nsSVGMaskFrame_id = 114, - nsSVGOuterSVGFrame_id = 115, - nsSVGOuterSVGAnonChildFrame_id = 116, - SVGGeometryFrame_id = 117, - nsSVGPatternFrame_id = 118, - nsSVGRadialGradientFrame_id = 119, - nsSVGStopFrame_id = 120, - nsSVGSwitchFrame_id = 121, - nsSVGSymbolFrame_id = 122, - SVGTextFrame_id = 123, - nsSVGUseFrame_id = 124, - SVGViewFrame_id = 125, - nsTableCellFrame_id = 126, - nsTableColFrame_id = 127, - nsTableColGroupFrame_id = 128, - nsTableFrame_id = 129, - nsTableWrapperFrame_id = 130, - nsTableRowFrame_id = 131, - nsTableRowGroupFrame_id = 132, - nsTextBoxFrame_id = 133, - nsTextControlFrame_id = 134, - nsTextFrame_id = 135, - nsTitleBarFrame_id = 136, - nsTreeBodyFrame_id = 137, - nsTreeColFrame_id = 138, - nsVideoFrame_id = 139, - nsXULLabelFrame_id = 140, - nsXULScrollFrame_id = 141, - ViewportFrame_id = 142, - nsContainerFrame_id = 143, - nsFormControlFrame_id = 144, - nsIFrame_id = 145, - nsLeafFrame_id = 146, - nsMathMLContainerFrame_id = 147, - nsRubyContentFrame_id = 148, - nsSplittableFrame_id = 149, - nsSVGDisplayContainerFrame_id = 150, - nsSVGGradientFrame_id = 151, - nsSVGPaintServerFrame_id = 152, - nsIAnonymousContentCreator_id = 153, - nsIComboboxControlFrame_id = 154, - nsIFormControlFrame_id = 155, - nsIFrameFrame_id = 156, - nsIListControlFrame_id = 157, - nsIMathMLFrame_id = 158, - nsIMenuFrame_id = 159, - nsIObjectFrame_id = 160, - nsIPageSequenceFrame_id = 161, - nsIPercentBSizeObserver_id = 162, - nsIRootBox_id = 163, - nsIScrollableFrame_id = 164, - nsIScrollbarMediator_id = 165, - nsISelectControlFrame_id = 166, - nsISVGSVGFrame_id = 167, - nsIStatefulFrame_id = 168, - nsITableCellLayout_id = 169, - nsITableLayout_id = 170, - nsITextControlFrame_id = 171, - nsITreeBoxObject_id = 172, - nsSVGDisplayableFrame_id = 173, - NON_FRAME_MARKER = 174, - } - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsQueryFrame_ClassID { - BRFrame_id = 0, - DetailsFrame_id = 1, - nsAutoRepeatBoxFrame_id = 2, - nsBCTableCellFrame_id = 3, - nsBackdropFrame_id = 4, - nsBlockFrame_id = 5, - nsBox_id = 6, - nsBoxFrame_id = 7, - nsBulletFrame_id = 8, - nsButtonBoxFrame_id = 9, - nsCanvasFrame_id = 10, - nsColorControlFrame_id = 11, - nsColumnSetFrame_id = 12, - nsComboboxControlFrame_id = 13, - nsComboboxDisplayFrame_id = 14, - nsContinuingTextFrame_id = 15, - nsDateTimeControlFrame_id = 16, - nsDeckFrame_id = 17, - nsDocElementBoxFrame_id = 18, - nsFieldSetFrame_id = 19, - nsFileControlFrame_id = 20, - nsFirstLetterFrame_id = 21, - nsFirstLineFrame_id = 22, - nsFlexContainerFrame_id = 23, - nsFrame_id = 24, - nsGfxButtonControlFrame_id = 25, - nsGfxCheckboxControlFrame_id = 26, - nsGfxRadioControlFrame_id = 27, - nsGridContainerFrame_id = 28, - nsGridRowGroupFrame_id = 29, - nsGridRowLeafFrame_id = 30, - nsGroupBoxFrame_id = 31, - nsHTMLButtonControlFrame_id = 32, - nsHTMLCanvasFrame_id = 33, - nsHTMLFramesetBlankFrame_id = 34, - nsHTMLFramesetBorderFrame_id = 35, - nsHTMLFramesetFrame_id = 36, - nsHTMLScrollFrame_id = 37, - nsImageBoxFrame_id = 38, - nsImageControlFrame_id = 39, - nsImageFrame_id = 40, - nsInlineFrame_id = 41, - nsLeafBoxFrame_id = 42, - nsLegendFrame_id = 43, - nsListBoxBodyFrame_id = 44, - nsListControlFrame_id = 45, - nsListItemFrame_id = 46, - nsMathMLFrame_id = 47, - nsMathMLmactionFrame_id = 48, - nsMathMLmathBlockFrame_id = 49, - nsMathMLmathInlineFrame_id = 50, - nsMathMLmencloseFrame_id = 51, - nsMathMLmfencedFrame_id = 52, - nsMathMLmfracFrame_id = 53, - nsMathMLmmultiscriptsFrame_id = 54, - nsMathMLmoFrame_id = 55, - nsMathMLmpaddedFrame_id = 56, - nsMathMLmrootFrame_id = 57, - nsMathMLmrowFrame_id = 58, - nsMathMLmspaceFrame_id = 59, - nsMathMLmsqrtFrame_id = 60, - nsMathMLmtableFrame_id = 61, - nsMathMLmtableWrapperFrame_id = 62, - nsMathMLmtdFrame_id = 63, - nsMathMLmtdInnerFrame_id = 64, - nsMathMLmtrFrame_id = 65, - nsMathMLmunderoverFrame_id = 66, - nsMathMLsemanticsFrame_id = 67, - nsMathMLTokenFrame_id = 68, - nsMenuBarFrame_id = 69, - nsMenuFrame_id = 70, - nsMenuPopupFrame_id = 71, - nsMeterFrame_id = 72, - nsNumberControlFrame_id = 73, - nsPluginFrame_id = 74, - nsPageBreakFrame_id = 75, - nsPageContentFrame_id = 76, - nsPageFrame_id = 77, - nsPlaceholderFrame_id = 78, - nsPopupSetFrame_id = 79, - nsProgressFrame_id = 80, - nsProgressMeterFrame_id = 81, - nsRangeFrame_id = 82, - nsResizerFrame_id = 83, - nsRootBoxFrame_id = 84, - nsRubyBaseContainerFrame_id = 85, - nsRubyBaseFrame_id = 86, - nsRubyFrame_id = 87, - nsRubyTextContainerFrame_id = 88, - nsRubyTextFrame_id = 89, - nsScrollbarButtonFrame_id = 90, - nsScrollbarFrame_id = 91, - nsSelectsAreaFrame_id = 92, - nsSimplePageSequenceFrame_id = 93, - nsSliderFrame_id = 94, - nsSplitterFrame_id = 95, - nsStackFrame_id = 96, - nsSubDocumentFrame_id = 97, - nsSVGAFrame_id = 98, - nsSVGClipPathFrame_id = 99, - nsSVGContainerFrame_id = 100, - SVGFEContainerFrame_id = 101, - SVGFEImageFrame_id = 102, - SVGFELeafFrame_id = 103, - SVGFEUnstyledLeafFrame_id = 104, - nsSVGFilterFrame_id = 105, - nsSVGForeignObjectFrame_id = 106, - nsSVGGenericContainerFrame_id = 107, - nsSVGGFrame_id = 108, - nsSVGImageFrame_id = 109, - nsSVGInnerSVGFrame_id = 110, - nsSVGLinearGradientFrame_id = 111, - nsSVGMarkerFrame_id = 112, - nsSVGMarkerAnonChildFrame_id = 113, - nsSVGMaskFrame_id = 114, - nsSVGOuterSVGFrame_id = 115, - nsSVGOuterSVGAnonChildFrame_id = 116, - SVGGeometryFrame_id = 117, - nsSVGPatternFrame_id = 118, - nsSVGRadialGradientFrame_id = 119, - nsSVGStopFrame_id = 120, - nsSVGSwitchFrame_id = 121, - nsSVGSymbolFrame_id = 122, - SVGTextFrame_id = 123, - nsSVGUseFrame_id = 124, - SVGViewFrame_id = 125, - nsTableCellFrame_id = 126, - nsTableColFrame_id = 127, - nsTableColGroupFrame_id = 128, - nsTableFrame_id = 129, - nsTableWrapperFrame_id = 130, - nsTableRowFrame_id = 131, - nsTableRowGroupFrame_id = 132, - nsTextBoxFrame_id = 133, - nsTextControlFrame_id = 134, - nsTextFrame_id = 135, - nsTitleBarFrame_id = 136, - nsTreeBodyFrame_id = 137, - nsTreeColFrame_id = 138, - nsVideoFrame_id = 139, - nsXULLabelFrame_id = 140, - nsXULScrollFrame_id = 141, - ViewportFrame_id = 142, - } - #[test] - fn bindgen_test_layout_nsQueryFrame() { - assert_eq!(::std::mem::size_of::<nsQueryFrame>() , 8usize , concat ! ( - "Size of: " , stringify ! ( nsQueryFrame ) )); - assert_eq! (::std::mem::align_of::<nsQueryFrame>() , 8usize , concat ! - ( "Alignment of " , stringify ! ( nsQueryFrame ) )); - } - impl Clone for nsQueryFrame { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug)] pub struct nsAString { pub _base: root::mozilla::detail::nsStringRepr, @@ -13120,6 +9991,34 @@ pub mod root { impl Clone for nsSubstringTuple { fn clone(&self) -> Self { *self } } + pub type nsString_self_type = ::nsstring::nsStringRepr; + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsString_Segment { + pub mBegin: u32, + pub mLength: u32, + } + #[test] + fn bindgen_test_layout_nsString_Segment() { + assert_eq!(::std::mem::size_of::<nsString_Segment>() , 8usize , concat + ! ( "Size of: " , stringify ! ( nsString_Segment ) )); + assert_eq! (::std::mem::align_of::<nsString_Segment>() , 4usize , + concat ! ( + "Alignment of " , stringify ! ( nsString_Segment ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsString_Segment ) ) . mBegin as * + const _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( nsString_Segment ) + , "::" , stringify ! ( mBegin ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsString_Segment ) ) . mLength as * + const _ as usize } , 4usize , concat ! ( + "Alignment of field: " , stringify ! ( nsString_Segment ) + , "::" , stringify ! ( mLength ) )); + } + impl Clone for nsString_Segment { + fn clone(&self) -> Self { *self } + } #[repr(C)] pub struct nsAutoString { pub _base: root::nsFixedString, @@ -13145,21 +10044,6 @@ pub mod root { "::" , stringify ! ( mStorage ) )); } #[repr(C)] - #[derive(Debug)] - pub struct nsDependentSubstring { - pub _base: root::nsAString, - } - pub type nsDependentSubstring_self_type = root::nsDependentSubstring; - #[test] - fn bindgen_test_layout_nsDependentSubstring() { - assert_eq!(::std::mem::size_of::<nsDependentSubstring>() , 16usize , - concat ! ( - "Size of: " , stringify ! ( nsDependentSubstring ) )); - assert_eq! (::std::mem::align_of::<nsDependentSubstring>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsDependentSubstring ) )); - } - #[repr(C)] pub struct nsStringComparator__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] #[derive(Debug, Copy)] @@ -13278,22 +10162,6 @@ pub mod root { "Alignment of " , stringify ! ( nsCString ) )); } #[repr(C)] - #[derive(Debug)] - pub struct nsDependentCSubstring { - pub _base: root::nsACString, - } - pub type nsDependentCSubstring_self_type = root::nsDependentCSubstring; - #[test] - fn bindgen_test_layout_nsDependentCSubstring() { - assert_eq!(::std::mem::size_of::<nsDependentCSubstring>() , 16usize , - concat ! ( - "Size of: " , stringify ! ( nsDependentCSubstring ) )); - assert_eq! (::std::mem::align_of::<nsDependentCSubstring>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsDependentCSubstring ) - )); - } - #[repr(C)] pub struct nsCStringComparator__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] #[derive(Debug, Copy)] @@ -13315,12 +10183,10 @@ pub mod root { } #[repr(C)] pub struct nsISupports__bindgen_vtable(::std::os::raw::c_void); - /** - * Basic component object model interface. Objects which implement - * this interface support runtime interface discovery (QueryInterface) - * and a reference counted memory model (AddRef/Release). This is - * modelled after the win32 IUnknown API. - */ + /// Basic component object model interface. Objects which implement + /// this interface support runtime interface discovery (QueryInterface) + /// and a reference counted memory model (AddRef/Release). This is + /// modelled after the win32 IUnknown API. #[repr(C)] #[derive(Debug, Copy)] pub struct nsISupports { @@ -13343,9 +10209,7 @@ pub mod root { } #[repr(C)] pub struct nsCycleCollectionParticipant__bindgen_vtable(::std::os::raw::c_void); - /** - * Participant implementation classes - */ + /// Participant implementation classes #[repr(C)] #[derive(Debug, Copy)] pub struct nsCycleCollectionParticipant { @@ -13411,9 +10275,7 @@ pub mod root { pub struct nsCharTraits { pub _address: u8, } - /** - * @see nsTAString - */ + /// @see nsTAString #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsReadingIterator<CharT> { @@ -13429,9 +10291,7 @@ pub mod root { pub type nsReadingIterator_value_type<CharT> = CharT; pub type nsReadingIterator_pointer<CharT> = *mut CharT; pub type nsReadingIterator_reference = u8; - /** - * @see nsTAString - */ + /// @see nsTAString #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsWritingIterator<CharT> { @@ -13447,158 +10307,16 @@ pub mod root { pub type nsWritingIterator_value_type<CharT> = CharT; pub type nsWritingIterator_pointer<CharT> = *mut CharT; pub type nsWritingIterator_reference = u8; + pub type AutoTArray_self_type = u8; + pub type AutoTArray_base_type<E> = root::nsTArray<E>; + pub type AutoTArray_Header<E> = root::AutoTArray_base_type<E>; + pub type AutoTArray_elem_type<E> = root::AutoTArray_base_type<E>; #[repr(C)] - pub struct nsSubstringSplitter { - pub mStr: *const root::nsAString, - pub mArray: u64, - pub mArraySize: root::nsSubstringSplitter_size_type, - pub mDelim: root::nsSubstringSplitter_char_type, - } - pub type nsSubstringSplitter_size_type = - root::mozilla::detail::nsStringRepr_size_type; - pub type nsSubstringSplitter_char_type = - root::mozilla::detail::nsStringRepr_char_type; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsSubstringSplitter_nsTSubstringSplit_Iter { - pub mObj: *const root::nsSubstringSplitter, - pub mPos: root::nsSubstringSplitter_size_type, - } - #[test] - fn bindgen_test_layout_nsSubstringSplitter_nsTSubstringSplit_Iter() { - assert_eq!(::std::mem::size_of::<nsSubstringSplitter_nsTSubstringSplit_Iter>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - nsSubstringSplitter_nsTSubstringSplit_Iter ) )); - assert_eq! (::std::mem::align_of::<nsSubstringSplitter_nsTSubstringSplit_Iter>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsSubstringSplitter_nsTSubstringSplit_Iter ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const nsSubstringSplitter_nsTSubstringSplit_Iter ) - ) . mObj as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsSubstringSplitter_nsTSubstringSplit_Iter ) , "::" , - stringify ! ( mObj ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const nsSubstringSplitter_nsTSubstringSplit_Iter ) - ) . mPos as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsSubstringSplitter_nsTSubstringSplit_Iter ) , "::" , - stringify ! ( mPos ) )); - } - impl Clone for nsSubstringSplitter_nsTSubstringSplit_Iter { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_nsSubstringSplitter() { - assert_eq!(::std::mem::size_of::<nsSubstringSplitter>() , 24usize , - concat ! ( - "Size of: " , stringify ! ( nsSubstringSplitter ) )); - assert_eq! (::std::mem::align_of::<nsSubstringSplitter>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsSubstringSplitter ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsSubstringSplitter ) ) . mStr as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsSubstringSplitter - ) , "::" , stringify ! ( mStr ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsSubstringSplitter ) ) . mArray as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( nsSubstringSplitter - ) , "::" , stringify ! ( mArray ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsSubstringSplitter ) ) . mArraySize - as * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( nsSubstringSplitter - ) , "::" , stringify ! ( mArraySize ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsSubstringSplitter ) ) . mDelim as * - const _ as usize } , 20usize , concat ! ( - "Alignment of field: " , stringify ! ( nsSubstringSplitter - ) , "::" , stringify ! ( mDelim ) )); - } - #[repr(C)] - pub struct nsCSubstringSplitter { - pub mStr: *const root::nsACString, - pub mArray: u64, - pub mArraySize: root::nsCSubstringSplitter_size_type, - pub mDelim: root::nsCSubstringSplitter_char_type, - } - pub type nsCSubstringSplitter_size_type = - root::mozilla::detail::nsCStringRepr_size_type; - pub type nsCSubstringSplitter_char_type = - root::mozilla::detail::nsCStringRepr_char_type; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsCSubstringSplitter_nsTSubstringSplit_Iter { - pub mObj: *const root::nsCSubstringSplitter, - pub mPos: root::nsCSubstringSplitter_size_type, - } - #[test] - fn bindgen_test_layout_nsCSubstringSplitter_nsTSubstringSplit_Iter() { - assert_eq!(::std::mem::size_of::<nsCSubstringSplitter_nsTSubstringSplit_Iter>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - nsCSubstringSplitter_nsTSubstringSplit_Iter ) )); - assert_eq! (::std::mem::align_of::<nsCSubstringSplitter_nsTSubstringSplit_Iter>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsCSubstringSplitter_nsTSubstringSplit_Iter ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const nsCSubstringSplitter_nsTSubstringSplit_Iter ) - ) . mObj as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSubstringSplitter_nsTSubstringSplit_Iter ) , "::" , - stringify ! ( mObj ) )); - assert_eq! (unsafe { - & ( - * ( - 0 as * const nsCSubstringSplitter_nsTSubstringSplit_Iter ) - ) . mPos as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSubstringSplitter_nsTSubstringSplit_Iter ) , "::" , - stringify ! ( mPos ) )); - } - impl Clone for nsCSubstringSplitter_nsTSubstringSplit_Iter { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_nsCSubstringSplitter() { - assert_eq!(::std::mem::size_of::<nsCSubstringSplitter>() , 24usize , - concat ! ( - "Size of: " , stringify ! ( nsCSubstringSplitter ) )); - assert_eq! (::std::mem::align_of::<nsCSubstringSplitter>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsCSubstringSplitter ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSubstringSplitter ) ) . mStr as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSubstringSplitter ) , "::" , stringify ! ( mStr ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSubstringSplitter ) ) . mArray as - * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSubstringSplitter ) , "::" , stringify ! ( mArray ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSubstringSplitter ) ) . mArraySize - as * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSubstringSplitter ) , "::" , stringify ! ( mArraySize ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSubstringSplitter ) ) . mDelim as - * const _ as usize } , 20usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSubstringSplitter ) , "::" , stringify ! ( mDelim ) )); + #[derive(Debug, Copy, Clone)] + pub struct AutoTArray__bindgen_ty_1 { + pub mAutoBuf: root::__BindgenUnionField<*mut ::std::os::raw::c_char>, + pub mAlign: root::__BindgenUnionField<u8>, + pub bindgen_union_field: u64, } #[repr(C)] #[derive(Debug)] @@ -13629,11 +10347,9 @@ pub mod root { pub type PRUint32 = ::std::os::raw::c_uint; pub type PRIntn = ::std::os::raw::c_int; pub type PRUintn = ::std::os::raw::c_uint; - /************************************************************************ -** TYPES: PRSize -** DESCRIPTION: -** A type for representing the size of objects. -************************************************************************/ + /// TYPES: PRSize + /// DESCRIPTION: + /// A type for representing the size of objects. pub type PRSize = usize; #[repr(C)] #[derive(Debug, Copy)] @@ -13803,32 +10519,6 @@ pub mod root { } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsCSSTokenType { - eCSSToken_Whitespace = 0, - eCSSToken_Comment = 1, - eCSSToken_Ident = 2, - eCSSToken_Function = 3, - eCSSToken_AtKeyword = 4, - eCSSToken_ID = 5, - eCSSToken_Hash = 6, - eCSSToken_Number = 7, - eCSSToken_Dimension = 8, - eCSSToken_Percentage = 9, - eCSSToken_String = 10, - eCSSToken_Bad_String = 11, - eCSSToken_URL = 12, - eCSSToken_Bad_URL = 13, - eCSSToken_Symbol = 14, - eCSSToken_Includes = 15, - eCSSToken_Dashmatch = 16, - eCSSToken_Beginsmatch = 17, - eCSSToken_Endsmatch = 18, - eCSSToken_Containsmatch = 19, - eCSSToken_URange = 20, - eCSSToken_HTMLComment = 21, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsCSSTokenSerializationType { eCSSTokenSerialization_Nothing = 0, eCSSTokenSerialization_Whitespace = 1, @@ -13857,140 +10547,6 @@ pub mod root { eCSSTokenSerialization_Other = 24, } #[repr(C)] - pub struct nsCSSToken { - pub mIdent: root::nsAutoString, - pub mNumber: f32, - pub mInteger: i32, - pub mInteger2: i32, - pub mType: root::nsCSSTokenType, - pub mSymbol: u16, - pub mIntegerValid: bool, - pub mHasSign: bool, - } - #[test] - fn bindgen_test_layout_nsCSSToken() { - assert_eq!(::std::mem::size_of::<nsCSSToken>() , 184usize , concat ! ( - "Size of: " , stringify ! ( nsCSSToken ) )); - assert_eq! (::std::mem::align_of::<nsCSSToken>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( nsCSSToken ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mIdent as * const _ - as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mIdent ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mNumber as * const _ - as usize } , 160usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mNumber ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mInteger as * const - _ as usize } , 164usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mInteger ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mInteger2 as * const - _ as usize } , 168usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mInteger2 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mType as * const _ - as usize } , 172usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mSymbol as * const _ - as usize } , 176usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mSymbol ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mIntegerValid as * - const _ as usize } , 178usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mIntegerValid ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSToken ) ) . mHasSign as * const - _ as usize } , 179usize , concat ! ( - "Alignment of field: " , stringify ! ( nsCSSToken ) , "::" - , stringify ! ( mHasSign ) )); - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsCSSScannerPosition { - pub mOffset: u32, - pub mLineNumber: u32, - pub mLineOffset: u32, - pub mTokenLineNumber: u32, - pub mTokenLineOffset: u32, - pub mTokenOffset: u32, - pub mInitialized: bool, - } - #[test] - fn bindgen_test_layout_nsCSSScannerPosition() { - assert_eq!(::std::mem::size_of::<nsCSSScannerPosition>() , 28usize , - concat ! ( - "Size of: " , stringify ! ( nsCSSScannerPosition ) )); - assert_eq! (::std::mem::align_of::<nsCSSScannerPosition>() , 4usize , - concat ! ( - "Alignment of " , stringify ! ( nsCSSScannerPosition ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . mOffset as - * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( mOffset ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . - mLineNumber as * const _ as usize } , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( mLineNumber - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . - mLineOffset as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( mLineOffset - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . - mTokenLineNumber as * const _ as usize } , 12usize , - concat ! ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( - mTokenLineNumber ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . - mTokenLineOffset as * const _ as usize } , 16usize , - concat ! ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( - mTokenLineOffset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . - mTokenOffset as * const _ as usize } , 20usize , concat ! - ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( mTokenOffset - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCSSScannerPosition ) ) . - mInitialized as * const _ as usize } , 24usize , concat ! - ( - "Alignment of field: " , stringify ! ( - nsCSSScannerPosition ) , "::" , stringify ! ( mInitialized - ) )); - } - impl Clone for nsCSSScannerPosition { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsCSSScannerExclude { - eCSSScannerExclude_None = 0, - eCSSScannerExclude_Comments = 1, - eCSSScannerExclude_WhitespaceAndComments = 2, - } - #[repr(C)] #[derive(Debug)] pub struct nsCSSScanner { pub mBuffer: *const u16, @@ -14098,54 +10654,6 @@ pub mod root { "Alignment of field: " , stringify ! ( nsCSSScanner ) , "::" , stringify ! ( mSeenVariableReference ) )); } - /** - * A "unique identifier". This is modeled after OSF DCE UUIDs. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsID { - pub m0: u32, - pub m1: u16, - pub m2: u16, - pub m3: [u8; 8usize], - } - #[test] - fn bindgen_test_layout_nsID() { - assert_eq!(::std::mem::size_of::<nsID>() , 16usize , concat ! ( - "Size of: " , stringify ! ( nsID ) )); - assert_eq! (::std::mem::align_of::<nsID>() , 4usize , concat ! ( - "Alignment of " , stringify ! ( nsID ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsID ) ) . m0 as * const _ as usize } - , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsID ) , "::" , - stringify ! ( m0 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsID ) ) . m1 as * const _ as usize } - , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( nsID ) , "::" , - stringify ! ( m1 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsID ) ) . m2 as * const _ as usize } - , 6usize , concat ! ( - "Alignment of field: " , stringify ! ( nsID ) , "::" , - stringify ! ( m2 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsID ) ) . m3 as * const _ as usize } - , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( nsID ) , "::" , - stringify ! ( m3 ) )); - } - impl Clone for nsID { - fn clone(&self) -> Self { *self } - } - pub type nsCID = root::nsID; - /** - * An "interface id" which can be used to uniquely identify a given - * interface. - */ - pub type nsIID = root::nsID; - pub type PRTime = i64; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PRThread { @@ -14172,47 +10680,6 @@ pub mod root { impl Clone for nsAutoRefCnt { fn clone(&self) -> Self { *self } } - /** - * already_AddRefed cooperates with reference counting smart pointers to enable - * you to assign in a pointer _without_ |AddRef|ing it. You might want to use - * this as a return type from a function that returns an already |AddRef|ed - * pointer. - * - * TODO Move already_AddRefed to namespace mozilla. This has not yet been done - * because of the sheer number of usages of already_AddRefed. - * - * When should you use already_AddRefed<>? - * * Ensure a consumer takes ownership of a reference - * * Pass ownership without calling AddRef/Release (sometimes required in - * off-main-thread code) - * * The ref pointer type you're using doesn't support move construction - * - * Otherwise, use Move(RefPtr/nsCOMPtr/etc). - */ - #[repr(C)] - #[derive(Debug)] - pub struct already_AddRefed<T> { - pub mRawPtr: *mut T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } - #[repr(C)] - pub struct nsCOMPtr_helper__bindgen_vtable(::std::os::raw::c_void); - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsCOMPtr_helper { - pub vtable_: *const nsCOMPtr_helper__bindgen_vtable, - } - #[test] - fn bindgen_test_layout_nsCOMPtr_helper() { - assert_eq!(::std::mem::size_of::<nsCOMPtr_helper>() , 8usize , concat - ! ( "Size of: " , stringify ! ( nsCOMPtr_helper ) )); - assert_eq! (::std::mem::align_of::<nsCOMPtr_helper>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsCOMPtr_helper ) )); - } - impl Clone for nsCOMPtr_helper { - fn clone(&self) -> Self { *self } - } #[repr(C)] #[derive(Debug)] pub struct RefPtr<T> { @@ -14231,46 +10698,6 @@ pub mod root { pub _address: u8, } #[repr(C)] - pub struct nsCycleCollectionTraversalCallback__bindgen_vtable(::std::os::raw::c_void); - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsCycleCollectionTraversalCallback { - pub vtable_: *const nsCycleCollectionTraversalCallback__bindgen_vtable, - pub mFlags: u32, - } - pub const nsCycleCollectionTraversalCallback_WANT_DEBUG_INFO: - root::nsCycleCollectionTraversalCallback__bindgen_ty_1 = - nsCycleCollectionTraversalCallback__bindgen_ty_1::WANT_DEBUG_INFO; - pub const nsCycleCollectionTraversalCallback_WANT_ALL_TRACES: - root::nsCycleCollectionTraversalCallback__bindgen_ty_1 = - nsCycleCollectionTraversalCallback__bindgen_ty_1::WANT_ALL_TRACES; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsCycleCollectionTraversalCallback__bindgen_ty_1 { - WANT_DEBUG_INFO = 1, - WANT_ALL_TRACES = 2, - } - #[test] - fn bindgen_test_layout_nsCycleCollectionTraversalCallback() { - assert_eq!(::std::mem::size_of::<nsCycleCollectionTraversalCallback>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - nsCycleCollectionTraversalCallback ) )); - assert_eq! (::std::mem::align_of::<nsCycleCollectionTraversalCallback>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsCycleCollectionTraversalCallback ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsCycleCollectionTraversalCallback ) - ) . mFlags as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsCycleCollectionTraversalCallback ) , "::" , stringify ! - ( mFlags ) )); - } - impl Clone for nsCycleCollectionTraversalCallback { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSContext { _unused: [u8; 0], @@ -14278,37 +10705,35 @@ pub mod root { pub mod JS { #[allow(unused_imports)] use self::super::super::root; - /** - * JS::Value is the interface for a single JavaScript Engine value. A few - * general notes on JS::Value: - * - * - JS::Value has setX() and isX() members for X in - * - * { Int32, Double, String, Symbol, Boolean, Undefined, Null, Object, Magic } - * - * JS::Value also contains toX() for each of the non-singleton types. - * - * - Magic is a singleton type whose payload contains either a JSWhyMagic "reason" for - * the magic value or a uint32_t value. By providing JSWhyMagic values when - * creating and checking for magic values, it is possible to assert, at - * runtime, that only magic values with the expected reason flow through a - * particular value. For example, if cx->exception has a magic value, the - * reason must be JS_GENERATOR_CLOSING. - * - * - The JS::Value operations are preferred. The JSVAL_* operations remain for - * compatibility; they may be removed at some point. These operations mostly - * provide similar functionality. But there are a few key differences. One - * is that JS::Value gives null a separate type. - * Also, to help prevent mistakenly boxing a nullable JSObject* as an object, - * Value::setObject takes a JSObject&. (Conversely, Value::toObject returns a - * JSObject&.) A convenience member Value::setObjectOrNull is provided. - * - * - JSVAL_VOID is the same as the singleton value of the Undefined type. - * - * - Note that JS::Value is 8 bytes on 32 and 64-bit architectures. Thus, on - * 32-bit user code should avoid copying jsval/JS::Value as much as possible, - * preferring to pass by const Value&. - */ + /// JS::Value is the interface for a single JavaScript Engine value. A few + /// general notes on JS::Value: + /// + /// - JS::Value has setX() and isX() members for X in + /// + /// { Int32, Double, String, Symbol, Boolean, Undefined, Null, Object, Magic } + /// + /// JS::Value also contains toX() for each of the non-singleton types. + /// + /// - Magic is a singleton type whose payload contains either a JSWhyMagic "reason" for + /// the magic value or a uint32_t value. By providing JSWhyMagic values when + /// creating and checking for magic values, it is possible to assert, at + /// runtime, that only magic values with the expected reason flow through a + /// particular value. For example, if cx->exception has a magic value, the + /// reason must be JS_GENERATOR_CLOSING. + /// + /// - The JS::Value operations are preferred. The JSVAL_* operations remain for + /// compatibility; they may be removed at some point. These operations mostly + /// provide similar functionality. But there are a few key differences. One + /// is that JS::Value gives null a separate type. + /// Also, to help prevent mistakenly boxing a nullable JSObject* as an object, + /// Value::setObject takes a JSObject&. (Conversely, Value::toObject returns a + /// JSObject&.) A convenience member Value::setObjectOrNull is provided. + /// + /// - JSVAL_VOID is the same as the singleton value of the Undefined type. + /// + /// - Note that JS::Value is 8 bytes on 32 and 64-bit architectures. Thus, on + /// 32-bit user code should avoid copying jsval/JS::Value as much as possible, + /// preferring to pass by const Value&. #[repr(C)] #[derive(Debug, Copy)] pub struct Value { @@ -14571,117 +10996,19 @@ pub mod root { impl Clone for Value { fn clone(&self) -> Self { *self } } - /** - * Reference to a T that has been rooted elsewhere. This is most useful - * as a parameter type, which guarantees that the T lvalue is properly - * rooted. See "Move GC Stack Rooting" above. - * - * If you want to add additional methods to Handle for a specific - * specialization, define a HandleBase<T> specialization containing them. - */ - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Handle<T> { - pub ptr: *mut T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } - pub type Handle_ElementType<T> = T; - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum Handle_Disambiguator { - DeliberatelyChoosingThisOverload = 0, - } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum Handle_CallerIdentity { - ImUsingThisOnlyInFromFromMarkedLocation = 0, - } - /** - * Similar to a handle, but the underlying storage can be changed. This is - * useful for outparams. - * - * If you want to add additional methods to MutableHandle for a specific - * specialization, define a MutableHandleBase<T> specialization containing - * them. - */ - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct MutableHandle<T> { - pub ptr: *mut T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } - pub type MutableHandle_ElementType<T> = T; - /** - * Local variable of type T whose value is always rooted. This is typically - * used for local variables, or for non-rooted values being passed to a - * function that requires a handle, e.g. Foo(Root<T>(cx, x)). - * - * If you want to add additional methods to Rooted for a specific - * specialization, define a RootedBase<T> specialization containing them. - */ + /// Local variable of type T whose value is always rooted. This is typically + /// used for local variables, or for non-rooted values being passed to a + /// function that requires a handle, e.g. Foo(Root<T>(cx, x)). + /// + /// If you want to add additional methods to Rooted for a specific + /// specialization, define a RootedBase<T> specialization containing them. #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Rooted { } pub type Rooted_ElementType<T> = T; - pub type HandleId = root::JS::Handle<root::jsid>; - pub type HandleObject = root::JS::Handle<*mut root::JSObject>; - pub type HandleValue = root::JS::Handle<root::JS::Value>; - pub type MutableHandleValue = - root::JS::MutableHandle<root::JS::Value>; pub type RootedObject = [u64; 3usize]; #[repr(C)] - #[derive(Debug, Copy)] - pub struct PropertyDescriptor { - pub obj: *mut root::JSObject, - pub attrs: ::std::os::raw::c_uint, - pub getter: root::JSGetterOp, - pub setter: root::JSSetterOp, - pub value: root::JS::Value, - } - #[test] - fn bindgen_test_layout_PropertyDescriptor() { - assert_eq!(::std::mem::size_of::<PropertyDescriptor>() , 40usize , - concat ! ( - "Size of: " , stringify ! ( PropertyDescriptor ) )); - assert_eq! (::std::mem::align_of::<PropertyDescriptor>() , 8usize - , concat ! ( - "Alignment of " , stringify ! ( PropertyDescriptor ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const PropertyDescriptor ) ) . obj as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - PropertyDescriptor ) , "::" , stringify ! ( obj ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const PropertyDescriptor ) ) . attrs as - * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - PropertyDescriptor ) , "::" , stringify ! ( attrs ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const PropertyDescriptor ) ) . getter - as * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( - PropertyDescriptor ) , "::" , stringify ! ( getter ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const PropertyDescriptor ) ) . setter - as * const _ as usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( - PropertyDescriptor ) , "::" , stringify ! ( setter ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const PropertyDescriptor ) ) . value as - * const _ as usize } , 32usize , concat ! ( - "Alignment of field: " , stringify ! ( - PropertyDescriptor ) , "::" , stringify ! ( value ) - )); - } - impl Clone for PropertyDescriptor { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DeletePolicy { pub _address: u8, @@ -14701,52 +11028,23 @@ pub mod root { impl Clone for FreePolicy { fn clone(&self) -> Self { *self } } - /** - * A GC pointer, tagged with the trace kind. - * - * In general, a GC pointer should be stored with an exact type. This class - * is for use when that is not possible because a single pointer must point - * to several kinds of GC thing. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct GCCellPtr { - pub ptr: usize, - } - #[test] - fn bindgen_test_layout_GCCellPtr() { - assert_eq!(::std::mem::size_of::<GCCellPtr>() , 8usize , concat ! - ( "Size of: " , stringify ! ( GCCellPtr ) )); - assert_eq! (::std::mem::align_of::<GCCellPtr>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( GCCellPtr ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const GCCellPtr ) ) . ptr as * const _ - as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( GCCellPtr ) , - "::" , stringify ! ( ptr ) )); - } - impl Clone for GCCellPtr { - fn clone(&self) -> Self { *self } - } - /** - * The Heap<T> class is a heap-stored reference to a JS GC thing. All members of - * heap classes that refer to GC things should use Heap<T> (or possibly - * TenuredHeap<T>, described below). - * - * Heap<T> is an abstraction that hides some of the complexity required to - * maintain GC invariants for the contained reference. It uses operator - * overloading to provide a normal pointer interface, but notifies the GC every - * time the value it contains is updated. This is necessary for generational GC, - * which keeps track of all pointers into the nursery. - * - * Heap<T> instances must be traced when their containing object is traced to - * keep the pointed-to GC thing alive. - * - * Heap<T> objects should only be used on the heap. GC references stored on the - * C/C++ stack must use Rooted/Handle/MutableHandle instead. - * - * Type T must be a public GC pointer type. - */ + /// The Heap<T> class is a heap-stored reference to a JS GC thing. All members of + /// heap classes that refer to GC things should use Heap<T> (or possibly + /// TenuredHeap<T>, described below). + /// + /// Heap<T> is an abstraction that hides some of the complexity required to + /// maintain GC invariants for the contained reference. It uses operator + /// overloading to provide a normal pointer interface, but notifies the GC every + /// time the value it contains is updated. This is necessary for generational GC, + /// which keeps track of all pointers into the nursery. + /// + /// Heap<T> instances must be traced when their containing object is traced to + /// keep the pointed-to GC thing alive. + /// + /// Heap<T> objects should only be used on the heap. GC references stored on the + /// C/C++ stack must use Rooted/Handle/MutableHandle instead. + /// + /// Type T must be a public GC pointer type. #[repr(C)] #[derive(Debug)] pub struct Heap<T> { @@ -14758,6 +11056,7 @@ pub mod root { #[allow(unused_imports)] use self::super::super::super::root; #[repr(C)] + #[derive(Debug)] pub struct GarbageCollectionEvent { pub majorGCNumber_: u64, pub reason: *const ::std::os::raw::c_char, @@ -14874,35 +11173,33 @@ pub mod root { savedMonitor_ ) )); } } - /** - * The TenuredHeap<T> class is similar to the Heap<T> class above in that it - * encapsulates the GC concerns of an on-heap reference to a JS object. However, - * it has two important differences: - * - * 1) Pointers which are statically known to only reference "tenured" objects - * can avoid the extra overhead of SpiderMonkey's write barriers. - * - * 2) Objects in the "tenured" heap have stronger alignment restrictions than - * those in the "nursery", so it is possible to store flags in the lower - * bits of pointers known to be tenured. TenuredHeap wraps a normal tagged - * pointer with a nice API for accessing the flag bits and adds various - * assertions to ensure that it is not mis-used. - * - * GC things are said to be "tenured" when they are located in the long-lived - * heap: e.g. they have gained tenure as an object by surviving past at least - * one GC. For performance, SpiderMonkey allocates some things which are known - * to normally be long lived directly into the tenured generation; for example, - * global objects. Additionally, SpiderMonkey does not visit individual objects - * when deleting non-tenured objects, so object with finalizers are also always - * tenured; for instance, this includes most DOM objects. - * - * The considerations to keep in mind when using a TenuredHeap<T> vs a normal - * Heap<T> are: - * - * - It is invalid for a TenuredHeap<T> to refer to a non-tenured thing. - * - It is however valid for a Heap<T> to refer to a tenured thing. - * - It is not possible to store flag bits in a Heap<T>. - */ + /// The TenuredHeap<T> class is similar to the Heap<T> class above in that it + /// encapsulates the GC concerns of an on-heap reference to a JS object. However, + /// it has two important differences: + /// + /// 1) Pointers which are statically known to only reference "tenured" objects + /// can avoid the extra overhead of SpiderMonkey's write barriers. + /// + /// 2) Objects in the "tenured" heap have stronger alignment restrictions than + /// those in the "nursery", so it is possible to store flags in the lower + /// bits of pointers known to be tenured. TenuredHeap wraps a normal tagged + /// pointer with a nice API for accessing the flag bits and adds various + /// assertions to ensure that it is not mis-used. + /// + /// GC things are said to be "tenured" when they are located in the long-lived + /// heap: e.g. they have gained tenure as an object by surviving past at least + /// one GC. For performance, SpiderMonkey allocates some things which are known + /// to normally be long lived directly into the tenured generation; for example, + /// global objects. Additionally, SpiderMonkey does not visit individual objects + /// when deleting non-tenured objects, so object with finalizers are also always + /// tenured; for instance, this includes most DOM objects. + /// + /// The considerations to keep in mind when using a TenuredHeap<T> vs a normal + /// Heap<T> are: + /// + /// - It is invalid for a TenuredHeap<T> to refer to a non-tenured thing. + /// - It is however valid for a Heap<T> to refer to a tenured thing. + /// - It is not possible to store flag bits in a Heap<T>. #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct TenuredHeap { @@ -14939,93 +11236,21 @@ pub mod root { impl Clone for ConstUTF8CharsZ { fn clone(&self) -> Self { *self } } - /** - * Per ES6, the [[DefineOwnProperty]] internal method has three different - * possible outcomes: - * - * - It can throw an exception (which we indicate by returning false). - * - * - It can return true, indicating unvarnished success. - * - * - It can return false, indicating "strict failure". The property could - * not be defined. It's an error, but no exception was thrown. - * - * It's not just [[DefineOwnProperty]]: all the mutating internal methods have - * the same three outcomes. (The other affected internal methods are [[Set]], - * [[Delete]], [[SetPrototypeOf]], and [[PreventExtensions]].) - * - * If you think this design is awful, you're not alone. But as it's the - * standard, we must represent these boolean "success" values somehow. - * ObjectOpSuccess is the class for this. It's like a bool, but when it's false - * it also stores an error code. - * - * Typical usage: - * - * ObjectOpResult result; - * if (!DefineProperty(cx, obj, id, ..., result)) - * return false; - * if (!result) - * return result.reportError(cx, obj, id); - * - * Users don't have to call `result.report()`; another possible ending is: - * - * argv.rval().setBoolean(bool(result)); - * return true; - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ObjectOpResult { - /** - * code_ is either one of the special codes OkCode or Uninitialized, or - * an error code. For now the error codes are private to the JS engine; - * they're defined in js/src/js.msg. - * - * code_ is uintptr_t (rather than uint32_t) for the convenience of the - * JITs, which would otherwise have to deal with either padding or stack - * alignment on 64-bit platforms. - */ - pub code_: usize, - } - #[repr(u64)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum ObjectOpResult_SpecialCodes { - OkCode = 0, - Uninitialized = 18446744073709551615, - } - #[test] - fn bindgen_test_layout_ObjectOpResult() { - assert_eq!(::std::mem::size_of::<ObjectOpResult>() , 8usize , - concat ! ( "Size of: " , stringify ! ( ObjectOpResult ) - )); - assert_eq! (::std::mem::align_of::<ObjectOpResult>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( ObjectOpResult ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ObjectOpResult ) ) . code_ as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( ObjectOpResult - ) , "::" , stringify ! ( code_ ) )); - } - impl Clone for ObjectOpResult { - fn clone(&self) -> Self { *self } - } - /** - * This class can be used to store a pointer to the youngest frame of a saved - * stack in the specified JSContext. This reference will be picked up by any new - * calls performed until the class is destroyed, with the specified asyncCause, - * that must not be empty. - * - * Any stack capture initiated during these new calls will go through the async - * stack instead of the current stack. - * - * Capturing the stack before a new call is performed will not be affected. - * - * The provided chain of SavedFrame objects can live in any compartment, - * although it will be copied to the compartment where the stack is captured. - * - * See also `js/src/doc/SavedFrame/SavedFrame.md` for documentation on async - * stack frames. - */ + /// This class can be used to store a pointer to the youngest frame of a saved + /// stack in the specified JSContext. This reference will be picked up by any new + /// calls performed until the class is destroyed, with the specified asyncCause, + /// that must not be empty. + /// + /// Any stack capture initiated during these new calls will go through the async + /// stack instead of the current stack. + /// + /// Capturing the stack before a new call is performed will not be affected. + /// + /// The provided chain of SavedFrame objects can live in any compartment, + /// although it will be copied to the compartment where the stack is captured. + /// + /// See also `js/src/doc/SavedFrame/SavedFrame.md` for documentation on async + /// stack frames. #[repr(C)] #[derive(Debug)] pub struct AutoSetAsyncStackForNewCalls { @@ -15103,44 +11328,9 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct JSFunction { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct JSObject { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct JSScript { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct JSString { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct jsid { - pub asBits: usize, - } - #[test] - fn bindgen_test_layout_jsid() { - assert_eq!(::std::mem::size_of::<jsid>() , 8usize , concat ! ( - "Size of: " , stringify ! ( jsid ) )); - assert_eq! (::std::mem::align_of::<jsid>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( jsid ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const jsid ) ) . asBits as * const _ as - usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( jsid ) , "::" , - stringify ! ( asBits ) )); - } - impl Clone for jsid { - fn clone(&self) -> Self { *self } - } pub mod js { #[allow(unused_imports)] use self::super::super::root; @@ -15148,15 +11338,6 @@ pub mod root { #[allow(unused_imports)] use self::super::super::super::root; } - pub mod gcstats { - #[allow(unused_imports)] - use self::super::super::super::root; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Statistics { - _unused: [u8; 0], - } - } #[repr(C)] #[derive(Debug, Copy)] pub struct SystemAllocPolicy { @@ -15187,32 +11368,20 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct HandleBase { - pub _address: u8, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct MutableHandleBase { - pub _address: u8, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct HeapBase { pub _address: u8, } #[repr(C)] pub struct SourceHook__bindgen_vtable(::std::os::raw::c_void); - /** - * A class of objects that return source code on demand. - * - * When code is compiled with setSourceIsLazy(true), SpiderMonkey doesn't - * retain the source code (and doesn't do lazy bytecode generation). If we ever - * need the source code, say, in response to a call to Function.prototype. - * toSource or Debugger.Source.prototype.text, then we call the 'load' member - * function of the instance of this class that has hopefully been registered - * with the runtime, passing the code's URL, and hope that it will be able to - * find the source. - */ + /// A class of objects that return source code on demand. + /// + /// When code is compiled with setSourceIsLazy(true), SpiderMonkey doesn't + /// retain the source code (and doesn't do lazy bytecode generation). If we ever + /// need the source code, say, in response to a call to Function.prototype. + /// toSource or Debugger.Source.prototype.text, then we call the 'load' member + /// function of the instance of this class that has hopefully been registered + /// with the runtime, passing the code's URL, and hope that it will be able to + /// find the source. #[repr(C)] #[derive(Debug)] pub struct SourceHook { @@ -15231,231 +11400,13 @@ pub mod root { pub struct JSCompartment { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct JSRuntime { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct JSTracer { - pub runtime_: *mut root::JSRuntime, - pub weakMapAction_: root::WeakMapTraceKind, - pub tag_: root::JSTracer_TracerKindTag, - pub traceWeakEdges_: bool, - } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum JSTracer_TracerKindTag { - Marking = 0, - WeakMarking = 1, - Tenuring = 2, - Callback = 3, - } - #[test] - fn bindgen_test_layout_JSTracer() { - assert_eq!(::std::mem::size_of::<JSTracer>() , 24usize , concat ! ( - "Size of: " , stringify ! ( JSTracer ) )); - assert_eq! (::std::mem::align_of::<JSTracer>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( JSTracer ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSTracer ) ) . runtime_ as * const _ - as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( JSTracer ) , "::" , - stringify ! ( runtime_ ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSTracer ) ) . weakMapAction_ as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( JSTracer ) , "::" , - stringify ! ( weakMapAction_ ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSTracer ) ) . tag_ as * const _ as - usize } , 12usize , concat ! ( - "Alignment of field: " , stringify ! ( JSTracer ) , "::" , - stringify ! ( tag_ ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSTracer ) ) . traceWeakEdges_ as * - const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( JSTracer ) , "::" , - stringify ! ( traceWeakEdges_ ) )); - } - impl Clone for JSTracer { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsQueryInterface { - pub mRawPtr: *mut root::nsISupports, - } - #[test] - fn bindgen_test_layout_nsQueryInterface() { - assert_eq!(::std::mem::size_of::<nsQueryInterface>() , 8usize , concat - ! ( "Size of: " , stringify ! ( nsQueryInterface ) )); - assert_eq! (::std::mem::align_of::<nsQueryInterface>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsQueryInterface ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsQueryInterface ) ) . mRawPtr as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsQueryInterface ) - , "::" , stringify ! ( mRawPtr ) )); - } - impl Clone for nsQueryInterface { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsQueryInterfaceWithError { - pub mRawPtr: *mut root::nsISupports, - pub mErrorPtr: *mut root::nsresult, - } - #[test] - fn bindgen_test_layout_nsQueryInterfaceWithError() { - assert_eq!(::std::mem::size_of::<nsQueryInterfaceWithError>() , - 16usize , concat ! ( - "Size of: " , stringify ! ( nsQueryInterfaceWithError ) )); - assert_eq! (::std::mem::align_of::<nsQueryInterfaceWithError>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( nsQueryInterfaceWithError - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsQueryInterfaceWithError ) ) . - mRawPtr as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsQueryInterfaceWithError ) , "::" , stringify ! ( mRawPtr - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsQueryInterfaceWithError ) ) . - mErrorPtr as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsQueryInterfaceWithError ) , "::" , stringify ! ( - mErrorPtr ) )); - } - impl Clone for nsQueryInterfaceWithError { - fn clone(&self) -> Self { *self } - } - //////////////////////////////////////////////////////////////////////////// - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsGetServiceByCID { - pub mCID: *const root::nsCID, - pub __bindgen_align: [u64; 0usize], - } - #[test] - fn bindgen_test_layout_nsGetServiceByCID() { - assert_eq!(::std::mem::size_of::<nsGetServiceByCID>() , 8usize , - concat ! ( "Size of: " , stringify ! ( nsGetServiceByCID ) - )); - assert_eq! (::std::mem::align_of::<nsGetServiceByCID>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsGetServiceByCID ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsGetServiceByCID ) ) . mCID as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsGetServiceByCID ) - , "::" , stringify ! ( mCID ) )); - } - impl Clone for nsGetServiceByCID { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsGetServiceByCIDWithError { - pub mCID: *const root::nsCID, - pub mErrorPtr: *mut root::nsresult, - } - #[test] - fn bindgen_test_layout_nsGetServiceByCIDWithError() { - assert_eq!(::std::mem::size_of::<nsGetServiceByCIDWithError>() , - 16usize , concat ! ( - "Size of: " , stringify ! ( nsGetServiceByCIDWithError ) - )); - assert_eq! (::std::mem::align_of::<nsGetServiceByCIDWithError>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( nsGetServiceByCIDWithError - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsGetServiceByCIDWithError ) ) . mCID - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsGetServiceByCIDWithError ) , "::" , stringify ! ( mCID ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsGetServiceByCIDWithError ) ) . - mErrorPtr as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsGetServiceByCIDWithError ) , "::" , stringify ! ( - mErrorPtr ) )); - } - impl Clone for nsGetServiceByCIDWithError { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsGetServiceByContractID { - pub mContractID: *const ::std::os::raw::c_char, - } - #[test] - fn bindgen_test_layout_nsGetServiceByContractID() { - assert_eq!(::std::mem::size_of::<nsGetServiceByContractID>() , 8usize - , concat ! ( - "Size of: " , stringify ! ( nsGetServiceByContractID ) )); - assert_eq! (::std::mem::align_of::<nsGetServiceByContractID>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( nsGetServiceByContractID ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsGetServiceByContractID ) ) . - mContractID as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsGetServiceByContractID ) , "::" , stringify ! ( - mContractID ) )); - } - impl Clone for nsGetServiceByContractID { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsGetServiceByContractIDWithError { - pub mContractID: *const ::std::os::raw::c_char, - pub mErrorPtr: *mut root::nsresult, - } - #[test] - fn bindgen_test_layout_nsGetServiceByContractIDWithError() { - assert_eq!(::std::mem::size_of::<nsGetServiceByContractIDWithError>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - nsGetServiceByContractIDWithError ) )); - assert_eq! (::std::mem::align_of::<nsGetServiceByContractIDWithError>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsGetServiceByContractIDWithError ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsGetServiceByContractIDWithError ) ) - . mContractID as * const _ as usize } , 0usize , concat ! - ( - "Alignment of field: " , stringify ! ( - nsGetServiceByContractIDWithError ) , "::" , stringify ! ( - mContractID ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsGetServiceByContractIDWithError ) ) - . mErrorPtr as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsGetServiceByContractIDWithError ) , "::" , stringify ! ( - mErrorPtr ) )); - } - impl Clone for nsGetServiceByContractIDWithError { - fn clone(&self) -> Self { *self } - } - /** - * Factors implementation for all template versions of nsCOMPtr. - * - * Here's the way people normally do things like this: - * - * template<class T> class Foo { ... }; - * template<> class Foo<void*> { ... }; - * template<class T> class Foo<T*> : private Foo<void*> { ... }; - */ + /// Factors implementation for all template versions of nsCOMPtr. + /// + /// Here's the way people normally do things like this: + /// + /// template<class T> class Foo { ... }; + /// template<> class Foo<void*> { ... }; + /// template<class T> class Foo<T*> : private Foo<void*> { ... }; #[repr(C)] #[derive(Debug)] pub struct nsCOMPtr_base { @@ -15740,11 +11691,9 @@ pub mod root { *mut root::PLDHashEntryHdr, aKey: *const ::std::os::raw::c_void)>; - /** - * hashkey wrapper using T* KeyType - * - * @see nsTHashtable::EntryType for specification - */ + /// hashkey wrapper using T* KeyType + /// + /// @see nsTHashtable::EntryType for specification #[repr(C)] #[derive(Debug)] pub struct nsPtrHashKey<T> { @@ -15759,11 +11708,9 @@ pub mod root { #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsPtrHashKey__bindgen_ty_1 { ALLOW_MEMMOVE = 0, } - /** - * hashkey wrapper using nsAString KeyType - * - * @see nsTHashtable::EntryType for specification - */ + /// hashkey wrapper using nsAString KeyType + /// + /// @see nsTHashtable::EntryType for specification #[repr(C)] #[derive(Debug)] pub struct nsStringHashKey { @@ -15791,11 +11738,9 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStringHashKey ) , "::" , stringify ! ( mStr ) )); } - /** - * hashkey wrapper using nsACString KeyType - * - * @see nsTHashtable::EntryType for specification - */ + /// hashkey wrapper using nsACString KeyType + /// + /// @see nsTHashtable::EntryType for specification #[repr(C)] #[derive(Debug)] pub struct nsCStringHashKey { @@ -15824,11 +11769,9 @@ pub mod root { "Alignment of field: " , stringify ! ( nsCStringHashKey ) , "::" , stringify ! ( mStr ) )); } - /** - * hashkey wrapper using nsISupports* KeyType - * - * @see nsTHashtable::EntryType for specification - */ + /// hashkey wrapper using nsISupports* KeyType + /// + /// @see nsTHashtable::EntryType for specification #[repr(C)] #[derive(Debug)] pub struct nsISupportsHashKey { @@ -15857,11 +11800,9 @@ pub mod root { "Alignment of field: " , stringify ! ( nsISupportsHashKey ) , "::" , stringify ! ( mSupports ) )); } - /** - * hashkey wrapper using refcounted * KeyType - * - * @see nsTHashtable::EntryType for specification - */ + /// hashkey wrapper using refcounted * KeyType + /// + /// @see nsTHashtable::EntryType for specification #[repr(C)] #[derive(Debug)] pub struct nsRefPtrHashKey<T> { @@ -15877,69 +11818,63 @@ pub mod root { #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsRefPtrHashKey__bindgen_ty_1 { ALLOW_MEMMOVE = 0, } - /** - * a base class for templated hashtables. - * - * Clients will rarely need to use this class directly. Check the derived - * classes first, to see if they will meet your needs. - * - * @param EntryType the templated entry-type class that is managed by the - * hashtable. <code>EntryType</code> must extend the following declaration, - * and <strong>must not declare any virtual functions or derive from classes - * with virtual functions.</strong> Any vtable pointer would break the - * PLDHashTable code. - *<pre> class EntryType : public PLDHashEntryHdr - * { - * public: or friend nsTHashtable<EntryType>; - * // KeyType is what we use when Get()ing or Put()ing this entry - * // this should either be a simple datatype (uint32_t, nsISupports*) or - * // a const reference (const nsAString&) - * typedef something KeyType; - * // KeyTypePointer is the pointer-version of KeyType, because - * // PLDHashTable.h requires keys to cast to <code>const void*</code> - * typedef const something* KeyTypePointer; - * - * EntryType(KeyTypePointer aKey); - * - * // A copy or C++11 Move constructor must be defined, even if - * // AllowMemMove() == true, otherwise you will cause link errors. - * EntryType(const EntryType& aEnt); // Either this... - * EntryType(EntryType&& aEnt); // ...or this - * - * // the destructor must be defined... or you will cause link errors! - * ~EntryType(); - * - * // KeyEquals(): does this entry match this key? - * bool KeyEquals(KeyTypePointer aKey) const; - * - * // KeyToPointer(): Convert KeyType to KeyTypePointer - * static KeyTypePointer KeyToPointer(KeyType aKey); - * - * // HashKey(): calculate the hash number - * static PLDHashNumber HashKey(KeyTypePointer aKey); - * - * // ALLOW_MEMMOVE can we move this class with memmove(), or do we have - * // to use the copy constructor? - * enum { ALLOW_MEMMOVE = true/false }; - * }</pre> - * - * @see nsInterfaceHashtable - * @see nsDataHashtable - * @see nsClassHashtable - * @author "Benjamin Smedberg <bsmedberg@covad.net>" - */ + /// a base class for templated hashtables. + /// + /// Clients will rarely need to use this class directly. Check the derived + /// classes first, to see if they will meet your needs. + /// + /// @param EntryType the templated entry-type class that is managed by the + /// hashtable. <code>EntryType</code> must extend the following declaration, + /// and <strong>must not declare any virtual functions or derive from classes + /// with virtual functions.</strong> Any vtable pointer would break the + /// PLDHashTable code. + /// <pre> class EntryType : public PLDHashEntryHdr + /// { + /// public: or friend nsTHashtable<EntryType>; + /// // KeyType is what we use when Get()ing or Put()ing this entry + /// // this should either be a simple datatype (uint32_t, nsISupports*) or + /// // a const reference (const nsAString&) + /// typedef something KeyType; + /// // KeyTypePointer is the pointer-version of KeyType, because + /// // PLDHashTable.h requires keys to cast to <code>const void*</code> + /// typedef const something* KeyTypePointer; + /// + /// EntryType(KeyTypePointer aKey); + /// + /// // A copy or C++11 Move constructor must be defined, even if + /// // AllowMemMove() == true, otherwise you will cause link errors. + /// EntryType(const EntryType& aEnt); // Either this... + /// EntryType(EntryType&& aEnt); // ...or this + /// + /// // the destructor must be defined... or you will cause link errors! + /// ~EntryType(); + /// + /// // KeyEquals(): does this entry match this key? + /// bool KeyEquals(KeyTypePointer aKey) const; + /// + /// // KeyToPointer(): Convert KeyType to KeyTypePointer + /// static KeyTypePointer KeyToPointer(KeyType aKey); + /// + /// // HashKey(): calculate the hash number + /// static PLDHashNumber HashKey(KeyTypePointer aKey); + /// + /// // ALLOW_MEMMOVE can we move this class with memmove(), or do we have + /// // to use the copy constructor? + /// enum { ALLOW_MEMMOVE = true/false }; + /// }</pre> + /// + /// @see nsInterfaceHashtable + /// @see nsDataHashtable + /// @see nsClassHashtable + /// @author "Benjamin Smedberg <bsmedberg@covad.net>" #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsTHashtable { } pub type nsTHashtable_fallible_t = root::mozilla::fallible_t; - /** - * KeyType is typedef'ed for ease of use. - */ + /// KeyType is typedef'ed for ease of use. pub type nsTHashtable_KeyType = [u8; 0usize]; - /** - * KeyTypePointer is typedef'ed for ease of use. - */ + /// KeyTypePointer is typedef'ed for ease of use. pub type nsTHashtable_KeyTypePointer = [u8; 0usize]; #[repr(C)] #[derive(Debug)] @@ -15947,18 +11882,16 @@ pub mod root { pub _base: root::PLDHashTable_Iterator, } pub type nsTHashtable_Iterator_Base = root::PLDHashTable_Iterator; - /** - * templated hashtable for simple data types - * This class manages simple data types that do not need construction or - * destruction. - * - * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h - * for a complete specification. - * @param DataType the datatype stored in the hashtable, - * for example, uint32_t or nsCOMPtr. If UserDataType is not the same, - * DataType must implicitly cast to UserDataType - * @param UserDataType the user sees, for example uint32_t or nsISupports* - */ + /// templated hashtable for simple data types + /// This class manages simple data types that do not need construction or + /// destruction. + /// + /// @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h + /// for a complete specification. + /// @param DataType the datatype stored in the hashtable, + /// for example, uint32_t or nsCOMPtr. If UserDataType is not the same, + /// DataType must implicitly cast to UserDataType + /// @param UserDataType the user sees, for example uint32_t or nsISupports* #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsBaseHashtable { @@ -15989,11 +11922,9 @@ pub mod root { pub _base: root::PLDHashTable_Iterator, } pub type nsBaseHashtable_Iterator_Base = root::PLDHashTable_Iterator; - /** - * the private nsTHashtable::EntryType class used by nsBaseHashtable - * @see nsTHashtable for the specification of this class - * @see nsBaseHashtable for template parameters - */ + /// the private nsTHashtable::EntryType class used by nsBaseHashtable + /// @see nsTHashtable for the specification of this class + /// @see nsBaseHashtable for template parameters #[repr(C)] #[derive(Debug)] pub struct nsBaseHashtableET<KeyClass, DataType> { @@ -16004,105 +11935,17 @@ pub mod root { } pub type nsBaseHashtableET_KeyType = [u8; 0usize]; pub type nsBaseHashtableET_KeyTypePointer = [u8; 0usize]; - /** - * templated hashtable class maps keys to simple datatypes. - * See nsBaseHashtable for complete declaration - * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h - * for a complete specification. - * @param DataType the simple datatype being wrapped - * @see nsInterfaceHashtable, nsClassHashtable - */ + /// templated hashtable class maps keys to simple datatypes. + /// See nsBaseHashtable for complete declaration + /// @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h + /// for a complete specification. + /// @param DataType the simple datatype being wrapped + /// @see nsInterfaceHashtable, nsClassHashtable #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsDataHashtable { } pub type nsDataHashtable_BaseClass = u8; - pub type nsIntRegion = root::mozilla::gfx::IntRegion; - #[repr(C)] - #[derive(Debug)] - pub struct nsRegion { - pub mImpl: root::pixman_region32_t, - } - pub type nsRegion_RectType = root::nsRect; - pub type nsRegion_PointType = root::nsPoint; - pub type nsRegion_MarginType = root::nsMargin; - /** - * VisitEdges is a weird kind of function that we use for padding - * out surfaces to prevent texture filtering artifacts. - * It calls the visitFn callback for each of the exterior edges of - * the regions. The top and bottom edges will be expanded 1 pixel - * to the left and right if there's an outside corner. The order - * the edges are visited is not guaranteed. - * - * visitFn has a side parameter that can be TOP,BOTTOM,LEFT,RIGHT - * and specifies which kind of edge is being visited. x1, y1, x2, y2 - * are the coordinates of the line. (x1 == x2) || (y1 == y2) - */ - pub type nsRegion_visitFn = - ::std::option::Option<unsafe extern "C" fn(closure: - *mut ::std::os::raw::c_void, - side: root::VisitSide, - x1: ::std::os::raw::c_int, - y1: ::std::os::raw::c_int, - x2: ::std::os::raw::c_int, - y2: - ::std::os::raw::c_int)>; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsRegion_RectIterator { - pub mCurrent: ::std::os::raw::c_int, - pub mLimit: ::std::os::raw::c_int, - pub mTmp: root::nsRect, - pub mBoxes: *mut root::pixman_box32_t, - } - #[test] - fn bindgen_test_layout_nsRegion_RectIterator() { - assert_eq!(::std::mem::size_of::<nsRegion_RectIterator>() , 32usize , - concat ! ( - "Size of: " , stringify ! ( nsRegion_RectIterator ) )); - assert_eq! (::std::mem::align_of::<nsRegion_RectIterator>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsRegion_RectIterator ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRegion_RectIterator ) ) . mCurrent - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsRegion_RectIterator ) , "::" , stringify ! ( mCurrent ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRegion_RectIterator ) ) . mLimit as - * const _ as usize } , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsRegion_RectIterator ) , "::" , stringify ! ( mLimit ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRegion_RectIterator ) ) . mTmp as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsRegion_RectIterator ) , "::" , stringify ! ( mTmp ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRegion_RectIterator ) ) . mBoxes as - * const _ as usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsRegion_RectIterator ) , "::" , stringify ! ( mBoxes ) - )); - } - impl Clone for nsRegion_RectIterator { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_nsRegion() { - assert_eq!(::std::mem::size_of::<nsRegion>() , 24usize , concat ! ( - "Size of: " , stringify ! ( nsRegion ) )); - assert_eq! (::std::mem::align_of::<nsRegion>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( nsRegion ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRegion ) ) . mImpl as * const _ as - usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsRegion ) , "::" , - stringify ! ( mImpl ) )); - } #[repr(C)] #[derive(Debug, Copy)] pub struct nsTArrayHeader { @@ -16218,8 +12061,6 @@ pub mod root { } pub type nscoord = i32; pub type nscolor = u32; - pub type nsIntPoint = root::mozilla::gfx::IntPoint; - pub type nsIntMargin = root::mozilla::gfx::IntMargin; #[repr(C)] #[derive(Debug, Copy)] pub struct gfxFontFeature { @@ -16455,11 +12296,6 @@ pub mod root { mFontFeatureValues ) )); } pub type gfxFontVariation = root::mozilla::gfx::FontVariation; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct gfxFontStyle { - _unused: [u8; 0], - } pub const kGenericFont_NONE: u8 = 0; pub const kGenericFont_moz_variable: u8 = 0; pub const kGenericFont_moz_fixed: u8 = 1; @@ -16611,10 +12447,8 @@ pub mod root { "Alignment of field: " , stringify ! ( nsFont ) , "::" , stringify ! ( languageOverride ) )); } - /** - * An array of objects, similar to AutoTArray<T,1> but which is memmovable. It - * always has length >= 1. - */ + /// An array of objects, similar to AutoTArray<T,1> but which is memmovable. It + /// always has length >= 1. #[repr(C)] #[derive(Debug)] pub struct nsStyleAutoArray<T> { @@ -16681,15 +12515,14 @@ pub mod root { impl Clone for nsStyleUnion { fn clone(&self) -> Self { *self } } - /** - * Class that hold a single size specification used by the style - * system. The size specification consists of two parts -- a number - * and a unit. The number is an integer, a floating point value, an - * nscoord, or undefined, and the unit is an nsStyleUnit. Checking - * the unit is a must before asking for the value in any particular - * form. - */ - /** <div rustbindgen private accessor="unsafe"></div> */ + /// Class that hold a single size specification used by the style + /// system. The size specification consists of two parts -- a number + /// and a unit. The number is an integer, a floating point value, an + /// nscoord, or undefined, and the unit is an nsStyleUnit. Checking + /// the unit is a must before asking for the value in any particular + /// form. + /// / + /// /** <div rustbindgen private accessor="unsafe"></div> #[repr(C)] #[derive(Debug)] pub struct nsStyleCoord { @@ -16791,12 +12624,11 @@ pub mod root { &mut self.mValue } } - /** - * Class that represents a set of top/right/bottom/left nsStyleCoords. - * This is commonly used to hold the widths of the borders, margins, - * or paddings of a box. - */ - /** <div rustbindgen private accessor="unsafe"></div> */ + /// Class that represents a set of top/right/bottom/left nsStyleCoords. + /// This is commonly used to hold the widths of the borders, margins, + /// or paddings of a box. + /// / + /// /** <div rustbindgen private accessor="unsafe"></div> #[repr(C)] #[derive(Debug)] pub struct nsStyleSides { @@ -16840,12 +12672,11 @@ pub mod root { &mut self.mValues } } - /** - * Class that represents a set of top-left/top-right/bottom-right/bottom-left - * nsStyleCoord pairs. This is used to hold the dimensions of the - * corners of a box (for, e.g., border-radius and outline-radius). - */ - /** <div rustbindgen private accessor="unsafe"></div> */ + /// Class that represents a set of top-left/top-right/bottom-right/bottom-left + /// nsStyleCoord pairs. This is used to hold the dimensions of the + /// corners of a box (for, e.g., border-radius and outline-radius). + /// / + /// /** <div rustbindgen private accessor="unsafe"></div> #[repr(C)] #[derive(Debug)] pub struct nsStyleCorners { @@ -17067,1395 +12898,24 @@ pub mod root { } } #[repr(C)] - /** - * |nsRestyleHint| is a bitfield for the result of - * |HasStateDependentStyle| and |HasAttributeDependentStyle|. When no - * restyling is necessary, use |nsRestyleHint(0)|. - * - * Without eRestyle_Force or eRestyle_ForceDescendants, the restyling process - * can stop processing at a frame when it detects no style changes and it is - * known that the styles of the subtree beneath it will not change, leaving - * the old style context on the frame. eRestyle_Force can be used to skip this - * optimization on a frame, and to force its new style context to be used. - * - * Similarly, eRestyle_ForceDescendants will cause the frame and all of its - * descendants to be traversed and for the new style contexts that are created - * to be set on the frames. - * - * NOTE: When adding new restyle hints, please also add them to - * RestyleManager::RestyleHintToString. - */ + /// |nsRestyleHint| is a bitfield for the result of + /// |HasStateDependentStyle| and |HasAttributeDependentStyle|. When no + /// restyling is necessary, use |nsRestyleHint(0)|. + /// + /// Without eRestyle_Force or eRestyle_ForceDescendants, the restyling process + /// can stop processing at a frame when it detects no style changes and it is + /// known that the styles of the subtree beneath it will not change, leaving + /// the old style context on the frame. eRestyle_Force can be used to skip this + /// optimization on a frame, and to force its new style context to be used. + /// + /// Similarly, eRestyle_ForceDescendants will cause the frame and all of its + /// descendants to be traversed and for the new style contexts that are created + /// to be set on the frames. + /// + /// NOTE: When adding new restyle hints, please also add them to + /// RestyleManager::RestyleHintToString. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct nsRestyleHint(pub u32); - #[repr(u32)] - /** - * Return status for event processors. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsEventStatus { - nsEventStatus_eIgnore = 0, - nsEventStatus_eConsumeNoDefault = 1, - nsEventStatus_eConsumeDoDefault = 2, - nsEventStatus_eSentinel = 3, - } - pub type gfxSize = [u64; 2usize]; - pub type nsIntRect = root::mozilla::gfx::IntRect; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct pixman_region32_data { - pub size: ::std::os::raw::c_long, - pub numRects: ::std::os::raw::c_long, - } - #[test] - fn bindgen_test_layout_pixman_region32_data() { - assert_eq!(::std::mem::size_of::<pixman_region32_data>() , 16usize , - concat ! ( - "Size of: " , stringify ! ( pixman_region32_data ) )); - assert_eq! (::std::mem::align_of::<pixman_region32_data>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( pixman_region32_data ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_region32_data ) ) . size as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - pixman_region32_data ) , "::" , stringify ! ( size ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_region32_data ) ) . numRects - as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - pixman_region32_data ) , "::" , stringify ! ( numRects ) - )); - } - impl Clone for pixman_region32_data { - fn clone(&self) -> Self { *self } - } - pub type pixman_region32_data_t = root::pixman_region32_data; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct pixman_box32 { - pub x1: i32, - pub y1: i32, - pub x2: i32, - pub y2: i32, - } - #[test] - fn bindgen_test_layout_pixman_box32() { - assert_eq!(::std::mem::size_of::<pixman_box32>() , 16usize , concat ! - ( "Size of: " , stringify ! ( pixman_box32 ) )); - assert_eq! (::std::mem::align_of::<pixman_box32>() , 4usize , concat ! - ( "Alignment of " , stringify ! ( pixman_box32 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_box32 ) ) . x1 as * const _ as - usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( pixman_box32 ) , - "::" , stringify ! ( x1 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_box32 ) ) . y1 as * const _ as - usize } , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( pixman_box32 ) , - "::" , stringify ! ( y1 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_box32 ) ) . x2 as * const _ as - usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( pixman_box32 ) , - "::" , stringify ! ( x2 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_box32 ) ) . y2 as * const _ as - usize } , 12usize , concat ! ( - "Alignment of field: " , stringify ! ( pixman_box32 ) , - "::" , stringify ! ( y2 ) )); - } - impl Clone for pixman_box32 { - fn clone(&self) -> Self { *self } - } - pub type pixman_box32_t = root::pixman_box32; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct pixman_region32 { - pub extents: root::pixman_box32_t, - pub data: *mut root::pixman_region32_data_t, - } - #[test] - fn bindgen_test_layout_pixman_region32() { - assert_eq!(::std::mem::size_of::<pixman_region32>() , 24usize , concat - ! ( "Size of: " , stringify ! ( pixman_region32 ) )); - assert_eq! (::std::mem::align_of::<pixman_region32>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( pixman_region32 ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_region32 ) ) . extents as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( pixman_region32 ) , - "::" , stringify ! ( extents ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const pixman_region32 ) ) . data as * const - _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( pixman_region32 ) , - "::" , stringify ! ( data ) )); - } - impl Clone for pixman_region32 { - fn clone(&self) -> Self { *self } - } - pub type pixman_region32_t = root::pixman_region32; - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum VisitSide { TOP = 0, BOTTOM = 1, LEFT = 2, RIGHT = 3, } - /** - * Presentation shell interface. Presentation shells are the - * controlling point for managing the presentation of a document. The - * presentation shell holds a live reference to the document, the - * presentation context, the style manager, the style set and the root - * frame. <p> - * - * When this object is Release'd, it will release the document, the - * presentation context, the style manager, the style set and the root - * frame. - */ - #[repr(C)] - pub struct nsIPresShell { - pub _base: root::nsISupports, - pub mDocument: root::nsCOMPtr, - pub mPresContext: root::RefPtr<root::nsPresContext>, - pub mStyleSet: root::mozilla::StyleSetHandle, - pub mFrameConstructor: *mut root::nsCSSFrameConstructor, - pub mViewManager: *mut root::nsViewManager, - pub mFrameArena: root::nsPresArena, - pub mSelection: root::RefPtr<root::nsFrameSelection>, - pub mFrameManager: *mut root::nsFrameManagerBase, - pub mForwardingContainer: u64, - pub mDocAccessible: *mut root::mozilla::a11y::DocAccessible, - pub mReflowContinueTimer: root::nsCOMPtr, - pub mPaintCount: u64, - pub mScrollPositionClampingScrollPortSize: root::nsSize, - pub mAutoWeakFrames: *mut root::AutoWeakFrame, - pub mWeakFrames: [u64; 5usize], - pub mCanvasBackgroundColor: root::nscolor, - pub mResolution: [u32; 2usize], - pub mSelectionFlags: i16, - pub mRenderFlags: root::nsIPresShell_RenderFlags, - pub _bitfield_1: [u8; 2usize], - pub mPresShellId: u32, - pub mFontSizeInflationEmPerLine: u32, - pub mFontSizeInflationMinTwips: u32, - pub mFontSizeInflationLineThreshold: u32, - pub mFontSizeInflationForceEnabled: bool, - pub mFontSizeInflationDisabledInMasterProcess: bool, - pub mFontSizeInflationEnabled: bool, - pub mFontSizeInflationEnabledIsDirty: bool, - pub mPaintingIsFrozen: bool, - pub mIsNeverPainting: bool, - pub mInFlush: bool, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIPresShell_COMTypeInfo { - pub _address: u8, - } - pub type nsIPresShell_FocusTarget = root::mozilla::layers::FocusTarget; - pub type nsIPresShell_LayerManager = root::mozilla::layers::LayerManager; - pub type nsIPresShell_SourceSurface = root::mozilla::gfx::SourceSurface; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_eRenderFlag { - STATE_IGNORING_VIEWPORT_SCROLLING = 1, - STATE_DRAWWINDOW_NOT_FLUSHING = 2, - } - pub type nsIPresShell_RenderFlags = u8; - #[repr(u32)] - /** - * Gets nearest scrollable frame from the specified content node. The frame - * is scrollable with overflow:scroll or overflow:auto in some direction when - * aDirection is eEither. Otherwise, this returns a nearest frame that is - * scrollable in the specified direction. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_ScrollDirection { - eHorizontal = 0, - eVertical = 1, - eEither = 2, - } - #[repr(u32)] - /** - * Tell the pres shell that a frame needs to be marked dirty and needs - * Reflow. It's OK if this is an ancestor of the frame needing reflow as - * long as the ancestor chain between them doesn't cross a reflow root. - * - * The bit to add should be NS_FRAME_IS_DIRTY, NS_FRAME_HAS_DIRTY_CHILDREN - * or nsFrameState(0); passing 0 means that dirty bits won't be set on the - * frame or its ancestors/descendants, but that intrinsic widths will still - * be marked dirty. Passing aIntrinsicDirty = eResize and aBitToAdd = 0 - * would result in no work being done, so don't do that. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_IntrinsicDirty { - eResize = 0, - eTreeChange = 1, - eStyleChange = 2, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_ReflowRootHandling { - ePositionOrSizeChange = 0, - eNoPositionOrSizeChange = 1, - eInferFromBitToAdd = 2, - } - pub const nsIPresShell_SCROLL_TOP: root::nsIPresShell__bindgen_ty_1 = - nsIPresShell__bindgen_ty_1::SCROLL_TOP; - pub const nsIPresShell_SCROLL_BOTTOM: root::nsIPresShell__bindgen_ty_1 = - nsIPresShell__bindgen_ty_1::SCROLL_BOTTOM; - pub const nsIPresShell_SCROLL_LEFT: root::nsIPresShell__bindgen_ty_1 = - nsIPresShell__bindgen_ty_1::SCROLL_TOP; - pub const nsIPresShell_SCROLL_RIGHT: root::nsIPresShell__bindgen_ty_1 = - nsIPresShell__bindgen_ty_1::SCROLL_BOTTOM; - pub const nsIPresShell_SCROLL_CENTER: root::nsIPresShell__bindgen_ty_1 = - nsIPresShell__bindgen_ty_1::SCROLL_CENTER; - pub const nsIPresShell_SCROLL_MINIMUM: root::nsIPresShell__bindgen_ty_1 = - nsIPresShell__bindgen_ty_1::SCROLL_MINIMUM; - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell__bindgen_ty_1 { - SCROLL_TOP = 0, - SCROLL_BOTTOM = 100, - SCROLL_CENTER = 50, - SCROLL_MINIMUM = -1, - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_WhenToScroll { - SCROLL_ALWAYS = 0, - SCROLL_IF_NOT_VISIBLE = 1, - SCROLL_IF_NOT_FULLY_VISIBLE = 2, - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIPresShell_ScrollAxis { - pub _bindgen_opaque_blob: u32, - } - #[test] - fn bindgen_test_layout_nsIPresShell_ScrollAxis() { - assert_eq!(::std::mem::size_of::<nsIPresShell_ScrollAxis>() , 4usize , - concat ! ( - "Size of: " , stringify ! ( nsIPresShell_ScrollAxis ) )); - assert_eq! (::std::mem::align_of::<nsIPresShell_ScrollAxis>() , 4usize - , concat ! ( - "Alignment of " , stringify ! ( nsIPresShell_ScrollAxis ) - )); - } - impl Clone for nsIPresShell_ScrollAxis { - fn clone(&self) -> Self { *self } - } - pub const nsIPresShell_SCROLL_FIRST_ANCESTOR_ONLY: - root::nsIPresShell__bindgen_ty_2 = - nsIPresShell__bindgen_ty_2::SCROLL_FIRST_ANCESTOR_ONLY; - pub const nsIPresShell_SCROLL_OVERFLOW_HIDDEN: - root::nsIPresShell__bindgen_ty_2 = - nsIPresShell__bindgen_ty_2::SCROLL_OVERFLOW_HIDDEN; - pub const nsIPresShell_SCROLL_NO_PARENT_FRAMES: - root::nsIPresShell__bindgen_ty_2 = - nsIPresShell__bindgen_ty_2::SCROLL_NO_PARENT_FRAMES; - pub const nsIPresShell_SCROLL_SMOOTH: root::nsIPresShell__bindgen_ty_2 = - nsIPresShell__bindgen_ty_2::SCROLL_SMOOTH; - pub const nsIPresShell_SCROLL_SMOOTH_AUTO: - root::nsIPresShell__bindgen_ty_2 = - nsIPresShell__bindgen_ty_2::SCROLL_SMOOTH_AUTO; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell__bindgen_ty_2 { - SCROLL_FIRST_ANCESTOR_ONLY = 1, - SCROLL_OVERFLOW_HIDDEN = 2, - SCROLL_NO_PARENT_FRAMES = 4, - SCROLL_SMOOTH = 8, - SCROLL_SMOOTH_AUTO = 16, - } - pub const nsIPresShell_RENDER_IS_UNTRUSTED: - root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_IS_UNTRUSTED; - pub const nsIPresShell_RENDER_IGNORE_VIEWPORT_SCROLLING: - root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_IGNORE_VIEWPORT_SCROLLING; - pub const nsIPresShell_RENDER_CARET: root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_CARET; - pub const nsIPresShell_RENDER_USE_WIDGET_LAYERS: - root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_USE_WIDGET_LAYERS; - pub const nsIPresShell_RENDER_ASYNC_DECODE_IMAGES: - root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_ASYNC_DECODE_IMAGES; - pub const nsIPresShell_RENDER_DOCUMENT_RELATIVE: - root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_DOCUMENT_RELATIVE; - pub const nsIPresShell_RENDER_DRAWWINDOW_NOT_FLUSHING: - root::nsIPresShell__bindgen_ty_3 = - nsIPresShell__bindgen_ty_3::RENDER_DRAWWINDOW_NOT_FLUSHING; - #[repr(u32)] - /** - * Render the document into an arbitrary gfxContext - * Designed for getting a picture of a document or a piece of a document - * Note that callers will generally want to call FlushPendingNotifications - * to get an up-to-date view of the document - * @param aRect is the region to capture into the offscreen buffer, in the - * root frame's coordinate system (if aIgnoreViewportScrolling is false) - * or in the root scrolled frame's coordinate system - * (if aIgnoreViewportScrolling is true). The coordinates are in appunits. - * @param aFlags see below; - * set RENDER_IS_UNTRUSTED if the contents may be passed to malicious - * agents. E.g. we might choose not to paint the contents of sensitive widgets - * such as the file name in a file upload widget, and we might choose not - * to paint themes. - * set RENDER_IGNORE_VIEWPORT_SCROLLING to ignore - * clipping and scrollbar painting due to scrolling in the viewport - * set RENDER_CARET to draw the caret if one would be visible - * (by default the caret is never drawn) - * set RENDER_USE_LAYER_MANAGER to force rendering to go through - * the layer manager for the window. This may be unexpectedly slow - * (if the layer manager must read back data from the GPU) or low-quality - * (if the layer manager reads back pixel data and scales it - * instead of rendering using the appropriate scaling). It may also - * slow everything down if the area rendered does not correspond to the - * normal visible area of the window. - * set RENDER_ASYNC_DECODE_IMAGES to avoid having images synchronously - * decoded during rendering. - * (by default images decode synchronously with RenderDocument) - * set RENDER_DOCUMENT_RELATIVE to render the document as if there has been - * no scrolling and interpret |aRect| relative to the document instead of the - * CSS viewport. Only considered if RENDER_IGNORE_VIEWPORT_SCROLLING is set - * or the document is in ignore viewport scrolling mode - * (nsIPresShell::SetIgnoreViewportScrolling/IgnoringViewportScrolling). - * @param aBackgroundColor a background color to render onto - * @param aRenderedContext the gfxContext to render to. We render so that - * one CSS pixel in the source document is rendered to one unit in the current - * transform. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell__bindgen_ty_3 { - RENDER_IS_UNTRUSTED = 1, - RENDER_IGNORE_VIEWPORT_SCROLLING = 2, - RENDER_CARET = 4, - RENDER_USE_WIDGET_LAYERS = 8, - RENDER_ASYNC_DECODE_IMAGES = 16, - RENDER_DOCUMENT_RELATIVE = 32, - RENDER_DRAWWINDOW_NOT_FLUSHING = 64, - } - pub const nsIPresShell_RENDER_IS_IMAGE: root::nsIPresShell__bindgen_ty_4 = - nsIPresShell__bindgen_ty_4::RENDER_IS_IMAGE; - pub const nsIPresShell_RENDER_AUTO_SCALE: root::nsIPresShell__bindgen_ty_4 - = - nsIPresShell__bindgen_ty_4::RENDER_AUTO_SCALE; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell__bindgen_ty_4 { - RENDER_IS_IMAGE = 256, - RENDER_AUTO_SCALE = 128, - } - pub const nsIPresShell_FORCE_DRAW: root::nsIPresShell__bindgen_ty_5 = - nsIPresShell__bindgen_ty_5::FORCE_DRAW; - pub const nsIPresShell_ADD_FOR_SUBDOC: root::nsIPresShell__bindgen_ty_5 = - nsIPresShell__bindgen_ty_5::ADD_FOR_SUBDOC; - pub const nsIPresShell_APPEND_UNSCROLLED_ONLY: - root::nsIPresShell__bindgen_ty_5 = - nsIPresShell__bindgen_ty_5::APPEND_UNSCROLLED_ONLY; - #[repr(u32)] - /** - * Add a solid color item to the bottom of aList with frame aFrame and bounds - * aBounds. Checks first if this needs to be done by checking if aFrame is a - * canvas frame (if the FORCE_DRAW flag is passed then this check is skipped). - * aBackstopColor is composed behind the background color of the canvas, it is - * transparent by default. - * We attempt to make the background color part of the scrolled canvas (to reduce - * transparent layers), and if async scrolling is enabled (and the background - * is opaque) then we add a second, unscrolled item to handle the checkerboarding - * case. - * ADD_FOR_SUBDOC shoud be specified when calling this for a subdocument, and - * LayoutUseContainersForRootFrame might cause the whole list to be scrolled. In - * that case the second unscrolled item will be elided. - * APPEND_UNSCROLLED_ONLY only attempts to add the unscrolled item, so that we - * can add it manually after LayoutUseContainersForRootFrame has built the - * scrolling ContainerLayer. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell__bindgen_ty_5 { - FORCE_DRAW = 1, - ADD_FOR_SUBDOC = 2, - APPEND_UNSCROLLED_ONLY = 4, - } - #[repr(C)] - pub struct nsIPresShell_PointerCaptureInfo { - pub mPendingContent: root::nsCOMPtr, - pub mOverrideContent: root::nsCOMPtr, - } - #[test] - fn bindgen_test_layout_nsIPresShell_PointerCaptureInfo() { - assert_eq!(::std::mem::size_of::<nsIPresShell_PointerCaptureInfo>() , - 16usize , concat ! ( - "Size of: " , stringify ! ( nsIPresShell_PointerCaptureInfo - ) )); - assert_eq! (::std::mem::align_of::<nsIPresShell_PointerCaptureInfo>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsIPresShell_PointerCaptureInfo ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell_PointerCaptureInfo ) ) . - mPendingContent as * const _ as usize } , 0usize , concat - ! ( - "Alignment of field: " , stringify ! ( - nsIPresShell_PointerCaptureInfo ) , "::" , stringify ! ( - mPendingContent ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell_PointerCaptureInfo ) ) . - mOverrideContent as * const _ as usize } , 8usize , concat - ! ( - "Alignment of field: " , stringify ! ( - nsIPresShell_PointerCaptureInfo ) , "::" , stringify ! ( - mOverrideContent ) )); - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIPresShell_PointerInfo { - pub mPointerType: u16, - pub mActiveState: bool, - pub mPrimaryState: bool, - pub mPreventMouseEventByContent: bool, - } - #[test] - fn bindgen_test_layout_nsIPresShell_PointerInfo() { - assert_eq!(::std::mem::size_of::<nsIPresShell_PointerInfo>() , 6usize - , concat ! ( - "Size of: " , stringify ! ( nsIPresShell_PointerInfo ) )); - assert_eq! (::std::mem::align_of::<nsIPresShell_PointerInfo>() , - 2usize , concat ! ( - "Alignment of " , stringify ! ( nsIPresShell_PointerInfo ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . - mPointerType as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsIPresShell_PointerInfo ) , "::" , stringify ! ( - mPointerType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . - mActiveState as * const _ as usize } , 2usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsIPresShell_PointerInfo ) , "::" , stringify ! ( - mActiveState ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . - mPrimaryState as * const _ as usize } , 3usize , concat ! - ( - "Alignment of field: " , stringify ! ( - nsIPresShell_PointerInfo ) , "::" , stringify ! ( - mPrimaryState ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . - mPreventMouseEventByContent as * const _ as usize } , - 4usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsIPresShell_PointerInfo ) , "::" , stringify ! ( - mPreventMouseEventByContent ) )); - } - impl Clone for nsIPresShell_PointerInfo { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_PaintFlags { - PAINT_LAYERS = 1, - PAINT_COMPOSITE = 2, - PAINT_SYNC_DECODE_IMAGES = 4, - } - #[repr(u32)] - /** - * Ensures that the refresh driver is running, and schedules a view - * manager flush on the next tick. - * - * @param aType PAINT_DELAYED_COMPRESS : Schedule a paint to be executed after a delay, and - * put FrameLayerBuilder in 'compressed' mode that avoids short cut optimizations. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIPresShell_PaintType { - PAINT_DEFAULT = 0, - PAINT_DELAYED_COMPRESS = 1, - } - extern "C" { - #[link_name = "_ZN12nsIPresShell12gCaptureInfoE"] - pub static mut nsIPresShell_gCaptureInfo: root::CapturingContentInfo; - } - extern "C" { - #[link_name = "_ZN12nsIPresShell14gKeyDownTargetE"] - pub static mut nsIPresShell_gKeyDownTarget: *mut root::nsIContent; - } - #[test] - fn bindgen_test_layout_nsIPresShell() { - assert_eq!(::std::mem::size_of::<nsIPresShell>() , 5384usize , concat - ! ( "Size of: " , stringify ! ( nsIPresShell ) )); - assert_eq! (::std::mem::align_of::<nsIPresShell>() , 8usize , concat ! - ( "Alignment of " , stringify ! ( nsIPresShell ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mDocument as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mDocument ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mPresContext as * - const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mPresContext ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mStyleSet as * - const _ as usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mStyleSet ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mFrameConstructor - as * const _ as usize } , 32usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFrameConstructor ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mViewManager as * - const _ as usize } , 40usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mViewManager ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mFrameArena as * - const _ as usize } , 48usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFrameArena ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mSelection as * - const _ as usize } , 5232usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mSelection ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mFrameManager as * - const _ as usize } , 5240usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFrameManager ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mForwardingContainer as * const _ as usize } , 5248usize , - concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mForwardingContainer ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mDocAccessible as - * const _ as usize } , 5256usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mDocAccessible ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mReflowContinueTimer as * const _ as usize } , 5264usize , - concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mReflowContinueTimer ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mPaintCount as * - const _ as usize } , 5272usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mPaintCount ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mScrollPositionClampingScrollPortSize as * const _ as - usize } , 5280usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mScrollPositionClampingScrollPortSize - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mAutoWeakFrames as - * const _ as usize } , 5288usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mAutoWeakFrames ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mWeakFrames as * - const _ as usize } , 5296usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mWeakFrames ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mCanvasBackgroundColor as * const _ as usize } , 5336usize - , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mCanvasBackgroundColor ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mResolution as * - const _ as usize } , 5340usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mResolution ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mSelectionFlags as - * const _ as usize } , 5348usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mSelectionFlags ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mRenderFlags as * - const _ as usize } , 5350usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mRenderFlags ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mPresShellId as * - const _ as usize } , 5356usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mPresShellId ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationEmPerLine as * const _ as usize } , - 5360usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFontSizeInflationEmPerLine ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationMinTwips as * const _ as usize } , - 5364usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFontSizeInflationMinTwips ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationLineThreshold as * const _ as usize } , - 5368usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFontSizeInflationLineThreshold ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationForceEnabled as * const _ as usize } , - 5372usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFontSizeInflationForceEnabled ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationDisabledInMasterProcess as * const _ as - usize } , 5373usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( - mFontSizeInflationDisabledInMasterProcess ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationEnabled as * const _ as usize } , - 5374usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFontSizeInflationEnabled ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . - mFontSizeInflationEnabledIsDirty as * const _ as usize } , - 5375usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mFontSizeInflationEnabledIsDirty ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mPaintingIsFrozen - as * const _ as usize } , 5376usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mPaintingIsFrozen ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mIsNeverPainting - as * const _ as usize } , 5377usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mIsNeverPainting ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mInFlush as * - const _ as usize } , 5378usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mInFlush ) )); - } - impl nsIPresShell { - #[inline] - pub fn mDidInitialize(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 1u64 as u16; - let val = (unit_field_val & mask) >> 0usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mDidInitialize(&mut self, val: bool) { - let mask = 1u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 0usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mIsDestroying(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 2u64 as u16; - let val = (unit_field_val & mask) >> 1usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsDestroying(&mut self, val: bool) { - let mask = 2u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 1usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mIsReflowing(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 4u64 as u16; - let val = (unit_field_val & mask) >> 2usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsReflowing(&mut self, val: bool) { - let mask = 4u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 2usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mPaintingSuppressed(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 8u64 as u16; - let val = (unit_field_val & mask) >> 3usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mPaintingSuppressed(&mut self, val: bool) { - let mask = 8u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 3usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mIsActive(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 16u64 as u16; - let val = (unit_field_val & mask) >> 4usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsActive(&mut self, val: bool) { - let mask = 16u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 4usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mFrozen(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 32u64 as u16; - let val = (unit_field_val & mask) >> 5usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mFrozen(&mut self, val: bool) { - let mask = 32u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 5usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mIsFirstPaint(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 64u64 as u16; - let val = (unit_field_val & mask) >> 6usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsFirstPaint(&mut self, val: bool) { - let mask = 64u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 6usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mObservesMutationsForPrint(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 128u64 as u16; - let val = (unit_field_val & mask) >> 7usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mObservesMutationsForPrint(&mut self, val: bool) { - let mask = 128u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 7usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mSuppressInterruptibleReflows(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 256u64 as u16; - let val = (unit_field_val & mask) >> 8usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mSuppressInterruptibleReflows(&mut self, val: bool) { - let mask = 256u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 8usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mScrollPositionClampingScrollPortSizeSet(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 512u64 as u16; - let val = (unit_field_val & mask) >> 9usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mScrollPositionClampingScrollPortSizeSet(&mut self, - val: bool) { - let mask = 512u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 9usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mNeedLayoutFlush(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 1024u64 as u16; - let val = (unit_field_val & mask) >> 10usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mNeedLayoutFlush(&mut self, val: bool) { - let mask = 1024u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 10usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mNeedStyleFlush(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 2048u64 as u16; - let val = (unit_field_val & mask) >> 11usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mNeedStyleFlush(&mut self, val: bool) { - let mask = 2048u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 11usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mObservingStyleFlushes(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 4096u64 as u16; - let val = (unit_field_val & mask) >> 12usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mObservingStyleFlushes(&mut self, val: bool) { - let mask = 4096u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 12usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mObservingLayoutFlushes(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 8192u64 as u16; - let val = (unit_field_val & mask) >> 13usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mObservingLayoutFlushes(&mut self, val: bool) { - let mask = 8192u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 13usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn mNeedThrottledAnimationFlush(&self) -> bool { - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - let mask = 16384u64 as u16; - let val = (unit_field_val & mask) >> 14usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mNeedThrottledAnimationFlush(&mut self, val: bool) { - let mask = 16384u64 as u16; - let val = val as u8 as u16; - let mut unit_field_val: u16 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u16 as *mut u8, - ::std::mem::size_of::<u16>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 14usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u16>()); - } - } - #[inline] - pub fn new_bitfield_1(mDidInitialize: bool, mIsDestroying: bool, - mIsReflowing: bool, mPaintingSuppressed: bool, - mIsActive: bool, mFrozen: bool, - mIsFirstPaint: bool, - mObservesMutationsForPrint: bool, - mSuppressInterruptibleReflows: bool, - mScrollPositionClampingScrollPortSizeSet: bool, - mNeedLayoutFlush: bool, mNeedStyleFlush: bool, - mObservingStyleFlushes: bool, - mObservingLayoutFlushes: bool, - mNeedThrottledAnimationFlush: bool) -> u16 { - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - ({ - 0 - } - | - ((mDidInitialize - as - u8 - as - u16) - << - 0usize) - & - (1u64 - as - u16)) - } - | - ((mIsDestroying - as - u8 - as - u16) - << - 1usize) - & - (2u64 - as - u16)) - } | - ((mIsReflowing - as - u8 - as - u16) - << - 2usize) - & - (4u64 - as - u16)) - } | - ((mPaintingSuppressed - as - u8 - as - u16) - << - 3usize) - & - (8u64 - as - u16)) - } | - ((mIsActive - as u8 - as - u16) - << - 4usize) - & - (16u64 - as - u16)) - } | - ((mFrozen as u8 - as u16) << - 5usize) & - (32u64 as - u16)) - } | - ((mIsFirstPaint as u8 - as u16) << - 6usize) & - (64u64 as u16)) - } | - ((mObservesMutationsForPrint - as u8 as u16) << - 7usize) & - (128u64 as u16)) - } | - ((mSuppressInterruptibleReflows - as u8 as u16) << 8usize) - & (256u64 as u16)) - } | - ((mScrollPositionClampingScrollPortSizeSet - as u8 as u16) << 9usize) & - (512u64 as u16)) - } | - ((mNeedLayoutFlush as u8 as u16) << - 10usize) & (1024u64 as u16)) - } | - ((mNeedStyleFlush as u8 as u16) << 11usize) & - (2048u64 as u16)) - } | - ((mObservingStyleFlushes as u8 as u16) << 12usize) - & (4096u64 as u16)) - } | - ((mObservingLayoutFlushes as u8 as u16) << 13usize) & - (8192u64 as u16)) - } | - ((mNeedThrottledAnimationFlush as u8 as u16) << 14usize) & - (16384u64 as u16)) - } - } #[repr(C)] #[derive(Debug)] pub struct nsStyleFont { @@ -18566,28 +13026,6 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStyleColor ) , "::" , stringify ! ( mColor ) )); } - #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_86() { - assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); - } - #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_87() { - assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); - } #[repr(C)] #[derive(Debug)] pub struct nsStyleList { @@ -18640,6 +13078,28 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStyleList ) , "::" , stringify ! ( mImageRegion ) )); } + #[test] + fn __bindgen_test_layout_StaticRefPtr_open0_nsStyleQuoteValues_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); + } + #[test] + fn __bindgen_test_layout_StaticRefPtr_open0_nsStyleQuoteValues_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::nsStyleQuoteValues>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr<root::nsStyleQuoteValues> ) )); + } #[repr(C)] #[derive(Debug)] pub struct nsStyleText { @@ -19105,39 +13565,14 @@ pub mod root { pub mContextPropsBits: u8, pub mContextFlags: u8, } - pub const nsStyleSVG_FILL_OPACITY_SOURCE_MASK: - root::nsStyleSVG__bindgen_ty_1 = - nsStyleSVG__bindgen_ty_1::FILL_OPACITY_SOURCE_MASK; - pub const nsStyleSVG_STROKE_OPACITY_SOURCE_MASK: - root::nsStyleSVG__bindgen_ty_1 = - nsStyleSVG__bindgen_ty_1::STROKE_OPACITY_SOURCE_MASK; - pub const nsStyleSVG_STROKE_DASHARRAY_CONTEXT: - root::nsStyleSVG__bindgen_ty_1 = - nsStyleSVG__bindgen_ty_1::STROKE_DASHARRAY_CONTEXT; - pub const nsStyleSVG_STROKE_DASHOFFSET_CONTEXT: - root::nsStyleSVG__bindgen_ty_1 = - nsStyleSVG__bindgen_ty_1::STROKE_DASHOFFSET_CONTEXT; - pub const nsStyleSVG_STROKE_WIDTH_CONTEXT: root::nsStyleSVG__bindgen_ty_1 - = - nsStyleSVG__bindgen_ty_1::STROKE_WIDTH_CONTEXT; - pub const nsStyleSVG_FILL_OPACITY_SOURCE_SHIFT: - root::nsStyleSVG__bindgen_ty_1 = - nsStyleSVG__bindgen_ty_1::FILL_OPACITY_SOURCE_SHIFT; - pub const nsStyleSVG_STROKE_OPACITY_SOURCE_SHIFT: - root::nsStyleSVG__bindgen_ty_1 = - nsStyleSVG__bindgen_ty_1::STROKE_OPACITY_SOURCE_SHIFT; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsStyleSVG__bindgen_ty_1 { - FILL_OPACITY_SOURCE_MASK = 3, - STROKE_OPACITY_SOURCE_MASK = 12, - STROKE_DASHARRAY_CONTEXT = 16, - STROKE_DASHOFFSET_CONTEXT = 32, - STROKE_WIDTH_CONTEXT = 64, - FILL_OPACITY_SOURCE_SHIFT = 0, - STROKE_OPACITY_SOURCE_SHIFT = 2, - } pub const nsStyleSVG_kHasFinishStyle: bool = false; + pub const nsStyleSVG_FILL_OPACITY_SOURCE_MASK: u8 = 3; + pub const nsStyleSVG_STROKE_OPACITY_SOURCE_MASK: u8 = 12; + pub const nsStyleSVG_STROKE_DASHARRAY_CONTEXT: u8 = 16; + pub const nsStyleSVG_STROKE_DASHOFFSET_CONTEXT: u8 = 32; + pub const nsStyleSVG_STROKE_WIDTH_CONTEXT: u8 = 64; + pub const nsStyleSVG_FILL_OPACITY_SOURCE_SHIFT: u8 = 0; + pub const nsStyleSVG_STROKE_OPACITY_SOURCE_SHIFT: u8 = 2; #[test] fn bindgen_test_layout_nsStyleSVG() { assert_eq!(::std::mem::size_of::<nsStyleSVG>() , 128usize , concat ! ( @@ -19330,6 +13765,7 @@ pub mod root { pub mAlignItems: u8, pub mAlignSelf: u8, pub mJustifyContent: u16, + pub mSpecifiedJustifyItems: u8, pub mJustifyItems: u8, pub mJustifySelf: u8, pub mFlexDirection: u8, @@ -19458,28 +13894,34 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStylePosition ) , "::" , stringify ! ( mJustifyContent ) )); assert_eq! (unsafe { + & ( * ( 0 as * const nsStylePosition ) ) . + mSpecifiedJustifyItems as * const _ as usize } , 248usize + , concat ! ( + "Alignment of field: " , stringify ! ( nsStylePosition ) , + "::" , stringify ! ( mSpecifiedJustifyItems ) )); + assert_eq! (unsafe { & ( * ( 0 as * const nsStylePosition ) ) . mJustifyItems - as * const _ as usize } , 248usize , concat ! ( + as * const _ as usize } , 249usize , concat ! ( "Alignment of field: " , stringify ! ( nsStylePosition ) , "::" , stringify ! ( mJustifyItems ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsStylePosition ) ) . mJustifySelf as - * const _ as usize } , 249usize , concat ! ( + * const _ as usize } , 250usize , concat ! ( "Alignment of field: " , stringify ! ( nsStylePosition ) , "::" , stringify ! ( mJustifySelf ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsStylePosition ) ) . mFlexDirection - as * const _ as usize } , 250usize , concat ! ( + as * const _ as usize } , 251usize , concat ! ( "Alignment of field: " , stringify ! ( nsStylePosition ) , "::" , stringify ! ( mFlexDirection ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsStylePosition ) ) . mFlexWrap as * - const _ as usize } , 251usize , concat ! ( + const _ as usize } , 252usize , concat ! ( "Alignment of field: " , stringify ! ( nsStylePosition ) , "::" , stringify ! ( mFlexWrap ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsStylePosition ) ) . mObjectFit as * - const _ as usize } , 252usize , concat ! ( + const _ as usize } , 253usize , concat ! ( "Alignment of field: " , stringify ! ( nsStylePosition ) , "::" , stringify ! ( mObjectFit ) )); assert_eq! (unsafe { @@ -20601,12 +15043,9 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStyleEffects ) , "::" , stringify ! ( mMixBlendMode ) )); } - /** - * We want C++ to be abe to read the style struct fields of ComputedValues - * so we define this type on the C++ side and use the bindgenned version - * on the Rust side. - * - */ + /// We want C++ to be able to read the style struct fields of ComputedValues + /// so we define this type on the C++ side and use the bindgenned version + /// on the Rust side. #[repr(C)] #[derive(Debug)] pub struct ServoComputedData { @@ -20637,206 +15076,170 @@ pub mod root { pub writing_mode: ::gecko_bindings::structs::ServoWritingMode, pub flags: ::gecko_bindings::structs::ServoComputedValueFlags, /// The rule node representing the ordered list of rules matched for this - /// node. Can be None for default values and text nodes. This is - /// essentially an optimization to avoid referencing the root rule node. + /// /// node. Can be None for default values and text nodes. This is + /// /// essentially an optimization to avoid referencing the root rule node. pub rules: ::gecko_bindings::structs::ServoRuleNode, /// The element's computed values if visited, only computed if there's a - /// relevant link for this element. A element's "relevant link" is the - /// element being matched if it is a link or the nearest ancestor link. + /// /// relevant link for this element. A element's "relevant link" is the + /// /// element being matched if it is a link or the nearest ancestor link. pub visited_style: ::gecko_bindings::structs::ServoVisitedStyle, pub font_computation_data: ::gecko_bindings::structs::ServoFontComputationData, } #[test] fn bindgen_test_layout_ServoComputedData() { assert_eq!(::std::mem::size_of::<ServoComputedData>() , 224usize , - concat ! ( - "Size of: " , stringify ! ( ServoComputedData ) )); + concat ! ( "Size of: " , stringify ! ( ServoComputedData ) + )); assert_eq! (::std::mem::align_of::<ServoComputedData>() , 8usize , concat ! ( "Alignment of " , stringify ! ( ServoComputedData ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Font as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Font ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Font ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Color as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Color ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Color ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . List as * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( List ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( List ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Text as * const _ as usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Text ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Text ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Visibility - as * const _ as usize } , 32usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Visibility ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Visibility as + * const _ as usize } , 32usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Visibility ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . - UserInterface as * const _ as usize } , 40usize , concat ! - ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( UserInterface ) )); + & ( * ( 0 as * const ServoComputedData ) ) . UserInterface + as * const _ as usize } , 40usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( UserInterface ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . TableBorder as * const _ as usize } , 48usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( TableBorder ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( TableBorder ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . SVG as * const _ as usize } , 56usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( SVG ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( SVG ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Background - as * const _ as usize } , 64usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Background ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Background as + * const _ as usize } , 64usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Background ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Position as - * const _ as usize } , 72usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Position ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Position as * + const _ as usize } , 72usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Position ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . TextReset - as * const _ as usize } , 80usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( TextReset ) )); + & ( * ( 0 as * const ServoComputedData ) ) . TextReset as + * const _ as usize } , 80usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( TextReset ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Display as - * const _ as usize } , 88usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Display ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Display as * + const _ as usize } , 88usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Display ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Content as - * const _ as usize } , 96usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Content ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Content as * + const _ as usize } , 96usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Content ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . UIReset as - * const _ as usize } , 104usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( UIReset ) )); + & ( * ( 0 as * const ServoComputedData ) ) . UIReset as * + const _ as usize } , 104usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( UIReset ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Table as * const _ as usize } , 112usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Table ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Table ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Margin as * const _ as usize } , 120usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Margin ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Margin ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Padding as - * const _ as usize } , 128usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Padding ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Padding as * + const _ as usize } , 128usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Padding ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Border as * const _ as usize } , 136usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Border ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Border ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Outline as - * const _ as usize } , 144usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Outline ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Outline as * + const _ as usize } , 144usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Outline ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . XUL as * const _ as usize } , 152usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( XUL ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( XUL ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . SVGReset as - * const _ as usize } , 160usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( SVGReset ) )); + & ( * ( 0 as * const ServoComputedData ) ) . SVGReset as * + const _ as usize } , 160usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( SVGReset ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . Column as * const _ as usize } , 168usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Column ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Column ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . Effects as - * const _ as usize } , 176usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( Effects ) )); + & ( * ( 0 as * const ServoComputedData ) ) . Effects as * + const _ as usize } , 176usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( Effects ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . custom_properties as * const _ as usize } , 184usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( custom_properties ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( custom_properties ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . - writing_mode as * const _ as usize } , 192usize , concat ! - ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( writing_mode ) )); + & ( * ( 0 as * const ServoComputedData ) ) . writing_mode + as * const _ as usize } , 192usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( writing_mode ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . flags as * const _ as usize } , 193usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( flags ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( flags ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . rules as * const _ as usize } , 200usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( rules ) )); + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( rules ) )); assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedData ) ) . - visited_style as * const _ as usize } , 208usize , concat - ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( visited_style ) )); + & ( * ( 0 as * const ServoComputedData ) ) . visited_style + as * const _ as usize } , 208usize , concat ! ( + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( visited_style ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoComputedData ) ) . font_computation_data as * const _ as usize } , 216usize , concat ! ( - "Alignment of field: " , stringify ! ( ServoComputedData - ) , "::" , stringify ! ( font_computation_data ) )); - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct ServoComputedDataForgotten { - pub mPtr: *const root::ServoComputedData, - } - #[test] - fn bindgen_test_layout_ServoComputedDataForgotten() { - assert_eq!(::std::mem::size_of::<ServoComputedDataForgotten>() , - 8usize , concat ! ( - "Size of: " , stringify ! ( ServoComputedDataForgotten ) - )); - assert_eq! (::std::mem::align_of::<ServoComputedDataForgotten>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( - ServoComputedDataForgotten ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const ServoComputedDataForgotten ) ) . - mPtr as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - ServoComputedDataForgotten ) , "::" , stringify ! ( mPtr - ) )); - } - impl Clone for ServoComputedDataForgotten { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum WeakMapTraceKind { - DoNotTraceWeakMaps = 0, - ExpandWeakMaps = 1, - TraceWeakMapValues = 2, - TraceWeakMapKeysValues = 3, + "Alignment of field: " , stringify ! ( ServoComputedData ) + , "::" , stringify ! ( font_computation_data ) )); } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -20874,17 +15277,15 @@ pub mod root { JS_GENERIC_MAGIC = 16, JS_WHY_MAGIC_COUNT = 17, } - /** - * This structure precedes the string buffers "we" allocate. It may be the - * case that nsTAString::mData does not point to one of these special - * buffers. The mDataFlags member variable distinguishes the buffer type. - * - * When this header is in use, it enables reference counting, and capacity - * tracking. NOTE: A string buffer can be modified only if its reference - * count is 1. - */ + /// This structure precedes the string buffers "we" allocate. It may be the + /// case that nsTAString::mData does not point to one of these special + /// buffers. The mDataFlags member variable distinguishes the buffer type. + /// + /// When this header is in use, it enables reference counting, and capacity + /// tracking. NOTE: A string buffer can be modified only if its reference + /// count is 1. #[repr(C)] - #[derive(Debug)] + #[derive(Debug, Copy)] pub struct nsStringBuffer { pub mRefCount: u32, pub mStorageSize: u32, @@ -20906,17 +15307,18 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStringBuffer ) , "::" , stringify ! ( mStorageSize ) )); } + impl Clone for nsStringBuffer { + fn clone(&self) -> Self { *self } + } #[repr(C)] #[derive(Debug, Copy)] pub struct nsIAtom { pub _base: root::nsISupports, pub _bitfield_1: u32, pub mHash: u32, - /** - * WARNING! There is an invisible constraint on |mString|: the chars it - * points to must belong to an nsStringBuffer. This is so that the - * nsStringBuffer::FromData() calls above are valid. - */ + /// WARNING! There is an invisible constraint on |mString|: the chars it + /// points to must belong to an nsStringBuffer. This is so that the + /// nsStringBuffer::FromData() calls above are valid. pub mString: *mut u16, } #[repr(C)] @@ -21054,43 +15456,41 @@ pub mod root { } #[repr(C)] pub struct nsWrapperCache__bindgen_vtable(::std::os::raw::c_void); - /** - * Class to store the wrapper for an object. This can only be used with objects - * that only have one non-security wrapper at a time (for an XPCWrappedNative - * this is usually ensured by setting an explicit parent in the PreCreate hook - * for the class). - * - * An instance of nsWrapperCache can be gotten from an object that implements - * a wrapper cache by calling QueryInterface on it. Note that this breaks XPCOM - * rules a bit (this object doesn't derive from nsISupports). - * - * The cache can store objects other than wrappers. We allow wrappers to use a - * separate JSObject to store their state (mostly expandos). If the wrapper is - * collected and we want to preserve this state we actually store the state - * object in the cache. - * - * The cache can store 2 types of objects: - * - * If WRAPPER_IS_NOT_DOM_BINDING is set (IsDOMBinding() returns false): - * - the JSObject of an XPCWrappedNative wrapper - * - * If WRAPPER_IS_NOT_DOM_BINDING is not set (IsDOMBinding() returns true): - * - a DOM binding object (regular JS object or proxy) - * - * The finalizer for the wrapper clears the cache. - * - * A compacting GC can move the wrapper object. Pointers to moved objects are - * usually found and updated by tracing the heap, however non-preserved wrappers - * are weak references and are not traced, so another approach is - * necessary. Instead a class hook (objectMovedOp) is provided that is called - * when an object is moved and is responsible for ensuring pointers are - * updated. It does this by calling UpdateWrapper() on the wrapper - * cache. SetWrapper() asserts that the hook is implemented for any wrapper set. - * - * A number of the methods are implemented in nsWrapperCacheInlines.h because we - * have to include some JS headers that don't play nicely with the rest of the - * codebase. Include nsWrapperCacheInlines.h if you need to call those methods. - */ + /// Class to store the wrapper for an object. This can only be used with objects + /// that only have one non-security wrapper at a time (for an XPCWrappedNative + /// this is usually ensured by setting an explicit parent in the PreCreate hook + /// for the class). + /// + /// An instance of nsWrapperCache can be gotten from an object that implements + /// a wrapper cache by calling QueryInterface on it. Note that this breaks XPCOM + /// rules a bit (this object doesn't derive from nsISupports). + /// + /// The cache can store objects other than wrappers. We allow wrappers to use a + /// separate JSObject to store their state (mostly expandos). If the wrapper is + /// collected and we want to preserve this state we actually store the state + /// object in the cache. + /// + /// The cache can store 2 types of objects: + /// + /// If WRAPPER_IS_NOT_DOM_BINDING is set (IsDOMBinding() returns false): + /// - the JSObject of an XPCWrappedNative wrapper + /// + /// If WRAPPER_IS_NOT_DOM_BINDING is not set (IsDOMBinding() returns true): + /// - a DOM binding object (regular JS object or proxy) + /// + /// The finalizer for the wrapper clears the cache. + /// + /// A compacting GC can move the wrapper object. Pointers to moved objects are + /// usually found and updated by tracing the heap, however non-preserved wrappers + /// are weak references and are not traced, so another approach is + /// necessary. Instead a class hook (objectMovedOp) is provided that is called + /// when an object is moved and is responsible for ensuring pointers are + /// updated. It does this by calling UpdateWrapper() on the wrapper + /// cache. SetWrapper() asserts that the hook is implemented for any wrapper set. + /// + /// A number of the methods are implemented in nsWrapperCacheInlines.h because we + /// have to include some JS headers that don't play nicely with the rest of the + /// codebase. Include nsWrapperCacheInlines.h if you need to call those methods. #[repr(C)] #[derive(Debug)] pub struct nsWrapperCache { @@ -21109,26 +15509,22 @@ pub mod root { root::nsWrapperCache__bindgen_ty_1 = nsWrapperCache__bindgen_ty_1::WRAPPER_BIT_PRESERVED; #[repr(u32)] - /** - * If this bit is set then we're preserving the wrapper, which in effect ties - * the lifetime of the JS object stored in the cache to the lifetime of the - * native object. We rely on the cycle collector to break the cycle that this - * causes between the native object and the JS object, so it is important that - * any native object that supports preserving of its wrapper - * traces/traverses/unlinks the cached JS object (see - * NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER and - * NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER). - */ + /// If this bit is set then we're preserving the wrapper, which in effect ties + /// the lifetime of the JS object stored in the cache to the lifetime of the + /// native object. We rely on the cycle collector to break the cycle that this + /// causes between the native object and the JS object, so it is important that + /// any native object that supports preserving of its wrapper + /// traces/traverses/unlinks the cached JS object (see + /// NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER and + /// NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER). #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsWrapperCache__bindgen_ty_1 { WRAPPER_BIT_PRESERVED = 1, } pub const nsWrapperCache_WRAPPER_IS_NOT_DOM_BINDING: root::nsWrapperCache__bindgen_ty_2 = nsWrapperCache__bindgen_ty_2::WRAPPER_IS_NOT_DOM_BINDING; #[repr(u32)] - /** - * If this bit is set then the wrapper for the native object is not a DOM - * binding. - */ + /// If this bit is set then the wrapper for the native object is not a DOM + /// binding. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsWrapperCache__bindgen_ty_2 { WRAPPER_IS_NOT_DOM_BINDING = 2, } pub const nsWrapperCache_kWrapperFlagsMask: @@ -21358,18 +15754,11 @@ pub mod root { impl Clone for nsIDOMNode { fn clone(&self) -> Self { *self } } - pub type nsContentPolicyType = u32; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMDocument { - _unused: [u8; 0], - } - /** - * An internal interface that abstracts some DOMNode-related parts that both - * nsIContent and nsIDocument share. An instance of this interface has a list - * of nsIContent children and provides access to them. - */ + /// An internal interface that abstracts some DOMNode-related parts that both + /// nsIContent and nsIDocument share. An instance of this interface has a list + /// of nsIContent children and provides access to them. #[repr(C)] + #[derive(Debug)] pub struct nsINode { pub _base: root::mozilla::dom::EventTarget, pub mNodeInfo: root::RefPtr<root::mozilla::dom::NodeInfo>, @@ -21424,9 +15813,7 @@ pub mod root { pub const nsINode_eFILTER: root::nsINode__bindgen_ty_2 = nsINode__bindgen_ty_2::eFILTER; #[repr(u32)] - /** - * Bit-flags to pass (or'ed together) to IsNodeOfType() - */ + /// Bit-flags to pass (or'ed together) to IsNodeOfType() #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsINode__bindgen_ty_2 { eCONTENT = 1, @@ -21448,30 +15835,25 @@ pub mod root { #[derive(Debug)] pub struct nsINode_nsSlots { pub vtable_: *const nsINode_nsSlots__bindgen_vtable, - /** - * A list of mutation observers - */ - pub mMutationObservers: [u64; 2usize], - /** - * An object implementing nsIDOMNodeList for this content (childNodes) - * @see nsIDOMNodeList - * @see nsGenericHTMLElement::GetChildNodes - */ + /// A list of mutation observers + pub mMutationObservers: [u64; 4usize], + /// An object implementing nsIDOMNodeList for this content (childNodes) + /// @see nsIDOMNodeList + /// @see nsGenericHTMLElement::GetChildNodes pub mChildNodes: root::RefPtr<root::nsChildContentList>, - /** - * Weak reference to this node. This is cleared by the destructor of - * nsNodeWeakReference. - */ + /// Weak reference to this node. This is cleared by the destructor of + /// nsNodeWeakReference. pub mWeakReference: *mut root::nsNodeWeakReference, - /** - * Number of descendant nodes in the uncomposed document that have been - * explicitly set as editable. - */ + /// A set of ranges in the common ancestor for the selection to which + /// this node belongs to. + pub mCommonAncestorRanges: u64, + /// Number of descendant nodes in the uncomposed document that have been + /// explicitly set as editable. pub mEditableDescendantCount: u32, } #[test] fn bindgen_test_layout_nsINode_nsSlots() { - assert_eq!(::std::mem::size_of::<nsINode_nsSlots>() , 48usize , concat + assert_eq!(::std::mem::size_of::<nsINode_nsSlots>() , 72usize , concat ! ( "Size of: " , stringify ! ( nsINode_nsSlots ) )); assert_eq! (::std::mem::align_of::<nsINode_nsSlots>() , 8usize , concat ! ( @@ -21484,25 +15866,29 @@ pub mod root { "::" , stringify ! ( mMutationObservers ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsINode_nsSlots ) ) . mChildNodes as - * const _ as usize } , 24usize , concat ! ( + * const _ as usize } , 40usize , concat ! ( "Alignment of field: " , stringify ! ( nsINode_nsSlots ) , "::" , stringify ! ( mChildNodes ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsINode_nsSlots ) ) . mWeakReference - as * const _ as usize } , 32usize , concat ! ( + as * const _ as usize } , 48usize , concat ! ( "Alignment of field: " , stringify ! ( nsINode_nsSlots ) , "::" , stringify ! ( mWeakReference ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsINode_nsSlots ) ) . - mEditableDescendantCount as * const _ as usize } , 40usize + mCommonAncestorRanges as * const _ as usize } , 56usize , + concat ! ( + "Alignment of field: " , stringify ! ( nsINode_nsSlots ) , + "::" , stringify ! ( mCommonAncestorRanges ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsINode_nsSlots ) ) . + mEditableDescendantCount as * const _ as usize } , 64usize , concat ! ( "Alignment of field: " , stringify ! ( nsINode_nsSlots ) , "::" , stringify ! ( mEditableDescendantCount ) )); } #[repr(u32)] - /** - * Boolean flags - */ + /// Boolean flags #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsINode_BooleanFlag { NodeHasRenderingObservers = 0, @@ -21613,86 +15999,6 @@ pub mod root { pub struct nsIRedirectHistoryEntry { _unused: [u8; 0], } - /** - * Get a property named by id in obj. Note the jsid id type -- id may - * be a string (Unicode property identifier) or an int (element index). The - * *vp out parameter, on success, is the new property value after the action. - */ - pub type JSGetterOp = - ::std::option::Option<unsafe extern "C" fn(cx: *mut root::JSContext, - obj: - root::JS::HandleObject, - id: root::JS::HandleId, - vp: - root::JS::MutableHandleValue) - -> bool>; - /** - * Set a property named by id in obj, treating the assignment as strict - * mode code if strict is true. Note the jsid id type -- id may be a string - * (Unicode property identifier) or an int (element index). The *vp out - * parameter, on success, is the new property value after the - * set. - */ - pub type JSSetterOp = - ::std::option::Option<unsafe extern "C" fn(cx: *mut root::JSContext, - obj: - root::JS::HandleObject, - id: root::JS::HandleId, - vp: - root::JS::MutableHandleValue, - result: - *mut root::JS::ObjectOpResult) - -> bool>; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct JSErrorFormatString { - /** The error message name in ASCII. */ - pub name: *const ::std::os::raw::c_char, - /** The error format string in ASCII. */ - pub format: *const ::std::os::raw::c_char, - /** The number of arguments to expand in the formatted error message. */ - pub argCount: u16, - /** One of the JSExnType constants above. */ - pub exnType: i16, - } - #[test] - fn bindgen_test_layout_JSErrorFormatString() { - assert_eq!(::std::mem::size_of::<JSErrorFormatString>() , 24usize , - concat ! ( - "Size of: " , stringify ! ( JSErrorFormatString ) )); - assert_eq! (::std::mem::align_of::<JSErrorFormatString>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( JSErrorFormatString ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSErrorFormatString ) ) . name as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( JSErrorFormatString - ) , "::" , stringify ! ( name ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSErrorFormatString ) ) . format as * - const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( JSErrorFormatString - ) , "::" , stringify ! ( format ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSErrorFormatString ) ) . argCount as - * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( JSErrorFormatString - ) , "::" , stringify ! ( argCount ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const JSErrorFormatString ) ) . exnType as - * const _ as usize } , 18usize , concat ! ( - "Alignment of field: " , stringify ! ( JSErrorFormatString - ) , "::" , stringify ! ( exnType ) )); - } - impl Clone for JSErrorFormatString { - fn clone(&self) -> Self { *self } - } - pub type JSErrorCallback = - ::std::option::Option<unsafe extern "C" fn(userRef: - *mut ::std::os::raw::c_void, - errorNumber: - ::std::os::raw::c_uint) - -> *const root::JSErrorFormatString>; #[repr(C)] #[derive(Debug)] pub struct JSAutoRequest { @@ -21765,10 +16071,8 @@ pub mod root { JSAutoNullableCompartment ) , "::" , stringify ! ( oldCompartment_ ) )); } - /** - * Base class that implements parts shared by JSErrorReport and - * JSErrorNotes::Note. - */ + /// Base class that implements parts shared by JSErrorReport and + /// JSErrorNotes::Note. #[repr(C)] #[derive(Debug)] pub struct JSErrorBase { @@ -21856,10 +16160,9 @@ pub mod root { ({ 0 } | ((ownsMessage_ as u8 as u8) << 0usize) & (1u64 as u8)) } } - /** - * Notes associated with JSErrorReport. - */ + /// Notes associated with JSErrorReport. #[repr(C)] + #[derive(Debug)] pub struct JSErrorNotes { pub notes_: [u64; 4usize], } @@ -21910,16 +16213,6 @@ pub mod root { "::" , stringify ! ( notes_ ) )); } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIObjectInputStream { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIObjectOutputStream { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsISerializable { pub _base: root::nsISupports, @@ -21941,11 +16234,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIContentSecurityPolicy { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIChannel { pub _base: root::nsIRequest, @@ -22017,149 +16305,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDocShell { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsILoadContext { - _unused: [u8; 0], - } - pub type nsSecurityFlags = u32; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsILoadInfo { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsILoadInfo_COMTypeInfo { - pub _address: u8, - } - pub const nsILoadInfo_SEC_NORMAL: root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_NORMAL; - pub const nsILoadInfo_SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS; - pub const nsILoadInfo_SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED; - pub const nsILoadInfo_SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS; - pub const nsILoadInfo_SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL; - pub const nsILoadInfo_SEC_REQUIRE_CORS_DATA_INHERITS: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_REQUIRE_CORS_DATA_INHERITS; - pub const nsILoadInfo_SEC_COOKIES_DEFAULT: root::nsILoadInfo__bindgen_ty_1 - = - nsILoadInfo__bindgen_ty_1::SEC_NORMAL; - pub const nsILoadInfo_SEC_COOKIES_INCLUDE: root::nsILoadInfo__bindgen_ty_1 - = - nsILoadInfo__bindgen_ty_1::SEC_COOKIES_INCLUDE; - pub const nsILoadInfo_SEC_COOKIES_SAME_ORIGIN: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_COOKIES_SAME_ORIGIN; - pub const nsILoadInfo_SEC_COOKIES_OMIT: root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_COOKIES_OMIT; - pub const nsILoadInfo_SEC_FORCE_INHERIT_PRINCIPAL: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_FORCE_INHERIT_PRINCIPAL; - pub const nsILoadInfo_SEC_SANDBOXED: root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_SANDBOXED; - pub const nsILoadInfo_SEC_ABOUT_BLANK_INHERITS: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_ABOUT_BLANK_INHERITS; - pub const nsILoadInfo_SEC_ALLOW_CHROME: root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_ALLOW_CHROME; - pub const nsILoadInfo_SEC_DISALLOW_SCRIPT: root::nsILoadInfo__bindgen_ty_1 - = - nsILoadInfo__bindgen_ty_1::SEC_DISALLOW_SCRIPT; - pub const nsILoadInfo_SEC_DONT_FOLLOW_REDIRECTS: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_DONT_FOLLOW_REDIRECTS; - pub const nsILoadInfo_SEC_LOAD_ERROR_PAGE: root::nsILoadInfo__bindgen_ty_1 - = - nsILoadInfo__bindgen_ty_1::SEC_LOAD_ERROR_PAGE; - pub const nsILoadInfo_SEC_FORCE_INHERIT_PRINCIPAL_OVERRULE_OWNER: - root::nsILoadInfo__bindgen_ty_1 = - nsILoadInfo__bindgen_ty_1::SEC_FORCE_INHERIT_PRINCIPAL_OVERRULE_OWNER; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsILoadInfo__bindgen_ty_1 { - SEC_NORMAL = 0, - SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS = 1, - SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED = 2, - SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS = 4, - SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL = 8, - SEC_REQUIRE_CORS_DATA_INHERITS = 16, - SEC_COOKIES_INCLUDE = 32, - SEC_COOKIES_SAME_ORIGIN = 64, - SEC_COOKIES_OMIT = 96, - SEC_FORCE_INHERIT_PRINCIPAL = 128, - SEC_SANDBOXED = 256, - SEC_ABOUT_BLANK_INHERITS = 512, - SEC_ALLOW_CHROME = 1024, - SEC_DISALLOW_SCRIPT = 2048, - SEC_DONT_FOLLOW_REDIRECTS = 4096, - SEC_LOAD_ERROR_PAGE = 8192, - SEC_FORCE_INHERIT_PRINCIPAL_OVERRULE_OWNER = 16384, - } - pub const nsILoadInfo_TAINTING_BASIC: root::nsILoadInfo__bindgen_ty_2 = - nsILoadInfo__bindgen_ty_2::TAINTING_BASIC; - pub const nsILoadInfo_TAINTING_CORS: root::nsILoadInfo__bindgen_ty_2 = - nsILoadInfo__bindgen_ty_2::TAINTING_CORS; - pub const nsILoadInfo_TAINTING_OPAQUE: root::nsILoadInfo__bindgen_ty_2 = - nsILoadInfo__bindgen_ty_2::TAINTING_OPAQUE; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsILoadInfo__bindgen_ty_2 { - TAINTING_BASIC = 0, - TAINTING_CORS = 1, - TAINTING_OPAQUE = 2, - } - #[test] - fn bindgen_test_layout_nsILoadInfo() { - assert_eq!(::std::mem::size_of::<nsILoadInfo>() , 8usize , concat ! ( - "Size of: " , stringify ! ( nsILoadInfo ) )); - assert_eq! (::std::mem::align_of::<nsILoadInfo>() , 8usize , concat ! - ( "Alignment of " , stringify ! ( nsILoadInfo ) )); - } - impl Clone for nsILoadInfo { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIInterfaceRequestor { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIInterfaceRequestor_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIInterfaceRequestor() { - assert_eq!(::std::mem::size_of::<nsIInterfaceRequestor>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsIInterfaceRequestor ) )); - assert_eq! (::std::mem::align_of::<nsIInterfaceRequestor>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIInterfaceRequestor ) - )); - } - impl Clone for nsIInterfaceRequestor { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIInputStream { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIStreamListener { pub _base: root::nsIRequestObserver, @@ -22226,46 +16371,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] - pub struct nsIDOMElement { - pub _base: root::nsIDOMNode, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMElement_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIDOMElement() { - assert_eq!(::std::mem::size_of::<nsIDOMElement>() , 8usize , concat ! - ( "Size of: " , stringify ! ( nsIDOMElement ) )); - assert_eq! (::std::mem::align_of::<nsIDOMElement>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( nsIDOMElement ) )); - } - impl Clone for nsIDOMElement { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIDOMNodeList { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMNodeList_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIDOMNodeList() { - assert_eq!(::std::mem::size_of::<nsIDOMNodeList>() , 8usize , concat ! - ( "Size of: " , stringify ! ( nsIDOMNodeList ) )); - assert_eq! (::std::mem::align_of::<nsIDOMNodeList>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( nsIDOMNodeList ) )); - } - impl Clone for nsIDOMNodeList { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] pub struct nsIDOMClientRect { pub _base: root::nsISupports, } @@ -22287,28 +16392,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] - pub struct nsIDOMClientRectList { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMClientRectList_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIDOMClientRectList() { - assert_eq!(::std::mem::size_of::<nsIDOMClientRectList>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsIDOMClientRectList ) )); - assert_eq! (::std::mem::align_of::<nsIDOMClientRectList>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIDOMClientRectList ) )); - } - impl Clone for nsIDOMClientRectList { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] pub struct nsIDOMStyleSheet { pub _base: root::nsISupports, } @@ -22350,11 +16433,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMEvent { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIDOMEventTarget { pub _base: root::nsISupports, @@ -22377,11 +16455,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMEventListener { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIDOMHTMLCollection { pub _base: root::nsISupports, @@ -22405,44 +16478,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] - pub struct nsIDOMCSSValue { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMCSSValue_COMTypeInfo { - pub _address: u8, - } - pub const nsIDOMCSSValue_CSS_INHERIT: root::nsIDOMCSSValue__bindgen_ty_1 = - nsIDOMCSSValue__bindgen_ty_1::CSS_INHERIT; - pub const nsIDOMCSSValue_CSS_PRIMITIVE_VALUE: - root::nsIDOMCSSValue__bindgen_ty_1 = - nsIDOMCSSValue__bindgen_ty_1::CSS_PRIMITIVE_VALUE; - pub const nsIDOMCSSValue_CSS_VALUE_LIST: - root::nsIDOMCSSValue__bindgen_ty_1 = - nsIDOMCSSValue__bindgen_ty_1::CSS_VALUE_LIST; - pub const nsIDOMCSSValue_CSS_CUSTOM: root::nsIDOMCSSValue__bindgen_ty_1 = - nsIDOMCSSValue__bindgen_ty_1::CSS_CUSTOM; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIDOMCSSValue__bindgen_ty_1 { - CSS_INHERIT = 0, - CSS_PRIMITIVE_VALUE = 1, - CSS_VALUE_LIST = 2, - CSS_CUSTOM = 3, - } - #[test] - fn bindgen_test_layout_nsIDOMCSSValue() { - assert_eq!(::std::mem::size_of::<nsIDOMCSSValue>() , 8usize , concat ! - ( "Size of: " , stringify ! ( nsIDOMCSSValue ) )); - assert_eq! (::std::mem::align_of::<nsIDOMCSSValue>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( nsIDOMCSSValue ) )); - } - impl Clone for nsIDOMCSSValue { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] pub struct nsIDOMCSSRule { pub _base: root::nsISupports, } @@ -22519,11 +16554,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMCSSRuleList { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIDOMCSSStyleSheet { pub _base: root::nsIDOMStyleSheet, @@ -22569,23 +16599,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - pub struct TraceCallbacks__bindgen_vtable(::std::os::raw::c_void); - #[repr(C)] - #[derive(Debug, Copy)] - pub struct TraceCallbacks { - pub vtable_: *const TraceCallbacks__bindgen_vtable, - } - #[test] - fn bindgen_test_layout_TraceCallbacks() { - assert_eq!(::std::mem::size_of::<TraceCallbacks>() , 8usize , concat ! - ( "Size of: " , stringify ! ( TraceCallbacks ) )); - assert_eq! (::std::mem::align_of::<TraceCallbacks>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( TraceCallbacks ) )); - } - impl Clone for TraceCallbacks { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsScriptObjectTracer { pub _base: root::nsCycleCollectionParticipant, @@ -22627,6 +16640,7 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug)] pub struct nsIDocument { pub _base: root::nsINode, pub _base_1: root::mozilla::dom::DispatcherTrait, @@ -22693,14 +16707,10 @@ pub mod root { pub mSubtreeModifiedDepth: u32, pub mDisplayDocument: root::nsCOMPtr, pub mEventsSuppressed: u32, - /** - * The number number of external scripts (ones with the src attribute) that - * have this document as their owner and that are being evaluated right now. - */ + /// The number number of external scripts (ones with the src attribute) that + /// have this document as their owner and that are being evaluated right now. pub mExternalScriptsBeingEvaluated: u32, - /** - * The current frame request callback handle - */ + /// The current frame request callback handle pub mFrameRequestCallbackCounter: i32, pub mStaticCloneCount: u32, pub mBlockedTrackingNodes: root::nsTArray<root::nsCOMPtr>, @@ -22739,6 +16749,7 @@ pub mod root { pub _address: u8, } #[repr(C)] + #[derive(Debug)] pub struct nsIDocument_PageUnloadingEventTimeStamp { pub mDocument: root::nsCOMPtr, pub mSet: bool, @@ -22769,14 +16780,12 @@ pub mod root { nsIDocument_PageUnloadingEventTimeStamp ) , "::" , stringify ! ( mSet ) )); } - /** - * This gets fired when the element that an id refers to changes. - * This fires at difficult times. It is generally not safe to do anything - * which could modify the DOM in any way. Use - * nsContentUtils::AddScriptRunner. - * @return true to keep the callback in the callback set, false - * to remove it. - */ + /// This gets fired when the element that an id refers to changes. + /// This fires at difficult times. It is generally not safe to do anything + /// which could modify the DOM in any way. Use + /// nsContentUtils::AddScriptRunner. + /// @return true to keep the callback in the callback set, false + /// to remove it. pub type nsIDocument_IDTargetObserver = ::std::option::Option<unsafe extern "C" fn(aOldElement: *mut root::nsIDocument_Element, @@ -22820,6 +16829,8 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] + pub struct nsIDocument_SelectorCache__bindgen_vtable(::std::os::raw::c_void); + #[repr(C)] #[derive(Debug, Copy)] pub struct nsIDocument_SelectorCache { pub _bindgen_opaque_blob: [u64; 17usize], @@ -22853,11 +16864,9 @@ pub mod root { READYSTATE_INTERACTIVE = 3, READYSTATE_COMPLETE = 4, } - /** - * Enumerate all subdocuments. - * The enumerator callback should return true to continue enumerating, or - * false to stop. This will never get passed a null aDocument. - */ + /// Enumerate all subdocuments. + /// The enumerator callback should return true to continue enumerating, or + /// false to stop. This will never get passed a null aDocument. pub type nsIDocument_nsSubDocEnumFunc = ::std::option::Option<unsafe extern "C" fn(aDocument: *mut root::nsIDocument, @@ -22871,17 +16880,16 @@ pub mod root { FLUSH_LAYOUT = 2, IS_ELEMENT_FROM_POINT = 4, } - /** - * A class that represents an external resource load that has begun but - * doesn't have a document yet. Observers can be registered on this object, - * and will be notified after the document is created. Observers registered - * after the document has been created will NOT be notified. When observers - * are notified, the subject will be the newly-created document, the topic - * will be "external-resource-document-created", and the data will be null. - * If document creation fails for some reason, observers will still be - * notified, with a null document pointer. - */ + /// A class that represents an external resource load that has begun but + /// doesn't have a document yet. Observers can be registered on this object, + /// and will be notified after the document is created. Observers registered + /// after the document has been created will NOT be notified. When observers + /// are notified, the subject will be the newly-created document, the topic + /// will be "external-resource-document-created", and the data will be null. + /// If document creation fails for some reason, observers will still be + /// notified, with a null document pointer. #[repr(C)] + #[derive(Debug)] pub struct nsIDocument_ExternalResourceLoad { pub _base: root::nsISupports, pub mObservers: [u64; 10usize], @@ -22949,7 +16957,7 @@ pub mod root { eShowModalDialog = 24, eWindow_Content = 25, eSyncXMLHttpRequest = 26, - eWindow_Controllers = 27, + eWindow_Cc_ontrollers = 27, eImportXULIntoContent = 28, ePannerNodeDoppler = 29, eNavigatorGetUserMedia = 30, @@ -25488,6 +19496,7 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] + #[derive(Debug)] pub struct nsBindingManager { pub _base: root::nsStubMutationObserver, pub mRefCnt: root::nsCycleCollectingAutoRefCnt, @@ -25504,18 +19513,16 @@ pub mod root { } pub type nsBindingManager_HasThreadSafeRefCnt = root::mozilla::FalseType; #[repr(u32)] - /** - * Notify the binding manager that an element - * has been removed from its document, - * so that it can update any bindings or - * nsIAnonymousContentCreator-created anonymous - * content that may depend on the document. - * @param aContent the element that's being moved - * @param aOldDocument the old document in which the - * content resided. - * @param aDestructorHandling whether or not to run the possible XBL - * destructor. - */ + /// Notify the binding manager that an element + /// has been removed from its document, + /// so that it can update any bindings or + /// nsIAnonymousContentCreator-created anonymous + /// content that may depend on the document. + /// @param aContent the element that's being moved + /// @param aOldDocument the old document in which the + /// content resided. + /// @param aDestructorHandling whether or not to run the possible XBL + /// destructor. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsBindingManager_DestructorHandling { eRunDtor = 0, @@ -25669,11 +19676,10 @@ pub mod root { nsFontFaceRuleContainer ) , "::" , stringify ! ( mSheetType ) )); } - /** - * A node of content in a document's content model. This interface - * is supported by all content objects. - */ + /// A node of content in a document's content model. This interface + /// is supported by all content objects. #[repr(C)] + #[derive(Debug)] pub struct nsIContent { pub _base: root::nsINode, } @@ -25711,23 +19717,21 @@ pub mod root { ATTR_MISSING = -1, ATTR_VALUE_NO_MATCH = -2, } - /** - * Check whether this content node's given attribute has one of a given - * list of values. If there is a match, we return the index in the list - * of the first matching value. If there was no attribute at all, then - * we return ATTR_MISSING. If there was an attribute but it didn't - * match, we return ATTR_VALUE_NO_MATCH. A non-negative result always - * indicates a match. - * - * @param aNameSpaceID The namespace ID of the attribute. Must not - * be kNameSpaceID_Unknown. - * @param aName The name atom of the attribute. Must not be null. - * @param aValues a nullptr-terminated array of pointers to atom values to test - * against. - * @param aCaseSensitive Whether to do a case-sensitive compare on the values. - * @return ATTR_MISSING, ATTR_VALUE_NO_MATCH or the non-negative index - * indicating the first value of aValues that matched - */ + /// Check whether this content node's given attribute has one of a given + /// list of values. If there is a match, we return the index in the list + /// of the first matching value. If there was no attribute at all, then + /// we return ATTR_MISSING. If there was an attribute but it didn't + /// match, we return ATTR_VALUE_NO_MATCH. A non-negative result always + /// indicates a match. + /// + /// @param aNameSpaceID The namespace ID of the attribute. Must not + /// be kNameSpaceID_Unknown. + /// @param aName The name atom of the attribute. Must not be null. + /// @param aValues a nullptr-terminated array of pointers to atom values to test + /// against. + /// @param aCaseSensitive Whether to do a case-sensitive compare on the values. + /// @return ATTR_MISSING, ATTR_VALUE_NO_MATCH or the non-negative index + /// indicating the first value of aValues that matched pub type nsIContent_AttrValuesArray = *const *const root::nsIAtom; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -25758,36 +19762,41 @@ pub mod root { assert_eq! (::std::mem::align_of::<nsIContent>() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsIContent ) )); } - /** - * An nsStyleContext represents the computed style data for an element. - * The computed style data are stored in a set of structs (see - * nsStyleStruct.h) that are cached either on the style context or in - * the rule tree (see nsRuleNode.h for a description of this caching and - * how the cached structs are shared). - * - * Since the data in |nsIStyleRule|s and |nsRuleNode|s are immutable - * (with a few exceptions, like system color changes), the data in an - * nsStyleContext are also immutable (with the additional exception of - * GetUniqueStyleData). When style data change, - * ElementRestyler::Restyle creates a new style context. - * - * Style contexts are reference counted. References are generally held - * by: - * 1. the |nsIFrame|s that are using the style context and - * 2. any *child* style contexts (this might be the reverse of - * expectation, but it makes sense in this case) - */ + /// An nsStyleContext represents the computed style data for an element. + /// The computed style data are stored in a set of structs (see + /// nsStyleStruct.h) that are cached either on the style context or in + /// the rule tree (see nsRuleNode.h for a description of this caching and + /// how the cached structs are shared). + /// + /// Since the data in |nsIStyleRule|s and |nsRuleNode|s are immutable + /// (with a few exceptions, like system color changes), the data in an + /// nsStyleContext are also immutable (with the additional exception of + /// GetUniqueStyleData). When style data change, + /// ElementRestyler::Restyle creates a new style context. + /// + /// Style contexts are reference counted. References are generally held + /// by: + /// 1. the |nsIFrame|s that are using the style context and + /// 2. any *child* style contexts (this might be the reverse of + /// expectation, but it makes sense in this case) #[repr(C)] #[derive(Debug)] pub struct nsStyleContext { pub mParent: root::RefPtr<root::nsStyleContext>, pub mPseudoTag: root::nsCOMPtr, pub mBits: u64, - pub mRefCnt: u32, + } + pub const nsStyleContext_kAllResolvedStructs: + root::nsStyleContext__bindgen_ty_1 = + nsStyleContext__bindgen_ty_1::kAllResolvedStructs; + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsStyleContext__bindgen_ty_1 { + kAllResolvedStructs = 4294967295, } #[test] fn bindgen_test_layout_nsStyleContext() { - assert_eq!(::std::mem::size_of::<nsStyleContext>() , 32usize , concat + assert_eq!(::std::mem::size_of::<nsStyleContext>() , 24usize , concat ! ( "Size of: " , stringify ! ( nsStyleContext ) )); assert_eq! (::std::mem::align_of::<nsStyleContext>() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsStyleContext ) )); @@ -25806,13 +19815,9 @@ pub mod root { _ as usize } , 16usize , concat ! ( "Alignment of field: " , stringify ! ( nsStyleContext ) , "::" , stringify ! ( mBits ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsStyleContext ) ) . mRefCnt as * - const _ as usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( nsStyleContext ) , - "::" , stringify ! ( mRefCnt ) )); } #[repr(C)] + #[derive(Debug)] pub struct nsPresContext { pub _base: root::nsIObserver, pub _base_1: u64, @@ -25933,9 +19938,7 @@ pub mod root { eMouseMoveInteraction = 2, eScrollInteraction = 3, } - /** - * A class that can be used to temporarily disable reflow interruption. - */ + /// A class that can be used to temporarily disable reflow interruption. #[repr(C)] #[derive(Debug)] pub struct nsPresContext_InterruptPreventer { @@ -27531,7 +21534,7 @@ pub mod root { } } #[inline] - pub fn mUsesViewportUnits(&self) -> ::std::os::raw::c_uint { + pub fn mPendingViewportChange(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -27546,8 +21549,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mUsesViewportUnits(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mPendingViewportChange(&mut self, + val: ::std::os::raw::c_uint) { let mask = 1073741824u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -27570,7 +21573,7 @@ pub mod root { } } #[inline] - pub fn mPendingViewportChange(&self) -> ::std::os::raw::c_uint { + pub fn mCounterStylesDirty(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -27585,8 +21588,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mPendingViewportChange(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mCounterStylesDirty(&mut self, + val: ::std::os::raw::c_uint) { let mask = 2147483648u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -27609,7 +21612,7 @@ pub mod root { } } #[inline] - pub fn mCounterStylesDirty(&self) -> ::std::os::raw::c_uint { + pub fn mPostedFlushCounterStyles(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -27624,8 +21627,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mCounterStylesDirty(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mPostedFlushCounterStyles(&mut self, + val: ::std::os::raw::c_uint) { let mask = 4294967296u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -27648,7 +21651,7 @@ pub mod root { } } #[inline] - pub fn mPostedFlushCounterStyles(&self) -> ::std::os::raw::c_uint { + pub fn mSuppressResizeReflow(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -27663,8 +21666,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mPostedFlushCounterStyles(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mSuppressResizeReflow(&mut self, + val: ::std::os::raw::c_uint) { let mask = 8589934592u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -27687,7 +21690,7 @@ pub mod root { } } #[inline] - pub fn mSuppressResizeReflow(&self) -> ::std::os::raw::c_uint { + pub fn mIsVisual(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -27702,8 +21705,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mSuppressResizeReflow(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mIsVisual(&mut self, val: ::std::os::raw::c_uint) { let mask = 17179869184u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -27726,7 +21728,7 @@ pub mod root { } } #[inline] - pub fn mIsVisual(&self) -> ::std::os::raw::c_uint { + pub fn mFireAfterPaintEvents(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -27741,7 +21743,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mIsVisual(&mut self, val: ::std::os::raw::c_uint) { + pub fn set_mFireAfterPaintEvents(&mut self, + val: ::std::os::raw::c_uint) { let mask = 34359738368u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -27764,7 +21767,7 @@ pub mod root { } } #[inline] - pub fn mFireAfterPaintEvents(&self) -> ::std::os::raw::c_uint { + pub fn mIsChrome(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -27779,8 +21782,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mFireAfterPaintEvents(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mIsChrome(&mut self, val: ::std::os::raw::c_uint) { let mask = 68719476736u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -27803,7 +21805,7 @@ pub mod root { } } #[inline] - pub fn mIsChrome(&self) -> ::std::os::raw::c_uint { + pub fn mIsChromeOriginImage(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -27818,7 +21820,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mIsChrome(&mut self, val: ::std::os::raw::c_uint) { + pub fn set_mIsChromeOriginImage(&mut self, + val: ::std::os::raw::c_uint) { let mask = 137438953472u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -27841,7 +21844,7 @@ pub mod root { } } #[inline] - pub fn mIsChromeOriginImage(&self) -> ::std::os::raw::c_uint { + pub fn mPaintFlashing(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -27856,8 +21859,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mIsChromeOriginImage(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mPaintFlashing(&mut self, val: ::std::os::raw::c_uint) { let mask = 274877906944u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -27880,7 +21882,7 @@ pub mod root { } } #[inline] - pub fn mPaintFlashing(&self) -> ::std::os::raw::c_uint { + pub fn mPaintFlashingInitialized(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -27895,7 +21897,8 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mPaintFlashing(&mut self, val: ::std::os::raw::c_uint) { + pub fn set_mPaintFlashingInitialized(&mut self, + val: ::std::os::raw::c_uint) { let mask = 549755813888u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -27918,7 +21921,8 @@ pub mod root { } } #[inline] - pub fn mPaintFlashingInitialized(&self) -> ::std::os::raw::c_uint { + pub fn mHasWarnedAboutPositionedTableParts(&self) + -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -27933,8 +21937,9 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mPaintFlashingInitialized(&mut self, - val: ::std::os::raw::c_uint) { + pub fn set_mHasWarnedAboutPositionedTableParts(&mut self, + val: + ::std::os::raw::c_uint) { let mask = 1099511627776u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -27957,7 +21962,7 @@ pub mod root { } } #[inline] - pub fn mHasWarnedAboutPositionedTableParts(&self) + pub fn mHasWarnedAboutTooLargeDashedOrDottedRadius(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; @@ -27973,9 +21978,9 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mHasWarnedAboutPositionedTableParts(&mut self, - val: - ::std::os::raw::c_uint) { + pub fn set_mHasWarnedAboutTooLargeDashedOrDottedRadius(&mut self, + val: + ::std::os::raw::c_uint) { let mask = 2199023255552u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -27998,8 +22003,7 @@ pub mod root { } } #[inline] - pub fn mHasWarnedAboutTooLargeDashedOrDottedRadius(&self) - -> ::std::os::raw::c_uint { + pub fn mQuirkSheetAdded(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28014,9 +22018,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mHasWarnedAboutTooLargeDashedOrDottedRadius(&mut self, - val: - ::std::os::raw::c_uint) { + pub fn set_mQuirkSheetAdded(&mut self, val: ::std::os::raw::c_uint) { let mask = 4398046511104u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28039,7 +22041,7 @@ pub mod root { } } #[inline] - pub fn mQuirkSheetAdded(&self) -> ::std::os::raw::c_uint { + pub fn mNeedsPrefUpdate(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28054,7 +22056,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mQuirkSheetAdded(&mut self, val: ::std::os::raw::c_uint) { + pub fn set_mNeedsPrefUpdate(&mut self, val: ::std::os::raw::c_uint) { let mask = 8796093022208u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28077,7 +22079,7 @@ pub mod root { } } #[inline] - pub fn mNeedsPrefUpdate(&self) -> ::std::os::raw::c_uint { + pub fn mHadNonBlankPaint(&self) -> ::std::os::raw::c_uint { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -28092,7 +22094,7 @@ pub mod root { unsafe { ::std::mem::transmute(val as u32) } } #[inline] - pub fn set_mNeedsPrefUpdate(&mut self, val: ::std::os::raw::c_uint) { + pub fn set_mHadNonBlankPaint(&mut self, val: ::std::os::raw::c_uint) { let mask = 17592186044416u64 as u64; let val = val as u32 as u64; let mut unit_field_val: u64 = @@ -28115,44 +22117,6 @@ pub mod root { } } #[inline] - pub fn mHadNonBlankPaint(&self) -> ::std::os::raw::c_uint { - let mut unit_field_val: u64 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u64 as *mut u8, - ::std::mem::size_of::<u64>()) - }; - let mask = 35184372088832u64 as u64; - let val = (unit_field_val & mask) >> 45usize; - unsafe { ::std::mem::transmute(val as u32) } - } - #[inline] - pub fn set_mHadNonBlankPaint(&mut self, val: ::std::os::raw::c_uint) { - let mask = 35184372088832u64 as u64; - let val = val as u32 as u64; - let mut unit_field_val: u64 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as - *mut u64 as *mut u8, - ::std::mem::size_of::<u64>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 45usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u64>()); - } - } - #[inline] pub fn new_bitfield_1(mHasPendingInterrupt: ::std::os::raw::c_uint, mPendingInterruptFromTest: ::std::os::raw::c_uint, @@ -28189,7 +22153,6 @@ pub mod root { mIsGlyph: ::std::os::raw::c_uint, mUsesRootEMUnits: ::std::os::raw::c_uint, mUsesExChUnits: ::std::os::raw::c_uint, - mUsesViewportUnits: ::std::os::raw::c_uint, mPendingViewportChange: ::std::os::raw::c_uint, mCounterStylesDirty: ::std::os::raw::c_uint, mPostedFlushCounterStyles: @@ -28254,396 +22217,382 @@ pub mod root { ({ ({ ({ - ({ - 0 - } - | - ((mHasPendingInterrupt - as - u32 - as - u64) - << - 0usize) - & - (1u64 - as - u64)) + 0 } | - ((mPendingInterruptFromTest + ((mHasPendingInterrupt as u32 as u64) << - 1usize) + 0usize) & - (2u64 + (1u64 as u64)) } | - ((mInterruptsEnabled + ((mPendingInterruptFromTest as u32 as u64) << - 2usize) + 1usize) & - (4u64 + (2u64 as u64)) } | - ((mUseDocumentFonts + ((mInterruptsEnabled as u32 as u64) << - 3usize) + 2usize) & - (8u64 + (4u64 as u64)) } | - ((mUseDocumentColors + ((mUseDocumentFonts as u32 as u64) << - 4usize) + 3usize) & - (16u64 + (8u64 as u64)) } | - ((mUnderlineLinks + ((mUseDocumentColors as u32 as u64) << - 5usize) + 4usize) & - (32u64 + (16u64 as u64)) } | - ((mSendAfterPaintToContent + ((mUnderlineLinks as u32 as u64) << - 6usize) + 5usize) & - (64u64 + (32u64 as u64)) } | - ((mUseFocusColors + ((mSendAfterPaintToContent as u32 as u64) << - 7usize) + 6usize) & - (128u64 + (64u64 as u64)) } | - ((mFocusRingOnAnything + ((mUseFocusColors as u32 as u64) << - 8usize) + 7usize) & - (256u64 + (128u64 as u64)) } | - ((mFocusRingStyle + ((mFocusRingOnAnything as u32 as u64) << - 9usize) + 8usize) & - (512u64 + (256u64 as u64)) } | - ((mDrawImageBackground + ((mFocusRingStyle as u32 as u64) << - 10usize) + 9usize) & - (1024u64 + (512u64 as u64)) } | - ((mDrawColorBackground + ((mDrawImageBackground as u32 as u64) << - 11usize) + 10usize) & - (2048u64 + (1024u64 as u64)) } | - ((mNeverAnimate + ((mDrawColorBackground as u32 as u64) << - 12usize) + 11usize) & - (4096u64 + (2048u64 as u64)) } | - ((mIsRenderingOnlySelection + ((mNeverAnimate as u32 as u64) << - 13usize) + 12usize) & - (8192u64 + (4096u64 as u64)) } | - ((mPaginated + ((mIsRenderingOnlySelection as u32 as u64) << - 14usize) + 13usize) & - (16384u64 + (8192u64 as u64)) } | - ((mCanPaginatedScroll + ((mPaginated as u32 as u64) << - 15usize) + 14usize) & - (32768u64 + (16384u64 as u64)) } | - ((mDoScaledTwips + ((mCanPaginatedScroll as u32 as u64) << - 16usize) + 15usize) & - (65536u64 + (32768u64 as u64)) } | - ((mIsRootPaginatedDocument + ((mDoScaledTwips as u32 as u64) << - 17usize) + 16usize) & - (131072u64 + (65536u64 as u64)) } | - ((mPrefBidiDirection + ((mIsRootPaginatedDocument as u32 as u64) << - 18usize) + 17usize) & - (262144u64 + (131072u64 as u64)) } | - ((mPrefScrollbarSide + ((mPrefBidiDirection as u32 as u64) << - 19usize) + 18usize) & - (1572864u64 + (262144u64 as u64)) } | - ((mPendingSysColorChanged + ((mPrefScrollbarSide as u32 as u64) << - 21usize) + 19usize) & - (2097152u64 + (1572864u64 as u64)) } | - ((mPendingThemeChanged + ((mPendingSysColorChanged as u32 as u64) << - 22usize) + 21usize) & - (4194304u64 + (2097152u64 as u64)) } | - ((mPendingUIResolutionChanged + ((mPendingThemeChanged as u32 as u64) << - 23usize) + 22usize) & - (8388608u64 + (4194304u64 as u64)) } | - ((mPendingMediaFeatureValuesChanged + ((mPendingUIResolutionChanged as u32 as u64) << - 24usize) + 23usize) & - (16777216u64 + (8388608u64 as u64)) } | - ((mPrefChangePendingNeedsReflow + ((mPendingMediaFeatureValuesChanged as u32 as u64) << - 25usize) + 24usize) & - (33554432u64 + (16777216u64 as u64)) } | - ((mIsEmulatingMedia + ((mPrefChangePendingNeedsReflow as u32 as u64) << - 26usize) + 25usize) & - (67108864u64 + (33554432u64 as u64)) } | - ((mIsGlyph + ((mIsEmulatingMedia as u32 as u64) << - 27usize) + 26usize) & - (134217728u64 + (67108864u64 as u64)) } | - ((mUsesRootEMUnits + ((mIsGlyph as u32 as u64) << - 28usize) + 27usize) & - (268435456u64 + (134217728u64 as u64)) } | - ((mUsesExChUnits + ((mUsesRootEMUnits as u32 as u64) << - 29usize) + 28usize) & - (536870912u64 + (268435456u64 as u64)) } | - ((mUsesViewportUnits + ((mUsesExChUnits as u32 as u64) << - 30usize) + 29usize) & - (1073741824u64 + (536870912u64 as u64)) } @@ -28654,9 +22603,9 @@ pub mod root { as u64) << - 31usize) + 30usize) & - (2147483648u64 + (1073741824u64 as u64)) } @@ -28667,9 +22616,9 @@ pub mod root { as u64) << - 32usize) + 31usize) & - (4294967296u64 + (2147483648u64 as u64)) } | @@ -28679,9 +22628,9 @@ pub mod root { as u64) << - 33usize) + 32usize) & - (8589934592u64 + (4294967296u64 as u64)) } | @@ -28691,9 +22640,9 @@ pub mod root { as u64) << - 34usize) + 33usize) & - (17179869184u64 + (8589934592u64 as u64)) } | @@ -28703,58 +22652,59 @@ pub mod root { as u64) << - 35usize) + 34usize) & - (34359738368u64 + (17179869184u64 as u64)) } | ((mFireAfterPaintEvents as u32 as u64) << - 36usize) & - (68719476736u64 + 35usize) & + (34359738368u64 as u64)) } | ((mIsChrome as u32 as u64) << - 37usize) & - (137438953472u64 + 36usize) & + (68719476736u64 as u64)) } | ((mIsChromeOriginImage as u32 as u64) << - 38usize) & - (274877906944u64 as + 37usize) & + (137438953472u64 as u64)) } | ((mPaintFlashing as u32 as u64) - << 39usize) & - (549755813888u64 as u64)) + << 38usize) & + (274877906944u64 as u64)) } | ((mPaintFlashingInitialized as u32 - as u64) << 40usize) & - (1099511627776u64 as u64)) + as u64) << 39usize) & + (549755813888u64 as u64)) } | ((mHasWarnedAboutPositionedTableParts as - u32 as u64) << 41usize) & - (2199023255552u64 as u64)) + u32 as u64) << 40usize) & + (1099511627776u64 as u64)) } | ((mHasWarnedAboutTooLargeDashedOrDottedRadius - as u32 as u64) << 42usize) & - (4398046511104u64 as u64)) + as u32 as u64) << 41usize) & + (2199023255552u64 as u64)) } | - ((mQuirkSheetAdded as u32 as u64) << 43usize) & - (8796093022208u64 as u64)) + ((mQuirkSheetAdded as u32 as u64) << 42usize) & + (4398046511104u64 as u64)) } | - ((mNeedsPrefUpdate as u32 as u64) << 44usize) & - (17592186044416u64 as u64)) + ((mNeedsPrefUpdate as u32 as u64) << 43usize) & + (8796093022208u64 as u64)) } | - ((mHadNonBlankPaint as u32 as u64) << 45usize) & - (35184372088832u64 as u64)) + ((mHadNonBlankPaint as u32 as u64) << 44usize) & + (17592186044416u64 as u64)) } } + pub type gfxSize = [u64; 2usize]; #[repr(C)] #[derive(Debug)] pub struct nsAttrName { @@ -28812,22 +22762,20 @@ pub mod root { eSVGTransformList = 32, eSVGViewBox = 33, } - /** - * Structure for a mapping from int (enum) values to strings. When you use - * it you generally create an array of them. - * Instantiate like this: - * EnumTable myTable[] = { - * { "string1", 1 }, - * { "string2", 2 }, - * { nullptr, 0 } - * } - */ + /// Structure for a mapping from int (enum) values to strings. When you use + /// it you generally create an array of them. + /// Instantiate like this: + /// EnumTable myTable[] = { + /// { "string1", 1 }, + /// { "string2", 2 }, + /// { nullptr, 0 } + /// } #[repr(C)] #[derive(Debug, Copy)] pub struct nsAttrValue_EnumTable { - /** The string the value maps to */ + /// The string the value maps to pub tag: *const ::std::os::raw::c_char, - /** The enum value that maps to this string */ + /// The enum value that maps to this string pub value: i16, } #[test] @@ -28878,13 +22826,6 @@ pub mod root { "Alignment of field: " , stringify ! ( nsAttrValue ) , "::" , stringify ! ( mBits ) )); } - #[repr(u32)] - /** - * This is the enum used by functions that need to be told whether to - * do case-sensitive or case-insensitive string comparisons. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsCaseTreatment { eCaseMatters = 0, eIgnoreCase = 1, } #[repr(C)] #[derive(Debug, Copy)] pub struct nsIVariant { @@ -28907,6 +22848,7 @@ pub mod root { } pub const kNameSpaceID_None: i32 = 0; #[repr(C)] + #[derive(Debug)] pub struct nsNodeInfoManager { pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub mNodeInfoHash: *mut root::PLHashTable, @@ -29015,49 +22957,12 @@ pub mod root { "Alignment of field: " , stringify ! ( nsNodeInfoManager ) , "::" , stringify ! ( mRecentlyUsedNodeInfos ) )); } - pub type NSPropertyFunc = - ::std::option::Option<unsafe extern "C" fn(aObject: - *mut ::std::os::raw::c_void, - aPropertyName: - *mut root::nsIAtom, - aPropertyValue: - *mut ::std::os::raw::c_void, - aData: - *mut ::std::os::raw::c_void)>; - /** - * Callback type for property destructors. |aObject| is the object - * the property is being removed for, |aPropertyName| is the property - * being removed, |aPropertyValue| is the value of the property, and |aData| - * is the opaque destructor data that was passed to SetProperty(). - **/ - pub type NSPropertyDtorFunc = root::NSPropertyFunc; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsIFrame { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsPropertyOwner { - pub mObject: *const ::std::os::raw::c_void, - } - #[test] - fn bindgen_test_layout_nsPropertyOwner() { - assert_eq!(::std::mem::size_of::<nsPropertyOwner>() , 8usize , concat - ! ( "Size of: " , stringify ! ( nsPropertyOwner ) )); - assert_eq! (::std::mem::align_of::<nsPropertyOwner>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsPropertyOwner ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsPropertyOwner ) ) . mObject as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsPropertyOwner ) , - "::" , stringify ! ( mObject ) )); - } - impl Clone for nsPropertyOwner { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug)] pub struct nsPropertyTable { pub mPropertyList: *mut root::nsPropertyTable_PropertyList, @@ -29080,23 +22985,8 @@ pub mod root { "Alignment of field: " , stringify ! ( nsPropertyTable ) , "::" , stringify ! ( mPropertyList ) )); } - /** - * An array of observers. Like a normal array, but supports iterators that are - * stable even if the array is modified during iteration. - * The template parameter T is the observer type the array will hold; - * N is the number of built-in storage slots that come with the array. - * NOTE: You probably want to use nsTObserverArray, unless you specifically - * want built-in storage. See below. - * @see nsTObserverArray, nsTArray - */ - #[repr(C)] - #[derive(Debug)] - pub struct nsTObserverArray_base { - pub mIterators: *mut root::nsTObserverArray_base_Iterator_base, - } pub type nsTObserverArray_base_index_type = usize; pub type nsTObserverArray_base_size_type = usize; - pub type nsTObserverArray_base_diff_type = isize; #[repr(C)] #[derive(Debug, Copy)] pub struct nsTObserverArray_base_Iterator_base { @@ -29130,73 +23020,47 @@ pub mod root { impl Clone for nsTObserverArray_base_Iterator_base { fn clone(&self) -> Self { *self } } - #[test] - fn bindgen_test_layout_nsTObserverArray_base() { - assert_eq!(::std::mem::size_of::<nsTObserverArray_base>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsTObserverArray_base ) )); - assert_eq! (::std::mem::align_of::<nsTObserverArray_base>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsTObserverArray_base ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsTObserverArray_base ) ) . - mIterators as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsTObserverArray_base ) , "::" , stringify ! ( mIterators - ) )); - } + pub type nsAutoTObserverArray_elem_type<T> = T; + pub type nsAutoTObserverArray_array_type<T> = root::nsTArray<T>; #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsTObserverArray { + #[derive(Debug)] + pub struct nsAutoTObserverArray_Iterator { + pub _base: root::nsTObserverArray_base_Iterator_base, + pub mArray: *mut root::nsAutoTObserverArray_Iterator_array_type, } - pub type nsTObserverArray_base_type = u8; - pub type nsTObserverArray_size_type = - root::nsTObserverArray_base_size_type; - /** - * It is used by the application to initialize a runtime and run scripts. - * A script runtime would implement this interface. - */ + pub type nsAutoTObserverArray_Iterator_array_type = u8; #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIScriptContext { - pub _base: root::nsISupports, + #[derive(Debug)] + pub struct nsAutoTObserverArray_ForwardIterator { + pub _base: root::nsAutoTObserverArray_Iterator, } + pub type nsAutoTObserverArray_ForwardIterator_array_type = u8; + pub type nsAutoTObserverArray_ForwardIterator_base_type = + root::nsAutoTObserverArray_Iterator; #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIScriptContext_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIScriptContext() { - assert_eq!(::std::mem::size_of::<nsIScriptContext>() , 8usize , concat - ! ( "Size of: " , stringify ! ( nsIScriptContext ) )); - assert_eq! (::std::mem::align_of::<nsIScriptContext>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIScriptContext ) )); - } - impl Clone for nsIScriptContext { - fn clone(&self) -> Self { *self } + #[derive(Debug)] + pub struct nsAutoTObserverArray_EndLimitedIterator { + pub _base: root::nsAutoTObserverArray_ForwardIterator, + pub mEnd: root::nsAutoTObserverArray_ForwardIterator, } + pub type nsAutoTObserverArray_EndLimitedIterator_array_type = u8; + pub type nsAutoTObserverArray_EndLimitedIterator_base_type = + root::nsAutoTObserverArray_Iterator; #[repr(C)] #[derive(Debug)] - pub struct nsPIDOMWindowOuter { - pub _base: [u64; 30usize], + pub struct nsAutoTObserverArray_BackwardIterator { + pub _base: root::nsAutoTObserverArray_Iterator, } + pub type nsAutoTObserverArray_BackwardIterator_array_type = u8; + pub type nsAutoTObserverArray_BackwardIterator_base_type = + root::nsAutoTObserverArray_Iterator; #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsPIDOMWindowOuter_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsPIDOMWindowOuter() { - assert_eq!(::std::mem::size_of::<nsPIDOMWindowOuter>() , 240usize , - concat ! ( "Size of: " , stringify ! ( nsPIDOMWindowOuter ) - )); - assert_eq! (::std::mem::align_of::<nsPIDOMWindowOuter>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsPIDOMWindowOuter ) )); + pub struct nsTObserverArray { } + pub type nsTObserverArray_base_type = u8; + pub type nsTObserverArray_size_type = + root::nsTObserverArray_base_size_type; #[repr(C)] #[derive(Debug)] pub struct nsIGlobalObject { @@ -29320,19 +23184,13 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsCSSSelectorList { - _unused: [u8; 0], - } - #[repr(C)] + #[derive(Debug)] pub struct nsDOMAttributeMap { pub _base: root::nsIDOMMozNamedAttrMap, pub _base_1: root::nsWrapperCache, pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub mContent: root::nsCOMPtr, - /** - * Cache of Attrs. - */ + /// Cache of Attrs. pub mAttributeCache: root::nsDOMAttributeMap_AttrCache, } pub type nsDOMAttributeMap_Attr = root::mozilla::dom::Attr; @@ -29373,25 +23231,18 @@ pub mod root { concat ! ( "Alignment of " , stringify ! ( nsDOMAttributeMap ) )); } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIAnimationObserver { - _unused: [u8; 0], - } - /** - * Mutation observer interface - * - * See nsINode::AddMutationObserver, nsINode::RemoveMutationObserver for how to - * attach or remove your observers. - * - * WARNING: During these notifications, you are not allowed to perform - * any mutations to the current or any other document, or start a - * network load. If you need to perform such operations do that - * during the _last_ nsIDocumentObserver::EndUpdate notification. The - * expection for this is ParentChainChanged, where mutations should be - * done from an async event, as the notification might not be - * surrounded by BeginUpdate/EndUpdate calls. - */ + /// Mutation observer interface + /// + /// See nsINode::AddMutationObserver, nsINode::RemoveMutationObserver for how to + /// attach or remove your observers. + /// + /// WARNING: During these notifications, you are not allowed to perform + /// any mutations to the current or any other document, or start a + /// network load. If you need to perform such operations do that + /// during the _last_ nsIDocumentObserver::EndUpdate notification. The + /// expection for this is ParentChainChanged, where mutations should be + /// done from an async event, as the notification might not be + /// surrounded by BeginUpdate/EndUpdate calls. #[repr(C)] #[derive(Debug, Copy)] pub struct nsIMutationObserver { @@ -29414,30 +23265,1251 @@ pub mod root { impl Clone for nsIMutationObserver { fn clone(&self) -> Self { *self } } - /** - * An internal interface for a reasonably fast indexOf. - */ + /// Presentation shell interface. Presentation shells are the + /// controlling point for managing the presentation of a document. The + /// presentation shell holds a live reference to the document, the + /// presentation context, the style manager, the style set and the root + /// frame. <p> + /// + /// When this object is Release'd, it will release the document, the + /// presentation context, the style manager, the style set and the root + /// frame. #[repr(C)] - #[derive(Debug)] - pub struct nsINodeList { - pub _base: root::nsIDOMNodeList, - pub _base_1: root::nsWrapperCache, + pub struct nsIPresShell { + pub _base: root::nsISupports, + pub mDocument: root::nsCOMPtr, + pub mPresContext: root::RefPtr<root::nsPresContext>, + pub mStyleSet: root::mozilla::StyleSetHandle, + pub mFrameConstructor: *mut root::nsCSSFrameConstructor, + pub mViewManager: *mut root::nsViewManager, + pub mFrameArena: root::nsPresArena, + pub mSelection: root::RefPtr<root::nsFrameSelection>, + pub mFrameManager: *mut root::nsFrameManagerBase, + pub mForwardingContainer: u64, + pub mDocAccessible: *mut root::mozilla::a11y::DocAccessible, + pub mReflowContinueTimer: root::nsCOMPtr, + pub mPaintCount: u64, + pub mScrollPositionClampingScrollPortSize: root::nsSize, + pub mAutoWeakFrames: *mut root::AutoWeakFrame, + pub mWeakFrames: [u64; 5usize], + pub mCanvasBackgroundColor: root::nscolor, + pub mResolution: [u32; 2usize], + pub mSelectionFlags: i16, + pub mRenderFlags: root::nsIPresShell_RenderFlags, + pub _bitfield_1: [u8; 2usize], + pub mPresShellId: u32, + pub mFontSizeInflationEmPerLine: u32, + pub mFontSizeInflationMinTwips: u32, + pub mFontSizeInflationLineThreshold: u32, + pub mFontSizeInflationForceEnabled: bool, + pub mFontSizeInflationDisabledInMasterProcess: bool, + pub mFontSizeInflationEnabled: bool, + pub mFontSizeInflationEnabledIsDirty: bool, + pub mPaintingIsFrozen: bool, + pub mIsNeverPainting: bool, + pub mInFlush: bool, } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsINodeList_COMTypeInfo { + pub struct nsIPresShell_COMTypeInfo { pub _address: u8, } + pub type nsIPresShell_LayerManager = root::mozilla::layers::LayerManager; + pub type nsIPresShell_SourceSurface = root::mozilla::gfx::SourceSurface; + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_eRenderFlag { + STATE_IGNORING_VIEWPORT_SCROLLING = 1, + STATE_DRAWWINDOW_NOT_FLUSHING = 2, + } + pub type nsIPresShell_RenderFlags = u8; + #[repr(u32)] + /// Gets nearest scrollable frame from the specified content node. The frame + /// is scrollable with overflow:scroll or overflow:auto in some direction when + /// aDirection is eEither. Otherwise, this returns a nearest frame that is + /// scrollable in the specified direction. + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_ScrollDirection { + eHorizontal = 0, + eVertical = 1, + eEither = 2, + } + #[repr(u32)] + /// Tell the pres shell that a frame needs to be marked dirty and needs + /// Reflow. It's OK if this is an ancestor of the frame needing reflow as + /// long as the ancestor chain between them doesn't cross a reflow root. + /// + /// The bit to add should be NS_FRAME_IS_DIRTY, NS_FRAME_HAS_DIRTY_CHILDREN + /// or nsFrameState(0); passing 0 means that dirty bits won't be set on the + /// frame or its ancestors/descendants, but that intrinsic widths will still + /// be marked dirty. Passing aIntrinsicDirty = eResize and aBitToAdd = 0 + /// would result in no work being done, so don't do that. + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_IntrinsicDirty { + eResize = 0, + eTreeChange = 1, + eStyleChange = 2, + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_ReflowRootHandling { + ePositionOrSizeChange = 0, + eNoPositionOrSizeChange = 1, + eInferFromBitToAdd = 2, + } + pub const nsIPresShell_SCROLL_TOP: root::nsIPresShell__bindgen_ty_1 = + nsIPresShell__bindgen_ty_1::SCROLL_TOP; + pub const nsIPresShell_SCROLL_BOTTOM: root::nsIPresShell__bindgen_ty_1 = + nsIPresShell__bindgen_ty_1::SCROLL_BOTTOM; + pub const nsIPresShell_SCROLL_LEFT: root::nsIPresShell__bindgen_ty_1 = + nsIPresShell__bindgen_ty_1::SCROLL_TOP; + pub const nsIPresShell_SCROLL_RIGHT: root::nsIPresShell__bindgen_ty_1 = + nsIPresShell__bindgen_ty_1::SCROLL_BOTTOM; + pub const nsIPresShell_SCROLL_CENTER: root::nsIPresShell__bindgen_ty_1 = + nsIPresShell__bindgen_ty_1::SCROLL_CENTER; + pub const nsIPresShell_SCROLL_MINIMUM: root::nsIPresShell__bindgen_ty_1 = + nsIPresShell__bindgen_ty_1::SCROLL_MINIMUM; + #[repr(i32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell__bindgen_ty_1 { + SCROLL_TOP = 0, + SCROLL_BOTTOM = 100, + SCROLL_CENTER = 50, + SCROLL_MINIMUM = -1, + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_WhenToScroll { + SCROLL_ALWAYS = 0, + SCROLL_IF_NOT_VISIBLE = 1, + SCROLL_IF_NOT_FULLY_VISIBLE = 2, + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsIPresShell_ScrollAxis { + pub _bindgen_opaque_blob: u32, + } #[test] - fn bindgen_test_layout_nsINodeList() { - assert_eq!(::std::mem::size_of::<nsINodeList>() , 32usize , concat ! ( - "Size of: " , stringify ! ( nsINodeList ) )); - assert_eq! (::std::mem::align_of::<nsINodeList>() , 8usize , concat ! - ( "Alignment of " , stringify ! ( nsINodeList ) )); + fn bindgen_test_layout_nsIPresShell_ScrollAxis() { + assert_eq!(::std::mem::size_of::<nsIPresShell_ScrollAxis>() , 4usize , + concat ! ( + "Size of: " , stringify ! ( nsIPresShell_ScrollAxis ) )); + assert_eq! (::std::mem::align_of::<nsIPresShell_ScrollAxis>() , 4usize + , concat ! ( + "Alignment of " , stringify ! ( nsIPresShell_ScrollAxis ) + )); + } + impl Clone for nsIPresShell_ScrollAxis { + fn clone(&self) -> Self { *self } + } + pub const nsIPresShell_SCROLL_FIRST_ANCESTOR_ONLY: + root::nsIPresShell__bindgen_ty_2 = + nsIPresShell__bindgen_ty_2::SCROLL_FIRST_ANCESTOR_ONLY; + pub const nsIPresShell_SCROLL_OVERFLOW_HIDDEN: + root::nsIPresShell__bindgen_ty_2 = + nsIPresShell__bindgen_ty_2::SCROLL_OVERFLOW_HIDDEN; + pub const nsIPresShell_SCROLL_NO_PARENT_FRAMES: + root::nsIPresShell__bindgen_ty_2 = + nsIPresShell__bindgen_ty_2::SCROLL_NO_PARENT_FRAMES; + pub const nsIPresShell_SCROLL_SMOOTH: root::nsIPresShell__bindgen_ty_2 = + nsIPresShell__bindgen_ty_2::SCROLL_SMOOTH; + pub const nsIPresShell_SCROLL_SMOOTH_AUTO: + root::nsIPresShell__bindgen_ty_2 = + nsIPresShell__bindgen_ty_2::SCROLL_SMOOTH_AUTO; + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell__bindgen_ty_2 { + SCROLL_FIRST_ANCESTOR_ONLY = 1, + SCROLL_OVERFLOW_HIDDEN = 2, + SCROLL_NO_PARENT_FRAMES = 4, + SCROLL_SMOOTH = 8, + SCROLL_SMOOTH_AUTO = 16, + } + pub const nsIPresShell_RENDER_IS_UNTRUSTED: + root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_IS_UNTRUSTED; + pub const nsIPresShell_RENDER_IGNORE_VIEWPORT_SCROLLING: + root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_IGNORE_VIEWPORT_SCROLLING; + pub const nsIPresShell_RENDER_CARET: root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_CARET; + pub const nsIPresShell_RENDER_USE_WIDGET_LAYERS: + root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_USE_WIDGET_LAYERS; + pub const nsIPresShell_RENDER_ASYNC_DECODE_IMAGES: + root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_ASYNC_DECODE_IMAGES; + pub const nsIPresShell_RENDER_DOCUMENT_RELATIVE: + root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_DOCUMENT_RELATIVE; + pub const nsIPresShell_RENDER_DRAWWINDOW_NOT_FLUSHING: + root::nsIPresShell__bindgen_ty_3 = + nsIPresShell__bindgen_ty_3::RENDER_DRAWWINDOW_NOT_FLUSHING; + #[repr(u32)] + /// Render the document into an arbitrary gfxContext + /// Designed for getting a picture of a document or a piece of a document + /// Note that callers will generally want to call FlushPendingNotifications + /// to get an up-to-date view of the document + /// @param aRect is the region to capture into the offscreen buffer, in the + /// root frame's coordinate system (if aIgnoreViewportScrolling is false) + /// or in the root scrolled frame's coordinate system + /// (if aIgnoreViewportScrolling is true). The coordinates are in appunits. + /// @param aFlags see below; + /// set RENDER_IS_UNTRUSTED if the contents may be passed to malicious + /// agents. E.g. we might choose not to paint the contents of sensitive widgets + /// such as the file name in a file upload widget, and we might choose not + /// to paint themes. + /// set RENDER_IGNORE_VIEWPORT_SCROLLING to ignore + /// clipping and scrollbar painting due to scrolling in the viewport + /// set RENDER_CARET to draw the caret if one would be visible + /// (by default the caret is never drawn) + /// set RENDER_USE_LAYER_MANAGER to force rendering to go through + /// the layer manager for the window. This may be unexpectedly slow + /// (if the layer manager must read back data from the GPU) or low-quality + /// (if the layer manager reads back pixel data and scales it + /// instead of rendering using the appropriate scaling). It may also + /// slow everything down if the area rendered does not correspond to the + /// normal visible area of the window. + /// set RENDER_ASYNC_DECODE_IMAGES to avoid having images synchronously + /// decoded during rendering. + /// (by default images decode synchronously with RenderDocument) + /// set RENDER_DOCUMENT_RELATIVE to render the document as if there has been + /// no scrolling and interpret |aRect| relative to the document instead of the + /// CSS viewport. Only considered if RENDER_IGNORE_VIEWPORT_SCROLLING is set + /// or the document is in ignore viewport scrolling mode + /// (nsIPresShell::SetIgnoreViewportScrolling/IgnoringViewportScrolling). + /// @param aBackgroundColor a background color to render onto + /// @param aRenderedContext the gfxContext to render to. We render so that + /// one CSS pixel in the source document is rendered to one unit in the current + /// transform. + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell__bindgen_ty_3 { + RENDER_IS_UNTRUSTED = 1, + RENDER_IGNORE_VIEWPORT_SCROLLING = 2, + RENDER_CARET = 4, + RENDER_USE_WIDGET_LAYERS = 8, + RENDER_ASYNC_DECODE_IMAGES = 16, + RENDER_DOCUMENT_RELATIVE = 32, + RENDER_DRAWWINDOW_NOT_FLUSHING = 64, + } + pub const nsIPresShell_RENDER_IS_IMAGE: root::nsIPresShell__bindgen_ty_4 = + nsIPresShell__bindgen_ty_4::RENDER_IS_IMAGE; + pub const nsIPresShell_RENDER_AUTO_SCALE: root::nsIPresShell__bindgen_ty_4 + = + nsIPresShell__bindgen_ty_4::RENDER_AUTO_SCALE; + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell__bindgen_ty_4 { + RENDER_IS_IMAGE = 256, + RENDER_AUTO_SCALE = 128, + } + pub const nsIPresShell_FORCE_DRAW: root::nsIPresShell__bindgen_ty_5 = + nsIPresShell__bindgen_ty_5::FORCE_DRAW; + pub const nsIPresShell_ADD_FOR_SUBDOC: root::nsIPresShell__bindgen_ty_5 = + nsIPresShell__bindgen_ty_5::ADD_FOR_SUBDOC; + pub const nsIPresShell_APPEND_UNSCROLLED_ONLY: + root::nsIPresShell__bindgen_ty_5 = + nsIPresShell__bindgen_ty_5::APPEND_UNSCROLLED_ONLY; + #[repr(u32)] + /// Add a solid color item to the bottom of aList with frame aFrame and bounds + /// aBounds. Checks first if this needs to be done by checking if aFrame is a + /// canvas frame (if the FORCE_DRAW flag is passed then this check is skipped). + /// aBackstopColor is composed behind the background color of the canvas, it is + /// transparent by default. + /// We attempt to make the background color part of the scrolled canvas (to reduce + /// transparent layers), and if async scrolling is enabled (and the background + /// is opaque) then we add a second, unscrolled item to handle the checkerboarding + /// case. + /// ADD_FOR_SUBDOC shoud be specified when calling this for a subdocument, and + /// LayoutUseContainersForRootFrame might cause the whole list to be scrolled. In + /// that case the second unscrolled item will be elided. + /// APPEND_UNSCROLLED_ONLY only attempts to add the unscrolled item, so that we + /// can add it manually after LayoutUseContainersForRootFrame has built the + /// scrolling ContainerLayer. + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell__bindgen_ty_5 { + FORCE_DRAW = 1, + ADD_FOR_SUBDOC = 2, + APPEND_UNSCROLLED_ONLY = 4, + } + #[repr(C)] + #[derive(Debug)] + pub struct nsIPresShell_PointerCaptureInfo { + pub mPendingContent: root::nsCOMPtr, + pub mOverrideContent: root::nsCOMPtr, + } + #[test] + fn bindgen_test_layout_nsIPresShell_PointerCaptureInfo() { + assert_eq!(::std::mem::size_of::<nsIPresShell_PointerCaptureInfo>() , + 16usize , concat ! ( + "Size of: " , stringify ! ( nsIPresShell_PointerCaptureInfo + ) )); + assert_eq! (::std::mem::align_of::<nsIPresShell_PointerCaptureInfo>() + , 8usize , concat ! ( + "Alignment of " , stringify ! ( + nsIPresShell_PointerCaptureInfo ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell_PointerCaptureInfo ) ) . + mPendingContent as * const _ as usize } , 0usize , concat + ! ( + "Alignment of field: " , stringify ! ( + nsIPresShell_PointerCaptureInfo ) , "::" , stringify ! ( + mPendingContent ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell_PointerCaptureInfo ) ) . + mOverrideContent as * const _ as usize } , 8usize , concat + ! ( + "Alignment of field: " , stringify ! ( + nsIPresShell_PointerCaptureInfo ) , "::" , stringify ! ( + mOverrideContent ) )); + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsIPresShell_PointerInfo { + pub mPointerType: u16, + pub mActiveState: bool, + pub mPrimaryState: bool, + pub mPreventMouseEventByContent: bool, + } + #[test] + fn bindgen_test_layout_nsIPresShell_PointerInfo() { + assert_eq!(::std::mem::size_of::<nsIPresShell_PointerInfo>() , 6usize + , concat ! ( + "Size of: " , stringify ! ( nsIPresShell_PointerInfo ) )); + assert_eq! (::std::mem::align_of::<nsIPresShell_PointerInfo>() , + 2usize , concat ! ( + "Alignment of " , stringify ! ( nsIPresShell_PointerInfo ) + )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . + mPointerType as * const _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( + nsIPresShell_PointerInfo ) , "::" , stringify ! ( + mPointerType ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . + mActiveState as * const _ as usize } , 2usize , concat ! ( + "Alignment of field: " , stringify ! ( + nsIPresShell_PointerInfo ) , "::" , stringify ! ( + mActiveState ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . + mPrimaryState as * const _ as usize } , 3usize , concat ! + ( + "Alignment of field: " , stringify ! ( + nsIPresShell_PointerInfo ) , "::" , stringify ! ( + mPrimaryState ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell_PointerInfo ) ) . + mPreventMouseEventByContent as * const _ as usize } , + 4usize , concat ! ( + "Alignment of field: " , stringify ! ( + nsIPresShell_PointerInfo ) , "::" , stringify ! ( + mPreventMouseEventByContent ) )); + } + impl Clone for nsIPresShell_PointerInfo { + fn clone(&self) -> Self { *self } + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_PaintFlags { + PAINT_LAYERS = 1, + PAINT_COMPOSITE = 2, + PAINT_SYNC_DECODE_IMAGES = 4, + } + #[repr(u32)] + /// Ensures that the refresh driver is running, and schedules a view + /// manager flush on the next tick. + /// + /// @param aType PAINT_DELAYED_COMPRESS : Schedule a paint to be executed after a delay, and + /// put FrameLayerBuilder in 'compressed' mode that avoids short cut optimizations. + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsIPresShell_PaintType { + PAINT_DEFAULT = 0, + PAINT_DELAYED_COMPRESS = 1, + } + extern "C" { + #[link_name = "_ZN12nsIPresShell12gCaptureInfoE"] + pub static mut nsIPresShell_gCaptureInfo: root::CapturingContentInfo; + } + extern "C" { + #[link_name = "_ZN12nsIPresShell14gKeyDownTargetE"] + pub static mut nsIPresShell_gKeyDownTarget: *mut root::nsIContent; + } + #[test] + fn bindgen_test_layout_nsIPresShell() { + assert_eq!(::std::mem::size_of::<nsIPresShell>() , 5384usize , concat + ! ( "Size of: " , stringify ! ( nsIPresShell ) )); + assert_eq! (::std::mem::align_of::<nsIPresShell>() , 8usize , concat ! + ( "Alignment of " , stringify ! ( nsIPresShell ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mDocument as * + const _ as usize } , 8usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mDocument ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mPresContext as * + const _ as usize } , 16usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mPresContext ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mStyleSet as * + const _ as usize } , 24usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mStyleSet ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mFrameConstructor + as * const _ as usize } , 32usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFrameConstructor ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mViewManager as * + const _ as usize } , 40usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mViewManager ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mFrameArena as * + const _ as usize } , 48usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFrameArena ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mSelection as * + const _ as usize } , 5232usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mSelection ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mFrameManager as * + const _ as usize } , 5240usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFrameManager ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mForwardingContainer as * const _ as usize } , 5248usize , + concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mForwardingContainer ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mDocAccessible as + * const _ as usize } , 5256usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mDocAccessible ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mReflowContinueTimer as * const _ as usize } , 5264usize , + concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mReflowContinueTimer ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mPaintCount as * + const _ as usize } , 5272usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mPaintCount ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mScrollPositionClampingScrollPortSize as * const _ as + usize } , 5280usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mScrollPositionClampingScrollPortSize + ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mAutoWeakFrames as + * const _ as usize } , 5288usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mAutoWeakFrames ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mWeakFrames as * + const _ as usize } , 5296usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mWeakFrames ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mCanvasBackgroundColor as * const _ as usize } , 5336usize + , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mCanvasBackgroundColor ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mResolution as * + const _ as usize } , 5340usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mResolution ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mSelectionFlags as + * const _ as usize } , 5348usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mSelectionFlags ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mRenderFlags as * + const _ as usize } , 5350usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mRenderFlags ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mPresShellId as * + const _ as usize } , 5356usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mPresShellId ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationEmPerLine as * const _ as usize } , + 5360usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFontSizeInflationEmPerLine ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationMinTwips as * const _ as usize } , + 5364usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFontSizeInflationMinTwips ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationLineThreshold as * const _ as usize } , + 5368usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFontSizeInflationLineThreshold ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationForceEnabled as * const _ as usize } , + 5372usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFontSizeInflationForceEnabled ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationDisabledInMasterProcess as * const _ as + usize } , 5373usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( + mFontSizeInflationDisabledInMasterProcess ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationEnabled as * const _ as usize } , + 5374usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFontSizeInflationEnabled ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . + mFontSizeInflationEnabledIsDirty as * const _ as usize } , + 5375usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mFontSizeInflationEnabledIsDirty ) + )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mPaintingIsFrozen + as * const _ as usize } , 5376usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mPaintingIsFrozen ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mIsNeverPainting + as * const _ as usize } , 5377usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mIsNeverPainting ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mInFlush as * + const _ as usize } , 5378usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mInFlush ) )); } - /** - * A class that implements nsIWeakReference - */ + impl nsIPresShell { + #[inline] + pub fn mDidInitialize(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 1u64 as u16; + let val = (unit_field_val & mask) >> 0usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mDidInitialize(&mut self, val: bool) { + let mask = 1u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mIsDestroying(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 2u64 as u16; + let val = (unit_field_val & mask) >> 1usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mIsDestroying(&mut self, val: bool) { + let mask = 2u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mIsReflowing(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 4u64 as u16; + let val = (unit_field_val & mask) >> 2usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mIsReflowing(&mut self, val: bool) { + let mask = 4u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mPaintingSuppressed(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 8u64 as u16; + let val = (unit_field_val & mask) >> 3usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mPaintingSuppressed(&mut self, val: bool) { + let mask = 8u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mIsActive(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 16u64 as u16; + let val = (unit_field_val & mask) >> 4usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mIsActive(&mut self, val: bool) { + let mask = 16u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mFrozen(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 32u64 as u16; + let val = (unit_field_val & mask) >> 5usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mFrozen(&mut self, val: bool) { + let mask = 32u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mIsFirstPaint(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 64u64 as u16; + let val = (unit_field_val & mask) >> 6usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mIsFirstPaint(&mut self, val: bool) { + let mask = 64u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mObservesMutationsForPrint(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 128u64 as u16; + let val = (unit_field_val & mask) >> 7usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mObservesMutationsForPrint(&mut self, val: bool) { + let mask = 128u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mSuppressInterruptibleReflows(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 256u64 as u16; + let val = (unit_field_val & mask) >> 8usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mSuppressInterruptibleReflows(&mut self, val: bool) { + let mask = 256u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 8usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mScrollPositionClampingScrollPortSizeSet(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 512u64 as u16; + let val = (unit_field_val & mask) >> 9usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mScrollPositionClampingScrollPortSizeSet(&mut self, + val: bool) { + let mask = 512u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 9usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mNeedLayoutFlush(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 1024u64 as u16; + let val = (unit_field_val & mask) >> 10usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mNeedLayoutFlush(&mut self, val: bool) { + let mask = 1024u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 10usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mNeedStyleFlush(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 2048u64 as u16; + let val = (unit_field_val & mask) >> 11usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mNeedStyleFlush(&mut self, val: bool) { + let mask = 2048u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 11usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mObservingStyleFlushes(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 4096u64 as u16; + let val = (unit_field_val & mask) >> 12usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mObservingStyleFlushes(&mut self, val: bool) { + let mask = 4096u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 12usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mObservingLayoutFlushes(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 8192u64 as u16; + let val = (unit_field_val & mask) >> 13usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mObservingLayoutFlushes(&mut self, val: bool) { + let mask = 8192u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 13usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn mNeedThrottledAnimationFlush(&self) -> bool { + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + let mask = 16384u64 as u16; + let val = (unit_field_val & mask) >> 14usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mNeedThrottledAnimationFlush(&mut self, val: bool) { + let mask = 16384u64 as u16; + let val = val as u8 as u16; + let mut unit_field_val: u16 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u16 as *mut u8, + ::std::mem::size_of::<u16>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 14usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u16>()); + } + } + #[inline] + pub fn new_bitfield_1(mDidInitialize: bool, mIsDestroying: bool, + mIsReflowing: bool, mPaintingSuppressed: bool, + mIsActive: bool, mFrozen: bool, + mIsFirstPaint: bool, + mObservesMutationsForPrint: bool, + mSuppressInterruptibleReflows: bool, + mScrollPositionClampingScrollPortSizeSet: bool, + mNeedLayoutFlush: bool, mNeedStyleFlush: bool, + mObservingStyleFlushes: bool, + mObservingLayoutFlushes: bool, + mNeedThrottledAnimationFlush: bool) -> u16 { + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + ({ + 0 + } + | + ((mDidInitialize + as + u8 + as + u16) + << + 0usize) + & + (1u64 + as + u16)) + } + | + ((mIsDestroying + as + u8 + as + u16) + << + 1usize) + & + (2u64 + as + u16)) + } | + ((mIsReflowing + as + u8 + as + u16) + << + 2usize) + & + (4u64 + as + u16)) + } | + ((mPaintingSuppressed + as + u8 + as + u16) + << + 3usize) + & + (8u64 + as + u16)) + } | + ((mIsActive + as u8 + as + u16) + << + 4usize) + & + (16u64 + as + u16)) + } | + ((mFrozen as u8 + as u16) << + 5usize) & + (32u64 as + u16)) + } | + ((mIsFirstPaint as u8 + as u16) << + 6usize) & + (64u64 as u16)) + } | + ((mObservesMutationsForPrint + as u8 as u16) << + 7usize) & + (128u64 as u16)) + } | + ((mSuppressInterruptibleReflows + as u8 as u16) << 8usize) + & (256u64 as u16)) + } | + ((mScrollPositionClampingScrollPortSizeSet + as u8 as u16) << 9usize) & + (512u64 as u16)) + } | + ((mNeedLayoutFlush as u8 as u16) << + 10usize) & (1024u64 as u16)) + } | + ((mNeedStyleFlush as u8 as u16) << 11usize) & + (2048u64 as u16)) + } | + ((mObservingStyleFlushes as u8 as u16) << 12usize) + & (4096u64 as u16)) + } | + ((mObservingLayoutFlushes as u8 as u16) << 13usize) & + (8192u64 as u16)) + } | + ((mNeedThrottledAnimationFlush as u8 as u16) << 14usize) & + (16384u64 as u16)) + } + } + /// A class that implements nsIWeakReference #[repr(C)] #[derive(Debug)] pub struct nsNodeWeakReference { @@ -29471,57 +24543,62 @@ pub mod root { pub struct nsDOMMutationObserver { _unused: [u8; 0], } - pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_LISTENERMANAGER; - pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_PROPERTIES; - pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_ANONYMOUS_ROOT; - pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; - pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_NATIVE_ANONYMOUS_ROOT; - pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_FORCE_XBL_BINDINGS; - pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_MAY_BE_IN_BINDING_MNGR; - pub const NODE_IS_EDITABLE: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_EDITABLE; - pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_NATIVE_ANONYMOUS; - pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_IN_SHADOW_TREE; - pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_EMPTY_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_SLOW_SELECTOR; - pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_EDGE_CHILD_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; - pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_ALL_SELECTOR_FLAGS; - pub const NODE_NEEDS_FRAME: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_NEEDS_FRAME; - pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_DESCENDANTS_NEED_FRAMES; - pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_ACCESSKEY; - pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_DIRECTION_RTL; - pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_DIRECTION_LTR; - pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_ALL_DIRECTION_FLAGS; - pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_CHROME_ONLY_ACCESS; - pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; - pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_TYPE_SPECIFIC_BITS_OFFSET; + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct nsRange { + _unused: [u8; 0], + } + pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_LISTENERMANAGER; + pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_PROPERTIES; + pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_ANONYMOUS_ROOT; + pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; + pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_NATIVE_ANONYMOUS_ROOT; + pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_FORCE_XBL_BINDINGS; + pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_MAY_BE_IN_BINDING_MNGR; + pub const NODE_IS_EDITABLE: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_EDITABLE; + pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_NATIVE_ANONYMOUS; + pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_IN_SHADOW_TREE; + pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_EMPTY_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_SLOW_SELECTOR; + pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_EDGE_CHILD_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; + pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_ALL_SELECTOR_FLAGS; + pub const NODE_NEEDS_FRAME: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_NEEDS_FRAME; + pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_DESCENDANTS_NEED_FRAMES; + pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_ACCESSKEY; + pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_DIRECTION_RTL; + pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_HAS_DIRECTION_LTR; + pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_ALL_DIRECTION_FLAGS; + pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_CHROME_ONLY_ACCESS; + pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; + pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_18 = + _bindgen_ty_18::NODE_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_83 { + pub enum _bindgen_ty_18 { NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_PROPERTIES = 8, NODE_IS_ANONYMOUS_ROOT = 16, @@ -29548,16 +24625,7 @@ pub mod root { NODE_TYPE_SPECIFIC_BITS_OFFSET = 21, } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsRuleWalker { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsTextFragment { - _unused: [u8; 0], - } - #[repr(C)] + #[derive(Debug)] pub struct nsXBLBinding { pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub mMarkedForDeath: bool, @@ -29664,200 +24732,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] - pub struct nsISelectionDisplay { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsISelectionDisplay_COMTypeInfo { - pub _address: u8, - } - pub const nsISelectionDisplay_DISPLAY_TEXT: - root::nsISelectionDisplay__bindgen_ty_1 = - nsISelectionDisplay__bindgen_ty_1::DISPLAY_TEXT; - pub const nsISelectionDisplay_DISPLAY_IMAGES: - root::nsISelectionDisplay__bindgen_ty_1 = - nsISelectionDisplay__bindgen_ty_1::DISPLAY_IMAGES; - pub const nsISelectionDisplay_DISPLAY_FRAMES: - root::nsISelectionDisplay__bindgen_ty_1 = - nsISelectionDisplay__bindgen_ty_1::DISPLAY_FRAMES; - pub const nsISelectionDisplay_DISPLAY_ALL: - root::nsISelectionDisplay__bindgen_ty_1 = - nsISelectionDisplay__bindgen_ty_1::DISPLAY_ALL; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsISelectionDisplay__bindgen_ty_1 { - DISPLAY_TEXT = 1, - DISPLAY_IMAGES = 2, - DISPLAY_FRAMES = 4, - DISPLAY_ALL = 7, - } - #[test] - fn bindgen_test_layout_nsISelectionDisplay() { - assert_eq!(::std::mem::size_of::<nsISelectionDisplay>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsISelectionDisplay ) )); - assert_eq! (::std::mem::align_of::<nsISelectionDisplay>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsISelectionDisplay ) )); - } - impl Clone for nsISelectionDisplay { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsISelection { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsISelectionController { - pub _base: root::nsISelectionDisplay, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsISelectionController_COMTypeInfo { - pub _address: u8, - } - pub const nsISelectionController_SELECTION_NONE: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_NONE; - pub const nsISelectionController_SELECTION_NORMAL: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_NORMAL; - pub const nsISelectionController_SELECTION_SPELLCHECK: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_SPELLCHECK; - pub const nsISelectionController_SELECTION_IME_RAWINPUT: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_IME_RAWINPUT; - pub const nsISelectionController_SELECTION_IME_SELECTEDRAWTEXT: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_IME_SELECTEDRAWTEXT; - pub const nsISelectionController_SELECTION_IME_CONVERTEDTEXT: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_IME_CONVERTEDTEXT; - pub const nsISelectionController_SELECTION_IME_SELECTEDCONVERTEDTEXT: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_IME_SELECTEDCONVERTEDTEXT; - pub const nsISelectionController_SELECTION_ACCESSIBILITY: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_ACCESSIBILITY; - pub const nsISelectionController_SELECTION_FIND: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_FIND; - pub const nsISelectionController_SELECTION_URLSECONDARY: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_URLSECONDARY; - pub const nsISelectionController_SELECTION_URLSTRIKEOUT: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_URLSTRIKEOUT; - pub const nsISelectionController_NUM_SELECTIONTYPES: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::NUM_SELECTIONTYPES; - pub const nsISelectionController_SELECTION_ANCHOR_REGION: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_NONE; - pub const nsISelectionController_SELECTION_FOCUS_REGION: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_NORMAL; - pub const nsISelectionController_SELECTION_WHOLE_SELECTION: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_SPELLCHECK; - pub const nsISelectionController_NUM_SELECTION_REGIONS: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::NUM_SELECTION_REGIONS; - pub const nsISelectionController_SELECTION_OFF: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_NONE; - pub const nsISelectionController_SELECTION_HIDDEN: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_NORMAL; - pub const nsISelectionController_SELECTION_ON: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_SPELLCHECK; - pub const nsISelectionController_SELECTION_DISABLED: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::NUM_SELECTION_REGIONS; - pub const nsISelectionController_SELECTION_ATTENTION: - root::nsISelectionController__bindgen_ty_1 = - nsISelectionController__bindgen_ty_1::SELECTION_IME_RAWINPUT; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsISelectionController__bindgen_ty_1 { - SELECTION_NONE = 0, - SELECTION_NORMAL = 1, - SELECTION_SPELLCHECK = 2, - SELECTION_IME_RAWINPUT = 4, - SELECTION_IME_SELECTEDRAWTEXT = 8, - SELECTION_IME_CONVERTEDTEXT = 16, - SELECTION_IME_SELECTEDCONVERTEDTEXT = 32, - SELECTION_ACCESSIBILITY = 64, - SELECTION_FIND = 128, - SELECTION_URLSECONDARY = 256, - SELECTION_URLSTRIKEOUT = 512, - NUM_SELECTIONTYPES = 11, - NUM_SELECTION_REGIONS = 3, - } - pub const nsISelectionController_SCROLL_SYNCHRONOUS: - root::nsISelectionController__bindgen_ty_2 = - nsISelectionController__bindgen_ty_2::SCROLL_SYNCHRONOUS; - pub const nsISelectionController_SCROLL_FIRST_ANCESTOR_ONLY: - root::nsISelectionController__bindgen_ty_2 = - nsISelectionController__bindgen_ty_2::SCROLL_FIRST_ANCESTOR_ONLY; - pub const nsISelectionController_SCROLL_CENTER_VERTICALLY: - root::nsISelectionController__bindgen_ty_2 = - nsISelectionController__bindgen_ty_2::SCROLL_CENTER_VERTICALLY; - pub const nsISelectionController_SCROLL_OVERFLOW_HIDDEN: - root::nsISelectionController__bindgen_ty_2 = - nsISelectionController__bindgen_ty_2::SCROLL_OVERFLOW_HIDDEN; - pub const nsISelectionController_SCROLL_FOR_CARET_MOVE: - root::nsISelectionController__bindgen_ty_2 = - nsISelectionController__bindgen_ty_2::SCROLL_FOR_CARET_MOVE; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsISelectionController__bindgen_ty_2 { - SCROLL_SYNCHRONOUS = 2, - SCROLL_FIRST_ANCESTOR_ONLY = 4, - SCROLL_CENTER_VERTICALLY = 16, - SCROLL_OVERFLOW_HIDDEN = 32, - SCROLL_FOR_CARET_MOVE = 64, - } - pub const nsISelectionController_MOVE_LEFT: - root::nsISelectionController__bindgen_ty_3 = - nsISelectionController__bindgen_ty_3::MOVE_LEFT; - pub const nsISelectionController_MOVE_RIGHT: - root::nsISelectionController__bindgen_ty_3 = - nsISelectionController__bindgen_ty_3::MOVE_RIGHT; - pub const nsISelectionController_MOVE_UP: - root::nsISelectionController__bindgen_ty_3 = - nsISelectionController__bindgen_ty_3::MOVE_UP; - pub const nsISelectionController_MOVE_DOWN: - root::nsISelectionController__bindgen_ty_3 = - nsISelectionController__bindgen_ty_3::MOVE_DOWN; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsISelectionController__bindgen_ty_3 { - MOVE_LEFT = 0, - MOVE_RIGHT = 1, - MOVE_UP = 2, - MOVE_DOWN = 3, - } - #[test] - fn bindgen_test_layout_nsISelectionController() { - assert_eq!(::std::mem::size_of::<nsISelectionController>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsISelectionController ) )); - assert_eq! (::std::mem::align_of::<nsISelectionController>() , 8usize - , concat ! ( - "Alignment of " , stringify ! ( nsISelectionController ) - )); - } - impl Clone for nsISelectionController { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] pub struct nsFrameManagerBase { pub mPresShell: *mut root::nsIPresShell, pub mRootFrame: *mut root::nsIFrame, @@ -29932,14 +24806,12 @@ pub mod root { fn clone(&self) -> Self { *self } } pub type nsWeakPtr = root::nsCOMPtr; - /** - * templated hashtable class maps keys to reference pointers. - * See nsBaseHashtable for complete declaration. - * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h - * for a complete specification. - * @param PtrType the reference-type being wrapped - * @see nsDataHashtable, nsClassHashtable - */ + /// templated hashtable class maps keys to reference pointers. + /// See nsBaseHashtable for complete declaration. + /// @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h + /// for a complete specification. + /// @param PtrType the reference-type being wrapped + /// @see nsDataHashtable, nsClassHashtable #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsRefPtrHashtable { @@ -29947,14 +24819,12 @@ pub mod root { pub type nsRefPtrHashtable_KeyType = [u8; 0usize]; pub type nsRefPtrHashtable_UserDataType<PtrType> = *mut PtrType; pub type nsRefPtrHashtable_base_type = u8; - /** - * templated hashtable class maps keys to C++ object pointers. - * See nsBaseHashtable for complete declaration. - * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h - * for a complete specification. - * @param Class the class-type being wrapped - * @see nsInterfaceHashtable, nsClassHashtable - */ + /// templated hashtable class maps keys to C++ object pointers. + /// See nsBaseHashtable for complete declaration. + /// @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h + /// for a complete specification. + /// @param Class the class-type being wrapped + /// @see nsInterfaceHashtable, nsClassHashtable #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsClassHashtable { @@ -30026,11 +24896,6 @@ pub mod root { "::" , stringify ! ( mArenaRefPtrs ) )); } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsArenaMemoryStats { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct imgIRequest { pub _base: root::nsIRequest, @@ -30176,255 +25041,6 @@ pub mod root { impl Clone for imgINotificationObserver { fn clone(&self) -> Self { *self } } - pub type nsFrameState_size_t = u64; - pub const nsFrameState_NS_STATE_FLEX_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER: - root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_NS_STATE_FLEX_IS_LEGACY_WEBKIT_BOX: - root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_NS_STATE_FLEX_SYNTHESIZE_BASELINE: - root::nsFrameState = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER: - root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_NS_STATE_GRID_DID_PUSH_ITEMS: root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_NS_STATE_GRID_GENERATE_COMPUTED_VALUES: - root::nsFrameState = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_NS_STATE_GRID_SYNTHESIZE_BASELINE: - root::nsFrameState = - nsFrameState::NS_STATE_AUTO_STRETCH; - pub const nsFrameState_NS_STATE_IS_OUTER_SVG: root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_NS_STATE_SVG_CLIPPATH_CHILD: root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_NS_STATE_SVG_POSITIONING_DIRTY: root::nsFrameState - = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES: - root::nsFrameState = - nsFrameState::NS_STATE_AUTO_STRETCH; - pub const nsFrameState_NS_STATE_SVG_TEXT_IN_REFLOW: root::nsFrameState = - nsFrameState::NS_STATE_IS_ROOT; - pub const nsFrameState_TEXT_FIRST_LETTER: root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_TEXT_START_OF_LINE: root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_TEXT_END_OF_LINE: root::nsFrameState = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_TEXT_HYPHEN_BREAK: root::nsFrameState = - nsFrameState::NS_STATE_AUTO_STRETCH; - pub const nsFrameState_TEXT_TRIMMED_TRAILING_WHITESPACE: - root::nsFrameState = - nsFrameState::NS_STATE_IS_ROOT; - pub const nsFrameState_TEXT_JUSTIFICATION_ENABLED: root::nsFrameState = - nsFrameState::NS_STATE_CURRENTLY_IN_DEBUG; - pub const nsFrameState_TEXT_SELECTION_UNDERLINE_OVERFLOWED: - root::nsFrameState = - nsFrameState::NS_STATE_SET_TO_DEBUG; - pub const nsFrameState_TEXT_IS_ONLY_WHITESPACE: root::nsFrameState = - nsFrameState::NS_STATE_DEBUG_WAS_SET; - pub const nsFrameState_TEXT_ISNOT_ONLY_WHITESPACE: root::nsFrameState = - nsFrameState::NS_STATE_MENU_HAS_POPUP_LIST; - pub const nsFrameState_TEXT_IN_TEXTRUN_USER_DATA: root::nsFrameState = - nsFrameState::NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK; - pub const nsFrameState_TEXT_OFFSETS_NEED_FIXING: root::nsFrameState = - nsFrameState::NS_STATE_EQUAL_SIZE; - pub const nsFrameState_TEXT_HAS_NONCOLLAPSED_CHARACTERS: - root::nsFrameState = - nsFrameState::NS_STATE_IS_DIRECTION_NORMAL; - pub const nsFrameState_TEXT_IS_IN_TOKEN_MATHML: root::nsFrameState = - nsFrameState::NS_FRAME_IS_PUSHED_FLOAT; - pub const nsFrameState_TEXT_IN_UNINFLATED_TEXTRUN_USER_DATA: - root::nsFrameState = - nsFrameState::NS_FRAME_MOUSE_THROUGH_ALWAYS; - pub const nsFrameState_TEXT_HAS_FONT_INFLATION: root::nsFrameState = - nsFrameState::NS_FRAME_MOUSE_THROUGH_NEVER; - pub const nsFrameState_NS_BLOCK_NEEDS_BIDI_RESOLUTION: root::nsFrameState - = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_NS_BLOCK_HAS_PUSHED_FLOATS: root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_NS_BLOCK_MARGIN_ROOT: root::nsFrameState = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_NS_BLOCK_FLOAT_MGR: root::nsFrameState = - nsFrameState::NS_STATE_AUTO_STRETCH; - pub const nsFrameState_NS_BLOCK_HAS_LINE_CURSOR: root::nsFrameState = - nsFrameState::NS_STATE_IS_ROOT; - pub const nsFrameState_NS_BLOCK_HAS_OVERFLOW_LINES: root::nsFrameState = - nsFrameState::NS_STATE_CURRENTLY_IN_DEBUG; - pub const nsFrameState_NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS: - root::nsFrameState = - nsFrameState::NS_STATE_SET_TO_DEBUG; - pub const nsFrameState_NS_BLOCK_HAS_CLEAR_CHILDREN: root::nsFrameState = - nsFrameState::NS_STATE_DEBUG_WAS_SET; - pub const nsFrameState_NS_BLOCK_CLIP_PAGINATED_OVERFLOW: - root::nsFrameState = - nsFrameState::NS_STATE_MENU_HAS_POPUP_LIST; - pub const nsFrameState_NS_BLOCK_HAS_FIRST_LETTER_STYLE: root::nsFrameState - = - nsFrameState::NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK; - pub const nsFrameState_NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET: - root::nsFrameState = - nsFrameState::NS_STATE_EQUAL_SIZE; - pub const nsFrameState_NS_BLOCK_FRAME_HAS_INSIDE_BULLET: - root::nsFrameState = - nsFrameState::NS_STATE_IS_DIRECTION_NORMAL; - pub const nsFrameState_NS_BLOCK_LOOK_FOR_DIRTY_FRAMES: root::nsFrameState - = - nsFrameState::NS_FRAME_MOUSE_THROUGH_NEVER; - pub const nsFrameState_NS_BLOCK_FRAME_INTRINSICS_INFLATED: - root::nsFrameState = - nsFrameState::TEXT_NO_RENDERED_GLYPHS; - pub const nsFrameState_NS_BLOCK_HAS_FIRST_LETTER_CHILD: root::nsFrameState - = - nsFrameState::TEXT_IN_OFFSET_CACHE; - pub const nsFrameState_BULLET_FRAME_HAS_FONT_INFLATION: root::nsFrameState - = - nsFrameState::TEXT_NO_RENDERED_GLYPHS; - pub const nsFrameState_BULLET_FRAME_IMAGE_LOADING: root::nsFrameState = - nsFrameState::TEXT_IN_OFFSET_CACHE; - pub const nsFrameState_NS_SCROLLFRAME_INVALIDATE_CONTENTS_ON_SCROLL: - root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_IMAGE_SIZECONSTRAINED: root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_IMAGE_GOTINITIALREFLOW: root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET: - root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_NS_INLINE_FRAME_BIDI_VISUAL_IS_FIRST: - root::nsFrameState = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_NS_INLINE_FRAME_BIDI_VISUAL_IS_LAST: - root::nsFrameState = - nsFrameState::NS_STATE_AUTO_STRETCH; - pub const nsFrameState_NS_RUBY_TEXT_FRAME_AUTOHIDE: root::nsFrameState = - nsFrameState::NS_STATE_IS_ROOT; - pub const nsFrameState_NS_RUBY_TEXT_CONTAINER_IS_SPAN: root::nsFrameState - = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_PLACEHOLDER_FOR_FLOAT: root::nsFrameState = - nsFrameState::NS_STATE_BOX_CHILD_RESERVED; - pub const nsFrameState_PLACEHOLDER_FOR_ABSPOS: root::nsFrameState = - nsFrameState::NS_STATE_STACK_NOT_POSITIONED; - pub const nsFrameState_PLACEHOLDER_FOR_FIXEDPOS: root::nsFrameState = - nsFrameState::NS_STATE_IS_HORIZONTAL; - pub const nsFrameState_PLACEHOLDER_FOR_POPUP: root::nsFrameState = - nsFrameState::NS_STATE_AUTO_STRETCH; - pub const nsFrameState_PLACEHOLDER_FOR_TOPLAYER: root::nsFrameState = - nsFrameState::NS_STATE_IS_ROOT; - pub const nsFrameState_PLACEHOLDER_STATICPOS_NEEDS_CSSALIGN: - root::nsFrameState = - nsFrameState::NS_STATE_CURRENTLY_IN_DEBUG; - pub const nsFrameState_PLACEHOLDER_LINE_IS_EMPTY_SO_FAR: - root::nsFrameState = - nsFrameState::NS_STATE_SET_TO_DEBUG; - pub const nsFrameState_PLACEHOLDER_HAVE_LINE_IS_EMPTY_SO_FAR: - root::nsFrameState = - nsFrameState::NS_STATE_DEBUG_WAS_SET; - pub const nsFrameState_NS_TABLE_CELL_HAS_PCT_OVER_BSIZE: - root::nsFrameState = - nsFrameState::NS_STATE_MENU_HAS_POPUP_LIST; - pub const nsFrameState_NS_TABLE_CELL_HAD_SPECIAL_REFLOW: - root::nsFrameState = - nsFrameState::NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK; - pub const nsFrameState_NS_TABLE_CELL_CONTENT_EMPTY: root::nsFrameState = - nsFrameState::NS_STATE_IS_DIRECTION_NORMAL; - pub const nsFrameState_NS_REPEATED_ROW_OR_ROWGROUP: root::nsFrameState = - nsFrameState::NS_STATE_MENU_HAS_POPUP_LIST; - pub const nsFrameState_NS_ROW_HAS_CELL_WITH_STYLE_BSIZE: - root::nsFrameState = - nsFrameState::NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK; - pub const nsFrameState_NS_TABLE_ROW_HAS_UNPAGINATED_BSIZE: - root::nsFrameState = - nsFrameState::NS_STATE_EQUAL_SIZE; - pub const nsFrameState_NS_ROWGROUP_HAS_ROW_CURSOR: root::nsFrameState = - nsFrameState::NS_STATE_DEBUG_WAS_SET; - pub const nsFrameState_NS_ROWGROUP_HAS_STYLE_BSIZE: root::nsFrameState = - nsFrameState::NS_STATE_EQUAL_SIZE; - pub const nsFrameState_NS_ROWGROUP_REPEATABLE: root::nsFrameState = - nsFrameState::NS_STATE_IS_DIRECTION_NORMAL; - pub const nsFrameState_NS_TABLE_PART_HAS_FIXED_BACKGROUND: - root::nsFrameState = - nsFrameState::NS_STATE_MENU_HAS_POPUP_LIST; - #[repr(u64)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsFrameState { - NS_FRAME_IN_REFLOW = 1, - NS_FRAME_FIRST_REFLOW = 2, - NS_FRAME_IS_FLUID_CONTINUATION = 4, - NS_FRAME_ANONYMOUSCONTENTCREATOR_CONTENT = 8, - NS_FRAME_EXTERNAL_REFERENCE = 16, - NS_FRAME_CONTAINS_RELATIVE_BSIZE = 32, - NS_FRAME_GENERATED_CONTENT = 64, - NS_FRAME_IS_OVERFLOW_CONTAINER = 128, - NS_FRAME_OUT_OF_FLOW = 256, - NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN = 512, - NS_FRAME_IS_DIRTY = 1024, - NS_FRAME_TOO_DEEP_IN_FRAME_TREE = 2048, - NS_FRAME_HAS_DIRTY_CHILDREN = 4096, - NS_FRAME_HAS_VIEW = 8192, - NS_FRAME_INDEPENDENT_SELECTION = 16384, - NS_FRAME_PART_OF_IBSPLIT = 32768, - NS_FRAME_MAY_BE_TRANSFORMED = 65536, - NS_FRAME_IS_BIDI = 131072, - NS_FRAME_HAS_CHILD_WITH_VIEW = 262144, - NS_FRAME_REFLOW_ROOT = 524288, - NS_FRAME_IS_PUSHED_FLOAT = 4294967296, - NS_FRAME_DRAWING_AS_PAINTSERVER = 8589934592, - NS_FRAME_DESCENDANT_INTRINSIC_ISIZE_DEPENDS_ON_BSIZE = 17179869184, - NS_FRAME_SIMPLE_EVENT_REGIONS = 34359738368, - NS_FRAME_UPDATE_LAYER_TREE = 68719476736, - NS_FRAME_HAS_ABSPOS_CHILDREN = 137438953472, - NS_FRAME_PAINTED_THEBES = 274877906944, - NS_FRAME_IN_CONSTRAINED_BSIZE = 549755813888, - NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO = 1099511627776, - NS_FRAME_FONT_INFLATION_CONTAINER = 2199023255552, - NS_FRAME_FONT_INFLATION_FLOW_ROOT = 4398046511104, - NS_FRAME_SVG_LAYOUT = 8796093022208, - NS_FRAME_MAY_HAVE_GENERATED_CONTENT = 17592186044416, - NS_FRAME_NO_COMPONENT_ALPHA = 35184372088832, - NS_FRAME_VISIBILITY_IS_TRACKED = 70368744177664, - NS_FRAME_IS_SVG_TEXT = 140737488355328, - NS_FRAME_NEEDS_PAINT = 281474976710656, - NS_FRAME_DESCENDANT_NEEDS_PAINT = 562949953421312, - NS_FRAME_IN_POPUP = 1125899906842624, - NS_FRAME_ALL_DESCENDANTS_NEED_PAINT = 2251799813685248, - NS_FRAME_HAS_INVALID_RECT = 4503599627370496, - NS_FRAME_IS_NONDISPLAY = 9007199254740992, - NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY = 18014398509481984, - NS_FRAME_OWNS_ANON_BOXES = 36028797018963968, - NS_FRAME_HAS_CSS_COUNTER_STYLE = 72057594037927936, - NS_FRAME_SIMPLE_DISPLAYLIST = 144115188075855872, - NS_FRAME_MATHML_SCRIPT_DESCENDANT = 288230376151711744, - NS_FRAME_IS_IN_SINGLE_CHAR_MI = 576460752303423488, - NS_STATE_BOX_CHILD_RESERVED = 1048576, - NS_STATE_STACK_NOT_POSITIONED = 2097152, - NS_STATE_IS_HORIZONTAL = 4194304, - NS_STATE_AUTO_STRETCH = 8388608, - NS_STATE_IS_ROOT = 16777216, - NS_STATE_CURRENTLY_IN_DEBUG = 33554432, - NS_STATE_SET_TO_DEBUG = 67108864, - NS_STATE_DEBUG_WAS_SET = 134217728, - NS_STATE_MENU_HAS_POPUP_LIST = 268435456, - NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK = 536870912, - NS_STATE_EQUAL_SIZE = 1073741824, - NS_STATE_IS_DIRECTION_NORMAL = 2147483648, - NS_FRAME_MOUSE_THROUGH_ALWAYS = 1152921504606846976, - NS_FRAME_MOUSE_THROUGH_NEVER = 2305843009213693952, - TEXT_NO_RENDERED_GLYPHS = 4611686018427387904, - TEXT_IN_OFFSET_CACHE = 9223372036854775808, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct gfxContext { - _unused: [u8; 0], - } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsDocShell { @@ -30437,41 +25053,11 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsView { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIPageSequenceFrame { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsCanvasFrame { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsCaret { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsFrameSelection { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsILayoutHistoryState { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIReflowCallback { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsCSSFrameConstructor { _unused: [u8; 0], } @@ -30485,151 +25071,17 @@ pub mod root { pub struct WeakFrame { _unused: [u8; 0], } - /** - * Interface for frames that are scrollable. This interface exposes - * APIs for examining scroll state, observing changes to scroll state, - * and triggering scrolling. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIScrollableFrame { - pub _base: root::nsIScrollbarMediator, - } - pub type nsIScrollableFrame_CSSIntPoint = root::mozilla::CSSIntPoint; - pub type nsIScrollableFrame_ContainerLayerParameters = - root::mozilla::ContainerLayerParameters; - pub type nsIScrollableFrame_FrameMetrics = - root::mozilla::layers::FrameMetrics; - pub type nsIScrollableFrame_ScrollSnapInfo = - root::mozilla::layers::ScrollSnapInfo; - pub type nsIScrollableFrame_Has_NS_DECL_QUERYFRAME_TARGET = - root::nsIScrollableFrame; - pub const nsIScrollableFrame_HORIZONTAL: - root::nsIScrollableFrame__bindgen_ty_1 = - nsIScrollableFrame__bindgen_ty_1::HORIZONTAL; - pub const nsIScrollableFrame_VERTICAL: - root::nsIScrollableFrame__bindgen_ty_1 = - nsIScrollableFrame__bindgen_ty_1::VERTICAL; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIScrollableFrame__bindgen_ty_1 { - HORIZONTAL = 1, - VERTICAL = 2, - } - #[repr(u32)] - /** - * When a scroll operation is requested, we ask for instant, smooth, - * smooth msd, or normal scrolling. - * - * SMOOTH scrolls have a symmetrical acceleration and deceleration curve - * modeled with a set of splines that guarantee that the destination will be - * reached over a fixed time interval. SMOOTH will only be smooth if smooth - * scrolling is actually enabled. This behavior is utilized by keyboard and - * mouse wheel scrolling events. - * - * SMOOTH_MSD implements a physically based model that approximates the - * behavior of a mass-spring-damper system. SMOOTH_MSD scrolls have a - * non-symmetrical acceleration and deceleration curve, can potentially - * overshoot the destination on intermediate frames, and complete over a - * variable time interval. SMOOTH_MSD will only be smooth if cssom-view - * smooth-scrolling is enabled. - * - * INSTANT is always synchronous, NORMAL can be asynchronous. - * - * If an INSTANT scroll request happens while a SMOOTH or async scroll is - * already in progress, the async scroll is interrupted and we instantly - * scroll to the destination. - * - * If an INSTANT or SMOOTH scroll request happens while a SMOOTH_MSD scroll - * is already in progress, the SMOOTH_MSD scroll is interrupted without - * first scrolling to the destination. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIScrollableFrame_ScrollMode { - INSTANT = 0, - SMOOTH = 1, - SMOOTH_MSD = 2, - NORMAL = 3, - } - #[repr(u32)] - /** - * Some platforms (OSX) may generate additional scrolling events even - * after the user has stopped scrolling, simulating a momentum scrolling - * effect resulting from fling gestures. - * SYNTHESIZED_MOMENTUM_EVENT indicates that the scrolling is being requested - * by such a synthesized event and may be ignored if another scroll has - * been started since the last actual user input. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIScrollableFrame_ScrollMomentum { - NOT_MOMENTUM = 0, - SYNTHESIZED_MOMENTUM_EVENT = 1, - } - #[repr(u32)] - /** - * When scrolling by a relative amount, we can choose various units. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIScrollableFrame_ScrollUnit { - DEVICE_PIXELS = 0, - LINES = 1, - PAGES = 2, - WHOLE = 3, - } - extern "C" { - #[link_name = "_ZN18nsIScrollableFrame9kFrameIIDE"] - pub static nsIScrollableFrame_kFrameIID: root::nsQueryFrame_FrameIID; - } - #[test] - fn bindgen_test_layout_nsIScrollableFrame() { - assert_eq!(::std::mem::size_of::<nsIScrollableFrame>() , 8usize , - concat ! ( "Size of: " , stringify ! ( nsIScrollableFrame ) - )); - assert_eq! (::std::mem::align_of::<nsIScrollableFrame>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIScrollableFrame ) )); - } - impl Clone for nsIScrollableFrame { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsDisplayList { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsDisplayListBuilder { - _unused: [u8; 0], - } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsRefreshDriver { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsARefreshObserver { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsAPostRefreshObserver { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsAccessibilityService { - _unused: [u8; 0], - } - /** - * The signature of the timer callback function passed to initWithFuncCallback. - * This is the function that will get called when the timer expires if the - * timer is initialized via initWithFuncCallback. - * - * @param aTimer the timer which has expired - * @param aClosure opaque parameter passed to initWithFuncCallback - */ + /// The signature of the timer callback function passed to initWithFuncCallback. + /// This is the function that will get called when the timer expires if the + /// timer is initialized via initWithFuncCallback. + /// + /// @param aTimer the timer which has expired + /// @param aClosure opaque parameter passed to initWithFuncCallback #[repr(C)] #[derive(Debug, Copy)] pub struct nsITimer { @@ -30676,6 +25128,7 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug)] pub struct CapturingContentInfo { pub mAllowed: bool, pub mPointerLock: bool, @@ -30723,15 +25176,6 @@ pub mod root { CapturingContentInfo ) , "::" , stringify ! ( mContent ) )); } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsRectVisibility { - nsRectVisibility_kVisible = 0, - nsRectVisibility_kAboveViewport = 1, - nsRectVisibility_kBelowViewport = 2, - nsRectVisibility_kLeftOfViewport = 3, - nsRectVisibility_kRightOfViewport = 4, - } #[repr(C)] #[derive(Debug, Copy)] pub struct nsIObserver { @@ -30794,78 +25238,12 @@ pub mod root { impl Clone for nsIEventTarget { fn clone(&self) -> Self { *self } } - pub type nsTimerCallbackFunc = - ::std::option::Option<unsafe extern "C" fn(aTimer: - *mut root::nsITimer, - aClosure: - *mut ::std::os::raw::c_void)>; - /** - * The signature of the timer name callback function passed to - * initWithNameableFuncCallback. - * This is the function that will get called when timer profiling is enabled - * via the "TimerFirings" log module. - * - * @param aTimer the timer which has expired - * @param aAnonymize whether the name should avoid including privacy sensitive info - * @param aClosure opaque parameter passed to initWithFuncCallback - * @param aBuf a buffer in which to put the name - * @param aLen the length of the buffer - */ - pub type nsTimerNameCallbackFunc = - ::std::option::Option<unsafe extern "C" fn(aTimer: - *mut root::nsITimer, - aAnonymize: bool, - aClosure: - *mut ::std::os::raw::c_void, - aBuf: - *mut ::std::os::raw::c_char, - aLen: usize)>; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsITimerCallback { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsITimerCallback_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsITimerCallback() { - assert_eq!(::std::mem::size_of::<nsITimerCallback>() , 8usize , concat - ! ( "Size of: " , stringify ! ( nsITimerCallback ) )); - assert_eq! (::std::mem::align_of::<nsITimerCallback>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsITimerCallback ) )); - } - impl Clone for nsITimerCallback { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIWidget { - _unused: [u8; 0], - } - #[repr(u32)] - /** - * sizemode is an adjunct to widget size - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsSizeMode { - nsSizeMode_Normal = 0, - nsSizeMode_Minimized = 1, - nsSizeMode_Maximized = 2, - nsSizeMode_Fullscreen = 3, - nsSizeMode_Invalid = 4, - } - /** - * templated hashtable class maps keys to interface pointers. - * See nsBaseHashtable for complete declaration. - * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h - * for a complete specification. - * @param Interface the interface-type being wrapped - * @see nsDataHashtable, nsClassHashtable - */ + /// templated hashtable class maps keys to interface pointers. + /// See nsBaseHashtable for complete declaration. + /// @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h + /// for a complete specification. + /// @param Interface the interface-type being wrapped + /// @see nsDataHashtable, nsClassHashtable #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsInterfaceHashtable { @@ -30904,11 +25282,6 @@ pub mod root { nsLanguageAtomService ) , "::" , stringify ! ( mLocaleLanguage ) )); } - /** - * Currently needs to be 'double' for Cairo compatibility. Could - * become 'float', perhaps, in some configurations. - */ - pub type gfxFloat = f64; #[repr(C)] #[derive(Debug, Copy)] pub struct nsINamed { @@ -30949,34 +25322,16 @@ pub mod root { impl Clone for nsIRunnable { fn clone(&self) -> Self { *self } } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsISerialEventTarget { - pub _base: root::nsIEventTarget, - } + pub type nsRunnableMethod_BaseType = u8; #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsISerialEventTarget_COMTypeInfo { + pub struct nsRunnableMethod_ReturnTypeEnforcer { pub _address: u8, } - #[test] - fn bindgen_test_layout_nsISerialEventTarget() { - assert_eq!(::std::mem::size_of::<nsISerialEventTarget>() , 16usize , - concat ! ( - "Size of: " , stringify ! ( nsISerialEventTarget ) )); - assert_eq! (::std::mem::align_of::<nsISerialEventTarget>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsISerialEventTarget ) )); - } - impl Clone for nsISerialEventTarget { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug)] - pub struct nsRevocableEventPtr<T> { - pub mEvent: root::RefPtr<T>, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - } + pub type nsRunnableMethod_ReturnTypeEnforcer_ReturnTypeIsSafe = + ::std::os::raw::c_int; + pub type nsRunnableMethod_check = + root::nsRunnableMethod_ReturnTypeEnforcer; #[repr(C)] #[derive(Debug)] pub struct nsPIDOMWindowInner { @@ -30996,17 +25351,10 @@ pub mod root { concat ! ( "Alignment of " , stringify ! ( nsPIDOMWindowInner ) )); } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsGlobalWindow { - _unused: [u8; 0], - } - /** - * The global object which keeps a script context for each supported script - * language. This often used to store per-window global state. - * This is a heavyweight interface implemented only by DOM globals, and - * it might go away some time in the future. - */ + /// The global object which keeps a script context for each supported script + /// language. This often used to store per-window global state. + /// This is a heavyweight interface implemented only by DOM globals, and + /// it might go away some time in the future. #[repr(C)] #[derive(Debug)] pub struct nsIScriptGlobalObject { @@ -31028,11 +25376,6 @@ pub mod root { )); } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIInterfaceInfo { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIXPConnectJSObjectHolder { pub _base: root::nsISupports, @@ -31081,11 +25424,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsISimpleEnumerator { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsIControllers { _unused: [u8; 0], } @@ -31110,28 +25448,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy)] - pub struct mozIDOMWindowProxy { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct mozIDOMWindowProxy_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_mozIDOMWindowProxy() { - assert_eq!(::std::mem::size_of::<mozIDOMWindowProxy>() , 8usize , - concat ! ( "Size of: " , stringify ! ( mozIDOMWindowProxy ) - )); - assert_eq! (::std::mem::align_of::<mozIDOMWindowProxy>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( mozIDOMWindowProxy ) )); - } - impl Clone for mozIDOMWindowProxy { - fn clone(&self) -> Self { *self } - } - #[repr(C)] #[derive(Debug)] pub struct nsICSSDeclaration { pub _base: root::nsIDOMCSSStyleDeclaration, @@ -31151,15 +25467,6 @@ pub mod root { concat ! ( "Alignment of " , stringify ! ( nsICSSDeclaration ) )); } - pub type SuspendTypes = u32; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum UIStateChangeType { - UIStateChangeType_NoChange = 0, - UIStateChangeType_Set = 1, - UIStateChangeType_Clear = 2, - UIStateChangeType_Invalid = 3, - } #[repr(C)] pub struct nsPIDOMWindow__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] @@ -31225,160 +25532,6 @@ pub mod root { eCompatibility_AlmostStandards = 2, eCompatibility_NavQuirks = 3, } - /** - * Information details about a characterdata change. Basically, we - * view all changes as replacements of a length of text at some offset - * with some other text (of possibly some other length). - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct CharacterDataChangeInfo { - /** - * True if this character data change is just an append. - */ - pub mAppend: bool, - /** - * The offset in the text where the change occurred. - */ - pub mChangeStart: u32, - /** - * The offset such that mChangeEnd - mChangeStart is equal to the length of - * the text we removed. If this was a pure insert or append, this is equal to - * mChangeStart. - */ - pub mChangeEnd: u32, - /** - * The length of the text that was inserted in place of the removed text. If - * this was a pure text removal, this is 0. - */ - pub mReplaceLength: u32, - /** - * Used for splitText() and normalize(), otherwise null. - */ - pub mDetails: *mut root::CharacterDataChangeInfo_Details, - } - /** - * The net result is that mChangeStart characters at the beginning of the - * text remained as they were. The next mChangeEnd - mChangeStart characters - * were removed, and mReplaceLength characters were inserted in their place. - * The text that used to begin at mChangeEnd now begins at - * mChangeStart + mReplaceLength. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct CharacterDataChangeInfo_Details { - pub mType: root::CharacterDataChangeInfo_Details__bindgen_ty_1, - /** - * For eMerge it's the text node that will be removed, for eSplit it's the - * new text node. - */ - pub mNextSibling: *mut root::nsIContent, - } - pub const CharacterDataChangeInfo_Details_eMerge: - root::CharacterDataChangeInfo_Details__bindgen_ty_1 = - CharacterDataChangeInfo_Details__bindgen_ty_1::eMerge; - pub const CharacterDataChangeInfo_Details_eSplit: - root::CharacterDataChangeInfo_Details__bindgen_ty_1 = - CharacterDataChangeInfo_Details__bindgen_ty_1::eSplit; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum CharacterDataChangeInfo_Details__bindgen_ty_1 { - eMerge = 0, - eSplit = 1, - } - #[test] - fn bindgen_test_layout_CharacterDataChangeInfo_Details() { - assert_eq!(::std::mem::size_of::<CharacterDataChangeInfo_Details>() , - 16usize , concat ! ( - "Size of: " , stringify ! ( CharacterDataChangeInfo_Details - ) )); - assert_eq! (::std::mem::align_of::<CharacterDataChangeInfo_Details>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - CharacterDataChangeInfo_Details ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo_Details ) ) . - mType as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo_Details ) , "::" , stringify ! ( - mType ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo_Details ) ) . - mNextSibling as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo_Details ) , "::" , stringify ! ( - mNextSibling ) )); - } - impl Clone for CharacterDataChangeInfo_Details { - fn clone(&self) -> Self { *self } - } - #[test] - fn bindgen_test_layout_CharacterDataChangeInfo() { - assert_eq!(::std::mem::size_of::<CharacterDataChangeInfo>() , 24usize - , concat ! ( - "Size of: " , stringify ! ( CharacterDataChangeInfo ) )); - assert_eq! (::std::mem::align_of::<CharacterDataChangeInfo>() , 8usize - , concat ! ( - "Alignment of " , stringify ! ( CharacterDataChangeInfo ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo ) ) . mAppend - as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo ) , "::" , stringify ! ( mAppend ) - )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo ) ) . - mChangeStart as * const _ as usize } , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo ) , "::" , stringify ! ( - mChangeStart ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo ) ) . - mChangeEnd as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo ) , "::" , stringify ! ( - mChangeEnd ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo ) ) . - mReplaceLength as * const _ as usize } , 12usize , concat - ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo ) , "::" , stringify ! ( - mReplaceLength ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const CharacterDataChangeInfo ) ) . - mDetails as * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( - CharacterDataChangeInfo ) , "::" , stringify ! ( mDetails - ) )); - } - impl Clone for CharacterDataChangeInfo { - fn clone(&self) -> Self { *self } - } - pub type nsUpdateType = u32; - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIDocumentObserver { - pub _base: root::nsIMutationObserver, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDocumentObserver_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIDocumentObserver() { - assert_eq!(::std::mem::size_of::<nsIDocumentObserver>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsIDocumentObserver ) )); - assert_eq! (::std::mem::align_of::<nsIDocumentObserver>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIDocumentObserver ) )); - } - impl Clone for nsIDocumentObserver { - fn clone(&self) -> Self { *self } - } #[repr(C)] #[derive(Debug, Copy)] pub struct nsIRequestObserver { @@ -31401,132 +25554,7 @@ pub mod root { impl Clone for nsIRequestObserver { fn clone(&self) -> Self { *self } } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsScanner { - _unused: [u8; 0], - } - /*************************************************************** - Notes: - ***************************************************************/ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsITokenizer { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsITokenizer_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsITokenizer() { - assert_eq!(::std::mem::size_of::<nsITokenizer>() , 8usize , concat ! ( - "Size of: " , stringify ! ( nsITokenizer ) )); - assert_eq! (::std::mem::align_of::<nsITokenizer>() , 8usize , concat ! - ( "Alignment of " , stringify ! ( nsITokenizer ) )); - } - impl Clone for nsITokenizer { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsDTDMode { - eDTDMode_unknown = 0, - eDTDMode_quirks = 1, - eDTDMode_almost_standards = 2, - eDTDMode_full_standards = 3, - eDTDMode_autodetect = 4, - eDTDMode_fragment = 5, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIContentSink { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct CParserContext { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIDTD { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDTD_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIDTD() { - assert_eq!(::std::mem::size_of::<nsIDTD>() , 8usize , concat ! ( - "Size of: " , stringify ! ( nsIDTD ) )); - assert_eq! (::std::mem::align_of::<nsIDTD>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( nsIDTD ) )); - } - impl Clone for nsIDTD { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsParserBase { - pub _base: root::nsISupports, - } - #[test] - fn bindgen_test_layout_nsParserBase() { - assert_eq!(::std::mem::size_of::<nsParserBase>() , 8usize , concat ! ( - "Size of: " , stringify ! ( nsParserBase ) )); - assert_eq! (::std::mem::align_of::<nsParserBase>() , 8usize , concat ! - ( "Alignment of " , stringify ! ( nsParserBase ) )); - } - impl Clone for nsParserBase { - fn clone(&self) -> Self { *self } - } - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum eParserCommands { - eViewNormal = 0, - eViewSource = 1, - eViewFragment = 2, - eViewErrors = 3, - } - /** - * This GECKO-INTERNAL interface is on track to being REMOVED (or refactored - * to the point of being near-unrecognizable). - * - * Please DO NOT #include this file in comm-central code, in your XULRunner - * app or binary extensions. - * - * Please DO NOT #include this into new files even inside Gecko. It is more - * likely than not that #including this header is the wrong thing to do. - */ - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIParser { - pub _base: root::nsParserBase, - } - pub type nsIParser_Encoding = root::mozilla::Encoding; - pub type nsIParser_NotNull<T> = root::mozilla::NotNull<T>; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIParser_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIParser() { - assert_eq!(::std::mem::size_of::<nsIParser>() , 8usize , concat ! ( - "Size of: " , stringify ! ( nsIParser ) )); - assert_eq! (::std::mem::align_of::<nsIParser>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( nsIParser ) )); - } - impl Clone for nsIParser { - fn clone(&self) -> Self { *self } - } - /** - * Hashtable key class to use with nsTHashtable/nsBaseHashtable - */ + /// Hashtable key class to use with nsTHashtable/nsBaseHashtable #[repr(C)] #[derive(Debug)] pub struct nsURIHashKey { @@ -31557,11 +25585,9 @@ pub mod root { pub struct nsContentList { _unused: [u8; 0], } - /** - * Data used to track the expiration state of an object. We promise that this - * is 32 bits so that objects that includes this as a field can pad and align - * efficiently. - */ + /// Data used to track the expiration state of an object. We promise that this + /// is 32 bits so that objects that includes this as a field can pad and align + /// efficiently. #[repr(C)] #[derive(Debug, Copy)] pub struct nsExpirationState { @@ -31683,21 +25709,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct gfxUserFontSet { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsDOMNavigationTiming { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsFrameLoader { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsHTMLCSSStyleSheet { _unused: [u8; 0], } @@ -31716,14 +25727,7 @@ pub mod root { pub struct nsIDocumentEncoder { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIDOMNodeFilter { - _unused: [u8; 0], - } - /** - * An internal interface - */ + /// An internal interface #[repr(C)] #[derive(Debug, Copy)] pub struct nsIHTMLCollection { @@ -31758,39 +25762,9 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsRange { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsSMILAnimationController { _unused: [u8; 0], } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsSVGElement { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsTextNode { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsWindowSizes { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsDOMCaretPosition { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsViewportInfo { - _unused: [u8; 0], - } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum HSTSPrimingState { @@ -31842,9 +25816,7 @@ pub mod root { pub struct nsITheme { _unused: [u8; 0], } - /** - * Interface used for handling clicks on links - */ + /// Interface used for handling clicks on links #[repr(C)] #[derive(Debug, Copy)] pub struct nsILinkHandler { @@ -31867,11 +25839,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct gfxUserFontEntry { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct gfxTextPerfMetrics { _unused: [u8; 0], } @@ -31897,118 +25864,6 @@ pub mod root { } pub const kPresContext_DefaultVariableFont_ID: u8 = 0; pub const kPresContext_DefaultFixedFont_ID: u8 = 1; - #[repr(C)] - pub struct nsRootPresContext { - pub _base: root::nsPresContext, - pub mNotifyDidPaintTimers: [u64; 10usize], - pub mApplyPluginGeometryTimer: root::nsCOMPtr, - pub mRegisteredPlugins: [u64; 5usize], - pub mWillPaintObservers: root::nsTArray<root::nsCOMPtr>, - pub mWillPaintFallbackEvent: root::nsRevocableEventPtr<root::nsRootPresContext_RunWillPaintObservers>, - pub mDOMGeneration: u32, - } - #[repr(C)] - #[derive(Debug)] - pub struct nsRootPresContext_RunWillPaintObservers { - pub _base: root::mozilla::Runnable, - pub mPresContext: *mut root::nsRootPresContext, - } - #[test] - fn bindgen_test_layout_nsRootPresContext_RunWillPaintObservers() { - assert_eq!(::std::mem::size_of::<nsRootPresContext_RunWillPaintObservers>() - , 40usize , concat ! ( - "Size of: " , stringify ! ( - nsRootPresContext_RunWillPaintObservers ) )); - assert_eq! (::std::mem::align_of::<nsRootPresContext_RunWillPaintObservers>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsRootPresContext_RunWillPaintObservers ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const nsRootPresContext_RunWillPaintObservers ) - ) . mPresContext as * const _ as usize } , 32usize , - concat ! ( - "Alignment of field: " , stringify ! ( - nsRootPresContext_RunWillPaintObservers ) , "::" , - stringify ! ( mPresContext ) )); - } - #[repr(C)] - #[derive(Debug)] - pub struct nsRootPresContext_NotifyDidPaintTimer { - pub mTransactionId: u64, - pub mTimer: root::nsCOMPtr, - } - #[test] - fn bindgen_test_layout_nsRootPresContext_NotifyDidPaintTimer() { - assert_eq!(::std::mem::size_of::<nsRootPresContext_NotifyDidPaintTimer>() - , 16usize , concat ! ( - "Size of: " , stringify ! ( - nsRootPresContext_NotifyDidPaintTimer ) )); - assert_eq! (::std::mem::align_of::<nsRootPresContext_NotifyDidPaintTimer>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsRootPresContext_NotifyDidPaintTimer ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const nsRootPresContext_NotifyDidPaintTimer ) ) - . mTransactionId as * const _ as usize } , 0usize , concat - ! ( - "Alignment of field: " , stringify ! ( - nsRootPresContext_NotifyDidPaintTimer ) , "::" , stringify - ! ( mTransactionId ) )); - assert_eq! (unsafe { - & ( - * ( 0 as * const nsRootPresContext_NotifyDidPaintTimer ) ) - . mTimer as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsRootPresContext_NotifyDidPaintTimer ) , "::" , stringify - ! ( mTimer ) )); - } - #[test] - fn bindgen_test_layout_nsRootPresContext() { - assert_eq!(::std::mem::size_of::<nsRootPresContext>() , 1456usize , - concat ! ( "Size of: " , stringify ! ( nsRootPresContext ) - )); - assert_eq! (::std::mem::align_of::<nsRootPresContext>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsRootPresContext ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRootPresContext ) ) . - mNotifyDidPaintTimers as * const _ as usize } , 1304usize - , concat ! ( - "Alignment of field: " , stringify ! ( nsRootPresContext ) - , "::" , stringify ! ( mNotifyDidPaintTimers ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRootPresContext ) ) . - mApplyPluginGeometryTimer as * const _ as usize } , - 1384usize , concat ! ( - "Alignment of field: " , stringify ! ( nsRootPresContext ) - , "::" , stringify ! ( mApplyPluginGeometryTimer ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRootPresContext ) ) . - mRegisteredPlugins as * const _ as usize } , 1392usize , - concat ! ( - "Alignment of field: " , stringify ! ( nsRootPresContext ) - , "::" , stringify ! ( mRegisteredPlugins ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRootPresContext ) ) . - mWillPaintObservers as * const _ as usize } , 1432usize , - concat ! ( - "Alignment of field: " , stringify ! ( nsRootPresContext ) - , "::" , stringify ! ( mWillPaintObservers ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRootPresContext ) ) . - mWillPaintFallbackEvent as * const _ as usize } , - 1440usize , concat ! ( - "Alignment of field: " , stringify ! ( nsRootPresContext ) - , "::" , stringify ! ( mWillPaintFallbackEvent ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsRootPresContext ) ) . - mDOMGeneration as * const _ as usize } , 1448usize , - concat ! ( - "Alignment of field: " , stringify ! ( nsRootPresContext ) - , "::" , stringify ! ( mDOMGeneration ) )); - } #[repr(i16)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsCSSKeyword { @@ -33286,21 +27141,6 @@ pub mod root { } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsCSSFontDesc { - eCSSFontDesc_UNKNOWN = -1, - eCSSFontDesc_Family = 0, - eCSSFontDesc_Style = 1, - eCSSFontDesc_Weight = 2, - eCSSFontDesc_Stretch = 3, - eCSSFontDesc_Src = 4, - eCSSFontDesc_UnicodeRange = 5, - eCSSFontDesc_FontFeatureSettings = 6, - eCSSFontDesc_FontLanguageOverride = 7, - eCSSFontDesc_Display = 8, - eCSSFontDesc_COUNT = 9, - } - #[repr(i32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsCSSCounterDesc { eCSSCounterDesc_UNKNOWN = -1, eCSSCounterDesc_System = 0, @@ -33359,30 +27199,8 @@ pub mod root { eStyleStruct_Effects = 23, nsStyleStructID_Length = 24, } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIProperties { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIProperties_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIProperties() { - assert_eq!(::std::mem::size_of::<nsIProperties>() , 8usize , concat ! - ( "Size of: " , stringify ! ( nsIProperties ) )); - assert_eq! (::std::mem::align_of::<nsIProperties>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( nsIProperties ) )); - } - impl Clone for nsIProperties { - fn clone(&self) -> Self { *self } - } #[repr(u32)] - /** - * Types of animatable values. - */ + /// Types of animatable values. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsStyleAnimType { eStyleAnimType_Custom = 0, @@ -34405,44 +28223,42 @@ pub mod root { impl Clone for nsCSSProps { fn clone(&self) -> Self { *self } } - /** - * Class to safely handle main-thread-only pointers off the main thread. - * - * Classes like XPCWrappedJS are main-thread-only, which means that it is - * forbidden to call methods on instances of these classes off the main thread. - * For various reasons (see bug 771074), this restriction recently began to - * apply to AddRef/Release as well. - * - * This presents a problem for consumers that wish to hold a callback alive - * on non-main-thread code. A common example of this is the proxy callback - * pattern, where non-main-thread code holds a strong-reference to the callback - * object, and dispatches new Runnables (also with a strong reference) to the - * main thread in order to execute the callback. This involves several AddRef - * and Release calls on the other thread, which is (now) verboten. - * - * The basic idea of this class is to introduce a layer of indirection. - * nsMainThreadPtrHolder is a threadsafe reference-counted class that internally - * maintains one strong reference to the main-thread-only object. It must be - * instantiated on the main thread (so that the AddRef of the underlying object - * happens on the main thread), but consumers may subsequently pass references - * to the holder anywhere they please. These references are meant to be opaque - * when accessed off-main-thread (assertions enforce this). - * - * The semantics of RefPtr<nsMainThreadPtrHolder<T> > would be cumbersome, so - * we also introduce nsMainThreadPtrHandle<T>, which is conceptually identical - * to the above (though it includes various convenience methods). The basic - * pattern is as follows. - * - * // On the main thread: - * nsCOMPtr<nsIFooCallback> callback = ...; - * nsMainThreadPtrHandle<nsIFooCallback> callbackHandle = - * new nsMainThreadPtrHolder<nsIFooCallback>(callback); - * // Pass callbackHandle to structs/classes that might be accessed on other - * // threads. - * - * All structs and classes that might be accessed on other threads should store - * an nsMainThreadPtrHandle<T> rather than an nsCOMPtr<T>. - */ + /// Class to safely handle main-thread-only pointers off the main thread. + /// + /// Classes like XPCWrappedJS are main-thread-only, which means that it is + /// forbidden to call methods on instances of these classes off the main thread. + /// For various reasons (see bug 771074), this restriction recently began to + /// apply to AddRef/Release as well. + /// + /// This presents a problem for consumers that wish to hold a callback alive + /// on non-main-thread code. A common example of this is the proxy callback + /// pattern, where non-main-thread code holds a strong-reference to the callback + /// object, and dispatches new Runnables (also with a strong reference) to the + /// main thread in order to execute the callback. This involves several AddRef + /// and Release calls on the other thread, which is (now) verboten. + /// + /// The basic idea of this class is to introduce a layer of indirection. + /// nsMainThreadPtrHolder is a threadsafe reference-counted class that internally + /// maintains one strong reference to the main-thread-only object. It must be + /// instantiated on the main thread (so that the AddRef of the underlying object + /// happens on the main thread), but consumers may subsequently pass references + /// to the holder anywhere they please. These references are meant to be opaque + /// when accessed off-main-thread (assertions enforce this). + /// + /// The semantics of RefPtr<nsMainThreadPtrHolder<T> > would be cumbersome, so + /// we also introduce nsMainThreadPtrHandle<T>, which is conceptually identical + /// to the above (though it includes various convenience methods). The basic + /// pattern is as follows. + /// + /// // On the main thread: + /// nsCOMPtr<nsIFooCallback> callback = ...; + /// nsMainThreadPtrHandle<nsIFooCallback> callbackHandle = + /// new nsMainThreadPtrHolder<nsIFooCallback>(callback); + /// // Pass callbackHandle to structs/classes that might be accessed on other + /// // threads. + /// + /// All structs and classes that might be accessed on other threads should store + /// an nsMainThreadPtrHandle<T> rather than an nsCOMPtr<T>. #[repr(C)] #[derive(Debug)] pub struct nsMainThreadPtrHolder<T> { @@ -34474,14 +28290,13 @@ pub mod root { pub mURI: root::RefPtr<root::mozilla::image::ImageURL>, pub mListener: *mut root::imgINotificationObserver, pub mLoadGroup: root::nsCOMPtr, + pub mTabGroup: root::RefPtr<root::mozilla::dom::TabGroup>, + pub mEventTarget: root::nsCOMPtr, pub mLoadFlags: root::nsLoadFlags, pub mLockCount: u32, pub mAnimationConsumers: u32, - pub mCanceled: bool, - pub mIsInLoadGroup: bool, - pub mListenerIsStrongRef: bool, - pub mDecodeRequested: bool, - pub mDeferNotifications: bool, + pub _bitfield_1: u8, + pub __bindgen_padding_0: [u8; 3usize], } pub type imgRequestProxy_Image = root::mozilla::image::Image; pub type imgRequestProxy_ImageURL = root::mozilla::image::ImageURL; @@ -34520,13 +28335,311 @@ pub mod root { } #[test] fn bindgen_test_layout_imgRequestProxy() { - assert_eq!(::std::mem::size_of::<imgRequestProxy>() , 112usize , + assert_eq!(::std::mem::size_of::<imgRequestProxy>() , 120usize , concat ! ( "Size of: " , stringify ! ( imgRequestProxy ) )); assert_eq! (::std::mem::align_of::<imgRequestProxy>() , 8usize , concat ! ( "Alignment of " , stringify ! ( imgRequestProxy ) )); } + impl imgRequestProxy { + #[inline] + pub fn mCanceled(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 1u64 as u8; + let val = (unit_field_val & mask) >> 0usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mCanceled(&mut self, val: bool) { + let mask = 1u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn mIsInLoadGroup(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 2u64 as u8; + let val = (unit_field_val & mask) >> 1usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mIsInLoadGroup(&mut self, val: bool) { + let mask = 2u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn mListenerIsStrongRef(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 4u64 as u8; + let val = (unit_field_val & mask) >> 2usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mListenerIsStrongRef(&mut self, val: bool) { + let mask = 4u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn mDecodeRequested(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 8u64 as u8; + let val = (unit_field_val & mask) >> 3usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mDecodeRequested(&mut self, val: bool) { + let mask = 8u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn mDeferNotifications(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 16u64 as u8; + let val = (unit_field_val & mask) >> 4usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mDeferNotifications(&mut self, val: bool) { + let mask = 16u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn mHadListener(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 32u64 as u8; + let val = (unit_field_val & mask) >> 5usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mHadListener(&mut self, val: bool) { + let mask = 32u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn mHadDispatch(&self) -> bool { + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + let mask = 64u64 as u8; + let val = (unit_field_val & mask) >> 6usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_mHadDispatch(&mut self, val: bool) { + let mask = 64u64 as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as *mut u8 + as *mut u8, + ::std::mem::size_of::<u8>()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::<u8>()); + } + } + #[inline] + pub fn new_bitfield_1(mCanceled: bool, mIsInLoadGroup: bool, + mListenerIsStrongRef: bool, + mDecodeRequested: bool, + mDeferNotifications: bool, mHadListener: bool, + mHadDispatch: bool) -> u8 { + ({ + ({ + ({ + ({ + ({ + ({ + ({ 0 } | + ((mCanceled as u8 as u8) << + 0usize) & (1u64 as u8)) + } | + ((mIsInLoadGroup as u8 as u8) << + 1usize) & (2u64 as u8)) + } | + ((mListenerIsStrongRef as u8 as u8) << + 2usize) & (4u64 as u8)) + } | + ((mDecodeRequested as u8 as u8) << 3usize) & + (8u64 as u8)) + } | + ((mDeferNotifications as u8 as u8) << 4usize) & + (16u64 as u8)) + } | ((mHadListener as u8 as u8) << 5usize) & (32u64 as u8)) + } | ((mHadDispatch as u8 as u8) << 6usize) & (64u64 as u8)) + } + } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsCSSUnit { @@ -35161,10 +29274,7 @@ pub mod root { } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsCSSValue_Serialization { - eNormalized = 0, - eAuthorSpecified = 1, - } + pub enum nsCSSValue_Serialization { eNormalized = 0, } #[repr(C)] #[derive(Debug, Copy)] pub struct nsCSSValue__bindgen_ty_1 { @@ -35491,433 +29601,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIAsyncVerifyRedirectCallback { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIAsyncVerifyRedirectCallback_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIAsyncVerifyRedirectCallback() { - assert_eq!(::std::mem::size_of::<nsIAsyncVerifyRedirectCallback>() , - 8usize , concat ! ( - "Size of: " , stringify ! ( nsIAsyncVerifyRedirectCallback - ) )); - assert_eq! (::std::mem::align_of::<nsIAsyncVerifyRedirectCallback>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsIAsyncVerifyRedirectCallback ) )); - } - impl Clone for nsIAsyncVerifyRedirectCallback { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIChannelEventSink { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIChannelEventSink_COMTypeInfo { - pub _address: u8, - } - pub const nsIChannelEventSink_REDIRECT_TEMPORARY: - root::nsIChannelEventSink__bindgen_ty_1 = - nsIChannelEventSink__bindgen_ty_1::REDIRECT_TEMPORARY; - pub const nsIChannelEventSink_REDIRECT_PERMANENT: - root::nsIChannelEventSink__bindgen_ty_1 = - nsIChannelEventSink__bindgen_ty_1::REDIRECT_PERMANENT; - pub const nsIChannelEventSink_REDIRECT_INTERNAL: - root::nsIChannelEventSink__bindgen_ty_1 = - nsIChannelEventSink__bindgen_ty_1::REDIRECT_INTERNAL; - pub const nsIChannelEventSink_REDIRECT_STS_UPGRADE: - root::nsIChannelEventSink__bindgen_ty_1 = - nsIChannelEventSink__bindgen_ty_1::REDIRECT_STS_UPGRADE; - #[repr(u32)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIChannelEventSink__bindgen_ty_1 { - REDIRECT_TEMPORARY = 1, - REDIRECT_PERMANENT = 2, - REDIRECT_INTERNAL = 4, - REDIRECT_STS_UPGRADE = 8, - } - #[test] - fn bindgen_test_layout_nsIChannelEventSink() { - assert_eq!(::std::mem::size_of::<nsIChannelEventSink>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsIChannelEventSink ) )); - assert_eq! (::std::mem::align_of::<nsIChannelEventSink>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIChannelEventSink ) )); - } - impl Clone for nsIChannelEventSink { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIThreadRetargetableStreamListener { - pub _base: root::nsISupports, - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIThreadRetargetableStreamListener_COMTypeInfo { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_nsIThreadRetargetableStreamListener() { - assert_eq!(::std::mem::size_of::<nsIThreadRetargetableStreamListener>() - , 8usize , concat ! ( - "Size of: " , stringify ! ( - nsIThreadRetargetableStreamListener ) )); - assert_eq! (::std::mem::align_of::<nsIThreadRetargetableStreamListener>() - , 8usize , concat ! ( - "Alignment of " , stringify ! ( - nsIThreadRetargetableStreamListener ) )); - } - impl Clone for nsIThreadRetargetableStreamListener { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct imgCacheValidator { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct imgLoader { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct imgCacheEntry { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIApplicationCache { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug)] - pub struct imgRequest { - pub _base: root::nsIStreamListener, - pub _base_1: root::nsIThreadRetargetableStreamListener, - pub _base_2: root::nsIChannelEventSink, - pub _base_3: root::nsIInterfaceRequestor, - pub _base_4: root::nsIAsyncVerifyRedirectCallback, - pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt, - pub mLoader: *mut root::imgLoader, - pub mRequest: root::nsCOMPtr, - pub mURI: root::RefPtr<root::mozilla::image::ImageURL>, - pub mCurrentURI: root::nsCOMPtr, - pub mLoadingPrincipal: root::nsCOMPtr, - pub mPrincipal: root::nsCOMPtr, - pub mProperties: root::nsCOMPtr, - pub mSecurityInfo: root::nsCOMPtr, - pub mChannel: root::nsCOMPtr, - pub mPrevChannelSink: root::nsCOMPtr, - pub mApplicationCache: root::nsCOMPtr, - pub mTimedChannel: root::nsCOMPtr, - pub mContentType: root::nsCString, - pub mCacheEntry: root::RefPtr<root::imgCacheEntry>, - /// The key under which this imgRequest is stored in the image cache. - pub mCacheKey: root::imgRequest_ImageCacheKey, - pub mLoadId: *mut ::std::os::raw::c_void, - /// Raw pointer to the first proxy that was added to this imgRequest. Use only - /// pointer comparisons; there's no guarantee this will remain valid. - pub mFirstProxy: *mut ::std::os::raw::c_void, - pub mValidator: *mut root::imgCacheValidator, - pub mRedirectCallback: root::nsCOMPtr, - pub mNewRedirectChannel: root::nsCOMPtr, - pub mInnerWindowId: u64, - pub mCORSMode: i32, - pub mReferrerPolicy: root::imgRequest_ReferrerPolicy, - pub mImageErrorCode: root::nsresult, - pub mBoostCategoriesRequested: u32, - pub mMutex: root::mozilla::Mutex, - pub mProgressTracker: root::RefPtr<root::mozilla::image::ProgressTracker>, - pub mImage: root::RefPtr<root::mozilla::image::Image>, - pub _bitfield_1: u8, - pub __bindgen_padding_0: [u8; 7usize], - } - pub type imgRequest_Image = root::mozilla::image::Image; - pub type imgRequest_ImageCacheKey = root::mozilla::image::ImageCacheKey; - pub type imgRequest_ImageURL = root::mozilla::image::ImageURL; - pub type imgRequest_ProgressTracker = - root::mozilla::image::ProgressTracker; - pub use self::super::root::mozilla::net::ReferrerPolicy as - imgRequest_ReferrerPolicy; - pub type imgRequest_HasThreadSafeRefCnt = root::mozilla::TrueType; - #[test] - fn bindgen_test_layout_imgRequest() { - assert_eq!(::std::mem::size_of::<imgRequest>() , 376usize , concat ! ( - "Size of: " , stringify ! ( imgRequest ) )); - assert_eq! (::std::mem::align_of::<imgRequest>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( imgRequest ) )); - } - impl imgRequest { - #[inline] - pub fn mIsMultiPartChannel(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 1u64 as u8; - let val = (unit_field_val & mask) >> 0usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsMultiPartChannel(&mut self, val: bool) { - let mask = 1u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 0usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mGotData(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 2u64 as u8; - let val = (unit_field_val & mask) >> 1usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mGotData(&mut self, val: bool) { - let mask = 2u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 1usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mIsInCache(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 4u64 as u8; - let val = (unit_field_val & mask) >> 2usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mIsInCache(&mut self, val: bool) { - let mask = 4u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 2usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mDecodeRequested(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 8u64 as u8; - let val = (unit_field_val & mask) >> 3usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mDecodeRequested(&mut self, val: bool) { - let mask = 8u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 3usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mNewPartPending(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 16u64 as u8; - let val = (unit_field_val & mask) >> 4usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mNewPartPending(&mut self, val: bool) { - let mask = 16u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 4usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn mHadInsecureRedirect(&self) -> bool { - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - let mask = 32u64 as u8; - let val = (unit_field_val & mask) >> 5usize; - unsafe { ::std::mem::transmute(val as u8) } - } - #[inline] - pub fn set_mHadInsecureRedirect(&mut self, val: bool) { - let mask = 32u64 as u8; - let val = val as u8 as u8; - let mut unit_field_val: u8 = - unsafe { ::std::mem::uninitialized() }; - unsafe { - ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ - as *const u8, - &mut unit_field_val as *mut u8 - as *mut u8, - ::std::mem::size_of::<u8>()) - }; - unit_field_val &= !mask; - unit_field_val |= (val << 5usize) & mask; - unsafe { - ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as - *const u8, - &mut self._bitfield_1 as - *mut _ as *mut u8, - ::std::mem::size_of::<u8>()); - } - } - #[inline] - pub fn new_bitfield_1(mIsMultiPartChannel: bool, mGotData: bool, - mIsInCache: bool, mDecodeRequested: bool, - mNewPartPending: bool, - mHadInsecureRedirect: bool) -> u8 { - ({ - ({ - ({ - ({ - ({ - ({ 0 } | - ((mIsMultiPartChannel as u8 as u8) - << 0usize) & (1u64 as u8)) - } | - ((mGotData as u8 as u8) << 1usize) & - (2u64 as u8)) - } | - ((mIsInCache as u8 as u8) << 2usize) & - (4u64 as u8)) - } | - ((mDecodeRequested as u8 as u8) << 3usize) & - (8u64 as u8)) - } | - ((mNewPartPending as u8 as u8) << 4usize) & - (16u64 as u8)) - } | - ((mHadInsecureRedirect as u8 as u8) << 5usize) & - (32u64 as u8)) - } - } - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ProxyBehaviour { _unused: [u8; 0], @@ -36041,35 +29724,33 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStyleGradient ) , "::" , stringify ! ( mRefCnt ) )); } - /** - * A wrapper for an imgRequestProxy that supports off-main-thread creation - * and equality comparison. - * - * An nsStyleImageRequest can be created in two ways: - * - * 1. Using the constructor that takes an imgRequestProxy. This must - * be called from the main thread. The nsStyleImageRequest is - * immediately considered "resolved", and the get() method that - * returns the imgRequestProxy can be called. - * - * 2. Using the constructor that takes the URL, base URI, referrer - * and principal that can be used to inititiate an image load and - * produce an imgRequestProxy later. This can be called from - * any thread. The nsStyleImageRequest is not considered "resolved" - * at this point, and the Resolve() method must be called later - * to initiate the image load and make calls to get() valid. - * - * Calls to TrackImage(), UntrackImage(), LockImage(), UnlockImage() and - * RequestDiscard() are made to the imgRequestProxy and ImageTracker as - * appropriate, according to the mode flags passed in to the constructor. - * - * The main thread constructor takes a pointer to the css::ImageValue that - * is the specified url() value, while the off-main-thread constructor - * creates a new css::ImageValue to represent the url() information passed - * to the constructor. This ImageValue is held on to for the comparisons done - * in DefinitelyEquals(), so that we don't need to call into the non-OMT-safe - * Equals() on the nsIURI objects returned from imgRequestProxy::GetURI(). - */ + /// A wrapper for an imgRequestProxy that supports off-main-thread creation + /// and equality comparison. + /// + /// An nsStyleImageRequest can be created in two ways: + /// + /// 1. Using the constructor that takes an imgRequestProxy. This must + /// be called from the main thread. The nsStyleImageRequest is + /// immediately considered "resolved", and the get() method that + /// returns the imgRequestProxy can be called. + /// + /// 2. Using the constructor that takes the URL, base URI, referrer + /// and principal that can be used to inititiate an image load and + /// produce an imgRequestProxy later. This can be called from + /// any thread. The nsStyleImageRequest is not considered "resolved" + /// at this point, and the Resolve() method must be called later + /// to initiate the image load and make calls to get() valid. + /// + /// Calls to TrackImage(), UntrackImage(), LockImage(), UnlockImage() and + /// RequestDiscard() are made to the imgRequestProxy and ImageTracker as + /// appropriate, according to the mode flags passed in to the constructor. + /// + /// The main thread constructor takes a pointer to the css::ImageValue that + /// is the specified url() value, while the off-main-thread constructor + /// creates a new css::ImageValue to represent the url() information passed + /// to the constructor. This ImageValue is held on to for the comparisons done + /// in DefinitelyEquals(), so that we don't need to call into the non-OMT-safe + /// Equals() on the nsIURI objects returned from imgRequestProxy::GetURI(). #[repr(C)] #[derive(Debug)] pub struct nsStyleImageRequest { @@ -36172,16 +29853,14 @@ pub mod root { CachedBorderImageData ) , "::" , stringify ! ( mSubImages ) )); } - /** - * Represents a paintable image of one of the following types. - * (1) A real image loaded from an external source. - * (2) A CSS linear or radial gradient. - * (3) An element within a document, or an <img>, <video>, or <canvas> element - * not in a document. - * (*) Optionally a crop rect can be set to paint a partial (rectangular) - * region of an image. (Currently, this feature is only supported with an - * image of type (1)). - */ + /// Represents a paintable image of one of the following types. + /// (1) A real image loaded from an external source. + /// (2) A CSS linear or radial gradient. + /// (3) An element within a document, or an <img>, <video>, or <canvas> element + /// not in a document. + /// (*) Optionally a crop rect can be set to paint a partial (rectangular) + /// region of an image. (Currently, this feature is only supported with an + /// image of type (1)). #[repr(C)] #[derive(Debug)] pub struct nsStyleImage { @@ -36716,11 +30395,9 @@ pub mod root { "Alignment of field: " , stringify ! ( nsCSSShadowArray ) , "::" , stringify ! ( mArray ) )); } - /** - * An object that allows sharing of arrays that store 'quotes' property - * values. This is particularly important for inheritance, where we want - * to share the same 'quotes' value with a parent style context. - */ + /// An object that allows sharing of arrays that store 'quotes' property + /// values. This is particularly important for inheritance, where we want + /// to share the same 'quotes' value with a parent style context. #[repr(C)] #[derive(Debug)] pub struct nsStyleQuoteValues { @@ -37392,6 +31069,13 @@ pub mod root { eStyleSVGFallbackType_None = 1, eStyleSVGFallbackType_Color = 2, } + #[repr(u8)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsStyleSVGOpacitySource { + eStyleSVGOpacitySource_Normal = 0, + eStyleSVGOpacitySource_ContextFillOpacity = 1, + eStyleSVGOpacitySource_ContextStrokeOpacity = 2, + } #[repr(C)] #[derive(Debug)] pub struct nsStyleSVGPaint { @@ -37519,15 +31203,13 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStyleFilter ) , "::" , stringify ! ( mFilterParameter ) )); } - /** - * These *_Simple types are used to map Gecko types to layout-equivalent but - * simpler Rust types, to aid Rust binding generation. - * - * If something in this types or the assertions below needs to change, ask - * bholley, heycam or emilio before! - * - * <div rustbindgen="true" replaces="nsPoint"> - */ + /// These *_Simple types are used to map Gecko types to layout-equivalent but + /// simpler Rust types, to aid Rust binding generation. + /// + /// If something in this types or the assertions below needs to change, ask + /// bholley, heycam or emilio before! + /// + /// <div rustbindgen="true" replaces="nsPoint"> #[repr(C)] #[derive(Debug, Copy)] pub struct nsPoint { @@ -37554,9 +31236,7 @@ pub mod root { impl Clone for nsPoint { fn clone(&self) -> Self { *self } } - /** - * <div rustbindgen="true" replaces="nsMargin"> - */ + /// <div rustbindgen="true" replaces="nsMargin"> #[repr(C)] #[derive(Debug, Copy)] pub struct nsMargin { @@ -37595,9 +31275,7 @@ pub mod root { impl Clone for nsMargin { fn clone(&self) -> Self { *self } } - /** - * <div rustbindgen="true" replaces="nsRect"> - */ + /// <div rustbindgen="true" replaces="nsRect"> #[repr(C)] #[derive(Debug, Copy)] pub struct nsRect { @@ -37636,9 +31314,7 @@ pub mod root { impl Clone for nsRect { fn clone(&self) -> Self { *self } } - /** - * <div rustbindgen="true" replaces="nsSize"> - */ + /// <div rustbindgen="true" replaces="nsSize"> #[repr(C)] #[derive(Debug, Copy)] pub struct nsSize { @@ -37665,20 +31341,16 @@ pub mod root { impl Clone for nsSize { fn clone(&self) -> Self { *self } } - /** - * <div rustbindgen replaces="nsTArray"></div> - */ + /// <div rustbindgen replaces="nsTArray"></div> #[repr(C)] #[derive(Debug)] pub struct nsTArray<T> { pub mBuffer: *mut T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } - /** - * <div rustbindgen replaces="nsCOMArray"></div> - * - * mozilla::ArrayIterator doesn't work well with bindgen. - */ + /// <div rustbindgen replaces="nsCOMArray"></div> + /// + /// mozilla::ArrayIterator doesn't work well with bindgen. #[repr(C)] #[derive(Debug)] pub struct nsCOMArray { @@ -37691,11 +31363,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct RawServoAnimationValueMap { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct RawServoStyleSheetContents { _unused: [u8; 0], } @@ -37758,15 +31425,11 @@ pub mod root { pub type RawGeckoGfxMatrix4x4 = [root::mozilla::gfx::Float; 16usize]; pub type RawGeckoStyleChildrenIterator = root::mozilla::dom::StyleChildrenIterator; - pub type RawServoDeclarationBlockBorrowed = - *const root::RawServoDeclarationBlock; pub type ServoStyleContextBorrowed = *const root::mozilla::ServoStyleContext; pub type ServoStyleContextBorrowedOrNull = *const root::mozilla::ServoStyleContext; pub type ServoComputedDataBorrowed = *const root::ServoComputedData; - pub type RawServoAnimationValueMapBorrowedMut = - *mut root::RawServoAnimationValueMap; pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode; pub type RawGeckoNodeBorrowedOrNull = *const root::RawGeckoNode; pub type RawGeckoElementBorrowed = *const root::RawGeckoElement; @@ -38088,31 +31751,6 @@ pub mod root { pub struct CSSRuleListImpl { _unused: [u8; 0], } - /** - * An nsMediaQueryResultCacheKey records what feature/value combinations - * a set of media query results are valid for. This allows the caller - * to quickly learn whether a prior result of media query evaluation is - * still valid (e.g., due to a window size change) without rerunning all - * of the evaluation and rebuilding the list of rules. - * - * This object may not be used after any media rules in any of the - * sheets it was given to have been modified. However, this is - * generally not a problem since ClearRuleCascades is called on the - * sheet whenever this happens, and these objects are stored inside the - * rule cascades. (FIXME: We're not actually doing this all the time.) - * - * The implementation could be further optimized in the future to store - * ranges (combinations of less-than, less-than-or-equal, greater-than, - * greater-than-or-equal, equal, not-equal, present, not-present) for - * each feature rather than simply storing the list of expressions. - * However, this requires combining any such ranges. - */ - #[repr(C)] - #[derive(Debug)] - pub struct nsMediaQueryResultCacheKey { - pub mMedium: root::nsCOMPtr, - pub mFeatureCache: root::nsTArray<root::nsMediaQueryResultCacheKey_FeatureEntry>, - } #[repr(C)] #[derive(Debug)] pub struct nsMediaQueryResultCacheKey_ExpressionEntry { @@ -38180,33 +31818,7 @@ pub mod root { nsMediaQueryResultCacheKey_FeatureEntry ) , "::" , stringify ! ( mExpressions ) )); } - #[test] - fn bindgen_test_layout_nsMediaQueryResultCacheKey() { - assert_eq!(::std::mem::size_of::<nsMediaQueryResultCacheKey>() , - 16usize , concat ! ( - "Size of: " , stringify ! ( nsMediaQueryResultCacheKey ) - )); - assert_eq! (::std::mem::align_of::<nsMediaQueryResultCacheKey>() , - 8usize , concat ! ( - "Alignment of " , stringify ! ( nsMediaQueryResultCacheKey - ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsMediaQueryResultCacheKey ) ) . - mMedium as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( - nsMediaQueryResultCacheKey ) , "::" , stringify ! ( - mMedium ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsMediaQueryResultCacheKey ) ) . - mFeatureCache as * const _ as usize } , 8usize , concat ! - ( - "Alignment of field: " , stringify ! ( - nsMediaQueryResultCacheKey ) , "::" , stringify ! ( - mFeatureCache ) )); - } - /** - * Utility class to provide scaling defined in a keySplines element. - */ + /// Utility class to provide scaling defined in a keySplines element. #[repr(C)] #[derive(Debug, Copy)] pub struct nsSMILKeySpline { @@ -38265,108 +31877,15 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsSVGAngle { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsSVGIntegerPair { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsSVGLength2 { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsSVGNumberPair { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsSVGViewBox { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsStyledElement { - _unused: [u8; 0], - } - /** - * A class used to construct a nsString from a nsStringBuffer (we might - * want to move this to nsString at some point). - * - * WARNING: Note that nsCheapString doesn't take an explicit length -- it - * assumes the string is maximally large, given the nsStringBuffer's storage - * size. This means the given string buffer *must* be sized exactly correctly - * for the string it contains (including one byte for a null terminator). If - * it has any unused storage space, then that will result in bogus characters - * at the end of our nsCheapString. - */ - #[repr(C)] - #[derive(Debug)] - pub struct nsCheapString { - pub _base: ::nsstring::nsStringRepr, - } - #[test] - fn bindgen_test_layout_nsCheapString() { - assert_eq!(::std::mem::size_of::<nsCheapString>() , 16usize , concat ! - ( "Size of: " , stringify ! ( nsCheapString ) )); - assert_eq! (::std::mem::align_of::<nsCheapString>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( nsCheapString ) )); - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsMappedAttributes { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsMappedAttributeElement { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsXBLDocumentInfo { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ElementRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct PseudoElementRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AnonBoxRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct XULTreeRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct StateRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct PseudoElementStateRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct AttributeRuleProcessorData { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIStyleRuleProcessor { pub _base: root::nsISupports, @@ -38444,6 +31963,7 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] + #[derive(Debug)] pub struct nsIAttribute { pub _base: root::nsINode, pub mAttrMap: root::RefPtr<root::nsDOMAttributeMap>, @@ -38465,17 +31985,15 @@ pub mod root { "Alignment of field: " , stringify ! ( nsIAttribute ) , "::" , stringify ! ( mAttrMap ) )); } - /** - * There are two advantages to inheriting from nsStubMutationObserver - * rather than directly from nsIMutationObserver: - * 1. smaller compiled code size (since there's no need for the code - * for the empty virtual function implementations for every - * nsIMutationObserver implementation) - * 2. the performance of document's loop over observers benefits from - * the fact that more of the functions called are the same (which - * can reduce instruction cache misses and perhaps improve branch - * prediction) - */ + /// There are two advantages to inheriting from nsStubMutationObserver + /// rather than directly from nsIMutationObserver: + /// 1. smaller compiled code size (since there's no need for the code + /// for the empty virtual function implementations for every + /// nsIMutationObserver implementation) + /// 2. the performance of document's loop over observers benefits from + /// the fact that more of the functions called are the same (which + /// can reduce instruction cache misses and perhaps improve branch + /// prediction) #[repr(C)] #[derive(Debug, Copy)] pub struct nsStubMutationObserver { @@ -38494,20 +32012,14 @@ pub mod root { impl Clone for nsStubMutationObserver { fn clone(&self) -> Self { *self } } - /** - * Structure used as a key for caching Attrs in nsDOMAttributeMap's mAttributeCache. - */ + /// Structure used as a key for caching Attrs in nsDOMAttributeMap's mAttributeCache. #[repr(C)] #[derive(Debug, Copy)] pub struct nsAttrKey { - /** - * The namespace of the attribute - */ + /// The namespace of the attribute pub mNamespaceID: i32, - /** - * The atom for attribute, stored as void*, to make sure that we only use it - * for the hashcode, and we can never dereference it. - */ + /// The atom for attribute, stored as void*, to make sure that we only use it + /// for the hashcode, and we can never dereference it. pub mLocalName: *mut ::std::os::raw::c_void, } #[test] @@ -38530,9 +32042,7 @@ pub mod root { impl Clone for nsAttrKey { fn clone(&self) -> Self { *self } } - /** - * PLDHashEntryHdr implementation for nsAttrKey. - */ + /// PLDHashEntryHdr implementation for nsAttrKey. #[repr(C)] #[derive(Debug)] pub struct nsAttrHashKey { @@ -38559,64 +32069,8 @@ pub mod root { "::" , stringify ! ( mKey ) )); } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsScrollbarFrame { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct nsIScrollbarMediator { - pub _base: root::nsQueryFrame, - } - pub type nsIScrollbarMediator_Has_NS_DECL_QUERYFRAME_TARGET = - root::nsIScrollbarMediator; - #[repr(u32)] - /** - * When set to ENABLE_SNAP, additional scrolling will be performed after the - * scroll operation to maintain the constraints set by CSS Scroll snapping. - * The additional scrolling may include asynchronous smooth scrolls that - * continue to animate after the initial scroll position has been set. - */ - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum nsIScrollbarMediator_ScrollSnapMode { - DISABLE_SNAP = 0, - ENABLE_SNAP = 1, - } - extern "C" { - #[link_name = "_ZN20nsIScrollbarMediator9kFrameIIDE"] - pub static nsIScrollbarMediator_kFrameIID: - root::nsQueryFrame_FrameIID; - } - #[test] - fn bindgen_test_layout_nsIScrollbarMediator() { - assert_eq!(::std::mem::size_of::<nsIScrollbarMediator>() , 8usize , - concat ! ( - "Size of: " , stringify ! ( nsIScrollbarMediator ) )); - assert_eq! (::std::mem::align_of::<nsIScrollbarMediator>() , 8usize , - concat ! ( - "Alignment of " , stringify ! ( nsIScrollbarMediator ) )); - } - impl Clone for nsIScrollbarMediator { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsBoxLayoutState { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsIScrollPositionListener { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsSMILValue { - _unused: [u8; 0], - } - #[repr(C)] pub struct nsISMILAttr__bindgen_vtable(::std::os::raw::c_void); - //////////////////////////////////////////////////////////////////////// + /// #[repr(C)] #[derive(Debug)] pub struct nsISMILAttr { @@ -38629,56 +32083,46 @@ pub mod root { assert_eq! (::std::mem::align_of::<nsISMILAttr>() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsISMILAttr ) )); } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct mozAutoDocUpdate { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsAttrValueOrString { - _unused: [u8; 0], - } - pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_3; + pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_1; pub const ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO: - root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_85 + root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_3; + pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_20 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_3; + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_3; pub const ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT: - root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; - pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_PENDING_RESTYLE_FLAGS; - pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; - pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_ALL_RESTYLE_FLAGS; - pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; + root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; + pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_PENDING_RESTYLE_FLAGS; + pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; + pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_ALL_RESTYLE_FLAGS; + pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_20 = + _bindgen_ty_20::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_85 { + pub enum _bindgen_ty_20 { ELEMENT_SHARED_RESTYLE_BIT_1 = 8388608, ELEMENT_SHARED_RESTYLE_BIT_2 = 16777216, ELEMENT_SHARED_RESTYLE_BIT_3 = 33554432, @@ -38715,35 +32159,33 @@ pub mod root { impl Clone for LookAndFeelInt { fn clone(&self) -> Self { *self } } - /** - * An object implementing |nsIStyleRule| (henceforth, a rule) represents - * immutable stylistic information that either applies or does not apply - * to a given element. It belongs to an object or group of objects that - * implement |nsIStyleSheet| and |nsIStyleRuleProcessor| (henceforth, a - * sheet). - * - * A rule becomes relevant to the computation of style data when - * |nsIStyleRuleProcessor::RulesMatching| creates a rule node that - * points to the rule. (A rule node, |nsRuleNode|, is a node in the - * rule tree, which is a lexicographic tree indexed by rules. The path - * from the root of the rule tree to the |nsRuleNode| for a given - * |nsStyleContext| contains exactly the rules that match the element - * that the style context is for, in priority (weight, origin, - * specificity) order.) - * - * The computation of style data uses the rule tree, which calls - * |nsIStyleRule::MapRuleInfoInto| below. - * - * It is worth emphasizing that the data represented by a rule - * implementation are immutable. When the data need to be changed, a - * new rule object must be created. Failing to do this will lead to - * bugs in the handling of dynamic style changes, since the rule tree - * caches the results of |MapRuleInfoInto|. - * - * |nsIStyleRule| objects are owned by |nsRuleNode| objects (in addition - * to typically being owned by their sheet), which are in turn garbage - * collected (with the garbage collection roots being style contexts). - */ + /// An object implementing |nsIStyleRule| (henceforth, a rule) represents + /// immutable stylistic information that either applies or does not apply + /// to a given element. It belongs to an object or group of objects that + /// implement |nsIStyleSheet| and |nsIStyleRuleProcessor| (henceforth, a + /// sheet). + /// + /// A rule becomes relevant to the computation of style data when + /// |nsIStyleRuleProcessor::RulesMatching| creates a rule node that + /// points to the rule. (A rule node, |nsRuleNode|, is a node in the + /// rule tree, which is a lexicographic tree indexed by rules. The path + /// from the root of the rule tree to the |nsRuleNode| for a given + /// |nsStyleContext| contains exactly the rules that match the element + /// that the style context is for, in priority (weight, origin, + /// specificity) order.) + /// + /// The computation of style data uses the rule tree, which calls + /// |nsIStyleRule::MapRuleInfoInto| below. + /// + /// It is worth emphasizing that the data represented by a rule + /// implementation are immutable. When the data need to be changed, a + /// new rule object must be created. Failing to do this will lead to + /// bugs in the handling of dynamic style changes, since the rule tree + /// caches the results of |MapRuleInfoInto|. + /// + /// |nsIStyleRule| objects are owned by |nsRuleNode| objects (in addition + /// to typically being owned by their sheet), which are in turn garbage + /// collected (with the garbage collection roots being style contexts). #[repr(C)] #[derive(Debug, Copy)] pub struct nsIStyleRule { @@ -39068,19 +32510,9 @@ pub mod root { pub const SERVO_CSS_PSEUDO_ELEMENT_FLAGS_mozPlaceholder: u32 = 8; pub const SERVO_CSS_PSEUDO_ELEMENT_FLAGS_placeholder: u32 = 8; pub const SERVO_CSS_PSEUDO_ELEMENT_FLAGS_mozColorSwatch: u32 = 12; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct ElementDependentRuleProcessorData { - _unused: [u8; 0], - } pub type nsBindingList = root::nsTArray<root::RefPtr<root::nsXBLBinding>>; #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct nsRuleData { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct nsCSSFontFeatureValuesRule { _unused: [u8; 0], } @@ -39113,11 +32545,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct nsROCSSPrimitiveValue { - _unused: [u8; 0], - } - #[repr(C)] #[derive(Debug, Copy)] pub struct nsIDOMCSSFontFaceRule { pub _base: root::nsISupports, @@ -39291,65 +32718,8 @@ pub mod root { "Alignment of field: " , stringify ! ( nsMediaList ) , "::" , stringify ! ( mArray ) )); } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct __va_list_tag { - pub gp_offset: ::std::os::raw::c_uint, - pub fp_offset: ::std::os::raw::c_uint, - pub overflow_arg_area: *mut ::std::os::raw::c_void, - pub reg_save_area: *mut ::std::os::raw::c_void, - } #[test] - fn bindgen_test_layout___va_list_tag() { - assert_eq!(::std::mem::size_of::<__va_list_tag>() , 24usize , concat ! - ( "Size of: " , stringify ! ( __va_list_tag ) )); - assert_eq! (::std::mem::align_of::<__va_list_tag>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( __va_list_tag ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __va_list_tag ) ) . gp_offset as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( __va_list_tag ) , - "::" , stringify ! ( gp_offset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __va_list_tag ) ) . fp_offset as * - const _ as usize } , 4usize , concat ! ( - "Alignment of field: " , stringify ! ( __va_list_tag ) , - "::" , stringify ! ( fp_offset ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __va_list_tag ) ) . overflow_arg_area - as * const _ as usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( __va_list_tag ) , - "::" , stringify ! ( overflow_arg_area ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __va_list_tag ) ) . reg_save_area as - * const _ as usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( __va_list_tag ) , - "::" , stringify ! ( reg_save_area ) )); - } - impl Clone for __va_list_tag { - fn clone(&self) -> Self { *self } - } - pub type __builtin_va_list = [root::__va_list_tag; 1usize]; - #[test] - fn __bindgen_test_layout_IntegralConstant_instantiation_88() { - assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! ( - "Size of template specialization: " , stringify ! ( u8 ) - )); - assert_eq!(::std::mem::align_of::<u8>() , 1usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( u8 - ) )); - } - #[test] - fn __bindgen_test_layout_IntegralConstant_instantiation_89() { - assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! ( - "Size of template specialization: " , stringify ! ( u8 ) - )); - assert_eq!(::std::mem::align_of::<u8>() , 1usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( u8 - ) )); - } - #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_90() { + fn __bindgen_test_layout_nsCharTraits_open0_char16_t_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCharTraits>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39360,7 +32730,7 @@ pub mod root { root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout_nsReadingIterator_instantiation_91() { + fn __bindgen_test_layout_nsReadingIterator_open0_char16_t_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsReadingIterator<u16>>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39371,7 +32741,7 @@ pub mod root { root::nsReadingIterator<u16> ) )); } #[test] - fn __bindgen_test_layout_nsWritingIterator_instantiation_92() { + fn __bindgen_test_layout_nsWritingIterator_open0_char16_t_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsWritingIterator<u16>>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39382,7 +32752,7 @@ pub mod root { root::nsWritingIterator<u16> ) )); } #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_93() { + fn __bindgen_test_layout_nsCharTraits_open0_char_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCharTraits>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39393,7 +32763,7 @@ pub mod root { root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout_nsReadingIterator_instantiation_94() { + fn __bindgen_test_layout_nsReadingIterator_open0_char_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsReadingIterator<::std::os::raw::c_char>>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39404,7 +32774,7 @@ pub mod root { root::nsReadingIterator<::std::os::raw::c_char> ) )); } #[test] - fn __bindgen_test_layout_nsWritingIterator_instantiation_95() { + fn __bindgen_test_layout_nsWritingIterator_open0_char_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsWritingIterator<::std::os::raw::c_char>>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39415,7 +32785,7 @@ pub mod root { root::nsWritingIterator<::std::os::raw::c_char> ) )); } #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_96() { + fn __bindgen_test_layout_nsCharTraits_open0_char16_t_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsCharTraits>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39426,7 +32796,7 @@ pub mod root { root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_97() { + fn __bindgen_test_layout_nsCharTraits_open0_char_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsCharTraits>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39437,25 +32807,7 @@ pub mod root { root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_217394_instantiation_98() { - assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! ( - "Size of template specialization: " , stringify ! ( u8 ) - )); - assert_eq!(::std::mem::align_of::<u8>() , 1usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( u8 - ) )); - } - #[test] - fn __bindgen_test_layout__bindgen_ty_id_217430_instantiation_99() { - assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! ( - "Size of template specialization: " , stringify ! ( u8 ) - )); - assert_eq!(::std::mem::align_of::<u8>() , 1usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( u8 - ) )); - } - #[test] - fn __bindgen_test_layout_nsTArray_instantiation_100() { + fn __bindgen_test_layout_nsTArray_open0_nsCString_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCString>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39466,73 +32818,53 @@ pub mod root { root::nsTArray<root::nsCString> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_101() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::jsid>>() , - 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::jsid> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::jsid>>() , - 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::jsid> ) )); - } - #[test] - fn __bindgen_test_layout_Handle_instantiation_102() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - } - #[test] - fn __bindgen_test_layout_Handle_instantiation_103() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_DeletePolicy_open1_JSErrorNotes_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::mozilla::UniquePtr<root::JSErrorNotes> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::JSErrorNotes>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::mozilla::UniquePtr<root::JSErrorNotes> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_104() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , + concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::<root::JS::DeletePolicy>() , 1usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_Rooted_instantiation_105() { - assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! + fn __bindgen_test_layout_nsCOMPtr_open0_nsISupports_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 3usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 3usize]>() , 8usize , concat ! - ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 3usize] ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_106() { - assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , - concat ! ( + fn __bindgen_test_layout_nsTArray_open0_CSSVariableValues_Variable_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::CSSVariableValues_Variable>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::DeletePolicy ) )); - assert_eq!(::std::mem::align_of::<root::JS::DeletePolicy>() , 1usize , - concat ! ( + root::nsTArray<root::mozilla::CSSVariableValues_Variable> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::CSSVariableValues_Variable>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::DeletePolicy ) )); + root::nsTArray<root::mozilla::CSSVariableValues_Variable> ) + )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_107() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39543,7 +32875,7 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_108() { + fn __bindgen_test_layout_nsTArray_open0_FontFamilyName_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::FontFamilyName>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39554,7 +32886,18 @@ pub mod root { root::nsTArray<root::mozilla::FontFamilyName> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_109() { + fn __bindgen_test_layout_nsTArray_open0_FontFamilyName_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::FontFamilyName>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::FontFamilyName> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::FontFamilyName>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::FontFamilyName> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_unsigned_int_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<::std::os::raw::c_uint>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39565,7 +32908,7 @@ pub mod root { root::nsTArray<::std::os::raw::c_uint> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_110() { + fn __bindgen_test_layout_nsTArray_open0_unsigned_int_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<::std::os::raw::c_uint>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39576,392 +32919,387 @@ pub mod root { root::nsTArray<::std::os::raw::c_uint> ) )); } #[test] - fn __bindgen_test_layout_PointTyped_instantiation_111() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_gfxFontFeatureValueSet_ValueList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::gfxFontFeatureValueSet_ValueList>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::nsTArray<root::gfxFontFeatureValueSet_ValueList> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::gfxFontFeatureValueSet_ValueList>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::nsTArray<root::gfxFontFeatureValueSet_ValueList> ) + )); } #[test] - fn __bindgen_test_layout_IntPointTyped_instantiation_112() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_unsigned_int_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::std::os::raw::c_uint>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::nsTArray<::std::os::raw::c_uint> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::std::os::raw::c_uint>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::nsTArray<::std::os::raw::c_uint> ) )); } #[test] - fn __bindgen_test_layout_SizeTyped_instantiation_113() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_unsigned_int_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::std::os::raw::c_uint>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::nsTArray<::std::os::raw::c_uint> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::std::os::raw::c_uint>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::nsTArray<::std::os::raw::c_uint> ) )); } #[test] - fn __bindgen_test_layout_RectTyped_instantiation_114() { - assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_gfxAlternateValue_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::gfxAlternateValue>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 4usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat ! - ( + root::nsTArray<root::gfxAlternateValue> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::gfxAlternateValue>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 4usize] ) )); + root::nsTArray<root::gfxAlternateValue> ) )); } #[test] - fn __bindgen_test_layout_IntPointTyped_instantiation_115() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_gfxFontFeatureValueSet_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::gfxFontFeatureValueSet>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::RefPtr<root::gfxFontFeatureValueSet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::gfxFontFeatureValueSet>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::RefPtr<root::gfxFontFeatureValueSet> ) )); } #[test] - fn __bindgen_test_layout_IntSizeTyped_instantiation_116() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_gfxFontFeature_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::gfxFontFeature>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::nsTArray<root::gfxFontFeature> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::gfxFontFeature>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::nsTArray<root::gfxFontFeature> ) )); } #[test] - fn __bindgen_test_layout_IntRectTyped_instantiation_117() { - assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_FontVariation_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::gfx::FontVariation>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 4usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat ! - ( + root::nsTArray<root::mozilla::gfx::FontVariation> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::gfx::FontVariation>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 4usize] ) )); + root::nsTArray<root::mozilla::gfx::FontVariation> ) )); } #[test] - fn __bindgen_test_layout_MarginTyped_instantiation_118() { - assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_201606_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsCSSSelector>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 4usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat ! - ( + root::nsTArray<*mut root::nsCSSSelector> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsCSSSelector>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 4usize] ) )); + root::nsTArray<*mut root::nsCSSSelector> ) )); } #[test] - fn __bindgen_test_layout_RectTyped_instantiation_119() { - assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 4usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat ! - ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 4usize] ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_IntRectTyped_instantiation_120() { - assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_nsStyleImageRequest_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsStyleImageRequest>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 4usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat ! - ( - "Alignment of template specialization: " , stringify ! ( - [u32; 4usize] ) )); - } - #[test] - fn __bindgen_test_layout_ScaleFactor_instantiation_121() { - assert_eq!(::std::mem::size_of::<u32>() , 4usize , concat ! ( - "Size of template specialization: " , stringify ! ( u32 ) - )); - assert_eq!(::std::mem::align_of::<u32>() , 4usize , concat ! ( + root::RefPtr<root::nsStyleImageRequest> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsStyleImageRequest>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u32 ) )); + root::RefPtr<root::nsStyleImageRequest> ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_122() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_nsStyleQuoteValues_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsStyleQuoteValues>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::RefPtr<root::nsStyleQuoteValues> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsStyleQuoteValues>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::RefPtr<root::nsStyleQuoteValues> ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_123() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_nsCSSShadowArray_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsCSSShadowArray>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::RefPtr<root::nsCSSShadowArray> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsCSSShadowArray>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::RefPtr<root::nsCSSShadowArray> ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_124() { - assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_nsCursorImage_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCursorImage>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! - ( + root::nsTArray<root::nsCursorImage> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCursorImage>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 2usize] ) )); + root::nsTArray<root::nsCursorImage> ) )); } #[test] - fn __bindgen_test_layout_BaseTimeDuration_instantiation_125() { - assert_eq!(::std::mem::size_of::<root::mozilla::BaseTimeDuration>() , - 8usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_URLValue_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::URLValue>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::BaseTimeDuration ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::BaseTimeDuration>() , - 8usize , concat ! ( + root::RefPtr<root::mozilla::css::URLValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::URLValue>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::BaseTimeDuration ) )); + root::RefPtr<root::mozilla::css::URLValue> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_126() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIContent>>() + fn __bindgen_test_layout_RefPtr_open0_URLValue_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::URLValue>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIContent> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIContent>>() + root::RefPtr<root::mozilla::css::URLValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::URLValue>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIContent> ) )); + root::RefPtr<root::mozilla::css::URLValue> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_127() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIContent>>() + fn __bindgen_test_layout_RefPtr_open0_URLValue_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::URLValue>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIContent> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIContent>>() + root::RefPtr<root::mozilla::css::URLValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::URLValue>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIContent> ) )); + root::RefPtr<root::mozilla::css::URLValue> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_128() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_nsTArray_open0_nsStyleCoord_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCoord>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::nsTArray<root::nsStyleCoord> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleCoord>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::nsTArray<root::nsStyleCoord> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_129() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIAtom_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) - )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() - , 8usize , concat ! ( + root::nsTArray<root::nsCOMPtr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) - )); + root::nsTArray<root::nsCOMPtr> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_130() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_131() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + fn __bindgen_test_layout_RefPtr_open0_GridTemplateAreasValue_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::GridTemplateAreasValue>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + root::RefPtr<root::mozilla::css::GridTemplateAreasValue> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::GridTemplateAreasValue>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + root::RefPtr<root::mozilla::css::GridTemplateAreasValue> ) )); } #[test] - fn __bindgen_test_layout_WeakPtr_instantiation_132() { - assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) - )); - assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMArray_open0_nsIAtom_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMArray>() , 8usize , concat + ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMArray ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMArray>() , 8usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsCOMArray ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_133() { - assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<root::WeakFrame>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_Position_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::Position>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsPtrHashKey<root::WeakFrame> ) )); - assert_eq!(::std::mem::align_of::<root::nsPtrHashKey<root::WeakFrame>>() + root::nsTArray<root::mozilla::Position> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::Position>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsPtrHashKey<root::WeakFrame> ) )); + root::nsTArray<root::mozilla::Position> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_134() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() + fn __bindgen_test_layout_RefPtr_open0_nsCSSValueSharedList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsCSSValueSharedList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::RefPtr<root::nsCSSValueSharedList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsCSSValueSharedList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::RefPtr<root::nsCSSValueSharedList> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_135() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsStyleAutoArray_open0_StyleTransition_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsStyleAutoArray<root::mozilla::StyleTransition>>() + , 48usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::nsStyleAutoArray<root::mozilla::StyleTransition> ) + )); + assert_eq!(::std::mem::align_of::<root::nsStyleAutoArray<root::mozilla::StyleTransition>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsStyleAutoArray<root::mozilla::StyleTransition> ) + )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_136() { - assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsStyleAutoArray_open0_StyleAnimation_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsStyleAutoArray<root::mozilla::StyleAnimation>>() + , 64usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsCOMPtr ) )); - assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat - ! ( + root::nsStyleAutoArray<root::mozilla::StyleAnimation> ) )); + assert_eq!(::std::mem::align_of::<root::nsStyleAutoArray<root::mozilla::StyleAnimation>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsCOMPtr ) )); + root::nsStyleAutoArray<root::mozilla::StyleAnimation> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_137() { - assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsStyleContentData_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleContentData>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<::nsstring::nsStringRepr> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , - 8usize , concat ! ( + root::nsTArray<root::nsStyleContentData> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleContentData>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<::nsstring::nsStringRepr> ) )); + root::nsTArray<root::nsStyleContentData> ) )); } #[test] - fn __bindgen_test_layout_TErrorResult_instantiation_138() { - assert_eq!(::std::mem::size_of::<root::mozilla::binding_danger::TErrorResult>() - , 16usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsStyleCounterData_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCounterData>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::binding_danger::TErrorResult ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::binding_danger::TErrorResult>() + root::nsTArray<root::nsStyleCounterData> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleCounterData>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::binding_danger::TErrorResult ) )); + root::nsTArray<root::nsStyleCounterData> ) )); } #[test] - fn __bindgen_test_layout_TErrorResult_instantiation_139() { - assert_eq!(::std::mem::size_of::<root::mozilla::binding_danger::TErrorResult>() - , 16usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsStyleCounterData_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCounterData>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::binding_danger::TErrorResult ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::binding_danger::TErrorResult>() + root::nsTArray<root::nsStyleCounterData> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleCounterData>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::binding_danger::TErrorResult ) )); + root::nsTArray<root::nsStyleCounterData> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_140() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStringBuffer>>() + fn __bindgen_test_layout_RefPtr_open0_nsCSSValueSharedList_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsCSSValueSharedList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStringBuffer> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStringBuffer>>() + root::RefPtr<root::nsCSSValueSharedList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsCSSValueSharedList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStringBuffer> ) )); + root::RefPtr<root::nsCSSValueSharedList> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_141() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0_nsStyleFilter_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleFilter>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsTArray<root::nsStyleFilter> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleFilter>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<root::nsStyleFilter> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_142() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_nsCSSShadowArray_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsCSSShadowArray>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::RefPtr<root::nsCSSShadowArray> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsCSSShadowArray>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::RefPtr<root::nsCSSShadowArray> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_143() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_144() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_TErrorResult_open0_AssertAndSuppressCleanupPolicy_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::binding_danger::TErrorResult>() + , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() + root::mozilla::binding_danger::TErrorResult ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::binding_danger::TErrorResult>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_145() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_203357_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<*mut root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_146() { + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -39972,106 +33310,102 @@ pub mod root { root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_147() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_MediaList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::MediaList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::dom::MediaList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::MediaList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::dom::MediaList> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_148() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_149() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_nsTArray_open0_StyleSetHandle_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::StyleSetHandle>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::nsTArray<root::mozilla::StyleSetHandle> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::StyleSetHandle>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsTArray<root::mozilla::StyleSetHandle> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_150() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_RefPtr_open0_nsChildContentList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsChildContentList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::RefPtr<root::nsChildContentList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsChildContentList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::RefPtr<root::nsChildContentList> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_151() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsINode>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsINode> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsINode>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_UniquePtr_open0_nsTHashtable_open1_nsPtrHashKey_open2_nsRange_close2_close1_DefaultDelete_open1_nsTHashtable_open2_nsPtrHashKey_open3_nsRange_close3_close2_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsINode> ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_152() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_nsTHashtable_open1_nsPtrHashKey_open2_nsRange_close2_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_153() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_UniquePtr_open0_nsTHashtable_open1_nsPtrHashKey_open2_nsRange_close2_close1_DefaultDelete_open1_nsTHashtable_open2_nsPtrHashKey_open3_nsRange_close3_close2_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_154() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_nsTHashtable_open1_nsPtrHashKey_open2_nsRange_close2_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_155() { - assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , - concat ! ( + fn __bindgen_test_layout_RefPtr_open0_NodeInfo_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::NodeInfo>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::DeletePolicy ) )); - assert_eq!(::std::mem::align_of::<root::JS::DeletePolicy>() , 1usize , - concat ! ( + root::RefPtr<root::mozilla::dom::NodeInfo> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::NodeInfo>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::DeletePolicy ) )); + root::RefPtr<root::mozilla::dom::NodeInfo> ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_156() { + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_Note_DeletePolicy_open1_JSErrorNotes_Note_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes_Note>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40082,7 +33416,7 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes_Note> ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_157() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_Note_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40093,7 +33427,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_158() { + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_DeletePolicy_open1_JSErrorNotes_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40104,7 +33438,7 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes> ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_159() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40115,7 +33449,18 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_160() { + fn __bindgen_test_layout_iterator_open0_input_iterator_tag_UniquePtr_open1_JSErrorNotes_Note_DeletePolicy_open2_JSErrorNotes_Note_close2_close1_long__bindgen_ty_id_208887__bindgen_ty_id_208894_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::std::iterator>() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::std::iterator ) )); + assert_eq!(::std::mem::align_of::<root::std::iterator>() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::std::iterator ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_Note_DeletePolicy_open1_JSErrorNotes_Note_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes_Note>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40126,7 +33471,7 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes_Note> ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_161() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_Note_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40137,7 +33482,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_162() { + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_Note_DeletePolicy_open1_JSErrorNotes_Note_close1_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes_Note>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40148,7 +33493,7 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes_Note> ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_163() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_Note_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40159,7 +33504,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_164() { + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_Note_DeletePolicy_open1_JSErrorNotes_Note_close1_close0_instantiation_3() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes_Note>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40170,18 +33515,7 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes_Note> ) )); } #[test] - fn __bindgen_test_layout_iterator_instantiation_165() { - assert_eq!(::std::mem::size_of::<root::std::iterator>() , 1usize , - concat ! ( - "Size of template specialization: " , stringify ! ( - root::std::iterator ) )); - assert_eq!(::std::mem::align_of::<root::std::iterator>() , 1usize , - concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::std::iterator ) )); - } - #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_166() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_Note_close0_instantiation_3() { assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40192,7 +33526,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_167() { + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_Note_DeletePolicy_open1_JSErrorNotes_Note_close1_close0_instantiation_4() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes_Note>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40203,7 +33537,7 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes_Note> ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_168() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_Note_close0_instantiation_4() { assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40214,7 +33548,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_169() { + fn __bindgen_test_layout_UniquePtr_open0_JSErrorNotes_Note_DeletePolicy_open1_JSErrorNotes_Note_close1_close0_instantiation_5() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::JSErrorNotes_Note>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40225,7 +33559,18 @@ pub mod root { root::mozilla::UniquePtr<root::JSErrorNotes_Note> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_170() { + fn __bindgen_test_layout_DeletePolicy_open0_JSErrorNotes_Note_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::JS::DeletePolicy>() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::<root::JS::DeletePolicy>() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40236,29 +33581,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_171() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - } - #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_172() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - } - #[test] - fn __bindgen_test_layout_nsTArray_instantiation_173() { + fn __bindgen_test_layout_nsTArray_open0_nsCString_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCString>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40269,7 +33592,7 @@ pub mod root { root::nsTArray<root::nsCString> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_174() { + fn __bindgen_test_layout_nsTArray_open0_nsCString_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCString>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40280,77 +33603,44 @@ pub mod root { root::nsTArray<root::nsCString> ) )); } #[test] - fn __bindgen_test_layout_Heap_instantiation_175() { - assert_eq!(::std::mem::size_of::<root::JS::Heap<root::JS::Value>>() , - 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::Heap<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Heap<root::JS::Value>>() , - 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::JS::Heap<root::JS::Value> ) )); - } - #[test] - fn __bindgen_test_layout_Heap_instantiation_176() { - assert_eq!(::std::mem::size_of::<root::JS::Heap<*mut root::JSObject>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::Heap<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Heap<*mut root::JSObject>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::JS::Heap<*mut root::JSObject> ) )); - } - #[test] - fn __bindgen_test_layout_TenuredHeap_instantiation_177() { - assert_eq!(::std::mem::size_of::<root::JS::TenuredHeap>() , 8usize , - concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIDocument_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::JS::TenuredHeap ) )); - assert_eq!(::std::mem::align_of::<root::JS::TenuredHeap>() , 8usize , - concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::TenuredHeap ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_178() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_AnonymousContent_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>> + ) )); } #[test] - fn __bindgen_test_layout_NotNull_instantiation_179() { - assert_eq!(::std::mem::size_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_StyleSheet_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_180() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>> - ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>> - ) )); - } - #[test] - fn __bindgen_test_layout_RefPtr_instantiation_181() { + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40361,7 +33651,7 @@ pub mod root { root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_182() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_StyleSheet_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40374,7 +33664,7 @@ pub mod root { )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_183() { + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_3() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40385,31 +33675,31 @@ pub mod root { root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_184() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_211375_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) - )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + root::nsTArray<*mut root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) - )); + root::nsTArray<*mut root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_185() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_Element_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::Element>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::dom::Element> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() + root::nsTArray<root::RefPtr<root::mozilla::dom::Element>> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::Element>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::dom::Element> ) )); + root::nsTArray<root::RefPtr<root::mozilla::dom::Element>> ) + )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_186() { + fn __bindgen_test_layout_RefPtr_open0_Element_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40420,7 +33710,51 @@ pub mod root { root::RefPtr<root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_187() { + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIObserver_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsCOMPtr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsCOMPtr> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIObserver_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIObserver_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_211677_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::mozilla::dom::Element> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_Element_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::Element>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40433,7 +33767,29 @@ pub mod root { )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_188() { + fn __bindgen_test_layout_RefPtr_open0_Element_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::Element> ) )); + } + #[test] + fn __bindgen_test_layout_nsAutoPtr_open0_nsIDocument_SelectorCache_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::nsIDocument_SelectorCache>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsAutoPtr<root::nsIDocument_SelectorCache> ) )); + assert_eq!(::std::mem::align_of::<root::nsAutoPtr<root::nsIDocument_SelectorCache>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsAutoPtr<root::nsIDocument_SelectorCache> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40444,18 +33800,18 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_189() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::nsCOMPtr> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr>>() , - 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::nsCOMPtr> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_190() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40466,163 +33822,185 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_191() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIDocument>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIDocument> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIDocument>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIDocument> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_192() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_193() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_RefPtr_open0_URLExtraData_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::URLExtraData>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::RefPtr<root::mozilla::URLExtraData> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::URLExtraData>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::RefPtr<root::mozilla::URLExtraData> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_194() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() + fn __bindgen_test_layout_NotNull_open0__bindgen_ty_id_212219_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::dom::Element> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() + root::mozilla::NotNull<*const root::mozilla::Encoding> ) + )); + assert_eq!(::std::mem::align_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::dom::Element> ) )); + root::mozilla::NotNull<*const root::mozilla::Encoding> ) + )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_195() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIDocument>>() + fn __bindgen_test_layout_RefPtr_open0_Loader_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::Loader>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIDocument> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIDocument>>() + root::RefPtr<root::mozilla::css::Loader> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::Loader>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIDocument> ) )); + root::RefPtr<root::mozilla::css::Loader> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_196() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_ImageLoader_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::ImageLoader>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::css::ImageLoader> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::ImageLoader>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::css::ImageLoader> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_197() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsContentList>>() + fn __bindgen_test_layout_RefPtr_open0_nsHTMLStyleSheet_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsHTMLStyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsContentList> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsContentList>>() + root::RefPtr<root::nsHTMLStyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsHTMLStyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsContentList> ) )); + root::RefPtr<root::nsHTMLStyleSheet> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_198() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsContentList>>() + fn __bindgen_test_layout_RefPtr_open0_nsHTMLCSSStyleSheet_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsHTMLCSSStyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsContentList> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsContentList>>() + root::RefPtr<root::nsHTMLCSSStyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsHTMLCSSStyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsContentList> ) )); + root::RefPtr<root::nsHTMLCSSStyleSheet> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_199() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsINode>>() + fn __bindgen_test_layout_RefPtr_open0_ImageTracker_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::ImageTracker>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsINode> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsINode>>() + root::RefPtr<root::mozilla::dom::ImageTracker> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::ImageTracker>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsINode> ) )); + root::RefPtr<root::mozilla::dom::ImageTracker> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_200() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() + fn __bindgen_test_layout_nsAutoPtr_open0_nsTHashtable_open1_nsPtrHashKey_open2_nsISupports_close2_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + u64 ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_Link_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_nsSMILAnimationController_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsSMILAnimationController>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::Element> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() + root::RefPtr<root::nsSMILAnimationController> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsSMILAnimationController>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::Element> ) )); + root::RefPtr<root::nsSMILAnimationController> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_201() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::Element>>>() + fn __bindgen_test_layout_nsTArray_open0_nsAutoPtr_open1_nsPropertyTable_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsAutoPtr<root::nsPropertyTable>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::dom::Element>> ) + root::nsTArray<root::nsAutoPtr<root::nsPropertyTable>> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::Element>>>() + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsAutoPtr<root::nsPropertyTable>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::dom::Element>> ) + root::nsTArray<root::nsAutoPtr<root::nsPropertyTable>> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_202() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIHTMLCollection_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_203() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_RefPtr_open0_FontFaceSet_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::FontFaceSet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::RefPtr<root::mozilla::dom::FontFaceSet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::FontFaceSet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::RefPtr<root::mozilla::dom::FontFaceSet> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_204() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIRunnable>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIScriptGlobalObject_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIRunnable>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_205() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIDocument_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40633,7 +34011,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_206() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIChannel_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40644,130 +34022,297 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_207() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsISupports_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIChannel_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMArray_open0_nsINode_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMArray>() , 8usize , concat + ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMArray ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMArray>() , 8usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMArray ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIDocument_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIWeakReference_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsCOMPtr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsCOMPtr> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIWeakReference_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIDocumentEncoder_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsIDocument_FrameRequest_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsIDocument_FrameRequest>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::nsTArray<root::nsIDocument_FrameRequest> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsIDocument_FrameRequest>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::nsTArray<root::nsIDocument_FrameRequest> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_208() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIStructuredCloneContainer_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIVariant_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_XPathEvaluator_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::XPathEvaluator>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) - )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() + root::RefPtr<root::mozilla::dom::XPathEvaluator> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::XPathEvaluator>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) - )); + root::RefPtr<root::mozilla::dom::XPathEvaluator> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_209() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_AnonymousContent_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() + root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>> + ) )); + } + #[test] + fn __bindgen_test_layout_LinkedList_open0_MediaQueryList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::LinkedList>() , + 24usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::LinkedList ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::LinkedList>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::LinkedList ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_210() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_DocGroup_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DocGroup>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::dom::DocGroup> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DocGroup>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::dom::DocGroup> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_211() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_RefPtr_open0_CSSRuleListImpl_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::CSSRuleListImpl>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::RefPtr<root::CSSRuleListImpl> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::CSSRuleListImpl>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::RefPtr<root::CSSRuleListImpl> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_212() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_RefPtr_open0_Element_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::RefPtr<root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::RefPtr<root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_213() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_RefPtr_open0_ServoCSSRuleList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::ServoCSSRuleList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::RefPtr<root::mozilla::ServoCSSRuleList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::ServoCSSRuleList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::RefPtr<root::mozilla::ServoCSSRuleList> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_214() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_StyleSheet_close1_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_215() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::RefPtr<root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_216() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_212632_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_6() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_7() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_217() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::RefPtr<root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_218() { + fn __bindgen_test_layout_nsTArray_open0_nsCString_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCString>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsCString> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCString>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsCString> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_ServoStyleSheet_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::ServoStyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40780,7 +34325,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_219() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_213036_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40791,29 +34336,29 @@ pub mod root { root::nsTArray<*mut root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_220() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleContext>>() + fn __bindgen_test_layout_RefPtr_open0_RawServoAnimationValue_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoAnimationValue>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleContext>>() + root::RefPtr<root::RawServoAnimationValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::RawServoAnimationValue>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleContext> ) )); + root::RefPtr<root::RawServoAnimationValue> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_221() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoAnimationValue>>() + fn __bindgen_test_layout_UniquePtr_open0_RawServoStyleSet_DefaultDelete_open1_RawServoStyleSet_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::RawServoStyleSet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::RawServoAnimationValue> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::RawServoAnimationValue>>() + root::mozilla::UniquePtr<root::RawServoStyleSet> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::RawServoStyleSet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::RawServoAnimationValue> ) )); + root::mozilla::UniquePtr<root::RawServoStyleSet> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_222() { + fn __bindgen_test_layout_DefaultDelete_open0_RawServoStyleSet_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40824,7 +34369,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_223() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_ServoStyleSheet_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::ServoStyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40837,29 +34382,18 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_224() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsStyleContext>>() + fn __bindgen_test_layout_nsTArray_open0_PostTraversalTask_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::PostTraversalTask>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::nsStyleContext> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsStyleContext>>() + root::nsTArray<root::mozilla::PostTraversalTask> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::PostTraversalTask>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::nsStyleContext> ) )); + root::nsTArray<root::mozilla::PostTraversalTask> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_225() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - } - #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_226() { + fn __bindgen_test_layout_UniquePtr_open0_nsISMILAttr_DefaultDelete_open1_nsISMILAttr_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsISMILAttr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40870,18 +34404,18 @@ pub mod root { root::mozilla::UniquePtr<root::nsISMILAttr> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_227() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_nsISMILAttr_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_228() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -40892,108 +34426,96 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_229() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_214000_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<*mut root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_230() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsAutoPtr_open0_nsTHashtable_open1_nsRefPtrHashKey_open2_nsIContent_close2_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_231() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsRefPtrHashKey_open0_nsIContent_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIContent>>() + , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsRefPtrHashKey<root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIContent>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsRefPtrHashKey<root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_232() { - assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::mozilla::dom::DOMIntersectionObserver>>() - , 16usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::mozilla::dom::DOMIntersectionObserver> - ) )); - assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::mozilla::dom::DOMIntersectionObserver>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsAutoPtr_open0_nsInterfaceHashtable_open1_nsISupportsHashKey_nsIXPConnectWrappedJS_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::mozilla::dom::DOMIntersectionObserver> - ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_nsDataHashtable_instantiation_233() { - assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! - ( - "Size of template specialization: " , stringify ! ( - [u64; 5usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 5usize]>() , 8usize , concat ! - ( + fn __bindgen_test_layout_nsAutoPtr_open0_nsRefPtrHashtable_open1_nsURIHashKey_nsXBLDocumentInfo_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 5usize] ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_234() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsAutoPtr_open0_nsInterfaceHashtable_open1_nsURIHashKey_nsIStreamListener_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_235() { - assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIContent>>() - , 16usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIContent> ) )); - assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIContent>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_nsRunnableMethod_open1_nsBindingManager_void_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIContent> ) )); + u64 ) )); } #[test] - fn __bindgen_test_layout_nsTHashtable_instantiation_236() { - assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 5usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 5usize]>() , 8usize , concat ! - ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 5usize] ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_237() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_nsCSSFontFaceRule_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsCSSFontFaceRule>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::nsCSSFontFaceRule> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsCSSFontFaceRule>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::nsCSSFontFaceRule> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_238() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_214303_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41004,7 +34526,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_239() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_214308_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41015,29 +34537,18 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_240() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - } - #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_241() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_RefPtr_open0_nsStyleContext_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsStyleContext>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::RefPtr<root::nsStyleContext> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsStyleContext>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::RefPtr<root::nsStyleContext> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_242() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_3() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41048,18 +34559,18 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_243() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIStyleRule_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::CSSStyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::CSSStyleSheet> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_244() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_CSSStyleSheet_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::CSSStyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41072,29 +34583,29 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_245() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_RefPtr_open0_CSSStyleSheet_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() + root::RefPtr<root::mozilla::CSSStyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + root::RefPtr<root::mozilla::CSSStyleSheet> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_246() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_214785_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::CSSStyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() + root::nsTArray<*mut root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::CSSStyleSheet> ) )); + root::nsTArray<*mut root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_247() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_CSSStyleSheet_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::CSSStyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41107,7 +34618,29 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_248() { + fn __bindgen_test_layout_RefPtr_open0_CSSStyleSheet_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::CSSStyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::CSSStyleSheet>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::CSSStyleSheet> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIStyleRuleProcessor_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsCOMPtr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsCOMPtr> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIStyleRuleProcessor_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41118,97 +34651,117 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_SupportsWeakPtr_instantiation_249() { - assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) - )); - assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsRect_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsRect>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsRect> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsRect>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsTArray<root::nsRect> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_250() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIDocument_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_nsDeviceContext_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsDeviceContext>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::RefPtr<root::nsDeviceContext> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsDeviceContext>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::RefPtr<root::nsDeviceContext> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_251() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsRect>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_EventStateManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::EventStateManager>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::nsRect> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsRect>>() , - 8usize , concat ! ( + root::RefPtr<root::mozilla::EventStateManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::EventStateManager>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::nsRect> ) )); + root::RefPtr<root::mozilla::EventStateManager> ) )); } #[test] - fn __bindgen_test_layout_NotNull_instantiation_252() { - assert_eq!(::std::mem::size_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + fn __bindgen_test_layout_RefPtr_open0_nsRefreshDriver_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsRefreshDriver>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); - assert_eq!(::std::mem::align_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + root::RefPtr<root::nsRefreshDriver> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsRefreshDriver>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); + root::RefPtr<root::nsRefreshDriver> ) )); } #[test] - fn __bindgen_test_layout_NotNull_instantiation_253() { - assert_eq!(::std::mem::size_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + fn __bindgen_test_layout_RefPtr_open0_EffectCompositor_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::EffectCompositor>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); - assert_eq!(::std::mem::align_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + root::RefPtr<root::mozilla::EffectCompositor> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::EffectCompositor>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); + root::RefPtr<root::mozilla::EffectCompositor> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_254() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsITimer>>() + fn __bindgen_test_layout_RefPtr_open0_nsTransitionManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsTransitionManager>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsITimer> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsITimer>>() + root::RefPtr<root::nsTransitionManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsTransitionManager>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsITimer> ) )); + root::RefPtr<root::nsTransitionManager> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_255() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_nsAnimationManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsAnimationManager>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + root::RefPtr<root::nsAnimationManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsAnimationManager>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); + root::RefPtr<root::nsAnimationManager> ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_256() { - assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIAtom>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_RestyleManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::RestyleManager>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIAtom>>() + root::RefPtr<root::mozilla::RestyleManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::RestyleManager>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIAtom> ) )); + root::RefPtr<root::mozilla::RestyleManager> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_257() { + fn __bindgen_test_layout_RefPtr_open0_CounterStyleManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::CounterStyleManager>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::CounterStyleManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::CounterStyleManager>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::CounterStyleManager> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_4() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41219,150 +34772,194 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_258() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::nsCOMPtr> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr>>() , - 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::nsCOMPtr> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_259() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsITheme_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_260() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrintSettings_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_261() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsITimer_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_262() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + fn __bindgen_test_layout_UniquePtr_open0_nsBidi_DefaultDelete_open1_nsBidi_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsBidi>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + root::mozilla::UniquePtr<root::nsBidi> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsBidi>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::mozilla::UniquePtr<root::nsBidi> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_263() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_nsBidi_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::mozilla::DefaultDelete ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsRect_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsRect>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsRect> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsRect>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsRect> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_264() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsAutoPtr_open0_gfxTextPerfMetrics_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::gfxTextPerfMetrics>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsAutoPtr<root::gfxTextPerfMetrics> ) )); + assert_eq!(::std::mem::align_of::<root::nsAutoPtr<root::gfxTextPerfMetrics>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsAutoPtr<root::gfxTextPerfMetrics> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_265() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsAutoPtr_open0_gfxMissingFontRecorder_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::gfxMissingFontRecorder>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsAutoPtr<root::gfxMissingFontRecorder> ) )); + assert_eq!(::std::mem::align_of::<root::nsAutoPtr<root::gfxMissingFontRecorder>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsAutoPtr<root::gfxMissingFontRecorder> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_266() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsRefPtrHashKey_open0_nsIAtom_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIAtom>>() + , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsRefPtrHashKey<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIAtom>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsRefPtrHashKey<root::nsIAtom> ) )); } #[test] - fn __bindgen_test_layout_nsPIDOMWindow_instantiation_267() { - assert_eq!(::std::mem::size_of::<[u64; 30usize]>() , 240usize , concat - ! ( + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIAtom_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 30usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 30usize]>() , 8usize , concat - ! ( + root::nsTArray<root::nsCOMPtr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 30usize] ) )); + root::nsTArray<root::nsCOMPtr> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_268() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIContent>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_6() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIContent> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIContent>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIContent> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_269() { - assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 5usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 5usize]>() , 8usize , concat ! + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 5usize] ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_270() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_nsBindingManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsBindingManager>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::nsBindingManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsBindingManager>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::nsBindingManager> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_nsNodeInfoManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsNodeInfoManager>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsNodeInfoManager> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsNodeInfoManager>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsNodeInfoManager> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsCString_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCString>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsCString> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCString>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsCString> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_271() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_3() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41373,183 +34970,200 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_272() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_Element_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_273() { - assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::nsINode>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_StyleSheet_close1_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::nsINode> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::OwningNonNull<root::nsINode>>() + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::nsINode> ) )); + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_274() { - assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::nsINode>>() + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_6() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::nsINode> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::OwningNonNull<root::nsINode>>() + root::RefPtr<root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::nsINode> ) )); + root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_275() { - assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::nsINode>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_StyleSheet_close1_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::nsINode> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::OwningNonNull<root::nsINode>>() + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::nsINode> ) )); + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_276() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_7() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::RefPtr<root::mozilla::StyleSheet> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_277() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIContent_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_278() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIContent_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_279() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIDocument_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_280() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::jsid>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_nsPresContext_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsPresContext>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::jsid> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::jsid>>() , - 8usize , concat ! ( + root::RefPtr<root::nsPresContext> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsPresContext>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::jsid> ) )); + root::RefPtr<root::nsPresContext> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_281() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::PropertyDescriptor>>() + fn __bindgen_test_layout_RefPtr_open0_nsFrameSelection_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsFrameSelection>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::PropertyDescriptor> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::PropertyDescriptor>>() + root::RefPtr<root::nsFrameSelection> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsFrameSelection>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::PropertyDescriptor> ) )); + root::RefPtr<root::nsFrameSelection> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_282() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::jsid>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsITimer_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::jsid> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::jsid>>() , - 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::jsid> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_283() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::PropertyDescriptor>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsPtrHashKey_open0_WeakFrame_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<root::WeakFrame>>() + , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::PropertyDescriptor> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::PropertyDescriptor>>() + root::nsPtrHashKey<root::WeakFrame> ) )); + assert_eq!(::std::mem::align_of::<root::nsPtrHashKey<root::WeakFrame>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::PropertyDescriptor> ) )); + root::nsPtrHashKey<root::WeakFrame> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_284() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsISupports_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_285() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIContent_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_nsXBLBinding_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsXBLBinding>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsXBLBinding> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsXBLBinding>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::nsXBLBinding> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_286() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_XBLChildrenElement_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::XBLChildrenElement>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::dom::XBLChildrenElement> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::XBLChildrenElement>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::dom::XBLChildrenElement> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_287() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_XBLChildrenElement_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::XBLChildrenElement>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<*mut root::JSObject>>() + root::nsTArray<root::RefPtr<root::mozilla::dom::XBLChildrenElement>> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::XBLChildrenElement>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<*mut root::JSObject> ) )); + root::nsTArray<root::RefPtr<root::mozilla::dom::XBLChildrenElement>> + ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_288() { + fn __bindgen_test_layout_RefPtr_open0_XBLChildrenElement_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::XBLChildrenElement>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41560,7 +35174,18 @@ pub mod root { root::RefPtr<root::mozilla::dom::XBLChildrenElement> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_289() { + fn __bindgen_test_layout_RefPtr_open0_nsAnonymousContentList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsAnonymousContentList>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsAnonymousContentList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsAnonymousContentList>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsAnonymousContentList> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_8() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41571,193 +35196,207 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_290() { - assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<::std::os::raw::c_void>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_9() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::nsPtrHashKey<::std::os::raw::c_void> ) )); - assert_eq!(::std::mem::align_of::<root::nsPtrHashKey<::std::os::raw::c_void>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::nsPtrHashKey<::std::os::raw::c_void> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_291() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIRunnable>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIRunnable>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_292() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIRunnable>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIWeakReference_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIRunnable>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_NotNull_instantiation_293() { - assert_eq!(::std::mem::size_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_217614_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut ::std::os::raw::c_void>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); - assert_eq!(::std::mem::align_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() + root::nsTArray<*mut ::std::os::raw::c_void> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut ::std::os::raw::c_void>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); + root::nsTArray<*mut ::std::os::raw::c_void> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_294() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsPtrHashKey_open0_void_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<::std::os::raw::c_void>>() + , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::nsPtrHashKey<::std::os::raw::c_void> ) )); + assert_eq!(::std::mem::align_of::<root::nsPtrHashKey<::std::os::raw::c_void>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::nsPtrHashKey<::std::os::raw::c_void> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_295() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() + fn __bindgen_test_layout_StaticRefPtr_open0_nsIContent_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::StaticRefPtr<root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::mozilla::StaticRefPtr<root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::StaticRefPtr<root::nsIContent>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::mozilla::StaticRefPtr<root::nsIContent> ) )); } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct _bindgen_ty_51 { - pub _address: u8, + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_7() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); } - impl Clone for _bindgen_ty_51 { - fn clone(&self) -> Self { *self } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIGlobalObject_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_296() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIRunnable>>() + fn __bindgen_test_layout_UniquePtr_open0_TimeoutManager_DefaultDelete_open1_TimeoutManager_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::mozilla::dom::TimeoutManager>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIRunnable>>() + root::mozilla::UniquePtr<root::mozilla::dom::TimeoutManager> + ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::mozilla::dom::TimeoutManager>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIRunnable> ) )); + root::mozilla::UniquePtr<root::mozilla::dom::TimeoutManager> + ) )); } #[test] - fn __bindgen_test_layout_nsPIDOMWindow_instantiation_297() { - assert_eq!(::std::mem::size_of::<[u64; 30usize]>() , 240usize , concat - ! ( + fn __bindgen_test_layout_DefaultDelete_open0_TimeoutManager_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 30usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 30usize]>() , 8usize , concat - ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 30usize] ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_298() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_223939_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::dom::AudioContext>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsTArray<*mut root::mozilla::dom::AudioContext> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::dom::AudioContext>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsTArray<*mut root::mozilla::dom::AudioContext> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_299() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0_ErrorNote_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::xpc::ErrorNote>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsTArray<root::xpc::ErrorNote> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::xpc::ErrorNote>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsTArray<root::xpc::ErrorNote> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_300() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::CSSValue>>() + fn __bindgen_test_layout_RefPtr_open0_CallbackObject_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::CallbackObject>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::CSSValue> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::CSSValue>>() + root::RefPtr<root::mozilla::dom::CallbackObject> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::CallbackObject>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::CSSValue> ) )); + root::RefPtr<root::mozilla::dom::CallbackObject> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_301() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_225100_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::JS::Heap<*mut root::JSObject>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + root::JS::Heap<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::<root::JS::Heap<*mut root::JSObject>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); + root::JS::Heap<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_302() { - assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! - ( + fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_225104_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::JS::Heap<*mut root::JSObject>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 5usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 5usize]>() , 8usize , concat ! - ( + root::JS::Heap<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::<root::JS::Heap<*mut root::JSObject>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 5usize] ) )); + root::JS::Heap<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Rooted_instantiation_303() { - assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! + fn __bindgen_test_layout_nsCOMPtr_open0_nsIGlobalObject_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 3usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 3usize]>() , 8usize , concat ! - ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 3usize] ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_Rooted_instantiation_304() { - assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! - ( + fn __bindgen_test_layout_TenuredHeap_open0__bindgen_ty_id_225111_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::JS::TenuredHeap>() , 8usize , + concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 3usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 3usize]>() , 8usize , concat ! - ( + root::JS::TenuredHeap ) )); + assert_eq!(::std::mem::align_of::<root::JS::TenuredHeap>() , 8usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 3usize] ) )); + root::JS::TenuredHeap ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_305() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsISupports>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsISupports_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsISupports> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsISupports>>() - , 8usize , concat ! ( + root::nsTArray<root::nsCOMPtr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsISupports> ) )); + root::nsTArray<root::nsCOMPtr> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_306() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsISupports_close0_instantiation_3() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41768,7 +35407,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_307() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41779,75 +35418,75 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_NotNull_instantiation_308() { - assert_eq!(::std::mem::size_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); - assert_eq!(::std::mem::align_of::<root::mozilla::NotNull<*const root::mozilla::Encoding>>() - , 8usize , concat ! ( + root::nsTArray<root::nsCOMPtr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::NotNull<*const root::mozilla::Encoding> ) - )); + root::nsTArray<root::nsCOMPtr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_309() { - assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::nsTArray<::nsstring::nsStringRepr> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , - 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<::nsstring::nsStringRepr> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_310() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0_CycleCollectedJSContext_RunInMetastableStateData_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::CycleCollectedJSContext_RunInMetastableStateData>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::nsTArray<root::mozilla::CycleCollectedJSContext_RunInMetastableStateData> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::CycleCollectedJSContext_RunInMetastableStateData>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::nsTArray<root::mozilla::CycleCollectedJSContext_RunInMetastableStateData> + ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_311() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_226568_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsISupports>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsTArray<*mut root::nsISupports> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsISupports>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsTArray<*mut root::nsISupports> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_312() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_313() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_10() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_314() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_5() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41858,18 +35497,20 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_315() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_SheetLoadData_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>> + ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_316() { + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_8() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41880,86 +35521,123 @@ pub mod root { root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_317() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_nsAutoPtr_open0_Loader_Sheets_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::mozilla::css::Loader_Sheets>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::nsAutoPtr<root::mozilla::css::Loader_Sheets> ) )); + assert_eq!(::std::mem::align_of::<root::nsAutoPtr<root::mozilla::css::Loader_Sheets>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::nsAutoPtr<root::mozilla::css::Loader_Sheets> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_318() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_RefPtr_open0_DocGroup_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DocGroup>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::RefPtr<root::mozilla::dom::DocGroup> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DocGroup>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::RefPtr<root::mozilla::dom::DocGroup> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_319() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIConsoleReportCollector_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_double_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<f64>>() , 8usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<f64> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<f64>>() , 8usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<f64> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_DOMIntersectionObserverEntry_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>> + root::nsTArray<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>>>() + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::RefPtr<root::mozilla::css::SheetLoadData>> + root::nsTArray<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_320() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_RefPtr_open0_DOMIntersectionObserverEntry_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry> + ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry> + ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_321() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsPIDOMWindowInner_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_322() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_RefPtr_open0_nsIDocument_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsIDocument>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsIDocument> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsIDocument>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsIDocument> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_IntersectionCallback_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::IntersectionCallback>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::RefPtr<root::mozilla::dom::IntersectionCallback> ) + )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::IntersectionCallback>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::RefPtr<root::mozilla::dom::IntersectionCallback> ) + )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_323() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_Element_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_324() { + fn __bindgen_test_layout_nsTArray_open0_double_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<f64>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41970,20 +35648,18 @@ pub mod root { root::nsTArray<f64> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_325() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_227943_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry> - ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>() + root::nsTArray<*mut root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry> - ) )); + root::nsTArray<*mut root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_326() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_DOMIntersectionObserverEntry_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -41996,7 +35672,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_327() { + fn __bindgen_test_layout_RefPtr_open0_DOMIntersectionObserverEntry_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42009,7 +35685,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_328() { + fn __bindgen_test_layout_UniquePtr_open0_ProfilerBacktrace_ProfilerBacktraceDestructor_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::ProfilerBacktrace>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42020,7 +35696,7 @@ pub mod root { root::mozilla::UniquePtr<root::ProfilerBacktrace> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_329() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_6() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42031,108 +35707,154 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_330() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_8() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_331() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsAutoPtr_open0_LangGroupFontPrefs_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::mozilla::LangGroupFontPrefs>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsAutoPtr<root::mozilla::LangGroupFontPrefs> ) )); + assert_eq!(::std::mem::align_of::<root::nsAutoPtr<root::mozilla::LangGroupFontPrefs>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsAutoPtr<root::mozilla::LangGroupFontPrefs> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_332() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_OwningNonNull_open0_EffectCompositor_AnimationStyleRuleProcessor_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor> + ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor> + ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_333() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsRefPtrHashKey_open0_nsIAtom_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIAtom>>() + , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsRefPtrHashKey<root::nsIAtom> ) )); + assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIAtom>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsRefPtrHashKey<root::nsIAtom> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_334() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_230331_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::CounterStyle>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::nsTArray<*mut root::mozilla::CounterStyle> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::CounterStyle>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::nsTArray<*mut root::mozilla::CounterStyle> ) )); } #[test] - fn __bindgen_test_layout_nsDataHashtable_instantiation_335() { - assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! - ( + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 5usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 5usize]>() , 8usize , concat ! + root::nsTArray<root::nsCOMPtr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsCOMPtr> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 5usize] ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_336() { - assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>() + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_7() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_open0_URLParams_DefaultDelete_open1_URLParams_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::mozilla::dom::URLParams>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor> - ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>() + root::mozilla::UniquePtr<root::mozilla::dom::URLParams> ) + )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::mozilla::dom::URLParams>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor> - ) )); + root::mozilla::UniquePtr<root::mozilla::dom::URLParams> ) + )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_337() { - assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIAtom>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_URLParams_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIAtom>>() + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_8() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_URLParams_Param_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::dom::URLParams_Param>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::dom::URLParams_Param> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::dom::URLParams_Param>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIAtom> ) )); + root::nsTArray<root::mozilla::dom::URLParams_Param> ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_338() { - assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::nsIContent>>() - , 16usize , concat ! ( + fn __bindgen_test_layout_UniquePtr_open0_const_char_XREAppData_NSFreePolicy_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<::std::os::raw::c_char>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIContent> ) )); - assert_eq!(::std::mem::align_of::<root::nsRefPtrHashKey<root::nsIContent>>() + root::mozilla::UniquePtr<::std::os::raw::c_char> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<::std::os::raw::c_char>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsRefPtrHashKey<root::nsIContent> ) )); + root::mozilla::UniquePtr<::std::os::raw::c_char> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_339() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIEventTarget_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42143,7 +35865,29 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_340() { + fn __bindgen_test_layout_RefPtr_open0_imgRequestProxy_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::imgRequestProxy>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::imgRequestProxy> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::imgRequestProxy>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::imgRequestProxy> ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_open0_ProxyBehaviour_DefaultDelete_open1_ProxyBehaviour_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::ProxyBehaviour>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr<root::ProxyBehaviour> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::ProxyBehaviour>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr<root::ProxyBehaviour> ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_open0_ProxyBehaviour_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42154,84 +35898,84 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_341() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + fn __bindgen_test_layout_RefPtr_open0_ImageURL_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::image::ImageURL>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + root::RefPtr<root::mozilla::image::ImageURL> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::image::ImageURL>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); + root::RefPtr<root::mozilla::image::ImageURL> ) )); } #[test] - fn __bindgen_test_layout_nsMainThreadPtrHolder_instantiation_342() { - assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHolder<root::nsIURI>>() - , 40usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsILoadGroup_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::nsMainThreadPtrHolder<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::nsMainThreadPtrHolder<root::nsIURI>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::nsMainThreadPtrHolder<root::nsIURI> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_343() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + fn __bindgen_test_layout_RefPtr_open0_TabGroup_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::TabGroup>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + root::RefPtr<root::mozilla::dom::TabGroup> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::TabGroup>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); + root::RefPtr<root::mozilla::dom::TabGroup> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_344() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsIEventTarget_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_345() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsMainThreadPtrHolder_open0_nsIURI_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHolder<root::nsIURI>>() + , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::nsMainThreadPtrHolder<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsMainThreadPtrHolder<root::nsIURI>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsMainThreadPtrHolder<root::nsIURI> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_346() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + fn __bindgen_test_layout_nsMainThreadPtrHandle_open0_nsIURI_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHandle<root::nsIURI>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + root::nsMainThreadPtrHandle<root::nsIURI> ) )); + assert_eq!(::std::mem::align_of::<root::nsMainThreadPtrHandle<root::nsIURI>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); + root::nsMainThreadPtrHandle<root::nsIURI> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_347() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + fn __bindgen_test_layout_RefPtr_open0_URLExtraData_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::URLExtraData>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::URLExtraData>>() + root::RefPtr<root::mozilla::URLExtraData> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::URLExtraData>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::URLExtraData> ) )); + root::RefPtr<root::mozilla::URLExtraData> ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_348() { + fn __bindgen_test_layout_nsPtrHashKey_open0_nsIDocument_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<root::nsIDocument>>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42242,29 +35986,73 @@ pub mod root { root::nsPtrHashKey<root::nsIDocument> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_349() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() + fn __bindgen_test_layout_nsTArray_open0_GridNamedArea_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::css::GridNamedArea>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::nsTArray<root::mozilla::css::GridNamedArea> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::css::GridNamedArea>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::nsTArray<root::mozilla::css::GridNamedArea> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_350() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_9() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsCSSValueGradientStop_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCSSValueGradientStop>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsCSSValueGradientStop> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCSSValueGradientStop>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsCSSValueGradientStop> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_11() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_351() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_12() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_open0_nsCSSValueList_DefaultDelete_open1_nsCSSValueList_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValueList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42275,7 +36063,7 @@ pub mod root { root::mozilla::UniquePtr<root::nsCSSValueList> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_352() { + fn __bindgen_test_layout_DefaultDelete_open0_nsCSSValueList_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42286,7 +36074,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_353() { + fn __bindgen_test_layout_UniquePtr_open0_nsCSSValuePairList_DefaultDelete_open1_nsCSSValuePairList_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42297,27 +36085,29 @@ pub mod root { root::mozilla::UniquePtr<root::nsCSSValuePairList> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_354() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStringBuffer>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_nsCSSValuePairList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStringBuffer> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStringBuffer>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStringBuffer> ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_SupportsWeakPtr_instantiation_355() { - assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) - )); - assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_10() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_356() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_11() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42328,7 +36118,7 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_357() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_12() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42339,73 +36129,73 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_358() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() + fn __bindgen_test_layout_nsTArray_open0_nsStyleGradientStop_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleGradientStop>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() + root::nsTArray<root::nsStyleGradientStop> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleGradientStop>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::nsTArray<root::nsStyleGradientStop> ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_359() { - assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_imgRequestProxy_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::imgRequestProxy>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 3usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 3usize]>() , 4usize , concat ! - ( + root::RefPtr<root::imgRequestProxy> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::imgRequestProxy>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 3usize] ) )); + root::RefPtr<root::imgRequestProxy> ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_360() { - assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! - ( + fn __bindgen_test_layout_RefPtr_open0_ImageValue_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::ImageValue>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 3usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 3usize]>() , 4usize , concat ! - ( + root::RefPtr<root::mozilla::css::ImageValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::ImageValue>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 3usize] ) )); + root::RefPtr<root::mozilla::css::ImageValue> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_361() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleImageRequest>>() + fn __bindgen_test_layout_RefPtr_open0_ImageTracker_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::ImageTracker>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleImageRequest> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsStyleImageRequest>>() + root::RefPtr<root::mozilla::dom::ImageTracker> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::ImageTracker>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsStyleImageRequest> ) )); + root::RefPtr<root::mozilla::dom::ImageTracker> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_362() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIAtom>>() + fn __bindgen_test_layout_RefPtr_open0_DocGroup_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DocGroup>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIAtom>>() + root::RefPtr<root::mozilla::dom::DocGroup> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DocGroup>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIAtom> ) )); + root::RefPtr<root::mozilla::dom::DocGroup> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_363() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + fn __bindgen_test_layout_nsCOMArray_open0_imgIContainer_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMArray>() , 8usize , concat + ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + root::nsCOMArray ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMArray>() , 8usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); + root::nsCOMArray ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_364() { + fn __bindgen_test_layout_UniquePtr_open0_nsStyleSides_DefaultDelete_open1_nsStyleSides_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsStyleSides>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42416,7 +36206,7 @@ pub mod root { root::mozilla::UniquePtr<root::nsStyleSides> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_365() { + fn __bindgen_test_layout_DefaultDelete_open0_nsStyleSides_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42427,7 +36217,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_366() { + fn __bindgen_test_layout_UniquePtr_open0_nsStyleSides_DefaultDelete_open1_nsStyleSides_close1_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsStyleSides>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42438,29 +36228,29 @@ pub mod root { root::mozilla::UniquePtr<root::nsStyleSides> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_367() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_nsStyleSides_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsIURI>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::nsIURI> ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_368() { - assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! - ( + fn __bindgen_test_layout_UniquePtr_open0_CachedBorderImageData_DefaultDelete_open1_CachedBorderImageData_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::CachedBorderImageData>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u32; 3usize] ) )); - assert_eq!(::std::mem::align_of::<[u32; 3usize]>() , 4usize , concat ! - ( + root::mozilla::UniquePtr<root::CachedBorderImageData> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::CachedBorderImageData>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u32; 3usize] ) )); + root::mozilla::UniquePtr<root::CachedBorderImageData> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_369() { + fn __bindgen_test_layout_DefaultDelete_open0_CachedBorderImageData_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42471,7 +36261,18 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_370() { + fn __bindgen_test_layout_UniquePtr_open0_nsStyleSides_DefaultDelete_open1_nsStyleSides_close1_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsStyleSides>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr<root::nsStyleSides> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsStyleSides>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr<root::nsStyleSides> ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_open0_nsStyleSides_close0_instantiation_2() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42482,18 +36283,20 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_pair_instantiation_371() { - assert_eq!(::std::mem::size_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>() - , 32usize , concat ! ( + fn __bindgen_test_layout_nsStyleAutoArray_open0_nsStyleImageLayers_Layer_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsStyleAutoArray<root::nsStyleImageLayers_Layer>>() + , 104usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); - assert_eq!(::std::mem::align_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>() + root::nsStyleAutoArray<root::nsStyleImageLayers_Layer> ) + )); + assert_eq!(::std::mem::align_of::<root::nsStyleAutoArray<root::nsStyleImageLayers_Layer>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); + root::nsStyleAutoArray<root::nsStyleImageLayers_Layer> ) + )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_372() { + fn __bindgen_test_layout_nsTArray_open0_pair_open1_nsString_nsString_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>>() , 8usize , concat ! ( @@ -42508,7 +36311,73 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_373() { + fn __bindgen_test_layout_pair_open0_nsString_nsString_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>() + , 32usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsTArray_open1_nsString_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsTArray<::nsstring::nsStringRepr>>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsTArray<::nsstring::nsStringRepr>> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsTArray<::nsstring::nsStringRepr>>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsTArray<::nsstring::nsStringRepr>> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_13() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsStyleCoord_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCoord>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsStyleCoord> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleCoord>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsStyleCoord> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsStyleCoord_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCoord>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsStyleCoord> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleCoord>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsStyleCoord> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_14() { + assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_15() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42519,7 +36388,18 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_374() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_9() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsStyleCoord_close0_instantiation_3() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCoord>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42530,7 +36410,7 @@ pub mod root { root::nsTArray<root::nsStyleCoord> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_375() { + fn __bindgen_test_layout_nsTArray_open0_nsStyleCoord_close0_instantiation_4() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCoord>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42541,7 +36421,84 @@ pub mod root { root::nsTArray<root::nsStyleCoord> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_376() { + fn __bindgen_test_layout_nsTArray_open0_nsStyleCoord_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleCoord>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsStyleCoord> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleCoord>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsStyleCoord> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_URLValue_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::css::URLValue>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::css::URLValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::css::URLValue>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::css::URLValue> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_nsStyleImageRequest_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsStyleImageRequest>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsStyleImageRequest> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsStyleImageRequest>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsStyleImageRequest> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_232810_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsISupports>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsISupports> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsISupports>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsISupports> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_ServoAttrSnapshot_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::ServoAttrSnapshot>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::ServoAttrSnapshot> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::ServoAttrSnapshot>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::ServoAttrSnapshot> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_PropertyValuePair_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::PropertyValuePair>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::PropertyValuePair> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::PropertyValuePair>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::PropertyValuePair> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_RawServoDeclarationBlock_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoDeclarationBlock>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::RawServoDeclarationBlock> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::RawServoDeclarationBlock>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::RawServoDeclarationBlock> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_open0_RawServoAnimationValue_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoAnimationValue>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42552,7 +36509,7 @@ pub mod root { root::RefPtr<root::RawServoAnimationValue> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_377() { + fn __bindgen_test_layout_nsTArray_open0_PropertyValuePair_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::PropertyValuePair>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42563,7 +36520,7 @@ pub mod root { root::nsTArray<root::mozilla::PropertyValuePair> ) )); } #[test] - fn __bindgen_test_layout_nsStyleAutoArray_instantiation_378() { + fn __bindgen_test_layout_nsStyleAutoArray_open0_StyleAnimation_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsStyleAutoArray<root::mozilla::StyleAnimation>>() , 64usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42574,7 +36531,18 @@ pub mod root { root::nsStyleAutoArray<root::mozilla::StyleAnimation> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_379() { + fn __bindgen_test_layout_UniquePtr_open0_nsCSSValueList_DefaultDelete_open1_nsCSSValueList_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValueList>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr<root::nsCSSValueList> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsCSSValueList>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr<root::nsCSSValueList> ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_open0_nsCSSValueList_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42585,18 +36553,18 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_380() { - assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValueList>>() + fn __bindgen_test_layout_UniquePtr_open0_nsCSSValuePairList_DefaultDelete_open1_nsCSSValuePairList_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::UniquePtr<root::nsCSSValueList> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsCSSValueList>>() + root::mozilla::UniquePtr<root::nsCSSValuePairList> ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::UniquePtr<root::nsCSSValueList> ) )); + root::mozilla::UniquePtr<root::nsCSSValuePairList> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_381() { + fn __bindgen_test_layout_DefaultDelete_open0_nsCSSValuePairList_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42607,29 +36575,31 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_382() { - assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList>>() + fn __bindgen_test_layout_RefPtr_open0_RawServoAnimationValue_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoAnimationValue>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::UniquePtr<root::nsCSSValuePairList> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList>>() + root::RefPtr<root::RawServoAnimationValue> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::RawServoAnimationValue>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::UniquePtr<root::nsCSSValuePairList> ) )); + root::RefPtr<root::RawServoAnimationValue> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_383() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_StyleSheet_close1_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::StyleSheet>>() + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::StyleSheet> ) )); + root::nsTArray<root::RefPtr<root::mozilla::StyleSheet>> ) + )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_384() { + fn __bindgen_test_layout_RefPtr_open0_StyleSheet_close0_instantiation_9() { assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42640,88 +36610,143 @@ pub mod root { root::RefPtr<root::mozilla::StyleSheet> ) )); } #[test] - fn __bindgen_test_layout_NonNull_instantiation_385() { - assert_eq!(::std::mem::size_of::<root::mozilla::dom::NonNull<root::mozilla::dom::Element>>() + fn __bindgen_test_layout_RefPtr_open0_RawServoStyleSheetContents_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoStyleSheetContents>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::dom::NonNull<root::mozilla::dom::Element> ) - )); - assert_eq!(::std::mem::align_of::<root::mozilla::dom::NonNull<root::mozilla::dom::Element>>() + root::RefPtr<root::RawServoStyleSheetContents> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::RawServoStyleSheetContents>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::dom::NonNull<root::mozilla::dom::Element> ) - )); + root::RefPtr<root::RawServoStyleSheetContents> ) )); } #[test] - fn __bindgen_test_layout_NonNull_instantiation_386() { - assert_eq!(::std::mem::size_of::<root::mozilla::dom::NonNull<root::mozilla::dom::CSSPseudoElement>>() + fn __bindgen_test_layout_RefPtr_open0_URLExtraData_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::URLExtraData>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::dom::NonNull<root::mozilla::dom::CSSPseudoElement> - ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::dom::NonNull<root::mozilla::dom::CSSPseudoElement>>() + root::RefPtr<root::mozilla::URLExtraData> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::URLExtraData>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::dom::NonNull<root::mozilla::dom::CSSPseudoElement> - ) )); + root::RefPtr<root::mozilla::URLExtraData> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_387() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0_nsMediaQueryResultCacheKey_ExpressionEntry_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsMediaQueryResultCacheKey_ExpressionEntry>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsTArray<root::nsMediaQueryResultCacheKey_ExpressionEntry> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsMediaQueryResultCacheKey_ExpressionEntry>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<root::nsMediaQueryResultCacheKey_ExpressionEntry> + ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_388() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0_nsMediaQueryResultCacheKey_FeatureEntry_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsMediaQueryResultCacheKey_FeatureEntry>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::nsTArray<root::nsMediaQueryResultCacheKey_FeatureEntry> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsMediaQueryResultCacheKey_FeatureEntry>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::nsTArray<root::nsMediaQueryResultCacheKey_FeatureEntry> + ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_389() { - assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat + fn __bindgen_test_layout_nsCOMPtr_open0_nsIPrincipal_close0_instantiation_6() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_BaseTimeDuration_open0_StickyTimeDurationValueCalculator_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::BaseTimeDuration>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::BaseTimeDuration ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::BaseTimeDuration>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::BaseTimeDuration ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIURI_close0_instantiation_13() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - [u64; 18usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 18usize]>() , 8usize , concat + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 18usize] ) )); + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_240615_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsIContent>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_390() { - assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_240620_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsIContent>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIContent_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsICSSDeclaration_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - [u64; 18usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 18usize]>() , 8usize , concat + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 18usize] ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_BaseTimeDuration_instantiation_391() { - assert_eq!(::std::mem::size_of::<root::mozilla::BaseTimeDuration>() , - 8usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_DeclarationBlock_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::DeclarationBlock>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::BaseTimeDuration ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::BaseTimeDuration>() , - 8usize , concat ! ( + root::RefPtr<root::mozilla::DeclarationBlock> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::DeclarationBlock>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::BaseTimeDuration ) )); + root::RefPtr<root::mozilla::DeclarationBlock> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_392() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIControllers_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42732,40 +36757,40 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_393() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + fn __bindgen_test_layout_RefPtr_open0_nsLabelsNodeList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsLabelsNodeList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + root::RefPtr<root::nsLabelsNodeList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsLabelsNodeList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::RefPtr<root::nsLabelsNodeList> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_394() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + fn __bindgen_test_layout_RefPtr_open0_ShadowRoot_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::ShadowRoot>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() + root::RefPtr<root::mozilla::dom::ShadowRoot> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::ShadowRoot>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::RefPtr<root::mozilla::dom::ShadowRoot> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_395() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() + fn __bindgen_test_layout_RefPtr_open0_ShadowRoot_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::ShadowRoot>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::nsIContent> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsIContent>>() + root::RefPtr<root::mozilla::dom::ShadowRoot> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::ShadowRoot>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::nsIContent> ) )); + root::RefPtr<root::mozilla::dom::ShadowRoot> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_396() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_240733_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42776,7 +36801,18 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_397() { + fn __bindgen_test_layout_RefPtr_open0_nsXBLBinding_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsXBLBinding>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsXBLBinding> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsXBLBinding>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsXBLBinding> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIContent_close0_instantiation_4() { assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42787,7 +36823,18 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_398() { + fn __bindgen_test_layout_RefPtr_open0_CustomElementData_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::CustomElementData>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::CustomElementData> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::CustomElementData>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::CustomElementData> ) )); + } + #[test] + fn __bindgen_test_layout_nsRefPtrHashKey_open0_DOMIntersectionObserver_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::mozilla::dom::DOMIntersectionObserver>>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -42800,201 +36847,213 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_399() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsISupports_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_400() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsICSSDeclaration_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::NodeInfo>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::NodeInfo> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_401() { - assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() + fn __bindgen_test_layout_RefPtr_open0_nsDOMAttributeMap_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsDOMAttributeMap>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect> - ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() + root::RefPtr<root::nsDOMAttributeMap> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsDOMAttributeMap>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect> - ) )); + root::RefPtr<root::nsDOMAttributeMap> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_402() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_nsContentList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsContentList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::nsContentList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsContentList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::nsContentList> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_403() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_nsDOMTokenList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsDOMTokenList>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::nsDOMTokenList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsDOMTokenList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::nsDOMTokenList> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_404() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() + fn __bindgen_test_layout_UniquePtr_open0_FragmentOrElement_nsExtendedDOMSlots_DefaultDelete_open1_FragmentOrElement_nsExtendedDOMSlots_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::mozilla::dom::FragmentOrElement_nsExtendedDOMSlots>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::DOMRect> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() + root::mozilla::UniquePtr<root::mozilla::dom::FragmentOrElement_nsExtendedDOMSlots> + ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::mozilla::dom::FragmentOrElement_nsExtendedDOMSlots>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::mozilla::dom::DOMRect> ) )); + root::mozilla::UniquePtr<root::mozilla::dom::FragmentOrElement_nsExtendedDOMSlots> + ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_405() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_DefaultDelete_open0_FragmentOrElement_nsExtendedDOMSlots_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() - , 8usize , concat ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , + 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_406() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_nsDOMAttributeMap_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsDOMAttributeMap>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::RefPtr<root::nsDOMAttributeMap> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsDOMAttributeMap>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::RefPtr<root::nsDOMAttributeMap> ) )); } #[test] - fn __bindgen_test_layout_Sequence_instantiation_407() { - assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) - )); - assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_DisplayItemClip_RoundedRect_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect> + ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_408() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_nsTArray_open0_DisplayItemClip_RoundedRect_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect> + ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect> + ) )); } #[test] - fn __bindgen_test_layout_Sequence_instantiation_409() { - assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) - )); - assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_open0_nsPoint_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsPoint>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsPoint> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsPoint>>() , + 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsTArray<root::nsPoint> ) )); } #[test] - fn __bindgen_test_layout_Sequence_instantiation_410() { - assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_DOMRect_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::DOMRect>>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::RefPtr<root::mozilla::dom::DOMRect>> ) )); - assert_eq!(::std::mem::align_of::<u64>() , 8usize , concat ! ( + assert_eq!(::std::mem::align_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::DOMRect>>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsTArray<root::RefPtr<root::mozilla::dom::DOMRect>> ) + )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_411() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_DOMRect_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::RefPtr<root::mozilla::dom::DOMRect> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::RefPtr<root::mozilla::dom::DOMRect> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_412() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsCOMPtr_open0_nsISupports_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() - , 8usize , concat ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_413() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_DOMRect_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::RefPtr<root::mozilla::dom::DOMRect> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::RefPtr<root::mozilla::dom::DOMRect> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_414() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_DOMRect_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<root::JS::Value>>() + root::RefPtr<root::mozilla::dom::DOMRect> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<root::JS::Value> ) )); + root::RefPtr<root::mozilla::dom::DOMRect> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_415() { - assert_eq!(::std::mem::size_of::<root::JS::MutableHandle<root::JS::Value>>() + fn __bindgen_test_layout_RefPtr_open0_DOMRect_close0_instantiation_3() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); - assert_eq!(::std::mem::align_of::<root::JS::MutableHandle<root::JS::Value>>() + root::RefPtr<root::mozilla::dom::DOMRect> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<root::JS::Value> ) )); + root::RefPtr<root::mozilla::dom::DOMRect> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_416() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_RefPtr_open0_Element_close0_instantiation_4() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::RefPtr<root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::RefPtr<root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_417() { + fn __bindgen_test_layout_nsRefPtrHashKey_open0_Element_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsRefPtrHashKey<root::mozilla::dom::Element>>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43005,29 +37064,42 @@ pub mod root { root::nsRefPtrHashKey<root::mozilla::dom::Element> ) )); } #[test] - fn __bindgen_test_layout_nsClassHashtable_instantiation_418() { - assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! - ( + fn __bindgen_test_layout_nsAutoPtr_open0_ExplicitChildIterator_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::mozilla::dom::ExplicitChildIterator>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 5usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 5usize]>() , 8usize , concat ! - ( + root::nsAutoPtr<root::mozilla::dom::ExplicitChildIterator> + ) )); + assert_eq!(::std::mem::align_of::<root::nsAutoPtr<root::mozilla::dom::ExplicitChildIterator>>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 5usize] ) )); + root::nsAutoPtr<root::mozilla::dom::ExplicitChildIterator> + ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_419() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_242339_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsTArray<*mut root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_420() { + fn __bindgen_test_layout_RefPtr_open0_Element_close0_instantiation_5() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::Element> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::mozilla::dom::Element>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::mozilla::dom::Element> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_242497_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43038,7 +37110,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_421() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_242502_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43049,7 +37121,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_422() { + fn __bindgen_test_layout_nsTArray_open0_nsString_close0_instantiation_16() { assert_eq!(::std::mem::size_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43060,18 +37132,18 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_423() { - assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsXBLBinding>>() , - 8usize , concat ! ( + fn __bindgen_test_layout_RefPtr_open0_RawServoMediaList_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::RawServoMediaList>>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr<root::nsXBLBinding> ) )); - assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsXBLBinding>>() + root::RefPtr<root::RawServoMediaList> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::RawServoMediaList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr<root::nsXBLBinding> ) )); + root::RefPtr<root::RawServoMediaList> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_424() { + fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_nsXBLBinding_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::nsXBLBinding>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43082,7 +37154,18 @@ pub mod root { root::nsTArray<root::RefPtr<root::nsXBLBinding>> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_425() { + fn __bindgen_test_layout_RefPtr_open0_nsXBLBinding_close0_instantiation_2() { + assert_eq!(::std::mem::size_of::<root::RefPtr<root::nsXBLBinding>>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr<root::nsXBLBinding> ) )); + assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsXBLBinding>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr<root::nsXBLBinding> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_gfxFontFeature_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::gfxFontFeature>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43093,7 +37176,7 @@ pub mod root { root::nsTArray<root::gfxFontFeature> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_426() { + fn __bindgen_test_layout_nsTArray_open0_FontVariation_close0_instantiation_1() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::gfx::FontVariation>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -43104,40 +37187,62 @@ pub mod root { root::nsTArray<root::mozilla::gfx::FontVariation> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_427() { - assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::CSSValue>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_244545_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::CSSValue> ) )); - assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::dom::CSSValue>>() + root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed<root::mozilla::dom::CSSValue> ) )); + root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_428() { - assert_eq!(::std::mem::size_of::<root::JS::Handle<*mut root::JSObject>>() + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_244551_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::<root::JS::Handle<*mut root::JSObject>>() + root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Handle<*mut root::JSObject> ) )); + root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_429() { - assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() + fn __bindgen_test_layout_nsCOMPtr_open0_nsIAtom_close0_instantiation_10() { + assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsMediaExpression_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsMediaExpression>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() + root::nsTArray<root::nsMediaExpression> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsMediaExpression>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); + root::nsTArray<root::nsMediaExpression> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_open0_nsAutoPtr_open1_nsMediaQuery_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsAutoPtr<root::nsMediaQuery>>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<root::nsAutoPtr<root::nsMediaQuery>> ) )); + assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsAutoPtr<root::nsMediaQuery>>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<root::nsAutoPtr<root::nsMediaQuery>> ) )); } #[test] - fn __bindgen_test_layout_nsAutoPtr_instantiation_430() { + fn __bindgen_test_layout_nsAutoPtr_open0_nsMediaQuery_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::nsMediaQuery>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( diff --git a/components/style/gecko/media_queries.rs b/components/style/gecko/media_queries.rs index 62e891eed90..a7ba27d8414 100644 --- a/components/style/gecko/media_queries.rs +++ b/components/style/gecko/media_queries.rs @@ -13,6 +13,7 @@ use euclid::Size2D; use font_metrics::get_metrics_provider_for_product; use gecko::values::convert_nscolor_to_rgba; use gecko_bindings::bindings; +use gecko_bindings::structs; use gecko_bindings::structs::{nsCSSKeyword, nsCSSProps_KTableEntry, nsCSSValue, nsCSSUnit, nsStringBuffer}; use gecko_bindings::structs::{nsMediaExpression_Range, nsMediaFeature}; use gecko_bindings::structs::{nsMediaFeature_ValueType, nsMediaFeature_RangeType, nsMediaFeature_RequirementFlags}; @@ -41,7 +42,6 @@ pub struct Device { /// here is fine. pres_context: RawGeckoPresContextOwned, default_values: Arc<ComputedValues>, - viewport_override: Option<ViewportConstraints>, /// The font size of the root element /// This is set when computing the style of the root /// element, and used for rem units in other elements. @@ -54,6 +54,9 @@ pub struct Device { /// Whether any styles computed in the document relied on the root font-size /// by using rem units. used_root_font_size: AtomicBool, + /// Whether any styles computed in the document relied on the viewport size + /// by using vw/vh/vmin/vmax units. + used_viewport_size: AtomicBool, } unsafe impl Sync for Device {} @@ -66,17 +69,20 @@ impl Device { Device { pres_context: pres_context, default_values: ComputedValues::default_values(unsafe { &*pres_context }), - viewport_override: None, - root_font_size: AtomicIsize::new(font_size::get_initial_value().0 as isize), // FIXME(bz): Seems dubious? + // FIXME(bz): Seems dubious? + root_font_size: AtomicIsize::new(font_size::get_initial_value().value() as isize), used_root_font_size: AtomicBool::new(false), + used_viewport_size: AtomicBool::new(false), } } /// Tells the device that a new viewport rule has been found, and stores the /// relevant viewport constraints. - pub fn account_for_viewport_rule(&mut self, - constraints: &ViewportConstraints) { - self.viewport_override = Some(constraints.clone()); + pub fn account_for_viewport_rule( + &mut self, + _constraints: &ViewportConstraints + ) { + unreachable!("Gecko doesn't support @viewport"); } /// Returns the default computed values as a reference, in order to match @@ -108,10 +114,14 @@ impl Device { /// Recreates the default computed values. pub fn reset_computed_values(&mut self) { - // NB: A following stylesheet flush will populate this if appropriate. - self.viewport_override = None; self.default_values = ComputedValues::default_values(self.pres_context()); + } + + /// Rebuild all the cached data. + pub fn rebuild_cached_data(&mut self) { + self.reset_computed_values(); self.used_root_font_size.store(false, Ordering::Relaxed); + self.used_viewport_size.store(false, Ordering::Relaxed); } /// Returns whether we ever looked up the root font size of the Device. @@ -124,8 +134,6 @@ impl Device { /// This includes the viewport override from `@viewport` rules, and also the /// default computed values. pub fn reset(&mut self) { - // NB: A following stylesheet flush will populate this if appropriate. - self.viewport_override = None; self.reset_computed_values(); } @@ -146,14 +154,17 @@ impl Device { /// Returns the current viewport size in app units. pub fn au_viewport_size(&self) -> Size2D<Au> { - self.viewport_override.as_ref().map(|v| { - Size2D::new(Au::from_f32_px(v.size.width), - Au::from_f32_px(v.size.height)) - }).unwrap_or_else(|| unsafe { + self.used_viewport_size.store(true, Ordering::Relaxed); + unsafe { // TODO(emilio): Need to take into account scrollbars. let area = &self.pres_context().mVisibleArea; Size2D::new(Au(area.width), Au(area.height)) - }) + } + } + + /// Returns whether we ever looked up the viewport size of the Device. + pub fn used_viewport_size(&self) -> bool { + self.used_viewport_size.load(Ordering::Relaxed) } /// Returns the device pixel ratio. @@ -174,6 +185,15 @@ impl Device { pub fn default_background_color(&self) -> RGBA { convert_nscolor_to_rgba(self.pres_context().mBackgroundColor) } + + /// Applies text zoom to a font-size or line-height value (see nsStyleFont::ZoomText). + pub fn zoom_text(&self, size: Au) -> Au { + size.scale_by(self.pres_context().mEffectiveTextZoom) + } + /// Un-apply text zoom (see nsStyleFont::UnzoomText). + pub fn unzoom_text(&self, size: Au) -> Au { + size.scale_by(1. / self.pres_context().mEffectiveTextZoom) + } } /// A expression for gecko contains a reference to the media feature, the value @@ -414,13 +434,8 @@ impl MediaExpressionValue { fn find_feature<F>(mut f: F) -> Option<&'static nsMediaFeature> where F: FnMut(&'static nsMediaFeature) -> bool, { - // FIXME(emilio): With build-time bindgen, we would be able to use - // structs::nsMediaFeatures_features. That would unfortunately break MSVC - // builds, or require one bindings file per platform. - // - // I'm not into any of those, so meanwhile let's use a FFI function. unsafe { - let mut features = bindings::Gecko_GetMediaFeatures(); + let mut features = structs::nsMediaFeatures_features.as_ptr(); while !(*features).mName.is_null() { if f(&*features) { return Some(&*features); @@ -428,7 +443,6 @@ fn find_feature<F>(mut f: F) -> Option<&'static nsMediaFeature> features = features.offset(1); } } - None } @@ -484,10 +498,13 @@ impl Expression { let result = { let mut feature_name = &**ident; - // TODO(emilio): this is under a pref in Gecko. - if starts_with_ignore_ascii_case(feature_name, "-webkit-") { + if unsafe { structs::StylePrefs_sWebkitPrefixedAliasesEnabled } && + starts_with_ignore_ascii_case(feature_name, "-webkit-") { feature_name = &feature_name[8..]; flags |= nsMediaFeature_RequirementFlags::eHasWebkitPrefix as u8; + if unsafe { structs::StylePrefs_sWebkitDevicePixelRatioEnabled } { + flags |= nsMediaFeature_RequirementFlags::eWebkitDevicePixelRatioPrefEnabled as u8; + } } let range = if starts_with_ignore_ascii_case(feature_name, "min-") { @@ -650,6 +667,7 @@ impl Expression { in_media_query: true, // TODO: pass the correct value here. quirks_mode: quirks_mode, + for_smil_animation: false, }; let required_value = match self.value { diff --git a/components/style/gecko/non_ts_pseudo_class_list.rs b/components/style/gecko/non_ts_pseudo_class_list.rs index c26c1cc98b6..9b30e4a5ee2 100644 --- a/components/style/gecko/non_ts_pseudo_class_list.rs +++ b/components/style/gecko/non_ts_pseudo_class_list.rs @@ -44,8 +44,8 @@ macro_rules! apply_non_ts_list { $apply_macro! { bare: [ ("unresolved", Unresolved, unresolved, IN_UNRESOLVED_STATE, _), - ("-moz-table-border-nonzero", MozTableBorderNonzero, mozTableBorderNonzero, _, PSEUDO_CLASS_INTERNAL), - ("-moz-browser-frame", MozBrowserFrame, mozBrowserFrame, _, PSEUDO_CLASS_INTERNAL), + ("-moz-table-border-nonzero", MozTableBorderNonzero, mozTableBorderNonzero, _, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), + ("-moz-browser-frame", MozBrowserFrame, mozBrowserFrame, _, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME), ("link", Link, link, IN_UNVISITED_STATE, _), ("any-link", AnyLink, anyLink, IN_VISITED_OR_UNVISITED_STATE, _), ("visited", Visited, visited, IN_VISITED_STATE, _), @@ -61,29 +61,29 @@ macro_rules! apply_non_ts_list { ("indeterminate", Indeterminate, indeterminate, IN_INDETERMINATE_STATE, _), ("-moz-devtools-highlighted", MozDevtoolsHighlighted, mozDevtoolsHighlighted, IN_DEVTOOLS_HIGHLIGHTED_STATE, _), ("-moz-styleeditor-transitioning", MozStyleeditorTransitioning, mozStyleeditorTransitioning, IN_STYLEEDITOR_TRANSITIONING_STATE, _), - // TODO(emilio): Needs pref check for - // full-screen-api.unprefix.enabled! + // TODO(emilio): Needs pref check for full-screen-api.unprefix.enabled! + // TODO(TYLin): Needs to use CSS_PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME? ("fullscreen", Fullscreen, fullscreen, IN_FULLSCREEN_STATE, _), ("-moz-full-screen", MozFullScreen, mozFullScreen, IN_FULLSCREEN_STATE, _), // TODO(emilio): This is inconsistently named (the capital R). ("-moz-focusring", MozFocusRing, mozFocusRing, IN_FOCUSRING_STATE, _), ("-moz-broken", MozBroken, mozBroken, IN_BROKEN_STATE, _), ("-moz-loading", MozLoading, mozLoading, IN_LOADING_STATE, _), - ("-moz-suppressed", MozSuppressed, mozSuppressed, IN_SUPPRESSED_STATE, PSEUDO_CLASS_INTERNAL), - ("-moz-has-dir-attr", MozHasDirAttr, mozHasDirAttr, IN_HAS_DIR_ATTR_STATE, PSEUDO_CLASS_INTERNAL), - ("-moz-dir-attr-ltr", MozDirAttrLTR, mozDirAttrLTR, IN_HAS_DIR_ATTR_LTR_STATE, PSEUDO_CLASS_INTERNAL), - ("-moz-dir-attr-rtl", MozDirAttrRTL, mozDirAttrRTL, IN_HAS_DIR_ATTR_RTL_STATE, PSEUDO_CLASS_INTERNAL), - ("-moz-dir-attr-like-auto", MozDirAttrLikeAuto, mozDirAttrLikeAuto, IN_HAS_DIR_ATTR_LIKE_AUTO_STATE, PSEUDO_CLASS_INTERNAL), - ("-moz-autofill", MozAutofill, mozAutofill, IN_AUTOFILL_STATE, PSEUDO_CLASS_INTERNAL), - ("-moz-autofill-preview", MozAutofillPreview, mozAutofillPreview, IN_AUTOFILL_PREVIEW_STATE, PSEUDO_CLASS_INTERNAL), + ("-moz-suppressed", MozSuppressed, mozSuppressed, IN_SUPPRESSED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME), + ("-moz-has-dir-attr", MozHasDirAttr, mozHasDirAttr, IN_HAS_DIR_ATTR_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), + ("-moz-dir-attr-ltr", MozDirAttrLTR, mozDirAttrLTR, IN_HAS_DIR_ATTR_LTR_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), + ("-moz-dir-attr-rtl", MozDirAttrRTL, mozDirAttrRTL, IN_HAS_DIR_ATTR_RTL_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), + ("-moz-dir-attr-like-auto", MozDirAttrLikeAuto, mozDirAttrLikeAuto, IN_HAS_DIR_ATTR_LIKE_AUTO_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), + ("-moz-autofill", MozAutofill, mozAutofill, IN_AUTOFILL_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME), + ("-moz-autofill-preview", MozAutofillPreview, mozAutofillPreview, IN_AUTOFILL_PREVIEW_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME), - ("-moz-handler-clicktoplay", MozHandlerClickToPlay, mozHandlerClickToPlay, IN_HANDLER_CLICK_TO_PLAY_STATE, PSEUDO_CLASS_INTERNAL), - ("-moz-handler-vulnerable-updatable", MozHandlerVulnerableUpdatable, mozHandlerVulnerableUpdatable, IN_HANDLER_VULNERABLE_UPDATABLE_STATE, PSEUDO_CLASS_INTERNAL), - ("-moz-handler-vulnerable-no-update", MozHandlerVulnerableNoUpdate, mozHandlerVulnerableNoUpdate, IN_HANDLER_VULNERABLE_NO_UPDATE_STATE, PSEUDO_CLASS_INTERNAL), + ("-moz-handler-clicktoplay", MozHandlerClickToPlay, mozHandlerClickToPlay, IN_HANDLER_CLICK_TO_PLAY_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME), + ("-moz-handler-vulnerable-updatable", MozHandlerVulnerableUpdatable, mozHandlerVulnerableUpdatable, IN_HANDLER_VULNERABLE_UPDATABLE_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME), + ("-moz-handler-vulnerable-no-update", MozHandlerVulnerableNoUpdate, mozHandlerVulnerableNoUpdate, IN_HANDLER_VULNERABLE_NO_UPDATE_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME), - ("-moz-handler-disabled", MozHandlerDisabled, mozHandlerDisabled, IN_HANDLER_DISABLED_STATE, PSEUDO_CLASS_INTERNAL), - ("-moz-handler-blocked", MozHandlerBlocked, mozHandlerBlocked, IN_HANDLER_BLOCKED_STATE, PSEUDO_CLASS_INTERNAL), - ("-moz-handler-crashed", MozHandlerCrashed, mozHandlerCrashed, IN_HANDLER_CRASHED_STATE, PSEUDO_CLASS_INTERNAL), + ("-moz-handler-disabled", MozHandlerDisabled, mozHandlerDisabled, IN_HANDLER_DISABLED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME), + ("-moz-handler-blocked", MozHandlerBlocked, mozHandlerBlocked, IN_HANDLER_BLOCKED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME), + ("-moz-handler-crashed", MozHandlerCrashed, mozHandlerCrashed, IN_HANDLER_CRASHED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME), ("-moz-math-increment-script-level", MozMathIncrementScriptLevel, mozMathIncrementScriptLevel, IN_INCREMENT_SCRIPT_LEVEL_STATE, _), ("required", Required, required, IN_REQUIRED_STATE, _), @@ -103,13 +103,13 @@ macro_rules! apply_non_ts_list { ("-moz-meter-sub-optimum", MozMeterSubOptimum, mozMeterSubOptimum, IN_SUB_OPTIMUM_STATE, _), ("-moz-meter-sub-sub-optimum", MozMeterSubSubOptimum, mozMeterSubSubOptimum, IN_SUB_SUB_OPTIMUM_STATE, _), - ("-moz-user-disabled", MozUserDisabled, mozUserDisabled, IN_USER_DISABLED_STATE, PSEUDO_CLASS_INTERNAL), + ("-moz-user-disabled", MozUserDisabled, mozUserDisabled, IN_USER_DISABLED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME), ("-moz-first-node", MozFirstNode, firstNode, _, _), ("-moz-last-node", MozLastNode, lastNode, _, _), ("-moz-only-whitespace", MozOnlyWhitespace, mozOnlyWhitespace, _, _), - ("-moz-native-anonymous", MozNativeAnonymous, mozNativeAnonymous, _, PSEUDO_CLASS_INTERNAL), - ("-moz-use-shadow-tree-root", MozUseShadowTreeRoot, mozUseShadowTreeRoot, _, PSEUDO_CLASS_INTERNAL), + ("-moz-native-anonymous", MozNativeAnonymous, mozNativeAnonymous, _, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), + ("-moz-use-shadow-tree-root", MozUseShadowTreeRoot, mozUseShadowTreeRoot, _, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), ("-moz-is-html", MozIsHTML, mozIsHTML, _, _), ("-moz-placeholder", MozPlaceholder, mozPlaceholder, _, _), ("-moz-lwtheme", MozLWTheme, mozLWTheme, _, _), @@ -118,9 +118,9 @@ macro_rules! apply_non_ts_list { ("-moz-window-inactive", MozWindowInactive, mozWindowInactive, _, _), ], string: [ - ("-moz-system-metric", MozSystemMetric, mozSystemMetric, _, PSEUDO_CLASS_INTERNAL), + ("-moz-system-metric", MozSystemMetric, mozSystemMetric, _, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), ("-moz-empty-except-children-with-localname", MozEmptyExceptChildrenWithLocalname, - mozEmptyExceptChildrenWithLocalname, _, PSEUDO_CLASS_INTERNAL), + mozEmptyExceptChildrenWithLocalname, _, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), ("lang", Lang, lang, _, _), ], keyword: [ diff --git a/components/style/gecko/pseudo_element.rs b/components/style/gecko/pseudo_element.rs index 7765122bd61..05e2ebbfb6a 100644 --- a/components/style/gecko/pseudo_element.rs +++ b/components/style/gecko/pseudo_element.rs @@ -12,6 +12,8 @@ use cssparser::{ToCss, serialize_identifier}; use gecko_bindings::structs::{self, CSSPseudoElementType}; use properties::{PropertyFlags, APPLIES_TO_FIRST_LETTER, APPLIES_TO_FIRST_LINE}; use properties::APPLIES_TO_PLACEHOLDER; +use properties::ComputedValues; +use properties::longhands::display::computed_value as display; use selector_parser::{NonTSPseudoClass, PseudoElementCascadeType, SelectorImpl}; use std::fmt; use string_cache::Atom; @@ -85,6 +87,12 @@ impl PseudoElement { *self == PseudoElement::FirstLetter } + /// Whether this pseudo-element is ::first-line. + #[inline] + pub fn is_first_line(&self) -> bool { + *self == PseudoElement::FirstLine + } + /// Whether this pseudo-element is ::-moz-fieldset-content. #[inline] pub fn is_fieldset_content(&self) -> bool { @@ -107,6 +115,13 @@ impl PseudoElement { (self.flags() & structs::CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE) != 0 } + /// Whether this pseudo-element skips flex/grid container display-based + /// fixup. + #[inline] + pub fn skip_item_based_display_fixup(&self) -> bool { + (self.flags() & structs::CSS_PSEUDO_ELEMENT_IS_FLEX_OR_GRID_ITEM) == 0 + } + /// Whether this pseudo-element is precomputed. #[inline] pub fn is_precomputed(&self) -> bool { @@ -132,4 +147,19 @@ impl PseudoElement { _ => None, } } + + /// Whether this pseudo-element should actually exist if it has + /// the given styles. + pub fn should_exist(&self, style: &ComputedValues) -> bool + { + let display = style.get_box().clone_display(); + if display == display::T::none { + return false; + } + if self.is_before_or_after() && style.ineffective_content_property() { + return false; + } + + true + } } diff --git a/components/style/gecko/pseudo_element_definition.mako.rs b/components/style/gecko/pseudo_element_definition.mako.rs index e4a5025314b..fd11fd6abb4 100644 --- a/components/style/gecko/pseudo_element_definition.mako.rs +++ b/components/style/gecko/pseudo_element_definition.mako.rs @@ -57,7 +57,7 @@ impl PseudoElement { /// Whether this pseudo-element is an anonymous box. #[inline] - fn is_anon_box(&self) -> bool { + pub fn is_anon_box(&self) -> bool { match *self { % for pseudo in PSEUDOS: % if pseudo.is_anon_box(): diff --git a/components/style/gecko/restyle_damage.rs b/components/style/gecko/restyle_damage.rs index 7d0c29c232f..b0f60663067 100644 --- a/components/style/gecko/restyle_damage.rs +++ b/components/style/gecko/restyle_damage.rs @@ -6,7 +6,7 @@ use gecko_bindings::bindings; use gecko_bindings::structs; -use gecko_bindings::structs::{nsChangeHint, nsStyleContext}; +use gecko_bindings::structs::{nsChangeHint, nsStyleContext, nsStyleStructID}; use matching::{StyleChange, StyleDifference}; use properties::ComputedValues; use servo_arc::Arc; @@ -62,6 +62,34 @@ impl GeckoRestyleDamage { StyleDifference::new(GeckoRestyleDamage(hint), change) } + /// Computes the `StyleDifference` between the two `ComputedValues` objects + /// for the case where the old and new style are both `display: none`. + /// + /// In general we don't need to generate damage for such elements, but we + /// do need to generate a frame reconstruction for `-moz-binding` changes, + /// so that we can start loading the new binding. + pub fn compute_undisplayed_style_difference( + old_style: &ComputedValues, + new_style: &ComputedValues, + ) -> StyleDifference { + let mut any_style_changed: bool = false; + + // Just compute the Display struct's difference. + let display_struct_bit = 1 << (nsStyleStructID::eStyleStruct_Display as u32); + let hint = unsafe { + bindings::Gecko_CalcStyleDifference(old_style, + new_style, + display_struct_bit, + &mut any_style_changed) + }; + + // Only pay attention to a reconstruct change hint. + let damage = GeckoRestyleDamage(hint) & Self::reconstruct(); + + let change = if damage.is_empty() { StyleChange::Changed } else { StyleChange::Unchanged }; + StyleDifference::new(damage, change) + } + /// Returns true if this restyle damage contains all the damage of |other|. pub fn contains(self, other: Self) -> bool { self & other == other diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs index 8fae5d563f2..26802333007 100644 --- a/components/style/gecko/selector_parser.rs +++ b/components/style/gecko/selector_parser.rs @@ -18,9 +18,12 @@ pub use gecko::pseudo_element::{PseudoElement, EAGER_PSEUDOS, EAGER_PSEUDO_COUNT pub use gecko::snapshot::SnapshotMap; bitflags! { + // See NonTSPseudoClass::is_enabled_in() flags NonTSPseudoClassFlag: u8 { - // See NonTSPseudoClass::is_internal() - const PSEUDO_CLASS_INTERNAL = 0x01, + const PSEUDO_CLASS_ENABLED_IN_UA_SHEETS = 1 << 0, + const PSEUDO_CLASS_ENABLED_IN_CHROME = 1 << 1, + const PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME = + PSEUDO_CLASS_ENABLED_IN_UA_SHEETS.bits | PSEUDO_CLASS_ENABLED_IN_CHROME.bits, } } @@ -122,14 +125,14 @@ impl SelectorMethods for NonTSPseudoClass { impl NonTSPseudoClass { - /// A pseudo-class is internal if it can only be used inside - /// user agent style sheets. - pub fn is_internal(&self) -> bool { + /// Returns true if this pseudo-class is enabled under the context of + /// the given flag. + fn is_enabled_in(&self, flag: NonTSPseudoClassFlag) -> bool { macro_rules! check_flag { (_) => (false); - ($flags:expr) => ($flags.contains(PSEUDO_CLASS_INTERNAL)); + ($flags:expr) => ($flags.contains(flag)); } - macro_rules! pseudo_class_check_internal { + macro_rules! pseudo_class_check_is_enabled_in { (bare: [$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*], string: [$(($s_css:expr, $s_name:ident, $s_gecko_type:tt, $s_state:tt, $s_flags:tt),)*], keyword: [$(($k_css:expr, $k_name:ident, $k_gecko_type:tt, $k_state:tt, $k_flags:tt),)*]) => { @@ -141,7 +144,7 @@ impl NonTSPseudoClass { } } } - apply_non_ts_list!(pseudo_class_check_internal) + apply_non_ts_list!(pseudo_class_check_is_enabled_in) } /// https://drafts.csswg.org/selectors-4/#useraction-pseudos @@ -263,6 +266,21 @@ impl ::selectors::SelectorImpl for SelectorImpl { } } +impl<'a> SelectorParser<'a> { + fn is_pseudo_class_enabled(&self, + pseudo_class: &NonTSPseudoClass) + -> bool { + let enabled_in_ua = pseudo_class.is_enabled_in(PSEUDO_CLASS_ENABLED_IN_UA_SHEETS); + let enabled_in_chrome = pseudo_class.is_enabled_in(PSEUDO_CLASS_ENABLED_IN_CHROME); + if !enabled_in_ua && !enabled_in_chrome { + true + } else { + (enabled_in_ua && self.in_user_agent_stylesheet()) || + (enabled_in_chrome && self.in_chrome_stylesheet()) + } + } +} + impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { type Impl = SelectorImpl; type Error = StyleParseError<'i>; @@ -286,7 +304,7 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { } } let pseudo_class = apply_non_ts_list!(pseudo_class_parse); - if !pseudo_class.is_internal() || self.in_user_agent_stylesheet() { + if self.is_pseudo_class_enabled(&pseudo_class) { Ok(pseudo_class) } else { Err(SelectorParseError::UnexpectedIdent(name).into()) @@ -331,7 +349,7 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { } } let pseudo_class = apply_non_ts_list!(pseudo_class_string_parse); - if !pseudo_class.is_internal() || self.in_user_agent_stylesheet() { + if self.is_pseudo_class_enabled(&pseudo_class) { Ok(pseudo_class) } else { Err(SelectorParseError::UnexpectedIdent(name).into()) diff --git a/components/style/gecko/values.rs b/components/style/gecko/values.rs index a4815222409..9d961ee18c3 100644 --- a/components/style/gecko/values.rs +++ b/components/style/gecko/values.rs @@ -19,8 +19,9 @@ use values::{Auto, Either, ExtremumLength, None_, Normal}; use values::computed::{Angle, LengthOrPercentage, LengthOrPercentageOrAuto}; use values::computed::{LengthOrPercentageOrNone, Number, NumberOrPercentage}; use values::computed::{MaxLength, MozLength, Percentage}; +use values::computed::{NonNegativeAu, NonNegativeLengthOrPercentage, NonNegativeNumber}; use values::computed::basic_shape::ShapeRadius as ComputedShapeRadius; -use values::generics::CounterStyleOrNone; +use values::generics::{CounterStyleOrNone, NonNegative}; use values::generics::basic_shape::ShapeRadius; use values::generics::gecko::ScrollSnapPoint; use values::generics::grid::{TrackBreadth, TrackKeyword}; @@ -121,6 +122,16 @@ impl GeckoStyleCoordConvertible for LengthOrPercentage { } } +impl GeckoStyleCoordConvertible for NonNegativeLengthOrPercentage { + fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) { + self.0.to_gecko_style_coord(coord); + } + + fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> { + LengthOrPercentage::from_gecko_style_coord(coord).map(NonNegative::<LengthOrPercentage>) + } +} + impl GeckoStyleCoordConvertible for Au { fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) { coord.set_value(CoordDataValue::Coord(self.0)); @@ -134,6 +145,26 @@ impl GeckoStyleCoordConvertible for Au { } } +impl GeckoStyleCoordConvertible for NonNegativeAu { + fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) { + self.0.to_gecko_style_coord(coord); + } + + fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> { + Au::from_gecko_style_coord(coord).map(NonNegative::<Au>) + } +} + +impl GeckoStyleCoordConvertible for NonNegativeNumber { + fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) { + self.0.to_gecko_style_coord(coord); + } + + fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> { + Number::from_gecko_style_coord(coord).map(NonNegative::<Number>) + } +} + impl GeckoStyleCoordConvertible for LengthOrPercentageOrAuto { fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) { let value = match *self { diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index c8028acaee2..6d62f54951c 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -18,8 +18,8 @@ use CaseSensitivityExt; use app_units::Au; use applicable_declarations::ApplicableDeclarationBlock; use atomic_refcell::{AtomicRefCell, AtomicRefMut}; -use context::{QuirksMode, SharedStyleContext, UpdateAnimationsTasks}; -use data::ElementData; +use context::{QuirksMode, SharedStyleContext, PostAnimationTasks, UpdateAnimationsTasks}; +use data::{ElementData, RestyleData}; use dom::{self, DescendantsBit, LayoutIterator, NodeInfo, TElement, TNode, UnsafeNode}; use dom::{OpaqueNode, PresentationalHintsSynthesizer}; use element_state::{ElementState, DocumentState, NS_DOCUMENT_STATE_WINDOW_INACTIVE}; @@ -63,7 +63,9 @@ use gecko_bindings::structs::ELEMENT_HAS_SNAPSHOT; use gecko_bindings::structs::EffectCompositor_CascadeLevel as CascadeLevel; use gecko_bindings::structs::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; use gecko_bindings::structs::NODE_IS_NATIVE_ANONYMOUS; +use gecko_bindings::structs::nsChangeHint; use gecko_bindings::structs::nsIDocument_DocumentTheme as DocumentTheme; +use gecko_bindings::structs::nsRestyleHint; use gecko_bindings::sugar::ownership::{HasArcFFI, HasSimpleFFI}; use logical_geometry::WritingMode; use media_queries::Device; @@ -385,7 +387,12 @@ impl<'a> Iterator for GeckoChildrenIterator<'a> { curr }, GeckoChildrenIterator::GeckoIterator(ref mut it) => unsafe { - Gecko_GetNextStyleChild(it).map(GeckoNode) + // We do this unsafe lengthening of the lifetime here because + // structs::StyleChildrenIterator is actually StyleChildrenIterator<'a>, + // however we can't express this easily with bindgen, and it would + // introduce functions with two input lifetimes into bindgen, + // which would be out of scope for elision. + Gecko_GetNextStyleChild(&mut * (it as *mut _)).map(GeckoNode) } } } @@ -670,6 +677,64 @@ impl<'le> GeckoElement<'le> { pub fn owner_document_quirks_mode(&self) -> QuirksMode { self.as_node().owner_doc().mCompatMode.into() } + + /// Only safe to call on the main thread, with exclusive access to the element and + /// its ancestors. + /// This function is also called after display property changed for SMIL animation. + /// + /// Also this function schedules style flush. + unsafe fn maybe_restyle<'a>(&self, + data: &'a mut ElementData, + animation_only: bool) -> Option<&'a mut RestyleData> { + use dom::{AnimationOnlyDirtyDescendants, DirtyDescendants}; + + // Don't generate a useless RestyleData if the element hasn't been styled. + if !data.has_styles() { + return None; + } + + // Propagate the bit up the chain. + if let Some(p) = self.traversal_parent() { + if animation_only { + p.note_descendants::<AnimationOnlyDirtyDescendants>(); + } else { + p.note_descendants::<DirtyDescendants>(); + } + }; + + bindings::Gecko_SetOwnerDocumentNeedsStyleFlush(self.0); + + // Ensure and return the RestyleData. + Some(&mut data.restyle) + } + + /// Set restyle and change hints to the element data. + pub fn note_explicit_hints(&self, + restyle_hint: nsRestyleHint, + change_hint: nsChangeHint) { + use gecko::restyle_damage::GeckoRestyleDamage; + use invalidation::element::restyle_hints::RestyleHint; + + let damage = GeckoRestyleDamage::new(change_hint); + debug!("note_explicit_hints: {:?}, restyle_hint={:?}, change_hint={:?}", + self, restyle_hint, change_hint); + + let restyle_hint: RestyleHint = restyle_hint.into(); + debug_assert!(!(restyle_hint.has_animation_hint() && + restyle_hint.has_non_animation_hint()), + "Animation restyle hints should not appear with non-animation restyle hints"); + + let mut maybe_data = self.mutate_data(); + let maybe_restyle_data = maybe_data.as_mut().and_then(|d| unsafe { + self.maybe_restyle(d, restyle_hint.has_animation_hint()) + }); + if let Some(restyle_data) = maybe_restyle_data { + restyle_data.hint.insert(restyle_hint.into()); + restyle_data.damage |= damage; + } else { + debug!("(Element not styled, discarding hints)"); + } + } } /// Converts flags from the layout used by rust-selectors to the layout used @@ -1107,6 +1172,31 @@ impl<'le> TElement for GeckoElement<'le> { self.as_node().get_bool_flag(nsINode_BooleanFlag::ElementHasAnimations) } + /// Process various tasks that are a result of animation-only restyle. + fn process_post_animation(&self, + tasks: PostAnimationTasks) { + use context::DISPLAY_CHANGED_FROM_NONE_FOR_SMIL; + use gecko_bindings::structs::nsChangeHint_nsChangeHint_Empty; + use gecko_bindings::structs::nsRestyleHint_eRestyle_Subtree; + + debug_assert!(!tasks.is_empty(), "Should be involved a task"); + + // If display style was changed from none to other, we need to resolve + // the descendants in the display:none subtree. Instead of resolving + // those styles in animation-only restyle, we defer it to a subsequent + // normal restyle. + if tasks.intersects(DISPLAY_CHANGED_FROM_NONE_FOR_SMIL) { + debug_assert!(self.implemented_pseudo_element() + .map_or(true, |p| !p.is_before_or_after()), + "display property animation shouldn't run on pseudo elements \ + since it's only for SMIL"); + self.note_explicit_hints(nsRestyleHint_eRestyle_Subtree, + nsChangeHint_nsChangeHint_Empty); + } + } + + /// Update various animation-related state on a given (pseudo-)element as + /// results of normal restyle. fn update_animations(&self, before_change_style: Option<Arc<ComputedValues>>, tasks: UpdateAnimationsTasks) { @@ -1402,6 +1492,7 @@ impl<'le> PresentationalHintsSynthesizer for GeckoElement<'le> { where V: Push<ApplicableDeclarationBlock>, { use properties::longhands::_x_lang::SpecifiedValue as SpecifiedLang; + use properties::longhands::_x_text_zoom::SpecifiedValue as SpecifiedZoom; use properties::longhands::color::SpecifiedValue as SpecifiedColor; use properties::longhands::text_align::SpecifiedValue as SpecifiedTextAlign; use values::specified::color::Color; @@ -1433,6 +1524,15 @@ impl<'le> PresentationalHintsSynthesizer for GeckoElement<'le> { let arc = Arc::new(global_style_data.shared_lock.wrap(pdb)); ApplicableDeclarationBlock::from_declarations(arc, ServoCascadeLevel::PresHints) }; + static ref SVG_TEXT_DISABLE_ZOOM_RULE: ApplicableDeclarationBlock = { + let global_style_data = &*GLOBAL_STYLE_DATA; + let pdb = PropertyDeclarationBlock::with_one( + PropertyDeclaration::XTextZoom(SpecifiedZoom(false)), + Importance::Normal + ); + let arc = Arc::new(global_style_data.shared_lock.wrap(pdb)); + ApplicableDeclarationBlock::from_declarations(arc, ServoCascadeLevel::PresHints) + }; }; let ns = self.get_namespace(); @@ -1445,6 +1545,11 @@ impl<'le> PresentationalHintsSynthesizer for GeckoElement<'le> { hints.push(TABLE_COLOR_RULE.clone()); } } + if ns == &*Namespace(atom!("http://www.w3.org/2000/svg")) { + if self.get_local_name().as_ptr() == atom!("text").as_ptr() { + hints.push(SVG_TEXT_DISABLE_ZOOM_RULE.clone()); + } + } let declarations = unsafe { Gecko_GetHTMLPresentationAttrDeclarationBlock(self.0) }; let declarations: Option<&RawOffsetArc<Locked<PropertyDeclarationBlock>>> = declarations.and_then(|s| s.as_arc_opt()); @@ -1665,7 +1770,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> { fn get_local_name(&self) -> &WeakAtom { unsafe { - WeakAtom::new(self.as_node().node_info().mInner.mName.raw::<nsIAtom>()) + WeakAtom::new(self.as_node().node_info().mInner.mName) } } diff --git a/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs b/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs index 0efebc94c19..0111256d5d1 100644 --- a/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs +++ b/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs @@ -27,7 +27,7 @@ impl nsCSSShadowItem { color: Color::rgba(convert_nscolor_to_rgba(self.mColor)), horizontal: Au(self.mXOffset), vertical: Au(self.mYOffset), - blur: Au(self.mRadius), + blur: Au(self.mRadius).into(), }, spread: Au(self.mSpread), inset: self.mInset, @@ -39,7 +39,7 @@ impl nsCSSShadowItem { pub fn set_from_simple_shadow(&mut self, shadow: SimpleShadow) { self.mXOffset = shadow.horizontal.0; self.mYOffset = shadow.vertical.0; - self.mRadius = shadow.blur.0; + self.mRadius = shadow.blur.value(); self.mSpread = 0; self.mInset = false; if shadow.color.is_currentcolor() { @@ -62,7 +62,7 @@ impl nsCSSShadowItem { color: Color::rgba(convert_nscolor_to_rgba(self.mColor)), horizontal: Au(self.mXOffset), vertical: Au(self.mYOffset), - blur: Au(self.mRadius), + blur: Au(self.mRadius).into(), } } } diff --git a/components/style/gecko_bindings/sugar/ns_style_coord.rs b/components/style/gecko_bindings/sugar/ns_style_coord.rs index be6a2a6f80b..001ab16b6c2 100644 --- a/components/style/gecko_bindings/sugar/ns_style_coord.rs +++ b/components/style/gecko_bindings/sugar/ns_style_coord.rs @@ -54,6 +54,14 @@ impl nsStyleCoord_CalcValue { } } +impl PartialEq for nsStyleCoord_CalcValue { + fn eq(&self, other: &Self) -> bool { + self.mLength == other.mLength && + self.mPercent == other.mPercent && + self.mHasPercent == other.mHasPercent + } +} + impl nsStyleSides { /// Immutably get the `nsStyleCoord`-like object representing the side at /// index `index`. @@ -192,11 +200,11 @@ impl<'a> CoordDataMut for CornersDataMut<'a> { } } -#[derive(Copy, Clone)] /// Enum representing the tagged union that is CoordData. /// /// In release mode this should never actually exist in the code, and will be /// optimized out by threading matches and inlining. +#[derive(Copy, Clone, Debug, PartialEq)] pub enum CoordDataValue { /// eStyleUnit_Null Null, diff --git a/components/style/gecko_string_cache/mod.rs b/components/style/gecko_string_cache/mod.rs index 0adf5c09da1..fed06fbeec5 100644 --- a/components/style/gecko_string_cache/mod.rs +++ b/components/style/gecko_string_cache/mod.rs @@ -94,7 +94,7 @@ unsafe impl Sync for WeakAtom {} impl WeakAtom { /// Construct a `WeakAtom` from a raw `nsIAtom`. #[inline] - pub unsafe fn new<'a>(atom: *mut nsIAtom) -> &'a mut Self { + pub unsafe fn new<'a>(atom: *const nsIAtom) -> &'a mut Self { &mut *(atom as *mut WeakAtom) } diff --git a/components/style/invalidation/element/invalidator.rs b/components/style/invalidation/element/invalidator.rs index ff60ecc32b9..055e3e6f3ac 100644 --- a/components/style/invalidation/element/invalidator.rs +++ b/components/style/invalidation/element/invalidator.rs @@ -35,6 +35,16 @@ pub struct TreeStyleInvalidator<'a, 'b: 'a, E> type InvalidationVector = SmallVec<[Invalidation; 10]>; +/// The kind of invalidation we're processing. +/// +/// We can use this to avoid pushing invalidations of the same kind to our +/// descendants or siblings. +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +enum InvalidationKind { + Descendant, + Sibling, +} + /// An `Invalidation` is a complex selector that describes which elements, /// relative to a current element we are processing, must be restyled. /// @@ -46,6 +56,37 @@ type InvalidationVector = SmallVec<[Invalidation; 10]>; struct Invalidation { selector: Selector<SelectorImpl>, offset: usize, + /// Whether the invalidation was already matched by any previous sibling or + /// ancestor. + /// + /// If this is the case, we can avoid pushing invalidations generated by + /// this one if the generated invalidation is effective for all the siblings + /// or descendants after us. + matched_by_any_previous: bool, +} + +impl Invalidation { + /// Whether this invalidation is effective for the next sibling or + /// descendant after us. + fn effective_for_next(&self) -> bool { + // TODO(emilio): For pseudo-elements this should be mostly false, except + // for the weird pseudos in <input type="number">. + // + // We should be able to do better here! + match self.selector.combinator_at(self.offset) { + Combinator::NextSibling | + Combinator::Child => false, + _ => true, + } + } + + fn kind(&self) -> InvalidationKind { + if self.selector.combinator_at(self.offset).is_ancestor() { + InvalidationKind::Descendant + } else { + InvalidationKind::Sibling + } + } } impl fmt::Debug for Invalidation { @@ -67,9 +108,9 @@ impl fmt::Debug for Invalidation { struct InvalidationResult { /// Whether the element itself was invalidated. invalidated_self: bool, - /// Whether the invalidation we've processed is effective for the next - /// sibling or descendant after us. - effective_for_next: bool, + /// Whether the invalidation matched, either invalidating the element or + /// generating another invalidation. + matched: bool, } impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E> @@ -460,14 +501,16 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E> let result = self.process_invalidation( &sibling_invalidations[i], descendant_invalidations, - &mut new_sibling_invalidations + &mut new_sibling_invalidations, + InvalidationKind::Sibling, ); invalidated_self |= result.invalidated_self; - if !result.effective_for_next { - sibling_invalidations.remove(i); - } else { + sibling_invalidations[i].matched_by_any_previous |= result.matched; + if sibling_invalidations[i].effective_for_next() { i += 1; + } else { + sibling_invalidations.remove(i); } } @@ -493,10 +536,13 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E> invalidation, descendant_invalidations, sibling_invalidations, + InvalidationKind::Descendant, ); invalidated |= result.invalidated_self; - if result.effective_for_next { + if invalidation.effective_for_next() { + let mut invalidation = invalidation.clone(); + invalidation.matched_by_any_previous |= result.matched; descendant_invalidations.push(invalidation.clone()); } } @@ -514,10 +560,11 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E> &mut self, invalidation: &Invalidation, descendant_invalidations: &mut InvalidationVector, - sibling_invalidations: &mut InvalidationVector + sibling_invalidations: &mut InvalidationVector, + invalidation_kind: InvalidationKind, ) -> InvalidationResult { - debug!("TreeStyleInvalidator::process_invalidation({:?}, {:?})", - self.element, invalidation); + debug!("TreeStyleInvalidator::process_invalidation({:?}, {:?}, {:?})", + self.element, invalidation, invalidation_kind); let mut context = MatchingContext::new_for_visited( @@ -535,14 +582,17 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E> ); let mut invalidated_self = false; + let mut matched = false; match matching_result { CompoundSelectorMatchingResult::Matched { next_combinator_offset: 0 } => { debug!(" > Invalidation matched completely"); + matched = true; invalidated_self = true; } CompoundSelectorMatchingResult::Matched { next_combinator_offset } => { let next_combinator = invalidation.selector.combinator_at(next_combinator_offset); + matched = true; if matches!(next_combinator, Combinator::PseudoElement) { let pseudo_selector = @@ -578,14 +628,90 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E> let next_invalidation = Invalidation { selector: invalidation.selector.clone(), offset: next_combinator_offset, + matched_by_any_previous: false, }; debug!(" > Invalidation matched, next: {:?}, ({:?})", next_invalidation, next_combinator); - if next_combinator.is_ancestor() { - descendant_invalidations.push(next_invalidation); + + let next_invalidation_kind = next_invalidation.kind(); + + // We can skip pushing under some circumstances, and we should + // because otherwise the invalidation list could grow + // exponentially. + // + // * First of all, both invalidations need to be of the same + // kind. This is because of how we propagate them going to + // the right of the tree for sibling invalidations and going + // down the tree for children invalidations. A sibling + // invalidation that ends up generating a children + // invalidation ends up (correctly) in five different lists, + // not in the same list five different times. + // + // * Then, the invalidation needs to be matched by a previous + // ancestor/sibling, in order to know that this invalidation + // has been generated already. + // + // * Finally, the new invalidation needs to be + // `effective_for_next()`, in order for us to know that it is + // still in the list, since we remove the dependencies that + // aren't from the lists for our children / siblings. + // + // To go through an example, let's imagine we are processing a + // dom subtree like: + // + // <div><address><div><div/></div></address></div> + // + // And an invalidation list with a single invalidation like: + // + // [div div div] + // + // When we process the invalidation list for the outer div, we + // match it, and generate a `div div` invalidation, so for the + // <address> child we have: + // + // [div div div, div div] + // + // With the first of them marked as `matched`. + // + // When we process the <address> child, we don't match any of + // them, so both invalidations go untouched to our children. + // + // When we process the second <div>, we match _both_ + // invalidations. + // + // However, when matching the first, we can tell it's been + // matched, and not push the corresponding `div div` + // invalidation, since we know it's necessarily already on the + // list. + // + // Thus, without skipping the push, we'll arrive to the + // innermost <div> with: + // + // [div div div, div div, div div, div] + // + // While skipping it, we won't arrive here with duplicating + // dependencies: + // + // [div div div, div div, div] + // + let can_skip_pushing = + next_invalidation_kind == invalidation_kind && + invalidation.matched_by_any_previous && + next_invalidation.effective_for_next(); + + if can_skip_pushing { + debug!(" > Can avoid push, since the invalidation had \ + already been matched before"); } else { - sibling_invalidations.push(next_invalidation); + match next_invalidation_kind { + InvalidationKind::Descendant => { + descendant_invalidations.push(next_invalidation); + } + InvalidationKind::Sibling => { + sibling_invalidations.push(next_invalidation); + } + } } } CompoundSelectorMatchingResult::NotMatched => {} @@ -597,21 +723,7 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E> } } - // TODO(emilio): For pseudo-elements this should be mostly false, except - // for the weird pseudos in <input type="number">. - // - // We should be able to do better here! - let effective_for_next = - match invalidation.selector.combinator_at(invalidation.offset) { - Combinator::NextSibling | - Combinator::Child => false, - _ => true, - }; - - InvalidationResult { - invalidated_self: invalidated_self, - effective_for_next: effective_for_next, - } + InvalidationResult { invalidated_self, matched, } } } @@ -830,12 +942,14 @@ impl<'a, 'b: 'a, E> InvalidationCollector<'a, 'b, E> self.descendant_invalidations.push(Invalidation { selector: dependency.selector.clone(), offset: dependency.selector_offset, + matched_by_any_previous: false, }); } else if dependency.affects_later_siblings() { debug_assert_ne!(dependency.selector_offset, 0); self.sibling_invalidations.push(Invalidation { selector: dependency.selector.clone(), offset: dependency.selector_offset, + matched_by_any_previous: false, }); } } diff --git a/components/style/invalidation/element/restyle_hints.rs b/components/style/invalidation/element/restyle_hints.rs index d846afa5e51..94bab930732 100644 --- a/components/style/invalidation/element/restyle_hints.rs +++ b/components/style/invalidation/element/restyle_hints.rs @@ -6,7 +6,7 @@ #[cfg(feature = "gecko")] use gecko_bindings::structs::nsRestyleHint; -use traversal::TraversalFlags; +use traversal_flags::TraversalFlags; bitflags! { /// The kind of restyle we need to do for a given element. @@ -189,7 +189,8 @@ impl Default for RestyleHint { #[cfg(feature = "gecko")] impl From<nsRestyleHint> for RestyleHint { - fn from(raw: nsRestyleHint) -> Self { + fn from(mut raw: nsRestyleHint) -> Self { + use gecko_bindings::structs::nsRestyleHint_eRestyle_Force as eRestyle_Force; use gecko_bindings::structs::nsRestyleHint_eRestyle_ForceDescendants as eRestyle_ForceDescendants; use gecko_bindings::structs::nsRestyleHint_eRestyle_LaterSiblings as eRestyle_LaterSiblings; use gecko_bindings::structs::nsRestyleHint_eRestyle_Self as eRestyle_Self; @@ -202,14 +203,23 @@ impl From<nsRestyleHint> for RestyleHint { "Handle later siblings manually if necessary plz."); if (raw.0 & (eRestyle_Self.0 | eRestyle_Subtree.0)) != 0 { + raw.0 &= !eRestyle_Self.0; hint.insert(RESTYLE_SELF); } if (raw.0 & (eRestyle_Subtree.0 | eRestyle_SomeDescendants.0)) != 0 { + raw.0 &= !eRestyle_Subtree.0; + raw.0 &= !eRestyle_SomeDescendants.0; hint.insert(RESTYLE_DESCENDANTS); } + if (raw.0 & (eRestyle_ForceDescendants.0 | eRestyle_Force.0)) != 0 { + raw.0 &= !eRestyle_Force.0; + hint.insert(RECASCADE_SELF); + } + if (raw.0 & eRestyle_ForceDescendants.0) != 0 { + raw.0 &= !eRestyle_ForceDescendants.0; hint.insert(RECASCADE_DESCENDANTS); } diff --git a/components/style/invalidation/stylesheets.rs b/components/style/invalidation/stylesheets.rs index 19c35405676..04a13d934ba 100644 --- a/components/style/invalidation/stylesheets.rs +++ b/components/style/invalidation/stylesheets.rs @@ -301,7 +301,8 @@ impl StylesheetInvalidationSet { CounterStyle(..) | Keyframes(..) | Page(..) | - Viewport(..) => { + Viewport(..) | + FontFeatureValues(..) => { debug!(" > Found unsupported rule, marking the whole subtree \ invalid."); diff --git a/components/style/lib.rs b/components/style/lib.rs index debcfd81676..fcf48752530 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -51,6 +51,7 @@ extern crate fnv; #[cfg(feature = "gecko")] #[macro_use] pub mod gecko_string_cache; #[cfg(feature = "servo")] extern crate heapsize; #[cfg(feature = "servo")] #[macro_use] extern crate heapsize_derive; +extern crate itertools; extern crate itoa; #[cfg(feature = "servo")] #[macro_use] extern crate html5ever; #[macro_use] @@ -70,7 +71,7 @@ extern crate ordered_float; extern crate owning_ref; extern crate parking_lot; extern crate pdqsort; -#[cfg(feature = "gecko")] extern crate precomputed_hash; +extern crate precomputed_hash; extern crate rayon; extern crate selectors; #[cfg(feature = "servo")] #[macro_use] extern crate serde; @@ -135,6 +136,7 @@ pub mod stylesheets; pub mod thread_state; pub mod timer; pub mod traversal; +pub mod traversal_flags; #[macro_use] #[allow(non_camel_case_types)] pub mod values; @@ -169,7 +171,7 @@ pub mod gecko_properties { } macro_rules! reexport_computed_values { - ( $( $name: ident )+ ) => { + ( $( { $name: ident, $boxed: expr } )+ ) => { /// Types for [computed values][computed]. /// /// [computed]: https://drafts.csswg.org/css-cascade/#computed diff --git a/components/style/matching.rs b/components/style/matching.rs index 01c1fb53d1b..d16dee6f3a1 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -19,6 +19,7 @@ use rule_tree::{CascadeLevel, StrongRuleNode}; use selector_parser::{PseudoElement, RestyleDamage}; use selectors::matching::ElementSelectorFlags; use servo_arc::{Arc, ArcBorrow}; +use traversal_flags; /// Represents the result of comparing an element's old and new style. pub struct StyleDifference { @@ -172,7 +173,7 @@ trait PrivateMatchMethods: TElement { // running or not. // TODO: We should check which @keyframes changed/added/deleted // and update only animations corresponding to those @keyframes. - (context.shared.traversal_flags.for_css_rule_changes() && + (context.shared.traversal_flags.contains(traversal_flags::ForCSSRuleChanges) && has_new_animation_style) || !old_box_style.animations_equals(&new_box_style) || (old_display_style == display::T::none && @@ -184,15 +185,56 @@ trait PrivateMatchMethods: TElement { }) } + /// Create a SequentialTask for resolving descendants in a SMIL display property + /// animation if the display property changed from none. + #[cfg(feature = "gecko")] + fn handle_display_change_for_smil_if_needed(&self, + context: &mut StyleContext<Self>, + old_values: Option<&ComputedValues>, + new_values: &ComputedValues, + restyle_hints: RestyleHint) { + use context::DISPLAY_CHANGED_FROM_NONE_FOR_SMIL; + + let display_changed_from_none = old_values.as_ref().map_or(false, |old| { + let old_display_style = old.get_box().clone_display(); + let new_display_style = new_values.get_box().clone_display(); + old_display_style == display::T::none && + new_display_style != display::T::none + }); + + if display_changed_from_none { + // When display value is changed from none to other, we need + // to traverse descendant elements in a subsequent normal + // traversal (we can't traverse them in this animation-only + // restyle since we have no way to know whether the decendants + // need to be traversed at the beginning of the animation-only + // restyle) + debug_assert!(restyle_hints.intersects(RESTYLE_SMIL), + "Display animation should only happen for SMIL"); + let task = ::context::SequentialTask::process_post_animation(*self, + DISPLAY_CHANGED_FROM_NONE_FOR_SMIL); + context.thread_local.tasks.push(task); + } + } + #[cfg(feature = "gecko")] fn process_animations(&self, context: &mut StyleContext<Self>, old_values: &mut Option<Arc<ComputedValues>>, new_values: &mut Arc<ComputedValues>, + restyle_hint: RestyleHint, important_rules_changed: bool) { use context::{CASCADE_RESULTS, CSS_ANIMATIONS, CSS_TRANSITIONS, EFFECT_PROPERTIES}; use context::UpdateAnimationsTasks; + if context.shared.traversal_flags.for_animation_only() { + self.handle_display_change_for_smil_if_needed(context, + old_values.as_ref().map(|v| &**v), + new_values, + restyle_hint); + return; + } + // Bug 868975: These steps should examine and update the visited styles // in addition to the unvisited styles. @@ -257,6 +299,7 @@ trait PrivateMatchMethods: TElement { context: &mut StyleContext<Self>, old_values: &mut Option<Arc<ComputedValues>>, new_values: &mut Arc<ComputedValues>, + _restyle_hint: RestyleHint, _important_rules_changed: bool) { use animation; use dom::TNode; @@ -301,8 +344,8 @@ trait PrivateMatchMethods: TElement { new_values: &Arc<ComputedValues>, pseudo: Option<&PseudoElement>) -> ChildCascadeRequirement { - // Don't accumulate damage if we're in a restyle for reconstruction. - if shared_context.traversal_flags.for_reconstruct() { + // Don't accumulate damage if we're in a forgetful traversal. + if shared_context.traversal_flags.contains(traversal_flags::Forgetful) { return ChildCascadeRequirement::MustCascadeChildren; } @@ -323,15 +366,19 @@ trait PrivateMatchMethods: TElement { restyle.damage |= difference.damage; } + // We need to cascade the children in order to ensure the correct + // propagation of computed value flags. + // + // FIXME(emilio): If we start optimizing changes to reset-only + // properties that aren't explicitly inherited, we'd need to add a flag + // to handle justify-items: auto correctly when there's a legacy + // justify-items. + if old_values.flags != new_values.flags { + return ChildCascadeRequirement::MustCascadeChildren; + } + match difference.change { - StyleChange::Unchanged => { - // We need to cascade the children in order to ensure the - // correct propagation of computed value flags. - if old_values.flags != new_values.flags { - return ChildCascadeRequirement::MustCascadeChildren; - } - ChildCascadeRequirement::CanSkipCascade - }, + StyleChange::Unchanged => ChildCascadeRequirement::CanSkipCascade, StyleChange::Changed => ChildCascadeRequirement::MustCascadeChildren, } } @@ -445,14 +492,13 @@ pub trait MatchMethods : TElement { debug_assert!(new_styles.primary.is_some(), "How did that happen?"); - if !context.shared.traversal_flags.for_animation_only() { - self.process_animations( - context, - &mut data.styles.primary, - &mut new_styles.primary.as_mut().unwrap(), - important_rules_changed, - ); - } + self.process_animations( + context, + &mut data.styles.primary, + &mut new_styles.primary.as_mut().unwrap(), + data.restyle.hint, + important_rules_changed, + ); // First of all, update the styles. let old_styles = mem::replace(&mut data.styles, new_styles); @@ -488,7 +534,7 @@ pub trait MatchMethods : TElement { if old_styles.primary.as_ref().map_or(true, |s| s.get_font().clone_font_size() != new_font_size) { debug_assert!(self.owner_doc_matches_for_testing(device)); - device.set_root_font_size(new_font_size); + device.set_root_font_size(new_font_size.0); // If the root font-size changed since last time, and something // in the document did use rem units, ensure we recascade the // entire tree. @@ -498,8 +544,8 @@ pub trait MatchMethods : TElement { } } - // Don't accumulate damage if we're in a restyle for reconstruction. - if context.shared.traversal_flags.for_reconstruct() { + // Don't accumulate damage if we're in a forgetful traversal. + if context.shared.traversal_flags.contains(traversal_flags::Forgetful) { return ChildCascadeRequirement::MustCascadeChildren; } @@ -521,18 +567,13 @@ pub trait MatchMethods : TElement { ); if data.styles.pseudos.is_empty() && old_styles.pseudos.is_empty() { - return cascade_requirement; - } - - // If it matched a different number of pseudos, reconstruct. - if data.styles.pseudos.is_empty() != old_styles.pseudos.is_empty() { - data.restyle.damage |= RestyleDamage::reconstruct(); + // This is the common case; no need to examine pseudos here. return cascade_requirement; } let pseudo_styles = - old_styles.pseudos.as_array().unwrap().iter().zip( - data.styles.pseudos.as_array().unwrap().iter()); + old_styles.pseudos.as_array().iter().zip( + data.styles.pseudos.as_array().iter()); for (i, (old, new)) in pseudo_styles.enumerate() { match (old, new) { @@ -547,8 +588,21 @@ pub trait MatchMethods : TElement { } (&None, &None) => {}, _ => { - data.restyle.damage |= RestyleDamage::reconstruct(); - return cascade_requirement; + // It's possible that we're switching from not having + // ::before/::after at all to having styles for them but not + // actually having a useful pseudo-element. Check for that + // case. + let pseudo = PseudoElement::from_eager_index(i); + let new_pseudo_should_exist = + new.as_ref().map_or(false, + |s| pseudo.should_exist(s)); + let old_pseudo_should_exist = + old.as_ref().map_or(false, + |s| pseudo.should_exist(s)); + if new_pseudo_should_exist != old_pseudo_should_exist { + data.restyle.damage |= RestyleDamage::reconstruct(); + return cascade_requirement; + } } } } @@ -647,14 +701,12 @@ pub trait MatchMethods : TElement { CascadeVisitedMode::Unvisited, cascade_inputs, ); - if !context.shared.traversal_flags.for_animation_only() { - result |= self.replace_rules_internal( - replacements, - context, - CascadeVisitedMode::Visited, - cascade_inputs - ); - } + result |= self.replace_rules_internal( + replacements, + context, + CascadeVisitedMode::Visited, + cascade_inputs + ); result } @@ -692,15 +744,17 @@ pub trait MatchMethods : TElement { let replace_rule_node = |level: CascadeLevel, pdb: Option<ArcBorrow<Locked<PropertyDeclarationBlock>>>, path: &mut StrongRuleNode| -> bool { + let mut important_rules_changed = false; let new_node = stylist.rule_tree() - .update_rule_at_level(level, pdb, path, guards); - match new_node { - Some(n) => { - *path = n; - level.is_important() - }, - None => false, + .update_rule_at_level(level, + pdb, + path, + guards, + &mut important_rules_changed); + if let Some(n) = new_node { + *path = n; } + important_rules_changed }; if !context.shared.traversal_flags.for_animation_only() { @@ -783,11 +837,17 @@ pub trait MatchMethods : TElement { // This happens with display:none elements, and not-yet-existing // pseudo-elements. if new_style_is_display_none && old_style_is_display_none { - // The style remains display:none. No need for damage. - return StyleDifference::new(RestyleDamage::empty(), StyleChange::Unchanged) + // The style remains display:none. The only case we need to care + // about is if -moz-binding changed, and to generate a reconstruct + // so that we can start the binding load. Otherwise, there is no + // need for damage. + return RestyleDamage::compute_undisplayed_style_difference(old_values, new_values); } if pseudo.map_or(false, |p| p.is_before_or_after()) { + // FIXME(bz) This duplicates some of the logic in + // PseudoElement::should_exist, but it's not clear how best to share + // that logic without redoing the "get the display" work. let old_style_generates_no_pseudo = old_style_is_display_none || old_values.ineffective_content_property(); @@ -814,7 +874,7 @@ pub trait MatchMethods : TElement { return StyleDifference::new(RestyleDamage::empty(), StyleChange::Unchanged) } - if pseudo.map_or(false, |p| p.is_first_letter()) { + if pseudo.map_or(false, |p| p.is_first_letter() || p.is_first_line()) { // No one cares about this pseudo, and we've checked above that // we're not switching from a "cares" to a "doesn't care" state // or vice versa. diff --git a/components/style/media_queries.rs b/components/style/media_queries.rs index 5f71ddf974f..b6bde057b3c 100644 --- a/components/style/media_queries.rs +++ b/components/style/media_queries.rs @@ -12,7 +12,6 @@ use cssparser::{Delimiter, Parser, Token, ParserInput}; use parser::ParserContext; use selectors::parser::SelectorParseError; use serialize_comma_separated_list; -use std::ascii::AsciiExt; use std::fmt; use style_traits::{ToCss, ParseError, StyleParseError}; @@ -146,20 +145,15 @@ pub enum MediaQueryType { impl MediaQueryType { fn parse(ident: &str) -> Result<Self, ()> { - if ident.eq_ignore_ascii_case("all") { - return Ok(MediaQueryType::All); - } - - // From https://drafts.csswg.org/mediaqueries/#mq-syntax: - // - // The <media-type> production does not include the keywords only, - // not, and, and or. - if ident.eq_ignore_ascii_case("not") || - ident.eq_ignore_ascii_case("or") || - ident.eq_ignore_ascii_case("and") || - ident.eq_ignore_ascii_case("only") { - return Err(()) - } + match_ignore_ascii_case! { ident, + "all" => return Ok(MediaQueryType::All), + // From https://drafts.csswg.org/mediaqueries/#mq-syntax: + // + // The <media-type> production does not include the keywords only, + // not, and, and or. + "not" | "or" | "and" | "only" => return Err(()), + _ => (), + }; Ok(match MediaType::parse(ident) { Some(media_type) => MediaQueryType::Known(media_type), diff --git a/components/style/parallel.rs b/components/style/parallel.rs index 358eeffd52c..3703559cd98 100644 --- a/components/style/parallel.rs +++ b/components/style/parallel.rs @@ -34,9 +34,16 @@ use traversal::{DomTraversal, PerLevelTraversalData, PreTraverseToken}; /// The maximum number of child nodes that we will process as a single unit. /// -/// Larger values will increase style sharing cache hits and general DOM locality -/// at the expense of decreased opportunities for parallelism. This value has not -/// been measured and could potentially be tuned. +/// Larger values will increase style sharing cache hits and general DOM +/// locality at the expense of decreased opportunities for parallelism. There +/// are some measurements in +/// https://bugzilla.mozilla.org/show_bug.cgi?id=1385982#c11 and comments 12 +/// and 13 that investigate some slightly different values for the work unit +/// size. If the size is significantly increased, make sure to adjust the +/// condition for kicking off a new work unit in top_down_dom, because +/// otherwise we're likely to end up doing too much work serially. For +/// example, the condition there could become some fraction of WORK_UNIT_MAX +/// instead of WORK_UNIT_MAX. pub const WORK_UNIT_MAX: usize = 16; /// A set of nodes, sized to the work unit. This gets copied when sent to other @@ -137,7 +144,8 @@ fn create_thread_local_context<'scope, E, D>( /// * Never process a child before its parent (since child style depends on /// parent style). If this were to happen, the styling algorithm would panic. /// * Prioritize discovering nodes as quickly as possible to maximize -/// opportunities for parallelism. +/// opportunities for parallelism. But this needs to be weighed against +/// styling cousins on a single thread to improve sharing. /// * Style all the children of a given node (i.e. all sibling nodes) on /// a single thread (with an upper bound to handle nodes with an /// abnormally large number of children). This is important because we use @@ -173,10 +181,10 @@ fn top_down_dom<'a, 'scope, E, D>(nodes: &'a [SendNode<E::ConcreteNode>], }; for n in nodes { - // If the last node we processed produced children, spawn them off - // into a work item. We do this at the beginning of the loop (rather - // than at the end) so that we can traverse the children of the last - // sibling directly on this thread without a spawn call. + // If the last node we processed produced children, we may want to + // spawn them off into a work item. We do this at the beginning of + // the loop (rather than at the end) so that we can traverse our + // last bits of work directly on this thread without a spawn call. // // This has the important effect of removing the allocation and // context-switching overhead of the parallel traversal for perfectly @@ -184,8 +192,33 @@ fn top_down_dom<'a, 'scope, E, D>(nodes: &'a [SendNode<E::ConcreteNode>], // // <russian><doll><tag><nesting></nesting></tag></doll></russian> // - // Which are not at all uncommon. - if !discovered_child_nodes.is_empty() { + // which are not at all uncommon. + // + // There's a tension here between spawning off a work item as soon + // as discovered_child_nodes is nonempty and waiting until we have a + // full work item to do so. The former optimizes for speed of + // discovery (we'll start discovering the kids of the things in + // "nodes" ASAP). The latter gives us better sharing (e.g. we can + // share between cousins much better, because we don't hand them off + // as separate work items, which are likely to end up on separate + // threads) and gives us a chance to just handle everything on this + // thread for small DOM subtrees, as in the linear example above. + // + // There are performance and "number of ComputedValues" + // measurements for various testcases in + // https://bugzilla.mozilla.org/show_bug.cgi?id=1385982#c10 and + // following. + // + // The worst case behavior for waiting until we have a full work + // item is a deep tree which has WORK_UNIT_MAX "linear" branches, + // hence WORK_UNIT_MAX elements at each level. Such a tree would + // end up getting processed entirely sequentially, because we would + // process each level one at a time as a single work unit, whether + // via our end-of-loop tail call or not. If we kicked off a + // traversal as soon as we discovered kids, we would instead + // process such a tree more or less with a thread-per-branch, + // multiplexed across our actual threadpool. + if discovered_child_nodes.len() >= WORK_UNIT_MAX { let mut traversal_data_copy = traversal_data.clone(); traversal_data_copy.current_dom_depth += 1; traverse_nodes(&*discovered_child_nodes, @@ -213,9 +246,9 @@ fn top_down_dom<'a, 'scope, E, D>(nodes: &'a [SendNode<E::ConcreteNode>], } } - // Handle the children of the last element in this work unit. If any exist, - // we can process them (or at least one work unit's worth of them) directly - // on this thread by passing TailCall. + // Handle whatever elements we have queued up but not kicked off traversals + // for yet. If any exist, we can process them (or at least one work unit's + // worth of them) directly on this thread by passing TailCall. if !discovered_child_nodes.is_empty() { traversal_data.current_dom_depth += 1; traverse_nodes(&discovered_child_nodes, diff --git a/components/style/properties/computed_value_flags.rs b/components/style/properties/computed_value_flags.rs index 3363fd76869..ef903bf775f 100644 --- a/components/style/properties/computed_value_flags.rs +++ b/components/style/properties/computed_value_flags.rs @@ -37,5 +37,12 @@ bitflags! { /// A flag used to mark styles under a relevant link that is also /// visited. const IS_RELEVANT_LINK_VISITED = 1 << 3, + + /// A flag used to mark styles which are a pseudo-element or under one. + const IS_IN_PSEUDO_ELEMENT_SUBTREE = 1 << 4, + + /// A flag used to mark styles which are in a display: none subtree, or + /// under one. + const IS_IN_DISPLAY_NONE_SUBTREE = 1 << 5, } } diff --git a/components/style/properties/data.py b/components/style/properties/data.py index d6aa4a016ad..7e08b079ad8 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -157,7 +157,7 @@ class Longhand(object): allowed_in_keyframe_block=True, cast_type='u8', has_uncacheable_values=False, logical=False, alias=None, extra_prefixes=None, boxed=False, flags=None, allowed_in_page_rule=False, allow_quirks=False, ignored_when_colors_disabled=False, - gecko_pref_ident=None, vector=False): + gecko_pref_ident=None, vector=False, need_animatable=False): self.name = name if not spec: raise TypeError("Spec should be specified for %s" % name) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index e6f1c42e31a..ce8861cc5a9 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -19,13 +19,11 @@ use gecko_bindings::bindings::Gecko_Construct_Default_${style_struct.gecko_ffi_n use gecko_bindings::bindings::Gecko_CopyConstruct_${style_struct.gecko_ffi_name}; use gecko_bindings::bindings::Gecko_Destroy_${style_struct.gecko_ffi_name}; % endfor -use gecko_bindings::bindings::Gecko_Construct_nsStyleVariables; use gecko_bindings::bindings::Gecko_CopyCounterStyle; use gecko_bindings::bindings::Gecko_CopyCursorArrayFrom; use gecko_bindings::bindings::Gecko_CopyFontFamilyFrom; use gecko_bindings::bindings::Gecko_CopyImageValueFrom; use gecko_bindings::bindings::Gecko_CopyListStyleImageFrom; -use gecko_bindings::bindings::Gecko_Destroy_nsStyleVariables; use gecko_bindings::bindings::Gecko_EnsureImageLayersLength; use gecko_bindings::bindings::Gecko_FontFamilyList_AppendGeneric; use gecko_bindings::bindings::Gecko_FontFamilyList_AppendNamed; @@ -43,7 +41,9 @@ use gecko_bindings::bindings::{Gecko_ResetFilters, Gecko_CopyFiltersFrom}; use gecko_bindings::bindings::RawGeckoPresContextBorrowed; use gecko_bindings::structs; use gecko_bindings::structs::nsCSSPropertyID; -use gecko_bindings::structs::nsStyleVariables; +use gecko_bindings::structs::mozilla::CSSPseudoElementType; +use gecko_bindings::structs::mozilla::CSSPseudoElementType_InheritingAnonBox; +use gecko_bindings::structs::root::NS_STYLE_CONTEXT_TYPE_SHIFT; use gecko_bindings::sugar::ns_style_coord::{CoordDataValue, CoordData, CoordDataMut}; use gecko::values::convert_nscolor_to_rgba; use gecko::values::convert_rgba_to_nscolor; @@ -60,8 +60,9 @@ use selector_parser::PseudoElement; use servo_arc::{Arc, RawOffsetArc}; use std::mem::{forget, uninitialized, transmute, zeroed}; use std::{cmp, ops, ptr}; -use values::{Auto, CustomIdent, Either, KeyframesName}; -use values::computed::ToComputedValue; +use stylesheets::{MallocSizeOfWithRepeats, SizeOfState}; +use values::{self, Auto, CustomIdent, Either, KeyframesName}; +use values::computed::{NonNegativeAu, ToComputedValue}; use values::computed::effects::{BoxShadow, Filter, SimpleShadow}; use values::computed::length::Percentage; use computed_values::border_style; @@ -136,6 +137,18 @@ impl ComputedValues { let atom = Atom::from(atom); PseudoElement::from_atom(&atom) } + + fn get_pseudo_type(&self) -> CSSPseudoElementType { + let bits = (self.0)._base.mBits; + let our_type = bits >> NS_STYLE_CONTEXT_TYPE_SHIFT; + unsafe { transmute(our_type as u8) } + } + + pub fn is_anon_box(&self) -> bool { + let our_type = self.get_pseudo_type(); + return our_type == CSSPseudoElementType_InheritingAnonBox || + our_type == CSSPseudoElementType::NonInheritingAnonBox; + } } impl Drop for ComputedValues { @@ -296,6 +309,11 @@ impl ComputedValuesInner { self.visited_style.as_ref().map(|x| &**x) } + /// Gets the raw visited style. Useful for memory reporting. + pub fn get_raw_visited_style(&self) -> &Option<RawOffsetArc<ComputedValues>> { + &self.visited_style + } + /// Gets a reference to the visited style. Panic if no visited style exists. pub fn visited_style(&self) -> &ComputedValues { self.get_visited_style().unwrap() @@ -352,6 +370,18 @@ impl ComputedValuesInner { } } +impl MallocSizeOfWithRepeats for ComputedValues { + fn malloc_size_of_children(&self, state: &mut SizeOfState) -> usize { + let mut n = 0; + if let Some(ref raw_offset_arc) = *self.get_raw_visited_style() { + n += raw_offset_arc.with_arc(|a: &Arc<ComputedValues>| { + a.malloc_size_of_children(state) + }) + } + n + } +} + <%def name="declare_style_struct(style_struct)"> pub use ::gecko_bindings::structs::mozilla::Gecko${style_struct.gecko_name} as ${style_struct.gecko_struct_name}; impl ${style_struct.gecko_struct_name} { @@ -367,21 +397,29 @@ impl ${style_struct.gecko_struct_name} { <%def name="impl_simple_setter(ident, gecko_ffi_name)"> #[allow(non_snake_case)] pub fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) { - ${set_gecko_property(gecko_ffi_name, "v")} + ${set_gecko_property(gecko_ffi_name, "From::from(v)")} } </%def> <%def name="impl_simple_clone(ident, gecko_ffi_name)"> #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - self.gecko.${gecko_ffi_name} + From::from(self.gecko.${gecko_ffi_name}) } </%def> -<%def name="impl_simple_copy(ident, gecko_ffi_name, *kwargs)"> +<%def name="impl_simple_copy(ident, gecko_ffi_name, on_set=None, *kwargs)"> #[allow(non_snake_case)] pub fn copy_${ident}_from(&mut self, other: &Self) { self.gecko.${gecko_ffi_name} = other.gecko.${gecko_ffi_name}; + % if on_set: + self.${on_set}(); + % endif + } + + #[allow(non_snake_case)] + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) } </%def> @@ -390,6 +428,11 @@ impl ${style_struct.gecko_struct_name} { pub fn copy_${ident}_from(&mut self, other: &Self) { self.gecko.${gecko_ffi_name}.copy_from(&other.gecko.${gecko_ffi_name}); } + + #[allow(non_snake_case)] + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) + } </%def> <%! @@ -467,6 +510,11 @@ def set_gecko_property(ffi_name, expr): let color = ${get_gecko_property(gecko_ffi_name, self_param = "other")}; ${set_gecko_property(gecko_ffi_name, "color")}; } + + #[allow(non_snake_case)] + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) + } </%def> <%def name="impl_color_clone(ident, gecko_ffi_name)"> @@ -478,7 +526,7 @@ def set_gecko_property(ffi_name, expr): <%def name="impl_keyword(ident, gecko_ffi_name, keyword, need_clone, cast_type='u8', **kwargs)"> <%call expr="impl_keyword_setter(ident, gecko_ffi_name, keyword, cast_type, **kwargs)"></%call> -<%call expr="impl_simple_copy(ident, gecko_ffi_name)"></%call> +<%call expr="impl_simple_copy(ident, gecko_ffi_name, **kwargs)"></%call> %if need_clone: <%call expr="impl_keyword_clone(ident, gecko_ffi_name, keyword, cast_type)"></%call> % endif @@ -546,10 +594,129 @@ def set_gecko_property(ffi_name, expr): % endif </%def> +<%def name="impl_svg_length(ident, gecko_ffi_name, need_clone=False)"> + // When context-value is used on an SVG length, the corresponding flag is + // set on mContextFlags, and the length field is set to the initial value. + + pub fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) { + use values::generics::svg::SVGLength; + use gecko_bindings::structs::nsStyleSVG_${ident.upper()}_CONTEXT as CONTEXT_VALUE; + let length = match v { + SVGLength::Length(length) => { + self.gecko.mContextFlags &= !CONTEXT_VALUE; + length + } + SVGLength::ContextValue => { + self.gecko.mContextFlags |= CONTEXT_VALUE; + match longhands::${ident}::get_initial_value() { + SVGLength::Length(length) => length, + _ => unreachable!("Initial value should not be context-value"), + } + } + }; + match length { + Either::First(number) => + self.gecko.${gecko_ffi_name}.set_value(CoordDataValue::Factor(From::from(number))), + Either::Second(lop) => self.gecko.${gecko_ffi_name}.set(lop), + } + } + + pub fn copy_${ident}_from(&mut self, other: &Self) { + use gecko_bindings::structs::nsStyleSVG_${ident.upper()}_CONTEXT as CONTEXT_VALUE; + self.gecko.${gecko_ffi_name}.copy_from(&other.gecko.${gecko_ffi_name}); + self.gecko.mContextFlags = + (self.gecko.mContextFlags & !CONTEXT_VALUE) | + (other.gecko.mContextFlags & CONTEXT_VALUE); + } + + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) + } + + pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { + use values::generics::svg::SVGLength; + use values::computed::LengthOrPercentage; + use gecko_bindings::structs::nsStyleSVG_${ident.upper()}_CONTEXT as CONTEXT_VALUE; + if (self.gecko.mContextFlags & CONTEXT_VALUE) != 0 { + return SVGLength::ContextValue; + } + let length = match self.gecko.${gecko_ffi_name}.as_value() { + CoordDataValue::Factor(number) => Either::First(From::from(number)), + CoordDataValue::Coord(coord) => Either::Second(From::from(LengthOrPercentage::Length(Au(coord)))), + CoordDataValue::Percent(p) => Either::Second(From::from(LengthOrPercentage::Percentage(Percentage(p)))), + CoordDataValue::Calc(calc) => Either::Second(From::from(LengthOrPercentage::Calc(calc.into()))), + _ => unreachable!("Unexpected coordinate {:?} in ${ident}", + self.gecko.${gecko_ffi_name}.as_value()), + }; + SVGLength::Length(length) + } +</%def> + +<%def name="impl_svg_opacity(ident, gecko_ffi_name, need_clone=False)"> + <% source_prefix = ident.split("_")[0].upper() + "_OPACITY_SOURCE" %> + + pub fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) { + use gecko_bindings::structs::nsStyleSVG_${source_prefix}_MASK as MASK; + use gecko_bindings::structs::nsStyleSVG_${source_prefix}_SHIFT as SHIFT; + use gecko_bindings::structs::nsStyleSVGOpacitySource::*; + use values::generics::svg::SVGOpacity; + self.gecko.mContextFlags &= !MASK; + match v { + SVGOpacity::Opacity(opacity) => { + self.gecko.mContextFlags |= + (eStyleSVGOpacitySource_Normal as u8) << SHIFT; + self.gecko.${gecko_ffi_name} = opacity; + } + SVGOpacity::ContextFillOpacity => { + self.gecko.mContextFlags |= + (eStyleSVGOpacitySource_ContextFillOpacity as u8) << SHIFT; + self.gecko.${gecko_ffi_name} = 1.; + } + SVGOpacity::ContextStrokeOpacity => { + self.gecko.mContextFlags |= + (eStyleSVGOpacitySource_ContextStrokeOpacity as u8) << SHIFT; + self.gecko.${gecko_ffi_name} = 1.; + } + } + } + + pub fn copy_${ident}_from(&mut self, other: &Self) { + use gecko_bindings::structs::nsStyleSVG_${source_prefix}_MASK as MASK; + self.gecko.${gecko_ffi_name} = other.gecko.${gecko_ffi_name}; + self.gecko.mContextFlags = + (self.gecko.mContextFlags & !MASK) | + (other.gecko.mContextFlags & MASK); + } + + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) + } + + pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { + use gecko_bindings::structs::nsStyleSVG_${source_prefix}_MASK as MASK; + use gecko_bindings::structs::nsStyleSVG_${source_prefix}_SHIFT as SHIFT; + use gecko_bindings::structs::nsStyleSVGOpacitySource::*; + use values::generics::svg::SVGOpacity; + + let source = (self.gecko.mContextFlags & MASK) >> SHIFT; + if source == eStyleSVGOpacitySource_Normal as u8 { + return SVGOpacity::Opacity(self.gecko.${gecko_ffi_name}); + } else { + debug_assert_eq!(self.gecko.${gecko_ffi_name}, 1.0); + if source == eStyleSVGOpacitySource_ContextFillOpacity as u8 { + SVGOpacity::ContextFillOpacity + } else { + debug_assert_eq!(source, eStyleSVGOpacitySource_ContextStrokeOpacity as u8); + SVGOpacity::ContextStrokeOpacity + } + } + } +</%def> + <%def name="impl_svg_paint(ident, gecko_ffi_name, need_clone=False)"> #[allow(non_snake_case)] pub fn set_${ident}(&mut self, mut v: longhands::${ident}::computed_value::T) { - use values::generics::SVGPaintKind; + use values::generics::svg::SVGPaintKind; use self::structs::nsStyleSVGPaintType; use self::structs::nsStyleSVGFallbackType; @@ -596,8 +763,13 @@ def set_gecko_property(ffi_name, expr): } #[allow(non_snake_case)] + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) + } + + #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - use values::generics::{SVGPaint, SVGPaintKind}; + use values::generics::svg::{SVGPaint, SVGPaintKind}; use values::specified::url::SpecifiedUrl; use self::structs::nsStyleSVGPaintType; use self::structs::nsStyleSVGFallbackType; @@ -631,15 +803,16 @@ def set_gecko_property(ffi_name, expr): } </%def> -<%def name="impl_app_units(ident, gecko_ffi_name, need_clone, inherit_from=None, round_to_pixels=False)"> +<%def name="impl_non_negative_app_units(ident, gecko_ffi_name, need_clone, inherit_from=None, + round_to_pixels=False)"> #[allow(non_snake_case)] pub fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) { let value = { % if round_to_pixels: let au_per_device_px = Au(self.gecko.mTwipsPerPixel); - round_border_to_device_pixels(v, au_per_device_px).0 + round_border_to_device_pixels(v.0, au_per_device_px).0 % else: - v.0 + v.value() % endif }; @@ -658,16 +831,24 @@ def set_gecko_property(ffi_name, expr): // // In practice, this means that we may have an incorrect value here, but // we'll adjust that properly in the style fixup phase. + // + // FIXME(emilio): We could clean this up a bit special-casing the reset_ + // function below. self.gecko.${gecko_ffi_name} = other.gecko.${inherit_from}; % else: self.gecko.${gecko_ffi_name} = other.gecko.${gecko_ffi_name}; % endif } + #[allow(non_snake_case)] + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) + } + %if need_clone: #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - Au(self.gecko.${gecko_ffi_name}) + Au(self.gecko.${gecko_ffi_name}).into() } % endif </%def> @@ -681,6 +862,10 @@ def set_gecko_property(ffi_name, expr): pub fn copy_${ident}_from(&mut self, other: &Self) { self.gecko.${gecko_ffi_name}.data_at_mut(${index}).copy_from(&other.gecko.${gecko_ffi_name}.data_at(${index})); } + #[allow(non_snake_case)] + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) + } % if need_clone: #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { @@ -700,6 +885,10 @@ def set_gecko_property(ffi_name, expr): pub fn copy_${ident}_from(&mut self, other: &Self) { self.gecko.${gecko_ffi_name}.copy_from(&other.gecko.${gecko_ffi_name}); } + #[allow(non_snake_case)] + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) + } % if need_clone: #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { @@ -737,6 +926,11 @@ def set_gecko_property(ffi_name, expr): % endfor ${ caller.body() } } + + #[allow(non_snake_case)] + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) + } </%def> <%def name="impl_corner_style_coord(ident, gecko_ffi_name, x_index, y_index, need_clone)"> @@ -752,6 +946,10 @@ def set_gecko_property(ffi_name, expr): self.gecko.${gecko_ffi_name}.data_at_mut(${y_index}) .copy_from(&other.gecko.${gecko_ffi_name}.data_at(${y_index})); } + #[allow(non_snake_case)] + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) + } % if need_clone: #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { @@ -796,6 +994,10 @@ def set_gecko_property(ffi_name, expr): self.gecko.${gecko_ffi_name}.set(&other.gecko.${gecko_ffi_name}); } } + #[allow(non_snake_case)] + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) + } % if need_clone: pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { use values::specified::url::SpecifiedUrl; @@ -887,6 +1089,9 @@ impl Clone for ${style_struct.gecko_struct_name} { predefined_types = { "length::LengthOrAuto": impl_style_coord, "length::LengthOrNormal": impl_style_coord, + "length::NonNegativeLengthOrAuto": impl_style_coord, + "length::NonNegativeLengthOrNormal": impl_style_coord, + "GreaterThanOrEqualToOneNumber": impl_simple, "Length": impl_absolute_length, "Position": impl_position, "LengthOrPercentage": impl_style_coord, @@ -896,12 +1101,17 @@ impl Clone for ${style_struct.gecko_struct_name} { "LengthOrNormal": impl_style_coord, "MaxLength": impl_style_coord, "MozLength": impl_style_coord, + "NonNegativeLengthOrPercentage": impl_style_coord, + "NonNegativeNumber": impl_simple, "Number": impl_simple, "Integer": impl_simple, "Opacity": impl_simple, "Color": impl_color, "RGBAColor": impl_rgba_color, + "SVGLength": impl_svg_length, + "SVGOpacity": impl_svg_opacity, "SVGPaint": impl_svg_paint, + "SVGWidth": impl_svg_length, "UrlOrNone": impl_css_url, } @@ -974,6 +1184,10 @@ impl ${style_struct.gecko_struct_name} { pub fn copy_${longhand.ident}_from(&mut self, _: &Self) { warn!("stylo: Unimplemented property setter: ${longhand.name}"); } + #[allow(non_snake_case)] + pub fn reset_${longhand.ident}(&mut self, other: &Self) { + self.copy_${longhand.ident}_from(other) + } % if longhand.need_clone: #[allow(non_snake_case)] pub fn clone_${longhand.ident}(&self) -> longhands::${longhand.ident}::computed_value::T { @@ -1103,11 +1317,11 @@ fn static_assert() { <% impl_color("border_%s_color" % side.ident, "(mBorderColor)[%s]" % side.index, need_clone=True) %> - <% impl_app_units("border_%s_width" % side.ident, - "mComputedBorder.%s" % side.ident, - inherit_from="mBorder.%s" % side.ident, - need_clone=True, - round_to_pixels=True) %> + <% impl_non_negative_app_units("border_%s_width" % side.ident, + "mComputedBorder.%s" % side.ident, + inherit_from="mBorder.%s" % side.ident, + need_clone=True, + round_to_pixels=True) %> pub fn border_${side.ident}_has_nonzero_width(&self) -> bool { self.gecko.mComputedBorder.${side.ident} != 0 @@ -1150,6 +1364,11 @@ fn static_assert() { } #[allow(non_snake_case)] + pub fn reset__moz_border_${side.ident}_colors(&mut self, other: &Self) { + self.copy__moz_border_${side.ident}_colors_from(other) + } + + #[allow(non_snake_case)] pub fn clone__moz_border_${side.ident}_colors(&self) -> longhands::_moz_border_${side.ident}_colors::computed_value::T { use self::longhands::_moz_border_${side.ident}_colors::computed_value::T; @@ -1200,6 +1419,10 @@ fn static_assert() { } } + pub fn reset_border_image_source(&mut self, other: &Self) { + self.copy_border_image_source_from(other) + } + pub fn clone_border_image_source(&self) -> longhands::border_image_source::computed_value::T { use values::None_; @@ -1235,6 +1458,10 @@ fn static_assert() { self.gecko.mBorderImageRepeatV = other.gecko.mBorderImageRepeatV; } + pub fn reset_border_image_repeat(&mut self, other: &Self) { + self.copy_border_image_repeat_from(other) + } + pub fn clone_border_image_repeat(&self) -> longhands::border_image_repeat::computed_value::T { use properties::longhands::border_image_repeat::computed_value::RepeatKeyword; use gecko_bindings::structs; @@ -1337,6 +1564,10 @@ fn static_assert() { } } + pub fn reset_z_index(&mut self, other: &Self) { + self.copy_z_index_from(other) + } + pub fn clone_z_index(&self) -> longhands::z_index::computed_value::T { return match self.gecko.mZIndex.as_value() { CoordDataValue::Integer(n) => Either::First(n), @@ -1351,8 +1582,35 @@ fn static_assert() { % for kind in ["align", "justify"]: ${impl_simple_type_with_conversion(kind + "_content")} ${impl_simple_type_with_conversion(kind + "_self")} - ${impl_simple_type_with_conversion(kind + "_items")} % endfor + ${impl_simple_type_with_conversion("align_items")} + + pub fn set_justify_items(&mut self, v: longhands::justify_items::computed_value::T) { + self.gecko.mSpecifiedJustifyItems = v.specified.into(); + self.set_computed_justify_items(v.computed); + } + + pub fn set_computed_justify_items(&mut self, v: values::specified::JustifyItems) { + debug_assert!(v.0 != ::values::specified::align::ALIGN_AUTO); + self.gecko.mJustifyItems = v.into(); + } + + pub fn reset_justify_items(&mut self, reset_style: &Self) { + self.gecko.mJustifyItems = reset_style.gecko.mJustifyItems; + self.gecko.mSpecifiedJustifyItems = reset_style.gecko.mSpecifiedJustifyItems; + } + + pub fn copy_justify_items_from(&mut self, other: &Self) { + self.gecko.mJustifyItems = other.gecko.mJustifyItems; + self.gecko.mSpecifiedJustifyItems = other.gecko.mJustifyItems; + } + + pub fn clone_justify_items(&self) -> longhands::justify_items::computed_value::T { + longhands::justify_items::computed_value::T { + computed: self.gecko.mJustifyItems.into(), + specified: self.gecko.mSpecifiedJustifyItems.into(), + } + } pub fn set_order(&mut self, v: longhands::order::computed_value::T) { self.gecko.mOrder = v; @@ -1384,6 +1642,10 @@ fn static_assert() { self.gecko.${value.gecko}.mLineName.assign(&*other.gecko.${value.gecko}.mLineName); } + pub fn reset_${value.name}(&mut self, other: &Self) { + self.copy_${value.name}_from(other) + } + pub fn clone_${value.name}(&self) -> longhands::${value.name}::computed_value::T { use gecko_bindings::structs::{nsStyleGridLine_kMinLine, nsStyleGridLine_kMaxLine}; use string_cache::Atom; @@ -1422,6 +1684,10 @@ fn static_assert() { self.gecko.mGridAuto${kind.title()}Max.copy_from(&other.gecko.mGridAuto${kind.title()}Max); } + pub fn reset_grid_auto_${kind}(&mut self, other: &Self) { + self.copy_grid_auto_${kind}_from(other) + } + pub fn clone_grid_auto_${kind}(&self) -> longhands::grid_auto_${kind}::computed_value::T { ::values::generics::grid::TrackSize::from_gecko_style_coords(&self.gecko.mGridAuto${kind.title()}Min, &self.gecko.mGridAuto${kind.title()}Max) @@ -1559,6 +1825,101 @@ fn static_assert() { &other.gecko.mGridTemplate${kind.title()}); } } + + pub fn reset_grid_template_${kind}(&mut self, other: &Self) { + self.copy_grid_template_${kind}_from(other) + } + + pub fn clone_grid_template_${kind}(&self) -> longhands::grid_template_${kind}::computed_value::T { + <% self_grid = "self.gecko.mGridTemplate%s" % kind.title() %> + use Atom; + use gecko_bindings::structs::nsTArray; + use nsstring::nsStringRepr; + use values::CustomIdent; + use values::generics::grid::{GridTemplateComponent, LineNameList, RepeatCount}; + use values::generics::grid::{TrackList, TrackListType, TrackRepeat, TrackSize}; + + if ${self_grid}.mRepeatAutoLineNameListBefore.len() == 0 && + ${self_grid}.mRepeatAutoLineNameListAfter.len() == 0 && + ${self_grid}.mMinTrackSizingFunctions.len() == 0 && + ${self_grid}.mMaxTrackSizingFunctions.len() == 0 && + ${self_grid}.mLineNameLists.len() == 0 && + ${self_grid}.mRepeatAutoIndex == -1 && + !${self_grid}.mIsAutoFill() && + !${self_grid}.mIsSubgrid() { + return GridTemplateComponent::None; + } + + #[inline] + fn to_boxed_customident_slice(gecko_names: &nsTArray<nsStringRepr>) -> Box<[CustomIdent]> { + let idents: Vec<CustomIdent> = gecko_names.iter().map(|gecko_name| { + CustomIdent(Atom::from(gecko_name.to_string())) + }).collect(); + idents.into_boxed_slice() + } + + #[inline] + fn to_line_names_vec(gecko_line_names: &nsTArray<nsTArray<nsStringRepr>>) + -> Vec<Box<[CustomIdent]>> { + gecko_line_names.iter().map(|gecko_names| { + to_boxed_customident_slice(gecko_names) + }).collect() + } + + let repeat_auto_index = ${self_grid}.mRepeatAutoIndex as usize; + if ${self_grid}.mIsSubgrid() { + let mut names_vec = to_line_names_vec(&${self_grid}.mLineNameLists); + let fill_idx = if ${self_grid}.mIsAutoFill() { + names_vec.insert( + repeat_auto_index, + to_boxed_customident_slice(&${self_grid}.mRepeatAutoLineNameListBefore)); + Some(repeat_auto_index as u32) + } else { + None + }; + let names = names_vec.into_boxed_slice(); + + GridTemplateComponent::Subgrid(LineNameList{names, fill_idx}) + } else { + let mut auto_repeat = None; + let mut list_type = TrackListType::Normal; + let line_names = to_line_names_vec(&${self_grid}.mLineNameLists).into_boxed_slice(); + let mut values = Vec::with_capacity(${self_grid}.mMinTrackSizingFunctions.len()); + + let min_max_iter = ${self_grid}.mMinTrackSizingFunctions.iter() + .zip(${self_grid}.mMaxTrackSizingFunctions.iter()); + for (i, (gecko_min, gecko_max)) in min_max_iter.enumerate() { + let track_size = TrackSize::from_gecko_style_coords(gecko_min, gecko_max); + + if i == repeat_auto_index { + list_type = TrackListType::Auto(repeat_auto_index as u16); + + let count = if ${self_grid}.mIsAutoFill() { + RepeatCount::AutoFill + } else { + RepeatCount::AutoFit + }; + + let line_names = { + let mut vec: Vec<Box<[CustomIdent]>> = Vec::with_capacity(2); + vec.push(to_boxed_customident_slice( + &${self_grid}.mRepeatAutoLineNameListBefore)); + vec.push(to_boxed_customident_slice( + &${self_grid}.mRepeatAutoLineNameListAfter)); + vec.into_boxed_slice() + }; + + let track_sizes = vec!(track_size); + + auto_repeat = Some(TrackRepeat{count, line_names, track_sizes}); + } else { + values.push(track_size); + } + } + + GridTemplateComponent::TrackList(TrackList{list_type, values, line_names, auto_repeat}) + } + } % endfor ${impl_simple_type_with_conversion("grid_auto_flow")} @@ -1598,6 +1959,53 @@ fn static_assert() { pub fn copy_grid_template_areas_from(&mut self, other: &Self) { unsafe { self.gecko.mGridTemplateAreas.set(&other.gecko.mGridTemplateAreas) } } + + pub fn reset_grid_template_areas(&mut self, other: &Self) { + self.copy_grid_template_areas_from(other) + } + + pub fn clone_grid_template_areas(&self) -> longhands::grid_template_areas::computed_value::T { + use properties::longhands::grid_template_areas::{NamedArea, TemplateAreas}; + use std::ops::Range; + use values::None_; + + if self.gecko.mGridTemplateAreas.mRawPtr.is_null() { + return Either::Second(None_); + } + + let gecko_grid_template_areas = self.gecko.mGridTemplateAreas.mRawPtr; + let areas = unsafe { + let vec: Vec<NamedArea> = + (*gecko_grid_template_areas).mNamedAreas.iter().map(|gecko_name_area| { + let name = gecko_name_area.mName.to_string().into_boxed_str(); + let rows = Range { + start: gecko_name_area.mRowStart, + end: gecko_name_area.mRowEnd + }; + let columns = Range { + start: gecko_name_area.mColumnStart, + end: gecko_name_area.mColumnEnd + }; + NamedArea{ name, rows, columns } + }).collect(); + vec.into_boxed_slice() + }; + + let strings = unsafe { + let vec: Vec<Box<str>> = + (*gecko_grid_template_areas).mTemplates.iter().map(|gecko_template| { + gecko_template.to_string().into_boxed_str() + }).collect(); + vec.into_boxed_slice() + }; + + let width = unsafe { + (*gecko_grid_template_areas).mNColumns + }; + + Either::First(TemplateAreas{ areas, strings, width }) + } + </%self:impl_trait> <% skip_outline_longhands = " ".join("outline-style outline-width".split() + @@ -1633,6 +2041,11 @@ fn static_assert() { } #[allow(non_snake_case)] + pub fn reset_outline_style(&mut self, other: &Self) { + self.copy_outline_style_from(other) + } + + #[allow(non_snake_case)] pub fn clone_outline_style(&self) -> longhands::outline_style::computed_value::T { // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts match ${get_gecko_property("mOutlineStyle")} ${border_style_keyword.maybe_cast("u32")} { @@ -1646,9 +2059,9 @@ fn static_assert() { } } - <% impl_app_units("outline_width", "mActualOutlineWidth", - inherit_from="mOutlineWidth", - need_clone=True, round_to_pixels=True) %> + <% impl_non_negative_app_units("outline_width", "mActualOutlineWidth", + inherit_from="mOutlineWidth", + need_clone=True, round_to_pixels=True) %> % for corner in CORNERS: <% impl_corner_style_coord("_moz_outline_radius_%s" % corner.ident.replace("_", ""), @@ -1669,7 +2082,7 @@ fn static_assert() { font-variant-east-asian font-variant-ligatures font-variant-numeric font-language-override font-feature-settings font-variation-settings - -moz-min-font-size-ratio""" + -moz-min-font-size-ratio -x-text-zoom""" %> <%self:impl_trait style_struct_name="Font" skip_longhands="${skip_font_longhands}" @@ -1695,7 +2108,7 @@ fn static_assert() { }; } - pub fn copy_font_feature_settings_from(&mut self, other: &Self ) { + pub fn copy_font_feature_settings_from(&mut self, other: &Self) { let current_settings = &mut self.gecko.mFont.fontFeatureSettings; let feature_settings = &other.gecko.mFont.fontFeatureSettings; let settings_length = feature_settings.len() as u32; @@ -1709,6 +2122,10 @@ fn static_assert() { } } + pub fn reset_font_feature_settings(&mut self, other: &Self) { + self.copy_font_feature_settings_from(other) + } + pub fn clone_font_feature_settings(&self) -> longhands::font_feature_settings::computed_value::T { use values::generics::{FontSettings, FontSettingTag, FontSettingTagInt} ; @@ -1760,6 +2177,10 @@ fn static_assert() { } } + pub fn reset_font_variation_settings(&mut self, other: &Self) { + self.copy_font_variation_settings_from(other) + } + pub fn fixup_none_generic(&mut self, device: &Device) { unsafe { bindings::Gecko_nsStyleFont_FixupNoneGeneric(&mut self.gecko, device.pres_context()) @@ -1767,7 +2188,7 @@ fn static_assert() { } pub fn set_font_family(&mut self, v: longhands::font_family::computed_value::T) { - use properties::longhands::font_family::computed_value::FontFamily; + use properties::longhands::font_family::computed_value::{FontFamily, FamilyNameSyntax}; let list = &mut self.gecko.mFont.fontlist; unsafe { Gecko_FontFamilyList_Clear(list); } @@ -1777,7 +2198,8 @@ fn static_assert() { for family in &v.0 { match *family { FontFamily::FamilyName(ref f) => { - unsafe { Gecko_FontFamilyList_AppendNamed(list, f.name.as_ptr(), f.quoted); } + let quoted = matches!(f.syntax, FamilyNameSyntax::Quoted); + unsafe { Gecko_FontFamilyList_AppendNamed(list, f.name.as_ptr(), quoted); } } FontFamily::Generic(ref name) => { let (family_type, generic) = FontFamily::generic(name); @@ -1803,8 +2225,13 @@ fn static_assert() { self.gecko.mGenericID = other.gecko.mGenericID; } + pub fn reset_font_family(&mut self, other: &Self) { + self.copy_font_family_from(other) + } + pub fn clone_font_family(&self) -> longhands::font_family::computed_value::T { - use properties::longhands::font_family::computed_value::{FontFamily, FamilyName}; + use cssparser::serialize_identifier; + use properties::longhands::font_family::computed_value::{FontFamily, FamilyName, FamilyNameSyntax}; use gecko_bindings::structs::FontFamilyType; use gecko_string_cache::Atom; @@ -1817,13 +2244,18 @@ fn static_assert() { FontFamilyType::eFamily_cursive => FontFamily::Generic(atom!("cursive")), FontFamilyType::eFamily_fantasy => FontFamily::Generic(atom!("fantasy")), FontFamilyType::eFamily_moz_fixed => FontFamily::Generic(Atom::from("-moz-fixed")), - FontFamilyType::eFamily_named => FontFamily::FamilyName(FamilyName { - name: (&*gecko_font_family_name.mName).into(), - quoted: false - }), + FontFamilyType::eFamily_named => { + let name = Atom::from(&*gecko_font_family_name.mName); + let mut serialization = String::new(); + serialize_identifier(&name.to_string(), &mut serialization).unwrap(); + FontFamily::FamilyName(FamilyName { + name: name.clone(), + syntax: FamilyNameSyntax::Identifiers(serialization), + }) + }, FontFamilyType::eFamily_named_quoted => FontFamily::FamilyName(FamilyName { name: (&*gecko_font_family_name.mName).into(), - quoted: true + syntax: FamilyNameSyntax::Quoted, }), x => panic!("Found unexpected font FontFamilyType: {:?}", x), } @@ -1831,21 +2263,24 @@ fn static_assert() { ) } - // FIXME(bholley): Gecko has two different sizes, one of which (mSize) is the - // actual computed size, and the other of which (mFont.size) is the 'display - // size' which takes font zooming into account. We don't handle font zooming yet. + pub fn unzoom_fonts(&mut self, device: &Device) { + self.gecko.mSize = device.unzoom_text(Au(self.gecko.mSize)).0; + self.gecko.mScriptUnconstrainedSize = device.unzoom_text(Au(self.gecko.mScriptUnconstrainedSize)).0; + self.gecko.mFont.size = device.unzoom_text(Au(self.gecko.mFont.size)).0; + } + pub fn set_font_size(&mut self, v: longhands::font_size::computed_value::T) { - self.gecko.mSize = v.0; - self.gecko.mScriptUnconstrainedSize = v.0; + self.gecko.mSize = v.value(); + self.gecko.mScriptUnconstrainedSize = v.value(); } /// Set font size, taking into account scriptminsize and scriptlevel /// Returns Some(size) if we have to recompute the script unconstrained size pub fn apply_font_size(&mut self, v: longhands::font_size::computed_value::T, parent: &Self, - device: &Device) -> Option<Au> { - let (adjusted_size, adjusted_unconstrained_size) - = self.calculate_script_level_size(parent); + device: &Device) -> Option<NonNegativeAu> { + let (adjusted_size, adjusted_unconstrained_size) = + self.calculate_script_level_size(parent, device); // In this case, we have been unaffected by scriptminsize, ignore it if parent.gecko.mSize == parent.gecko.mScriptUnconstrainedSize && adjusted_size == adjusted_unconstrained_size { @@ -1853,9 +2288,9 @@ fn static_assert() { self.fixup_font_min_size(device); None } else { - self.gecko.mSize = v.0; + self.gecko.mSize = v.value(); self.fixup_font_min_size(device); - Some(Au(parent.gecko.mScriptUnconstrainedSize)) + Some(Au(parent.gecko.mScriptUnconstrainedSize).into()) } } @@ -1863,8 +2298,8 @@ fn static_assert() { unsafe { bindings::Gecko_nsStyleFont_FixupMinFontSize(&mut self.gecko, device.pres_context()) } } - pub fn apply_unconstrained_font_size(&mut self, v: Au) { - self.gecko.mScriptUnconstrainedSize = v.0; + pub fn apply_unconstrained_font_size(&mut self, v: NonNegativeAu) { + self.gecko.mScriptUnconstrainedSize = v.value(); } /// Calculates the constrained and unconstrained font sizes to be inherited @@ -1924,7 +2359,7 @@ fn static_assert() { /// will be set to the value of that unit computed against the parent /// unconstrained size, whereas the font size will be set computing against /// the parent font size. - pub fn calculate_script_level_size(&self, parent: &Self) -> (Au, Au) { + pub fn calculate_script_level_size(&self, parent: &Self, device: &Device) -> (Au, Au) { use std::cmp; let delta = self.gecko.mScriptLevel - parent.gecko.mScriptLevel; @@ -1936,8 +2371,11 @@ fn static_assert() { return (parent_size, parent_unconstrained_size) } - /// XXXManishearth this should also handle text zoom - let min = Au(parent.gecko.mScriptMinSize); + + let mut min = Au(parent.gecko.mScriptMinSize); + if self.gecko.mAllowZoom { + min = device.zoom_text(min); + } let scale = (parent.gecko.mScriptSizeMultiplier as f32).powi(delta as i32); @@ -1971,10 +2409,10 @@ fn static_assert() { /// /// Returns true if the inherited keyword size was actually used pub fn inherit_font_size_from(&mut self, parent: &Self, - kw_inherited_size: Option<Au>, + kw_inherited_size: Option<NonNegativeAu>, device: &Device) -> bool { let (adjusted_size, adjusted_unconstrained_size) - = self.calculate_script_level_size(parent); + = self.calculate_script_level_size(parent, device); if adjusted_size.0 != parent.gecko.mSize || adjusted_unconstrained_size.0 != parent.gecko.mScriptUnconstrainedSize { // This is incorrect. When there is both a keyword size being inherited @@ -1997,9 +2435,9 @@ fn static_assert() { false } else if let Some(size) = kw_inherited_size { // Parent element was a keyword-derived size. - self.gecko.mSize = size.0; + self.gecko.mSize = size.value(); // MathML constraints didn't apply here, so we can ignore this. - self.gecko.mScriptUnconstrainedSize = size.0; + self.gecko.mScriptUnconstrainedSize = size.value(); self.fixup_font_min_size(device); true } else { @@ -2013,7 +2451,7 @@ fn static_assert() { } pub fn clone_font_size(&self) -> longhands::font_size::computed_value::T { - Au(self.gecko.mSize) + Au(self.gecko.mSize).into() } pub fn set_font_weight(&mut self, v: longhands::font_weight::computed_value::T) { @@ -2022,10 +2460,8 @@ fn static_assert() { ${impl_simple_copy('font_weight', 'mFont.weight')} pub fn clone_font_weight(&self) -> longhands::font_weight::computed_value::T { - debug_assert!(self.gecko.mFont.weight >= 100); - debug_assert!(self.gecko.mFont.weight <= 900); - debug_assert!(self.gecko.mFont.weight % 10 == 0); - unsafe { transmute(self.gecko.mFont.weight) } + debug_assert!(self.gecko.mFont.weight <= ::std::u16::MAX); + longhands::font_weight::computed_value::T(self.gecko.mFont.weight) } ${impl_simple_type_with_conversion("font_synthesis", "mFont.synthesis")} @@ -2042,6 +2478,10 @@ fn static_assert() { self.gecko.mFont.sizeAdjust = other.gecko.mFont.sizeAdjust; } + pub fn reset_font_size_adjust(&mut self, other: &Self) { + self.copy_font_size_adjust_from(other) + } + pub fn clone_font_size_adjust(&self) -> longhands::font_size_adjust::computed_value::T { use properties::longhands::font_size_adjust::computed_value::T; T::from_gecko_adjust(self.gecko.mFont.sizeAdjust) @@ -2063,6 +2503,26 @@ fn static_assert() { } } + #[allow(non_snake_case)] + pub fn set__x_text_zoom(&mut self, v: longhands::_x_text_zoom::computed_value::T) { + self.gecko.mAllowZoom = v.0; + } + + #[allow(non_snake_case)] + pub fn copy__x_text_zoom_from(&mut self, other: &Self) { + self.gecko.mAllowZoom = other.gecko.mAllowZoom; + } + + #[allow(non_snake_case)] + pub fn reset__x_text_zoom(&mut self, other: &Self) { + self.copy__x_text_zoom_from(other) + } + + #[allow(non_snake_case)] + pub fn reset__x_lang(&mut self, other: &Self) { + self.copy__x_lang_from(other) + } + <% impl_simple_type_with_conversion("font_language_override", "mFont.languageOverride") %> pub fn set_font_variant_alternates(&mut self, v: longhands::font_variant_alternates::computed_value::T) { @@ -2121,6 +2581,63 @@ fn static_assert() { } } + pub fn reset_font_variant_alternates(&mut self, other: &Self) { + self.copy_font_variant_alternates_from(other) + } + + pub fn clone_font_variant_alternates(&self) -> longhands::font_variant_alternates::computed_value::T { + use Atom; + % for value in "normal swash stylistic ornaments annotation styleset character_variant historical".split(): + use gecko_bindings::structs::NS_FONT_VARIANT_ALTERNATES_${value.upper()}; + % endfor + use properties::longhands::font_variant_alternates::VariantAlternates; + use properties::longhands::font_variant_alternates::VariantAlternatesList; + use values::CustomIdent; + + if self.gecko.mFont.variantAlternates == NS_FONT_VARIANT_ALTERNATES_NORMAL as u16 { + return VariantAlternatesList(vec![].into_boxed_slice()); + } + + let mut alternates = Vec::with_capacity(self.gecko.mFont.alternateValues.len()); + if self.gecko.mFont.variantAlternates & (NS_FONT_VARIANT_ALTERNATES_HISTORICAL as u16) != 0 { + alternates.push(VariantAlternates::HistoricalForms); + } + + <% + property_need_ident_list = "styleset character_variant".split() + %> + % for value in property_need_ident_list: + let mut ${value}_list = Vec::new(); + % endfor + + for gecko_alternate_value in self.gecko.mFont.alternateValues.iter() { + let ident = Atom::from(gecko_alternate_value.value.to_string()); + match gecko_alternate_value.alternate { + % for value in "Swash Stylistic Ornaments Annotation".split(): + NS_FONT_VARIANT_ALTERNATES_${value.upper()} => { + alternates.push(VariantAlternates::${value}(CustomIdent(ident))); + }, + % endfor + % for value in property_need_ident_list: + NS_FONT_VARIANT_ALTERNATES_${value.upper()} => { + ${value}_list.push(CustomIdent(ident)); + }, + % endfor + x => { + panic!("Found unexpected value for font-variant-alternates: {:?}", x); + } + } + } + + % for value in property_need_ident_list: + if !${value}_list.is_empty() { + alternates.push(VariantAlternates::${to_camel_case(value)}(${value}_list.into_boxed_slice())); + } + % endfor + + VariantAlternatesList(alternates.into_boxed_slice()) + } + ${impl_simple_type_with_conversion("font_variant_ligatures", "mFont.variantLigatures")} ${impl_simple_type_with_conversion("font_variant_east_asian", "mFont.variantEastAsian")} ${impl_simple_type_with_conversion("font_variant_numeric", "mFont.variantNumeric")} @@ -2155,6 +2672,11 @@ fn static_assert() { gecko.m${gecko_ffi_name} = other.gecko.m${type.capitalize()}s[index].m${gecko_ffi_name}; } } + + #[allow(non_snake_case)] + pub fn reset_${type}_${ident}(&mut self, other: &Self) { + self.copy_${type}_${ident}_from(other) + } </%def> <%def name="impl_animation_or_transition_count(type, ident, gecko_ffi_name)"> @@ -2344,6 +2866,10 @@ fn static_assert() { self.gecko.mOriginalDisplay = other.gecko.mDisplay; } + pub fn reset_display(&mut self, other: &Self) { + self.copy_display_from(other) + } + <%call expr="impl_keyword_clone('display', 'mDisplay', display_keyword)"></%call> <% overflow_x = data.longhands_by_name["overflow-x"] %> @@ -2464,6 +2990,10 @@ fn static_assert() { } } + pub fn reset_scroll_snap_coordinate(&mut self, other: &Self) { + self.copy_scroll_snap_coordinate_from(other) + } + pub fn clone_scroll_snap_coordinate(&self) -> longhands::scroll_snap_coordinate::computed_value::T { let vec = self.gecko.mScrollSnapCoordinate.iter().map(|f| f.into()).collect(); longhands::scroll_snap_coordinate::computed_value::T(vec) @@ -2587,6 +3117,10 @@ fn static_assert() { unsafe { self.gecko.mSpecifiedTransform.set(&other.gecko.mSpecifiedTransform); } } + pub fn reset_transform(&mut self, other: &Self) { + self.copy_transform_from(other) + } + <%def name="computed_operation_arm(name, keyword, items)"> <% # %s is substituted with the call to GetArrayItem. @@ -2776,6 +3310,11 @@ fn static_assert() { } } } + + pub fn reset_transition_property(&mut self, other: &Self) { + self.copy_transition_property_from(other) + } + ${impl_transition_count('property', 'Property')} pub fn animations_equals(&self, other: &Self) -> bool { @@ -2823,6 +3362,11 @@ fn static_assert() { animation.mName.assign(&*other.gecko.mAnimations[index].mName); } } + + pub fn reset_animation_name(&mut self, other: &Self) { + self.copy_animation_name_from(other) + } + ${impl_animation_count('name', 'Name')} ${impl_animation_time_value('delay', 'Delay')} @@ -2886,6 +3430,10 @@ fn static_assert() { self.gecko.mPerspectiveOrigin[1].copy_from(&other.gecko.mPerspectiveOrigin[1]); } + pub fn reset_perspective_origin(&mut self, other: &Self) { + self.copy_perspective_origin_from(other) + } + pub fn clone_perspective_origin(&self) -> longhands::perspective_origin::computed_value::T { use properties::longhands::perspective_origin::computed_value::T; use values::computed::LengthOrPercentage; @@ -2909,6 +3457,10 @@ fn static_assert() { self.gecko.mTransformOrigin[2].copy_from(&other.gecko.mTransformOrigin[2]); } + pub fn reset_transform_origin(&mut self, other: &Self) { + self.copy_transform_origin_from(other) + } + pub fn clone_transform_origin(&self) -> longhands::transform_origin::computed_value::T { use properties::longhands::transform_origin::computed_value::T; use values::computed::LengthOrPercentage; @@ -3008,6 +3560,10 @@ fn static_assert() { } } + pub fn reset_will_change(&mut self, other: &Self) { + self.copy_will_change_from(other) + } + pub fn clone_will_change(&self) -> longhands::will_change::computed_value::T { use properties::longhands::will_change::computed_value::T; use gecko_bindings::structs::nsIAtom; @@ -3141,6 +3697,10 @@ fn static_assert() { } self.gecko.${layers_field_name}.${field_name}Count = count; } + + pub fn reset_${shorthand}_${name}(&mut self, other: &Self) { + self.copy_${shorthand}_${name}_from(other) + } </%def> <%def name="impl_simple_image_array_property(name, shorthand, layer_field_name, field_name, struct_name)"> @@ -3291,6 +3851,10 @@ fn static_assert() { self.gecko.${image_layers_field}.mPosition${orientation.upper()}Count = count; } + pub fn reset_${shorthand}_position_${orientation}(&mut self, other: &Self) { + self.copy_${shorthand}_position_${orientation}_from(other) + } + pub fn clone_${shorthand}_position_${orientation}(&self) -> longhands::${shorthand}_position_${orientation}::computed_value::T { longhands::${shorthand}_position_${orientation}::computed_value::T( @@ -3380,7 +3944,7 @@ fn static_assert() { LengthOrPercentageOrAuto::Auto } else { debug_assert!(ty == DimensionType::eLengthPercentage as u8); - LengthOrPercentageOrAuto::Calc(value.into()) + value.into() } } @@ -3402,7 +3966,6 @@ fn static_assert() { ) } - pub fn copy_${shorthand}_image_from(&mut self, other: &Self) { use gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; unsafe { @@ -3422,6 +3985,10 @@ fn static_assert() { } } + pub fn reset_${shorthand}_image(&mut self, other: &Self) { + self.copy_${shorthand}_image_from(other) + } + #[allow(unused_variables)] pub fn set_${shorthand}_image<I>(&mut self, images: I) where I: IntoIterator<Item = longhands::${shorthand}_image::computed_value::single_value::T>, @@ -3537,6 +4104,10 @@ fn static_assert() { unsafe { Gecko_CopyListStyleImageFrom(&mut self.gecko, &other.gecko); } } + pub fn reset_list_style_image(&mut self, other: &Self) { + self.copy_list_style_image_from(other) + } + pub fn clone_list_style_image(&self) -> longhands::list_style_image::computed_value::T { use values::specified::url::SpecifiedUrl; use values::{Either, None_}; @@ -3574,6 +4145,10 @@ fn static_assert() { } } + pub fn reset_list_style_type(&mut self, other: &Self) { + self.copy_list_style_type_from(other) + } + pub fn set_quotes(&mut self, other: longhands::quotes::computed_value::T) { use gecko_bindings::bindings::Gecko_NewStyleQuoteValues; use gecko_bindings::sugar::refptr::UniqueRefPtr; @@ -3594,6 +4169,10 @@ fn static_assert() { unsafe { self.gecko.mQuotes.set(&other.gecko.mQuotes); } } + pub fn reset_quotes(&mut self, other: &Self) { + self.copy_quotes_from(other) + } + pub fn clone_quotes(&self) -> longhands::quotes::computed_value::T { unsafe { let ref gecko_quote_values = *self.gecko.mQuotes.mRawPtr; @@ -3693,6 +4272,10 @@ fn static_assert() { self.gecko.mBoxShadow.copy_from(&other.gecko.mBoxShadow); } + pub fn reset_box_shadow(&mut self, other: &Self) { + self.copy_box_shadow_from(other) + } + pub fn clone_box_shadow(&self) -> longhands::box_shadow::computed_value::T { let buf = self.gecko.mBoxShadow.iter().map(|v| v.to_box_shadow()).collect(); longhands::box_shadow::computed_value::T(buf) @@ -3725,14 +4308,14 @@ fn static_assert() { } if let Some(bottom) = rect.bottom { - self.gecko.mClip.height = bottom.0 - self.gecko.mClip.y; + self.gecko.mClip.height = (bottom - Au(self.gecko.mClip.y)).0; } else { self.gecko.mClip.height = 1 << 30; // NS_MAXSIZE self.gecko.mClipFlags |= NS_STYLE_CLIP_BOTTOM_AUTO as u8; } if let Some(right) = rect.right { - self.gecko.mClip.width = right.0 - self.gecko.mClip.x; + self.gecko.mClip.width = (right - Au(self.gecko.mClip.x)).0; } else { self.gecko.mClip.width = 1 << 30; // NS_MAXSIZE self.gecko.mClipFlags |= NS_STYLE_CLIP_RIGHT_AUTO as u8; @@ -3753,6 +4336,10 @@ fn static_assert() { self.gecko.mClipFlags = other.gecko.mClipFlags; } + pub fn reset_clip(&mut self, other: &Self) { + self.copy_clip_from(other) + } + pub fn clone_clip(&self) -> longhands::clip::computed_value::T { use gecko_bindings::structs::NS_STYLE_CLIP_AUTO; use gecko_bindings::structs::NS_STYLE_CLIP_BOTTOM_AUTO; @@ -3840,11 +4427,11 @@ fn static_assert() { match servo { % for func in FILTER_FUNCTIONS: ${func}(factor) => fill_filter(NS_STYLE_FILTER_${func.upper()}, - CoordDataValue::Factor(factor), + CoordDataValue::Factor(factor.0), gecko_filter), % endfor Blur(length) => fill_filter(NS_STYLE_FILTER_BLUR, - CoordDataValue::Coord(length.0), + CoordDataValue::Coord(length.value()), gecko_filter), HueRotate(angle) => fill_filter(NS_STYLE_FILTER_HUE_ROTATE, @@ -3882,6 +4469,10 @@ fn static_assert() { } } + pub fn reset_filter(&mut self, other: &Self) { + self.copy_filter_from(other) + } + pub fn clone_filter(&self) -> longhands::filter::computed_value::T { use values::generics::effects::Filter; use values::specified::url::SpecifiedUrl; @@ -3908,7 +4499,7 @@ fn static_assert() { }, % endfor NS_STYLE_FILTER_BLUR => { - filters.push(Filter::Blur(Au::from_gecko_style_coord( + filters.push(Filter::Blur(NonNegativeAu::from_gecko_style_coord( &filter.mFilterParameter).unwrap())); }, NS_STYLE_FILTER_HUE_ROTATE => { @@ -3965,14 +4556,43 @@ fn static_assert() { bindings::Gecko_CopyImageOrientationFrom(&mut self.gecko, &other.gecko); } } + + pub fn reset_image_orientation(&mut self, other: &Self) { + self.copy_image_orientation_from(other) + } + + pub fn clone_image_orientation(&self) -> longhands::image_orientation::computed_value::T { + use gecko_bindings::structs::{nsStyleImageOrientation_Bits, nsStyleImageOrientation_Angles}; + use properties::longhands::image_orientation::computed_value::{Orientation, T}; + + let gecko_orientation = self.gecko.mImageOrientation.mOrientation; + if gecko_orientation & nsStyleImageOrientation_Bits::FROM_IMAGE_MASK as u8 != 0 { + T::FromImage + } else { + const ANGLE0: u8 = nsStyleImageOrientation_Angles::ANGLE_0 as u8; + const ANGLE90: u8 = nsStyleImageOrientation_Angles::ANGLE_90 as u8; + const ANGLE180: u8 = nsStyleImageOrientation_Angles::ANGLE_180 as u8; + const ANGLE270: u8 = nsStyleImageOrientation_Angles::ANGLE_270 as u8; + + let flip = gecko_orientation & nsStyleImageOrientation_Bits::FLIP_MASK as u8 != 0; + let orientation = match gecko_orientation & nsStyleImageOrientation_Bits::ORIENTATION_MASK as u8 { + ANGLE0 => Orientation::Angle0, + ANGLE90 => Orientation::Angle90, + ANGLE180 => Orientation::Angle180, + ANGLE270 => Orientation::Angle270, + _ => unreachable!() + }; + T::AngleWithFlipped(orientation, flip) + } + } </%self:impl_trait> <%self:impl_trait style_struct_name="InheritedTable" skip_longhands="border-spacing"> pub fn set_border_spacing(&mut self, v: longhands::border_spacing::computed_value::T) { - self.gecko.mBorderSpacingCol = v.horizontal.0; - self.gecko.mBorderSpacingRow = v.vertical.0; + self.gecko.mBorderSpacingCol = v.horizontal.value(); + self.gecko.mBorderSpacingRow = v.vertical.value(); } pub fn copy_border_spacing_from(&mut self, other: &Self) { @@ -3980,10 +4600,14 @@ fn static_assert() { self.gecko.mBorderSpacingRow = other.gecko.mBorderSpacingRow; } + pub fn reset_border_spacing(&mut self, other: &Self) { + self.copy_border_spacing_from(other) + } + pub fn clone_border_spacing(&self) -> longhands::border_spacing::computed_value::T { longhands::border_spacing::computed_value::T { - horizontal: Au(self.gecko.mBorderSpacingCol), - vertical: Au(self.gecko.mBorderSpacingRow) + horizontal: Au(self.gecko.mBorderSpacingCol).into(), + vertical: Au(self.gecko.mBorderSpacingRow).into() } } </%self:impl_trait> @@ -4014,6 +4638,10 @@ fn static_assert() { self.gecko.mTextShadow.copy_from(&other.gecko.mTextShadow); } + pub fn reset_text_shadow(&mut self, other: &Self) { + self.copy_text_shadow_from(other) + } + pub fn clone_text_shadow(&self) -> longhands::text_shadow::computed_value::T { let buf = self.gecko.mTextShadow.iter().map(|v| v.to_simple_shadow()).collect(); longhands::text_shadow::computed_value::T(buf) @@ -4024,8 +4652,8 @@ fn static_assert() { // FIXME: Align binary representations and ditch |match| for cast + static_asserts let en = match v { LineHeight::Normal => CoordDataValue::Normal, - LineHeight::Length(val) => CoordDataValue::Coord(val.0), - LineHeight::Number(val) => CoordDataValue::Factor(val), + LineHeight::Length(val) => CoordDataValue::Coord(val.value()), + LineHeight::Number(val) => CoordDataValue::Factor(val.0), LineHeight::MozBlockHeight => CoordDataValue::Enumerated(structs::NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT), }; @@ -4036,8 +4664,8 @@ fn static_assert() { use values::generics::text::LineHeight; return match self.gecko.mLineHeight.as_value() { CoordDataValue::Normal => LineHeight::Normal, - CoordDataValue::Coord(coord) => LineHeight::Length(Au(coord)), - CoordDataValue::Factor(n) => LineHeight::Number(n), + CoordDataValue::Coord(coord) => LineHeight::Length(Au(coord).into()), + CoordDataValue::Factor(n) => LineHeight::Number(n.into()), CoordDataValue::Enumerated(val) if val == structs::NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT => LineHeight::MozBlockHeight, _ => panic!("this should not happen"), @@ -4140,6 +4768,10 @@ fn static_assert() { self.gecko.mTextEmphasisStyle = other.gecko.mTextEmphasisStyle; } + pub fn reset_text_emphasis_style(&mut self, other: &Self) { + self.copy_text_emphasis_style_from(other) + } + pub fn clone_text_emphasis_style(&self) -> longhands::text_emphasis_style::computed_value::T { use properties::longhands::text_emphasis_style::computed_value::{T, KeywordValue}; use properties::longhands::text_emphasis_style::ShapeKeyword; @@ -4167,18 +4799,20 @@ fn static_assert() { }) } - <%call expr="impl_app_units('_webkit_text_stroke_width', 'mWebkitTextStrokeWidth', need_clone=True)"></%call> + <%call expr="impl_non_negative_app_units('_webkit_text_stroke_width', + 'mWebkitTextStrokeWidth', + need_clone=True)"></%call> #[allow(non_snake_case)] pub fn set__moz_tab_size(&mut self, v: longhands::_moz_tab_size::computed_value::T) { use values::Either; match v { - Either::Second(number) => { - self.gecko.mTabSize.set_value(CoordDataValue::Factor(number)); + Either::Second(non_negative_number) => { + self.gecko.mTabSize.set_value(CoordDataValue::Factor(non_negative_number.0)); } - Either::First(au) => { - self.gecko.mTabSize.set(au); + Either::First(non_negative_au) => { + self.gecko.mTabSize.set(non_negative_au.0); } } } @@ -4188,8 +4822,8 @@ fn static_assert() { use values::Either; match self.gecko.mTabSize.as_value() { - CoordDataValue::Coord(coord) => Either::First(Au(coord)), - CoordDataValue::Factor(number) => Either::Second(number), + CoordDataValue::Coord(coord) => Either::First(Au(coord).into()), + CoordDataValue::Factor(number) => Either::Second(From::from(number)), _ => unreachable!(), } } @@ -4215,6 +4849,7 @@ fn static_assert() { clear_if_string(&mut self.gecko.mTextOverflow.mLeft); clear_if_string(&mut self.gecko.mTextOverflow.mRight); } + pub fn set_text_overflow(&mut self, v: longhands::text_overflow::computed_value::T) { use gecko_bindings::structs::nsStyleTextOverflowSide; use properties::longhands::text_overflow::Side; @@ -4252,6 +4887,10 @@ fn static_assert() { self.gecko.mTextOverflow.mLogicalDirections = other.gecko.mTextOverflow.mLogicalDirections; } + pub fn reset_text_overflow(&mut self, other: &Self) { + self.copy_text_overflow_from(other) + } + pub fn clone_text_overflow(&self) -> longhands::text_overflow::computed_value::T { use gecko_bindings::structs::nsStyleTextOverflowSide; use properties::longhands::text_overflow::Side; @@ -4295,6 +4934,10 @@ fn static_assert() { self.gecko.mInitialLetterSink = other.gecko.mInitialLetterSink; } + pub fn reset_initial_letter(&mut self, other: &Self) { + self.copy_initial_letter_from(other) + } + pub fn clone_initial_letter(&self) -> longhands::initial_letter::computed_value::T { use values::generics::text::InitialLetter; @@ -4432,6 +5075,10 @@ fn static_assert() { Gecko_CopyShapeSourceFrom(&mut self.gecko.${gecko_ffi_name}, &other.gecko.${gecko_ffi_name}); } } + + pub fn reset_${ident}(&mut self, other: &Self) { + self.copy_${ident}_from(other) + } </%def> <% skip_svg_longhands = """ @@ -4450,7 +5097,7 @@ clip-path </%self:impl_trait> <%self:impl_trait style_struct_name="InheritedSVG" - skip_longhands="paint-order stroke-dasharray stroke-dashoffset stroke-width -moz-context-properties" + skip_longhands="paint-order stroke-dasharray -moz-context-properties" skip_additionals="*"> pub fn set_paint_order(&mut self, v: longhands::paint_order::computed_value::T) { use self::longhands::paint_order; @@ -4476,86 +5123,94 @@ clip-path ${impl_simple_copy('paint_order', 'mPaintOrder')} - pub fn set_stroke_dasharray<I>(&mut self, v: I) - where I: IntoIterator<Item = longhands::stroke_dasharray::computed_value::single_value::T>, - I::IntoIter: ExactSizeIterator - { - let v = v.into_iter(); - unsafe { - bindings::Gecko_nsStyleSVG_SetDashArrayLength(&mut self.gecko, v.len() as u32); + pub fn clone_paint_order(&self) -> longhands::paint_order::computed_value::T { + use self::longhands::paint_order::{COUNT, FILL, MARKERS, NORMAL, SHIFT, STROKE}; + use self::longhands::paint_order::computed_value::T; + + if self.gecko.mPaintOrder == structs::NS_STYLE_PAINT_ORDER_NORMAL as u8 { + return T(NORMAL); } - for (mut gecko, servo) in self.gecko.mStrokeDasharray.iter_mut().zip(v) { - match servo { - Either::First(number) => gecko.set_value(CoordDataValue::Factor(number)), - Either::Second(lop) => gecko.set(lop), + const PAINT_ORDER_BITWIDTH: u8 = structs::NS_STYLE_PAINT_ORDER_BITWIDTH as u8; + let mask = (1 << PAINT_ORDER_BITWIDTH) - 1; + let mut order = 0; + for pos in 0..COUNT { + let value = + match (self.gecko.mPaintOrder >> pos * PAINT_ORDER_BITWIDTH & mask) as u32 { + structs::NS_STYLE_PAINT_ORDER_FILL => FILL, + structs::NS_STYLE_PAINT_ORDER_STROKE => STROKE, + structs::NS_STYLE_PAINT_ORDER_MARKERS => MARKERS, + _ => unreachable!(), + }; + order |= value << (pos * SHIFT); + }; + T(order) + } + + pub fn set_stroke_dasharray(&mut self, v: longhands::stroke_dasharray::computed_value::T) { + use gecko_bindings::structs::nsStyleSVG_STROKE_DASHARRAY_CONTEXT as CONTEXT_VALUE; + use values::generics::svg::SVGStrokeDashArray; + + match v { + SVGStrokeDashArray::Values(v) => { + let v = v.into_iter(); + self.gecko.mContextFlags &= !CONTEXT_VALUE; + unsafe { + bindings::Gecko_nsStyleSVG_SetDashArrayLength(&mut self.gecko, v.len() as u32); + } + for (mut gecko, servo) in self.gecko.mStrokeDasharray.iter_mut().zip(v) { + match servo { + Either::First(number) => gecko.set_value(CoordDataValue::Factor(number.into())), + Either::Second(lop) => gecko.set(lop), + } + } + } + SVGStrokeDashArray::ContextValue => { + self.gecko.mContextFlags |= CONTEXT_VALUE; + unsafe { + bindings::Gecko_nsStyleSVG_SetDashArrayLength(&mut self.gecko, 0); + } } } } pub fn copy_stroke_dasharray_from(&mut self, other: &Self) { + use gecko_bindings::structs::nsStyleSVG_STROKE_DASHARRAY_CONTEXT as CONTEXT_VALUE; unsafe { bindings::Gecko_nsStyleSVG_CopyDashArray(&mut self.gecko, &other.gecko); } + self.gecko.mContextFlags = + (self.gecko.mContextFlags & !CONTEXT_VALUE) | + (other.gecko.mContextFlags & CONTEXT_VALUE); + } + + pub fn reset_stroke_dasharray(&mut self, other: &Self) { + self.copy_stroke_dasharray_from(other) } pub fn clone_stroke_dasharray(&self) -> longhands::stroke_dasharray::computed_value::T { + use gecko_bindings::structs::nsStyleSVG_STROKE_DASHARRAY_CONTEXT as CONTEXT_VALUE; use values::computed::LengthOrPercentage; + use values::generics::svg::SVGStrokeDashArray; + if self.gecko.mContextFlags & CONTEXT_VALUE != 0 { + debug_assert_eq!(self.gecko.mStrokeDasharray.len(), 0); + return SVGStrokeDashArray::ContextValue; + } let mut vec = vec![]; for gecko in self.gecko.mStrokeDasharray.iter() { match gecko.as_value() { - CoordDataValue::Factor(number) => vec.push(Either::First(number)), + CoordDataValue::Factor(number) => vec.push(Either::First(number.into())), CoordDataValue::Coord(coord) => - vec.push(Either::Second(LengthOrPercentage::Length(Au(coord)))), + vec.push(Either::Second(LengthOrPercentage::Length(Au(coord)).into())), CoordDataValue::Percent(p) => - vec.push(Either::Second(LengthOrPercentage::Percentage(Percentage(p)))), + vec.push(Either::Second(LengthOrPercentage::Percentage(Percentage(p)).into())), CoordDataValue::Calc(calc) => - vec.push(Either::Second(LengthOrPercentage::Calc(calc.into()))), + vec.push(Either::Second(LengthOrPercentage::Calc(calc.into()).into())), _ => unreachable!(), } } - longhands::stroke_dasharray::computed_value::T(vec) - } - - pub fn set_stroke_dashoffset(&mut self, v: longhands::stroke_dashoffset::computed_value::T) { - match v { - Either::First(number) => self.gecko.mStrokeDashoffset.set_value(CoordDataValue::Factor(number)), - Either::Second(lop) => self.gecko.mStrokeDashoffset.set(lop), - } - } - - ${impl_coord_copy('stroke_dashoffset', 'mStrokeDashoffset')} - - pub fn clone_stroke_dashoffset(&self) -> longhands::stroke_dashoffset::computed_value::T { - use values::computed::LengthOrPercentage; - match self.gecko.mStrokeDashoffset.as_value() { - CoordDataValue::Factor(number) => Either::First(number), - CoordDataValue::Coord(coord) => Either::Second(LengthOrPercentage::Length(Au(coord))), - CoordDataValue::Percent(p) => Either::Second(LengthOrPercentage::Percentage(Percentage(p))), - CoordDataValue::Calc(calc) => Either::Second(LengthOrPercentage::Calc(calc.into())), - _ => unreachable!(), - } - } - - pub fn set_stroke_width(&mut self, v: longhands::stroke_width::computed_value::T) { - match v { - Either::First(number) => self.gecko.mStrokeWidth.set_value(CoordDataValue::Factor(number)), - Either::Second(lop) => self.gecko.mStrokeWidth.set(lop), - } - } - - ${impl_coord_copy('stroke_width', 'mStrokeWidth')} - - pub fn clone_stroke_width(&self) -> longhands::stroke_width::computed_value::T { - use values::computed::LengthOrPercentage; - match self.gecko.mStrokeWidth.as_value() { - CoordDataValue::Factor(number) => Either::First(number), - CoordDataValue::Coord(coord) => Either::Second(LengthOrPercentage::Length(Au(coord))), - CoordDataValue::Percent(p) => Either::Second(LengthOrPercentage::Percentage(Percentage(p))), - CoordDataValue::Calc(calc) => Either::Second(LengthOrPercentage::Calc(calc.into())), - _ => unreachable!(), - } + SVGStrokeDashArray::Values(vec) } #[allow(non_snake_case)] @@ -4589,6 +5244,11 @@ clip-path bindings::Gecko_nsStyleSVG_CopyContextProperties(&mut self.gecko, &other.gecko); } } + + #[allow(non_snake_case)] + pub fn reset__moz_context_properties(&mut self, other: &Self) { + self.copy__moz_context_properties_from(other) + } </%self:impl_trait> <%self:impl_trait style_struct_name="Color" @@ -4692,6 +5352,10 @@ clip-path } } + pub fn reset_cursor(&mut self, other: &Self) { + self.copy_cursor_from(other) + } + pub fn clone_cursor(&self) -> longhands::cursor::computed_value::T { use properties::longhands::cursor::computed_value::{Keyword, Image}; use style_traits::cursor::Cursor; @@ -4768,8 +5432,8 @@ clip-path use gecko_bindings::structs::{NS_STYLE_COLUMN_COUNT_AUTO, nsStyleColumn_kMaxColumnCount}; self.gecko.mColumnCount = match v { - Either::First(number) => unsafe { - cmp::min(number as u32, nsStyleColumn_kMaxColumnCount) + Either::First(integer) => unsafe { + cmp::min(integer.0 as u32, nsStyleColumn_kMaxColumnCount) }, Either::Second(Auto) => NS_STYLE_COLUMN_COUNT_AUTO }; @@ -4782,14 +5446,14 @@ clip-path if self.gecko.mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO { debug_assert!((self.gecko.mColumnCount as i32) >= 0 && (self.gecko.mColumnCount as i32) < i32::max_value()); - Either::First(self.gecko.mColumnCount as i32) + Either::First((self.gecko.mColumnCount as i32).into()) } else { Either::Second(Auto) } } - <% impl_app_units("column_rule_width", "mColumnRuleWidth", need_clone=True, - round_to_pixels=True) %> + <% impl_non_negative_app_units("column_rule_width", "mColumnRuleWidth", need_clone=True, + round_to_pixels=True) %> </%self:impl_trait> <%self:impl_trait style_struct_name="Counters" @@ -4919,6 +5583,10 @@ clip-path } } + pub fn reset_content(&mut self, other: &Self) { + self.copy_content_from(other) + } + % for counter_property in ["Increment", "Reset"]: pub fn set_counter_${counter_property.lower()}(&mut self, v: longhands::counter_increment::computed_value::T) { unsafe { @@ -4937,6 +5605,10 @@ clip-path } } + pub fn reset_counter_${counter_property.lower()}(&mut self, other: &Self) { + self.copy_counter_${counter_property.lower()}_from(other) + } + pub fn clone_counter_${counter_property.lower()}(&self) -> longhands::counter_increment::computed_value::T { use values::CustomIdent; use gecko_string_cache::Atom; @@ -4976,26 +5648,3 @@ ${impl_style_struct(style_struct)} <%self:raw_impl_trait style_struct="${style_struct}"></%self:raw_impl_trait> % endif % endfor - -// This is only accessed from the Gecko main thread. -static mut EMPTY_VARIABLES_STRUCT: Option<nsStyleVariables> = None; - -#[no_mangle] -#[allow(non_snake_case)] -pub unsafe extern "C" fn Servo_GetEmptyVariables() - -> *const nsStyleVariables { - EMPTY_VARIABLES_STRUCT.as_ref().unwrap() -} - -pub fn initialize() { - unsafe { - EMPTY_VARIABLES_STRUCT = Some(zeroed()); - Gecko_Construct_nsStyleVariables(EMPTY_VARIABLES_STRUCT.as_mut().unwrap()); - } -} - -pub fn shutdown() { - unsafe { - EMPTY_VARIABLES_STRUCT.take().as_mut().map(|v| Gecko_Destroy_nsStyleVariables(v)); - } -} diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 442b9894f4f..82eeb653e16 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -76,8 +76,10 @@ We assume that the default/initial value is an empty vector for these. `initial_value` need not be defined for these. </%doc> -<%def name="vector_longhand(name, animation_value_type=None, allow_empty=False, separator='Comma', **kwargs)"> - <%call expr="longhand(name, animation_value_type=animation_value_type, vector=True, **kwargs)"> +<%def name="vector_longhand(name, animation_value_type=None, allow_empty=False, separator='Comma', + need_animatable=False, **kwargs)"> + <%call expr="longhand(name, animation_value_type=animation_value_type, vector=True, + need_animatable=need_animatable, **kwargs)"> #[allow(unused_imports)] use smallvec::SmallVec; use std::fmt; @@ -127,7 +129,7 @@ % endif ); - % if animation_value_type == "ComputedValue": + % if need_animatable or animation_value_type == "ComputedValue": use properties::animated_properties::Animatable; use values::animated::ToAnimatedZero; @@ -917,6 +919,15 @@ </%def> </%self:logical_setter_helper> } + + /// Copy the appropriate physical property from another struct for ${name} + /// given a writing mode. + pub fn reset_${to_rust_ident(name)}(&mut self, + other: &Self, + wm: WritingMode) { + self.copy_${to_rust_ident(name)}_from(other, wm) + } + % if need_clone: /// Get the computed value for the appropriate physical property for /// ${name} given a writing mode. diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 4e3a79f5e77..19ca7e49e7a 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -16,8 +16,11 @@ use euclid::{Point2D, Size2D}; #[cfg(feature = "gecko")] use gecko_string_cache::Atom; use properties::{CSSWideKeyword, PropertyDeclaration}; use properties::longhands; +use properties::longhands::background_size::computed_value::T as BackgroundSizeList; +use properties::longhands::border_spacing::computed_value::T as BorderSpacing; use properties::longhands::font_weight::computed_value::T as FontWeight; use properties::longhands::font_stretch::computed_value::T as FontStretch; +use properties::longhands::line_height::computed_value::T as LineHeight; use properties::longhands::transform::computed_value::ComputedMatrix; use properties::longhands::transform::computed_value::ComputedOperation as TransformOperation; use properties::longhands::transform::computed_value::T as TransformList; @@ -43,10 +46,14 @@ use values::computed::{Angle, LengthOrPercentageOrAuto, LengthOrPercentageOrNone use values::computed::{BorderCornerRadius, ClipRect}; use values::computed::{CalcLengthOrPercentage, Color, Context, ComputedValueAsSpecified}; use values::computed::{LengthOrPercentage, MaxLength, MozLength, Percentage, ToComputedValue}; -use values::generics::{SVGPaint, SVGPaintKind}; +use values::computed::{NonNegativeAu, NonNegativeNumber, PositiveIntegerOrAuto}; +use values::computed::length::{NonNegativeLengthOrAuto, NonNegativeLengthOrNormal}; +use values::computed::length::NonNegativeLengthOrPercentage; +use values::generics::{GreaterThanOrEqualToOne, NonNegative}; use values::generics::border::BorderCornerRadius as GenericBorderCornerRadius; use values::generics::effects::Filter; use values::generics::position as generic_position; +use values::generics::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind, SVGStrokeDashArray}; /// A trait used to implement various procedures used during animation. pub trait Animatable: Sized { @@ -605,8 +612,8 @@ impl AnimationValue { CSSWideKeyword::Unset | % endif CSSWideKeyword::Inherit => { - let inherit_struct = context.inherited_style() - .get_${prop.style_struct.name_lower}(); + let inherit_struct = context.builder + .get_parent_${prop.style_struct.name_lower}(); inherit_struct.clone_${prop.ident}() }, }; @@ -777,6 +784,7 @@ impl ToAnimatedZero for AnimationValue { impl RepeatableListAnimatable for LengthOrPercentage {} impl RepeatableListAnimatable for Either<f32, LengthOrPercentage> {} +impl RepeatableListAnimatable for Either<NonNegativeNumber, NonNegativeLengthOrPercentage> {} macro_rules! repeated_vec_impl { ($($ty:ty),*) => { @@ -925,6 +933,13 @@ impl Animatable for Angle { } } } + + #[inline] + fn compute_distance(&self, other: &Self) -> Result<f64, ()> { + // Use the formula for calculating the distance between angles defined in SVG: + // https://www.w3.org/TR/SVG/animate.html#complexDistances + Ok((self.radians64() - other.radians64()).abs()) + } } /// https://drafts.csswg.org/css-transitions/#animtype-percentage @@ -1357,7 +1372,14 @@ impl Animatable for MozLength { impl ToAnimatedZero for MozLength { #[inline] - fn to_animated_zero(&self) -> Result<Self, ()> { Err(()) } + fn to_animated_zero(&self) -> Result<Self, ()> { + match *self { + MozLength::LengthOrPercentageOrAuto(ref length) => { + Ok(MozLength::LengthOrPercentageOrAuto(length.to_animated_zero()?)) + }, + _ => Err(()) + } + } } /// https://drafts.csswg.org/css-transitions/#animtype-lpcalc @@ -1731,7 +1753,7 @@ fn add_weighted_transform_lists(from_list: &[TransformOperation], TransformList(Some(result)) } -/// https://drafts.csswg.org/css-transforms/#Rotate3dDefined +/// https://www.w3.org/TR/css-transforms-1/#Rotate3dDefined fn rotate_to_matrix(x: f32, y: f32, z: f32, a: Angle) -> ComputedMatrix { let half_rad = a.radians() / 2.0; let sc = (half_rad).sin() * (half_rad).cos(); @@ -1739,17 +1761,17 @@ fn rotate_to_matrix(x: f32, y: f32, z: f32, a: Angle) -> ComputedMatrix { ComputedMatrix { m11: 1.0 - 2.0 * (y * y + z * z) * sq, - m12: 2.0 * (x * y * sq - z * sc), - m13: 2.0 * (x * z * sq + y * sc), + m12: 2.0 * (x * y * sq + z * sc), + m13: 2.0 * (x * z * sq - y * sc), m14: 0.0, - m21: 2.0 * (x * y * sq + z * sc), + m21: 2.0 * (x * y * sq - z * sc), m22: 1.0 - 2.0 * (x * x + z * z) * sq, - m23: 2.0 * (y * z * sq - x * sc), + m23: 2.0 * (y * z * sq + x * sc), m24: 0.0, - m31: 2.0 * (x * z * sq - y * sc), - m32: 2.0 * (y * z * sq + x * sc), + m31: 2.0 * (x * z * sq + y * sc), + m32: 2.0 * (y * z * sq - x * sc), m33: 1.0 - 2.0 * (x * x + y * y) * sq, m34: 0.0, @@ -2274,7 +2296,7 @@ impl Animatable for MatrixDecomposed3D { use std::f64; debug_assert!((self_portion + other_portion - 1.0f64).abs() <= f64::EPSILON || - other_portion == 1.0f64, + other_portion == 1.0f64 || other_portion == 0.0f64, "add_weighted should only be used for interpolating or accumulating transforms"); let mut sum = *self; @@ -2390,19 +2412,19 @@ impl From<MatrixDecomposed3D> for ComputedMatrix { let mut temp = ComputedMatrix::identity(); if decomposed.skew.2 != 0.0 { temp.m32 = decomposed.skew.2; - matrix = multiply(matrix, temp); + matrix = multiply(temp, matrix); } if decomposed.skew.1 != 0.0 { temp.m32 = 0.0; temp.m31 = decomposed.skew.1; - matrix = multiply(matrix, temp); + matrix = multiply(temp, matrix); } if decomposed.skew.0 != 0.0 { temp.m31 = 0.0; temp.m21 = decomposed.skew.0; - matrix = multiply(matrix, temp); + matrix = multiply(temp, matrix); } // Apply scale @@ -3031,6 +3053,123 @@ impl ToAnimatedZero for IntermediateSVGPaintKind { } } +impl<LengthType> Animatable for SVGLength<LengthType> + where LengthType: Animatable + Clone +{ + #[inline] + fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64) -> Result<Self, ()> { + match (self, other) { + (&SVGLength::Length(ref this), &SVGLength::Length(ref other)) => { + this.add_weighted(&other, self_portion, other_portion).map(SVGLength::Length) + } + _ => { + Ok(if self_portion > other_portion { self.clone() } else { other.clone() }) + } + } + } + + #[inline] + fn compute_distance(&self, other: &Self) -> Result<f64, ()> { + match (self, other) { + (&SVGLength::Length(ref this), &SVGLength::Length(ref other)) => { + this.compute_distance(other) + } + _ => Err(()) + } + } +} + +impl<LengthType> ToAnimatedZero for SVGLength<LengthType> where LengthType : ToAnimatedZero { + #[inline] + fn to_animated_zero(&self) -> Result<Self, ()> { + match self { + &SVGLength::Length(ref length) => length.to_animated_zero().map(SVGLength::Length), + &SVGLength::ContextValue => Ok(SVGLength::ContextValue), + } + } +} + +impl<LengthType> Animatable for SVGStrokeDashArray<LengthType> + where LengthType : RepeatableListAnimatable + Clone +{ + #[inline] + fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64) -> Result<Self, ()> { + match (self, other) { + (&SVGStrokeDashArray::Values(ref this), &SVGStrokeDashArray::Values(ref other))=> { + this.add_weighted(other, self_portion, other_portion) + .map(SVGStrokeDashArray::Values) + } + _ => { + Ok(if self_portion > other_portion { self.clone() } else { other.clone() }) + } + } + } + + #[inline] + fn compute_distance(&self, other: &Self) -> Result<f64, ()> { + match (self, other) { + (&SVGStrokeDashArray::Values(ref this), &SVGStrokeDashArray::Values(ref other)) => { + this.compute_distance(other) + } + _ => Err(()) + } + } +} + +impl<LengthType> ToAnimatedZero for SVGStrokeDashArray<LengthType> + where LengthType : ToAnimatedZero + Clone +{ + #[inline] + fn to_animated_zero(&self) -> Result<Self, ()> { + match self { + &SVGStrokeDashArray::Values(ref values) => { + values.iter().map(ToAnimatedZero::to_animated_zero) + .collect::<Result<Vec<_>, ()>>().map(SVGStrokeDashArray::Values) + } + &SVGStrokeDashArray::ContextValue => Ok(SVGStrokeDashArray::ContextValue), + } + } +} + +impl<OpacityType> Animatable for SVGOpacity<OpacityType> + where OpacityType: Animatable + Clone +{ + #[inline] + fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64) -> Result<Self, ()> { + match (self, other) { + (&SVGOpacity::Opacity(ref this), &SVGOpacity::Opacity(ref other)) => { + this.add_weighted(other, self_portion, other_portion).map(SVGOpacity::Opacity) + } + _ => { + Ok(if self_portion > other_portion { self.clone() } else { other.clone() }) + } + } + } + + #[inline] + fn compute_distance(&self, other: &Self) -> Result<f64, ()> { + match (self, other) { + (&SVGOpacity::Opacity(ref this), &SVGOpacity::Opacity(ref other)) => { + this.compute_distance(other) + } + _ => Err(()) + } + } +} + +impl<OpacityType> ToAnimatedZero for SVGOpacity<OpacityType> + where OpacityType: ToAnimatedZero + Clone +{ + #[inline] + fn to_animated_zero(&self) -> Result<Self, ()> { + match self { + &SVGOpacity::Opacity(ref opacity) => + opacity.to_animated_zero().map(SVGOpacity::Opacity), + other => Ok(other.clone()), + } + } +} + <% FILTER_FUNCTIONS = [ 'Blur', 'Brightness', 'Contrast', 'Grayscale', 'HueRotate', 'Invert', 'Opacity', 'Saturate', @@ -3060,7 +3199,7 @@ fn add_weighted_filter_function_impl(from: &AnimatedFilter, &to_value, self_portion, other_portion, - &0.0, + &NonNegative::<CSSFloat>(0.0), )?)) }, % endfor @@ -3071,7 +3210,7 @@ fn add_weighted_filter_function_impl(from: &AnimatedFilter, &to_value, self_portion, other_portion, - &1.0, + &NonNegative::<CSSFloat>(1.0), )?)) }, % endfor @@ -3172,37 +3311,21 @@ impl Animatable for AnimatedFilterList { #[inline] fn compute_squared_distance(&self, other: &Self) -> Result<f64, ()> { - let mut square_distance: f64 = 0.0; - let mut from_iter = self.0.iter(); - let mut to_iter = other.0.iter(); - - let mut from = from_iter.next(); - let mut to = to_iter.next(); - while from.is_some() || to.is_some() { - let current_square_distance: f64 ; - if from.is_none() { - let none = try!(add_weighted_filter_function(to, to, 0.0, 0.0)); - current_square_distance = - compute_filter_square_distance(&none, &(to.unwrap())).unwrap(); + use itertools::{EitherOrBoth, Itertools}; - to = to_iter.next(); - } else if to.is_none() { - let none = try!(add_weighted_filter_function(from, from, 0.0, 0.0)); - current_square_distance = - compute_filter_square_distance(&none, &(from.unwrap())).unwrap(); - - from = from_iter.next(); - } else { - current_square_distance = - compute_filter_square_distance(&(from.unwrap()), - &(to.unwrap())).unwrap(); - - from = from_iter.next(); - to = to_iter.next(); - } - square_distance += current_square_distance; + let mut square_distance: f64 = 0.0; + for it in self.0.iter().zip_longest(other.0.iter()) { + square_distance += match it { + EitherOrBoth::Both(from, to) => { + compute_filter_square_distance(&from, &to)? + }, + EitherOrBoth::Left(list) | EitherOrBoth::Right(list)=> { + let none = add_weighted_filter_function(Some(list), Some(list), 0.0, 0.0)?; + compute_filter_square_distance(&none, &list)? + }, + }; } - Ok(square_distance.sqrt()) + Ok(square_distance) } } @@ -3258,3 +3381,49 @@ sorted_shorthands = [(p, position) for position, p in enumerate(sorted_shorthand % endfor } } + +impl<T> Animatable for NonNegative<T> + where T: Animatable + Clone +{ + #[inline] + fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64) -> Result<Self, ()> { + self.0.add_weighted(&other.0, self_portion, other_portion).map(NonNegative::<T>) + } + + #[inline] + fn compute_distance(&self, other: &Self) -> Result<f64, ()> { + self.0.compute_distance(&other.0) + } +} + +impl<T> ToAnimatedZero for NonNegative<T> + where T: ToAnimatedZero +{ + #[inline] + fn to_animated_zero(&self) -> Result<Self, ()> { + self.0.to_animated_zero().map(NonNegative::<T>) + } +} + +impl<T> Animatable for GreaterThanOrEqualToOne<T> + where T: Animatable + Clone +{ + #[inline] + fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64) -> Result<Self, ()> { + self.0.add_weighted(&other.0, self_portion, other_portion).map(GreaterThanOrEqualToOne::<T>) + } + + #[inline] + fn compute_distance(&self, other: &Self) -> Result<f64, ()> { + self.0.compute_distance(&other.0) + } +} + +impl<T> ToAnimatedZero for GreaterThanOrEqualToOne<T> + where T: ToAnimatedZero +{ + #[inline] + fn to_animated_zero(&self) -> Result<Self, ()> { + self.0.to_animated_zero().map(GreaterThanOrEqualToOne::<T>) + } +} diff --git a/components/style/properties/longhand/background.mako.rs b/components/style/properties/longhand/background.mako.rs index 1fed8b37f40..b2de4e38fc6 100644 --- a/components/style/properties/longhand/background.mako.rs +++ b/components/style/properties/longhand/background.mako.rs @@ -167,7 +167,8 @@ ${helpers.predefined_type("background-size", "BackgroundSize", initial_specified_value="specified::LengthOrPercentageOrAuto::Auto.into()", spec="https://drafts.csswg.org/css-backgrounds/#the-background-size", vector=True, - animation_value_type="ComputedValue", + animation_value_type="BackgroundSizeList", + need_animatable=True, flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", extra_prefixes="webkit")} diff --git a/components/style/properties/longhand/border.mako.rs b/components/style/properties/longhand/border.mako.rs index c4f6aa888b1..db5fd47b2bd 100644 --- a/components/style/properties/longhand/border.mako.rs +++ b/components/style/properties/longhand/border.mako.rs @@ -40,11 +40,11 @@ ${helpers.predefined_type("border-%s-width" % side_name, "BorderSideWidth", - "Au::from_px(3)", - computed_type="::app_units::Au", + "::values::computed::NonNegativeAu::from_px(3)", + computed_type="::values::computed::NonNegativeAu", alias=maybe_moz_logical_alias(product, side, "-moz-border-%s-width"), spec=maybe_logical_spec(side, "width"), - animation_value_type="ComputedValue", + animation_value_type="NonNegativeAu", logical=is_logical, flags="APPLIES_TO_FIRST_LETTER", allow_quirks=not is_logical)} @@ -62,7 +62,7 @@ ${helpers.gecko_keyword_conversion(Keyword('border-style', spec="https://drafts.csswg.org/css-backgrounds/#border-%s-radius" % corner, boxed=True, flags="APPLIES_TO_FIRST_LETTER", - animation_value_type="ComputedValue")} + animation_value_type="BorderCornerRadius")} % endfor /// -moz-border-*-colors: color, string, enum, none, inherit/initial diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs index 41e7a3fb4c8..7bdb7c1c1c5 100644 --- a/components/style/properties/longhand/box.mako.rs +++ b/components/style/properties/longhand/box.mako.rs @@ -591,6 +591,8 @@ ${helpers.predefined_type("animation-duration", extra_prefixes="moz webkit", spec="https://drafts.csswg.org/css-transitions/#propdef-transition-duration")} +// animation-timing-function is the exception to the rule for allowed_in_keyframe_block: +// https://drafts.csswg.org/css-animations/#keyframes ${helpers.predefined_type("animation-timing-function", "TimingFunction", "computed::TimingFunction::ease()", @@ -671,8 +673,6 @@ ${helpers.single_keyword("animation-direction", spec="https://drafts.csswg.org/css-animations/#propdef-animation-direction", allowed_in_keyframe_block=False)} -// animation-play-state is the exception to the rule for allowed_in_keyframe_block: -// https://drafts.csswg.org/css-animations/#keyframes ${helpers.single_keyword("animation-play-state", "running paused", need_clone=True, @@ -681,7 +681,7 @@ ${helpers.single_keyword("animation-play-state", vector=True, extra_prefixes="moz webkit", spec="https://drafts.csswg.org/css-animations/#propdef-animation-play-state", - allowed_in_keyframe_block=True)} + allowed_in_keyframe_block=False)} ${helpers.single_keyword("animation-fill-mode", "none forwards backwards both", @@ -979,7 +979,14 @@ ${helpers.predefined_type( dest, "rotate3d({}, {}, {}, {})", Css(x), Css(y), Css(z), Css(theta)), SpecifiedOperation::Perspective(ref length) => write!(dest, "perspective({})", Css(length)), - _ => unreachable!(), + SpecifiedOperation::InterpolateMatrix { ref from_list, ref to_list, progress } => { + write!(dest, "interpolatematrix({}, {}, {})", + Css(from_list), Css(to_list), Css(progress)) + }, + SpecifiedOperation::AccumulateMatrix { ref from_list, ref to_list, count } => { + write!(dest, "accumulatematrix({}, {}, {})", + Css(from_list), Css(to_list), Css(count)) + } } } } diff --git a/components/style/properties/longhand/color.mako.rs b/components/style/properties/longhand/color.mako.rs index d1fb5429261..9ac3bbfcfbc 100644 --- a/components/style/properties/longhand/color.mako.rs +++ b/components/style/properties/longhand/color.mako.rs @@ -22,7 +22,7 @@ #[inline] fn to_computed_value(&self, context: &Context) -> computed_value::T { self.0.to_computed_value(context) - .to_rgba(context.inherited_style().get_color().clone_color()) + .to_rgba(context.builder.get_parent_color().clone_color()) } #[inline] diff --git a/components/style/properties/longhand/column.mako.rs b/components/style/properties/longhand/column.mako.rs index 440e5d94d81..dda11ea696c 100644 --- a/components/style/properties/longhand/column.mako.rs +++ b/components/style/properties/longhand/column.mako.rs @@ -7,33 +7,30 @@ <% data.new_style_struct("Column", inherited=False) %> ${helpers.predefined_type("column-width", - "length::LengthOrAuto", + "length::NonNegativeLengthOrAuto", "Either::Second(Auto)", initial_specified_value="Either::Second(Auto)", - parse_method="parse_non_negative_length", extra_prefixes="moz", - animation_value_type="ComputedValue", + animation_value_type="NonNegativeLengthOrAuto", experimental=True, spec="https://drafts.csswg.org/css-multicol/#propdef-column-width")} ${helpers.predefined_type("column-count", - "IntegerOrAuto", + "PositiveIntegerOrAuto", "Either::Second(Auto)", - parse_method="parse_positive", initial_specified_value="Either::Second(Auto)", experimental="True", - animation_value_type="ComputedValue", + animation_value_type="PositiveIntegerOrAuto", extra_prefixes="moz", spec="https://drafts.csswg.org/css-multicol/#propdef-column-count")} ${helpers.predefined_type("column-gap", - "length::LengthOrNormal", + "length::NonNegativeLengthOrNormal", "Either::Second(Normal)", - parse_method='parse_non_negative_length', extra_prefixes="moz", experimental=True, - animation_value_type="ComputedValue", + animation_value_type="NonNegativeLengthOrNormal", spec="https://drafts.csswg.org/css-multicol/#propdef-column-gap")} ${helpers.single_keyword("column-fill", "balance auto", extra_prefixes="moz", @@ -42,12 +39,12 @@ ${helpers.single_keyword("column-fill", "balance auto", extra_prefixes="moz", ${helpers.predefined_type("column-rule-width", "BorderSideWidth", - "Au::from_px(3)", + "::values::computed::NonNegativeAu::from_px(3)", initial_specified_value="specified::BorderSideWidth::Medium", - computed_type="::app_units::Au", + computed_type="::values::computed::NonNegativeAu", products="gecko", spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-width", - animation_value_type="ComputedValue", + animation_value_type="NonNegativeAu", extra_prefixes="moz")} // https://drafts.csswg.org/css-multicol-1/#crc diff --git a/components/style/properties/longhand/font.mako.rs b/components/style/properties/longhand/font.mako.rs index 8942c73afb9..e31d459cee2 100644 --- a/components/style/properties/longhand/font.mako.rs +++ b/components/style/properties/longhand/font.mako.rs @@ -96,7 +96,20 @@ macro_rules! impl_gecko_keyword_conversions { #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))] pub struct FamilyName { pub name: Atom, - pub quoted: bool, + pub syntax: FamilyNameSyntax, + } + + #[derive(Debug, PartialEq, Eq, Clone, Hash)] + #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))] + pub enum FamilyNameSyntax { + /// The family name was specified in a quoted form, e.g. "Font Name" + /// or 'Font Name'. + Quoted, + + /// The family name was specified in an unquoted form as a sequence of + /// identifiers. The `String` is the serialization of the sequence of + /// identifiers. + Identifiers(String), } impl FontFamily { @@ -139,7 +152,7 @@ macro_rules! impl_gecko_keyword_conversions { // quoted by default. FontFamily::FamilyName(FamilyName { name: input, - quoted: true, + syntax: FamilyNameSyntax::Quoted, }) } @@ -148,7 +161,7 @@ macro_rules! impl_gecko_keyword_conversions { if let Ok(value) = input.try(|i| i.expect_string_cloned()) { return Ok(FontFamily::FamilyName(FamilyName { name: Atom::from(&*value), - quoted: true, + syntax: FamilyNameSyntax::Quoted, })) } let first_ident = input.expect_ident()?.clone(); @@ -182,20 +195,27 @@ macro_rules! impl_gecko_keyword_conversions { } let mut value = first_ident.as_ref().to_owned(); + let mut serialization = String::new(); + serialize_identifier(&first_ident, &mut serialization).unwrap(); + // These keywords are not allowed by themselves. // The only way this value can be valid with with another keyword. if css_wide_keyword { let ident = input.expect_ident()?; - value.push_str(" "); + value.push(' '); value.push_str(&ident); + serialization.push(' '); + serialize_identifier(&ident, &mut serialization).unwrap(); } while let Ok(ident) = input.try(|i| i.expect_ident_cloned()) { - value.push_str(" "); + value.push(' '); value.push_str(&ident); + serialization.push(' '); + serialize_identifier(&ident, &mut serialization).unwrap(); } Ok(FontFamily::FamilyName(FamilyName { name: Atom::from(value), - quoted: false, + syntax: FamilyNameSyntax::Identifiers(serialization), })) } @@ -229,12 +249,17 @@ macro_rules! impl_gecko_keyword_conversions { impl ToCss for FamilyName { fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { - if self.quoted { - dest.write_char('"')?; - write!(CssStringWriter::new(dest), "{}", self.name)?; - dest.write_char('"') - } else { - serialize_identifier(&*self.name.to_string(), dest) + match self.syntax { + FamilyNameSyntax::Quoted => { + dest.write_char('"')?; + write!(CssStringWriter::new(dest), "{}", self.name)?; + dest.write_char('"') + } + FamilyNameSyntax::Identifiers(ref serialization) => { + // Note that `serialization` is already escaped/ + // serialized appropriately. + dest.write_str(&*serialization) + } } } } @@ -457,6 +482,9 @@ ${helpers.single_keyword_system("font-variant-caps", pub mod computed_value { /// As of CSS Fonts Module Level 3, only the following values are /// valid: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 + /// + /// However, system fonts may provide other values. Pango + /// may provide 350, 380, and 1000 (on top of the existing values), for example. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, ToCss)] #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))] pub struct T(pub u16); @@ -483,8 +511,9 @@ ${helpers.single_keyword_system("font-variant-caps", /// Convert from an Gecko weight pub fn from_gecko_weight(weight: u16) -> Self { - Self::from_int(weight as i32) - .expect("from_gecko_weight: called with invalid weight") + // we allow a wider range of weights than is parseable + // because system fonts may provide custom values + T(weight) } /// Weither this weight is bold @@ -544,9 +573,9 @@ ${helpers.single_keyword_system("font-variant-caps", SpecifiedValue::Normal => computed_value::T::normal(), SpecifiedValue::Bold => computed_value::T::bold(), SpecifiedValue::Bolder => - context.inherited_style().get_font().clone_font_weight().bolder(), + context.builder.get_parent_font().clone_font_weight().bolder(), SpecifiedValue::Lighter => - context.inherited_style().get_font().clone_font_weight().lighter(), + context.builder.get_parent_font().clone_font_weight().lighter(), SpecifiedValue::System(_) => { <%self:nongecko_unreachable> context.cached_system_font.as_ref().unwrap().font_weight.clone() @@ -562,7 +591,7 @@ ${helpers.single_keyword_system("font-variant-caps", } </%helpers:longhand> -<%helpers:longhand name="font-size" need_clone="True" animation_value_type="ComputedValue" +<%helpers:longhand name="font-size" need_clone="True" animation_value_type="NonNegativeAu" flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER" allow_quirks="True" spec="https://drafts.csswg.org/css-fonts/#propdef-font-size"> use app_units::Au; @@ -570,6 +599,7 @@ ${helpers.single_keyword_system("font-variant-caps", use std::fmt; use style_traits::{HasViewportPercentage, ToCss}; use values::FONT_MEDIUM_PX; + use values::computed::NonNegativeAu; use values::specified::{AllowQuirks, FontRelativeLength, LengthOrPercentage, NoCalcLength}; use values::specified::length::FontBaseSize; @@ -617,8 +647,8 @@ ${helpers.single_keyword_system("font-variant-caps", } pub mod computed_value { - use app_units::Au; - pub type T = Au; + use values::computed::NonNegativeAu; + pub type T = NonNegativeAu; } /// CSS font keywords @@ -693,7 +723,7 @@ ${helpers.single_keyword_system("font-variant-caps", % if product == "servo": impl ToComputedValue for KeywordSize { - type ComputedValue = Au; + type ComputedValue = NonNegativeAu; #[inline] fn to_computed_value(&self, _: &Context) -> computed_value::T { // https://drafts.csswg.org/css-fonts-3/#font-size-prop @@ -707,7 +737,7 @@ ${helpers.single_keyword_system("font-variant-caps", XLarge => Au::from_px(FONT_MEDIUM_PX) * 3 / 2, XXLarge => Au::from_px(FONT_MEDIUM_PX) * 2, XXXLarge => Au::from_px(FONT_MEDIUM_PX) * 3, - } + }.into() } #[inline] @@ -717,7 +747,7 @@ ${helpers.single_keyword_system("font-variant-caps", } % else: impl ToComputedValue for KeywordSize { - type ComputedValue = Au; + type ComputedValue = NonNegativeAu; #[inline] fn to_computed_value(&self, cx: &Context) -> computed_value::T { use gecko_bindings::structs::nsIAtom; @@ -753,9 +783,9 @@ ${helpers.single_keyword_system("font-variant-caps", let base_size_px = au_to_int_px(base_size as f32); let html_size = self.html_size() as usize; if base_size_px >= 9 && base_size_px <= 16 { - Au::from_px(FONT_SIZE_MAPPING[(base_size_px - 9) as usize][html_size]) + NonNegativeAu::from_px(FONT_SIZE_MAPPING[(base_size_px - 9) as usize][html_size]) } else { - Au(FONT_SIZE_FACTORS[html_size] * base_size / 100) + Au(FONT_SIZE_FACTORS[html_size] * base_size / 100).into() } } @@ -814,37 +844,38 @@ ${helpers.single_keyword_system("font-variant-caps", } /// Compute it against a given base font size - pub fn to_computed_value_against(&self, context: &Context, base_size: FontBaseSize) -> Au { + pub fn to_computed_value_against(&self, context: &Context, base_size: FontBaseSize) + -> NonNegativeAu { use values::specified::length::FontRelativeLength; match *self { SpecifiedValue::Length(LengthOrPercentage::Length( NoCalcLength::FontRelative(value))) => { - value.to_computed_value(context, base_size) + value.to_computed_value(context, base_size).into() } SpecifiedValue::Length(LengthOrPercentage::Length( NoCalcLength::ServoCharacterWidth(value))) => { - value.to_computed_value(base_size.resolve(context)) + value.to_computed_value(base_size.resolve(context)).into() } SpecifiedValue::Length(LengthOrPercentage::Length(ref l)) => { - l.to_computed_value(context) + context.maybe_zoom_text(l.to_computed_value(context).into()) } SpecifiedValue::Length(LengthOrPercentage::Percentage(pc)) => { - base_size.resolve(context).scale_by(pc.0) + base_size.resolve(context).scale_by(pc.0).into() } SpecifiedValue::Length(LengthOrPercentage::Calc(ref calc)) => { - let calc = calc.to_computed_value(context); - calc.to_used_value(Some(base_size.resolve(context))).unwrap() + let calc = calc.to_computed_value_zoomed(context); + calc.to_used_value(Some(base_size.resolve(context))).unwrap().into() } SpecifiedValue::Keyword(ref key, fraction) => { - key.to_computed_value(context).scale_by(fraction) + context.maybe_zoom_text(key.to_computed_value(context).scale_by(fraction)) } SpecifiedValue::Smaller => { FontRelativeLength::Em(1. / LARGER_FONT_SIZE_RATIO) - .to_computed_value(context, base_size) + .to_computed_value(context, base_size).into() } SpecifiedValue::Larger => { FontRelativeLength::Em(LARGER_FONT_SIZE_RATIO) - .to_computed_value(context, base_size) + .to_computed_value(context, base_size).into() } SpecifiedValue::System(_) => { @@ -859,7 +890,7 @@ ${helpers.single_keyword_system("font-variant-caps", #[inline] #[allow(missing_docs)] pub fn get_initial_value() -> computed_value::T { - Au::from_px(FONT_MEDIUM_PX) + NonNegativeAu::from_px(FONT_MEDIUM_PX) } #[inline] @@ -879,7 +910,7 @@ ${helpers.single_keyword_system("font-variant-caps", #[inline] fn from_computed_value(computed: &computed_value::T) -> Self { SpecifiedValue::Length(LengthOrPercentage::Length( - ToComputedValue::from_computed_value(computed) + ToComputedValue::from_computed_value(&computed.0) )) } } @@ -926,7 +957,7 @@ ${helpers.single_keyword_system("font-variant-caps", #[allow(unused_mut)] pub fn cascade_specified_font_size(context: &mut Context, specified_value: &SpecifiedValue, - mut computed: Au) { + mut computed: NonNegativeAu) { if let SpecifiedValue::Keyword(kw, fraction) = *specified_value { context.builder.font_size_keyword = Some((kw, fraction)); } else if let Some(ratio) = specified_value.as_font_ratio() { @@ -936,7 +967,7 @@ ${helpers.single_keyword_system("font-variant-caps", // recomputed from the base size for the keyword and the relative size. // // See bug 1355707 - if let Some((kw, fraction)) = context.builder.inherited_style().font_computation_data.font_size_keyword { + if let Some((kw, fraction)) = context.builder.inherited_font_computation_data().font_size_keyword { context.builder.font_size_keyword = Some((kw, fraction * ratio)); } else { context.builder.font_size_keyword = None; @@ -952,11 +983,11 @@ ${helpers.single_keyword_system("font-variant-caps", // if the language or generic changed, we need to recalculate // the font size from the stored font-size origin information. if context.builder.get_font().gecko().mLanguage.raw::<nsIAtom>() != - context.builder.inherited_style().get_font().gecko().mLanguage.raw::<nsIAtom>() || + context.builder.get_parent_font().gecko().mLanguage.raw::<nsIAtom>() || context.builder.get_font().gecko().mGenericID != - context.builder.inherited_style().get_font().gecko().mGenericID { + context.builder.get_parent_font().gecko().mGenericID { if let Some((kw, ratio)) = context.builder.font_size_keyword { - computed = kw.to_computed_value(context).scale_by(ratio); + computed = context.maybe_zoom_text(kw.to_computed_value(context).scale_by(ratio)); } } % endif @@ -964,8 +995,7 @@ ${helpers.single_keyword_system("font-variant-caps", let device = context.builder.device; let mut font = context.builder.take_font(); let parent_unconstrained = { - let parent_style = context.builder.inherited_style(); - let parent_font = parent_style.get_font(); + let parent_font = context.builder.get_parent_font(); font.apply_font_size(computed, parent_font, device) }; context.builder.put_font(font); @@ -973,7 +1003,7 @@ ${helpers.single_keyword_system("font-variant-caps", if let Some(parent) = parent_unconstrained { let new_unconstrained = specified_value - .to_computed_value_against(context, FontBaseSize::Custom(parent)); + .to_computed_value_against(context, FontBaseSize::Custom(parent.0)); context.builder .mutate_font() .apply_unconstrained_font_size(new_unconstrained); @@ -987,15 +1017,14 @@ ${helpers.single_keyword_system("font-variant-caps", // changes using the font_size_keyword. We also need to do this to // handle mathml scriptlevel changes let kw_inherited_size = context.builder.font_size_keyword.map(|(kw, ratio)| { - SpecifiedValue::Keyword(kw, ratio).to_computed_value(context) + context.maybe_zoom_text(SpecifiedValue::Keyword(kw, ratio).to_computed_value(context)) }); let parent_kw; let device = context.builder.device; let mut font = context.builder.take_font(); let used_kw = { - let parent_style = context.builder.inherited_style(); - let parent_font = parent_style.get_font(); - parent_kw = parent_style.font_computation_data.font_size_keyword; + let parent_font = context.builder.get_parent_font(); + parent_kw = context.builder.inherited_font_computation_data().font_size_keyword; font.inherit_font_size_from(parent_font, kw_inherited_size, device) }; @@ -1013,8 +1042,10 @@ ${helpers.single_keyword_system("font-variant-caps", pub fn cascade_initial_font_size(context: &mut Context) { // font-size's default ("medium") does not always // compute to the same value and depends on the font - let computed = longhands::font_size::get_initial_specified_value() - .to_computed_value(context); + let computed = context.maybe_zoom_text( + longhands::font_size::get_initial_specified_value() + .to_computed_value(context) + ); context.builder.mutate_font().set_font_size(computed); % if product == "gecko": let device = context.builder.device; @@ -1024,7 +1055,8 @@ ${helpers.single_keyword_system("font-variant-caps", } </%helpers:longhand> -<%helpers:longhand products="gecko" name="font-size-adjust" animation_value_type="ComputedValue" +<%helpers:longhand products="gecko" name="font-size-adjust" + animation_value_type="longhands::font_size_adjust::computed_value::T" flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER" spec="https://drafts.csswg.org/css-fonts/#propdef-font-size-adjust"> use properties::longhands::system_font::SystemFont; @@ -1078,7 +1110,7 @@ ${helpers.single_keyword_system("font-variant-caps", pub mod computed_value { use properties::animated_properties::Animatable; use values::CSSFloat; - use values::animated::ToAnimatedZero; + use values::animated::{ToAnimatedValue, ToAnimatedZero}; #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Copy, Clone, Debug, PartialEq, ToCss)] @@ -1121,6 +1153,23 @@ ${helpers.single_keyword_system("font-variant-caps", #[inline] fn to_animated_zero(&self) -> Result<Self, ()> { Err(()) } } + + impl ToAnimatedValue for T { + type AnimatedValue = Self; + + #[inline] + fn to_animated_value(self) -> Self { + self + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + match animated { + T::Number(number) => T::Number(number.max(0.)), + _ => animated + } + } + } } #[inline] @@ -1258,7 +1307,7 @@ ${helpers.single_keyword_system("font-kerning", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", animation_value_type="discrete")} -<%helpers:longhand name="font-variant-alternates" products="gecko" animation_value_type="none" +<%helpers:longhand name="font-variant-alternates" products="gecko" animation_value_type="discrete" flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER" spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-alternates"> use properties::longhands::system_font::SystemFont; @@ -2275,8 +2324,8 @@ https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-settings-control- let int = match *self { SpecifiedValue::Auto => { - let parent = cx.inherited_style().get_font().clone__moz_script_level() as i32; - let display = cx.inherited_style().get_font().clone__moz_math_display(); + let parent = cx.builder.get_parent_font().clone__moz_script_level() as i32; + let display = cx.builder.get_parent_font().clone__moz_math_display(); if display == DisplayValue::inline { parent + 1 } else { @@ -2284,7 +2333,7 @@ https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-settings-control- } } SpecifiedValue::Relative(rel) => { - let parent = cx.inherited_style().get_font().clone__moz_script_level(); + let parent = cx.builder.get_parent_font().clone__moz_script_level(); parent as i32 + rel } SpecifiedValue::Absolute(abs) => abs, @@ -2379,6 +2428,41 @@ ${helpers.single_keyword("-moz-math-variant", } </%helpers:longhand> +<%helpers:longhand name="-x-text-zoom" products="gecko" animation_value_type="none" internal="True" + spec="Internal (not web-exposed)"> + use values::computed::ComputedValueAsSpecified; + pub use self::computed_value::T as SpecifiedValue; + + impl ComputedValueAsSpecified for SpecifiedValue {} + no_viewport_percentage!(SpecifiedValue); + + pub mod computed_value { + use std::fmt; + use style_traits::ToCss; + + impl ToCss for T { + fn to_css<W>(&self, _: &mut W) -> fmt::Result where W: fmt::Write { + Ok(()) + } + } + + #[derive(Clone, Debug, PartialEq)] + #[cfg_attr(feature = "servo", derive(HeapSizeOf))] + /// text-zoom. Enable if true, disable if false + pub struct T(pub bool); + } + + #[inline] + pub fn get_initial_value() -> computed_value::T { + computed_value::T(true) + } + + pub fn parse<'i, 't>(_context: &ParserContext, _input: &mut Parser<'i, 't>) + -> Result<SpecifiedValue, ParseError<'i>> { + debug_assert!(false, "Should be set directly by presentation attributes only."); + Err(StyleParseError::UnspecifiedError.into()) + } +</%helpers:longhand> % if product == "gecko": pub mod system_font { @@ -2469,13 +2553,13 @@ ${helpers.single_keyword("-moz-math-variant", use properties::longhands::font_family::computed_value::*; FontFamily::FamilyName(FamilyName { name: (&*font.mName).into(), - quoted: true + syntax: FamilyNameSyntax::Quoted, }) }).collect::<Vec<_>>(); let weight = longhands::font_weight::computed_value::T::from_gecko_weight(system.weight); let ret = ComputedSystemFont { font_family: longhands::font_family::computed_value::T(family), - font_size: Au(system.size), + font_size: Au(system.size).into(), font_weight: weight, font_size_adjust: longhands::font_size_adjust::computed_value ::T::from_gecko_adjust(system.sizeAdjust), diff --git a/components/style/properties/longhand/inherited_box.mako.rs b/components/style/properties/longhand/inherited_box.mako.rs index 2a8bff1a120..99d9216fce3 100644 --- a/components/style/properties/longhand/inherited_box.mako.rs +++ b/components/style/properties/longhand/inherited_box.mako.rs @@ -59,7 +59,7 @@ ${helpers.single_keyword("image-rendering", // Image Orientation <%helpers:longhand name="image-orientation" products="gecko" - animation_value_type="none" + animation_value_type="discrete" spec="https://drafts.csswg.org/css-images/#propdef-image-orientation, \ /// additional values in https://developer.mozilla.org/en-US/docs/Web/CSS/image-orientation"> use std::fmt; diff --git a/components/style/properties/longhand/inherited_svg.mako.rs b/components/style/properties/longhand/inherited_svg.mako.rs index 0ead8db90ef..533c2f62e68 100644 --- a/components/style/properties/longhand/inherited_svg.mako.rs +++ b/components/style/properties/longhand/inherited_svg.mako.rs @@ -39,7 +39,7 @@ ${helpers.predefined_type( boxed=True, spec="https://www.w3.org/TR/SVG2/painting.html#SpecifyingFillPaint")} -${helpers.predefined_type("fill-opacity", "Opacity", "1.0", +${helpers.predefined_type("fill-opacity", "SVGOpacity", "Default::default()", products="gecko", animation_value_type="ComputedValue", spec="https://www.w3.org/TR/SVG11/painting.html#FillOpacityProperty")} @@ -64,11 +64,11 @@ ${helpers.predefined_type( spec="https://www.w3.org/TR/SVG2/painting.html#SpecifyingStrokePaint")} ${helpers.predefined_type( - "stroke-width", "LengthOrPercentageOrNumber", - "Either::First(1.0)", - "parse_non_negative", + "stroke-width", "SVGWidth", + "::values::computed::NonNegativeAu::from_px(1).into()", products="gecko", - animation_value_type="ComputedValue", + boxed="True", + animation_value_type="::values::computed::SVGWidth", spec="https://www.w3.org/TR/SVG2/painting.html#StrokeWidth")} ${helpers.single_keyword("stroke-linecap", "butt round square", @@ -79,31 +79,30 @@ ${helpers.single_keyword("stroke-linejoin", "miter round bevel", products="gecko", animation_value_type="discrete", spec="https://www.w3.org/TR/SVG11/painting.html#StrokeLinejoinProperty")} -${helpers.predefined_type("stroke-miterlimit", "Number", "4.0", - "parse_at_least_one", products="gecko", - animation_value_type="ComputedValue", +${helpers.predefined_type("stroke-miterlimit", "GreaterThanOrEqualToOneNumber", + "From::from(4.0)", + products="gecko", + animation_value_type="::values::computed::GreaterThanOrEqualToOneNumber", spec="https://www.w3.org/TR/SVG11/painting.html#StrokeMiterlimitProperty")} -${helpers.predefined_type("stroke-opacity", "Opacity", "1.0", +${helpers.predefined_type("stroke-opacity", "SVGOpacity", "Default::default()", products="gecko", animation_value_type="ComputedValue", spec="https://www.w3.org/TR/SVG11/painting.html#StrokeOpacityProperty")} ${helpers.predefined_type( "stroke-dasharray", - "LengthOrPercentageOrNumber", - None, - "parse_non_negative", - vector=True, + "SVGStrokeDashArray", + "Default::default()", products="gecko", - animation_value_type="ComputedValue", - separator="CommaWithSpace", + animation_value_type="::values::computed::SVGStrokeDashArray", spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing", )} ${helpers.predefined_type( - "stroke-dashoffset", "LengthOrPercentageOrNumber", - "Either::First(0.0)", + "stroke-dashoffset", "SVGLength", + "Au(0).into()", products="gecko", + boxed="True", animation_value_type="ComputedValue", spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing")} @@ -134,7 +133,7 @@ ${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)", spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")} <%helpers:longhand name="paint-order" - animation_value_type="none" + animation_value_type="discrete" products="gecko" spec="https://www.w3.org/TR/SVG2/painting.html#PaintOrder"> diff --git a/components/style/properties/longhand/inherited_table.mako.rs b/components/style/properties/longhand/inherited_table.mako.rs index d524833304c..1be9de01bd2 100644 --- a/components/style/properties/longhand/inherited_table.mako.rs +++ b/components/style/properties/longhand/inherited_table.mako.rs @@ -20,21 +20,21 @@ ${helpers.single_keyword("caption-side", "top bottom", animation_value_type="discrete", spec="https://drafts.csswg.org/css-tables/#propdef-caption-side")} -<%helpers:longhand name="border-spacing" animation_value_type="ComputedValue" boxed="True" +<%helpers:longhand name="border-spacing" animation_value_type="BorderSpacing" boxed="True" spec="https://drafts.csswg.org/css-tables/#propdef-border-spacing"> - use app_units::Au; use values::specified::{AllowQuirks, Length}; + use values::specified::length::NonNegativeLength; pub mod computed_value { - use app_units::Au; use properties::animated_properties::Animatable; - use values::animated::ToAnimatedZero; + use values::animated::{ToAnimatedValue, ToAnimatedZero}; + use values::computed::NonNegativeAu; #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Clone, Copy, Debug, PartialEq, ToCss)] pub struct T { - pub horizontal: Au, - pub vertical: Au, + pub horizontal: NonNegativeAu, + pub vertical: NonNegativeAu, } /// https://drafts.csswg.org/css-transitions/#animtype-simple-list @@ -66,20 +66,38 @@ ${helpers.single_keyword("caption-side", "top bottom", #[inline] fn to_animated_zero(&self) -> Result<Self, ()> { Err(()) } } + + impl ToAnimatedValue for T { + type AnimatedValue = Self; + + #[inline] + fn to_animated_value(self) -> Self { + self + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + T { + horizontal: ToAnimatedValue::from_animated_value(animated.horizontal), + vertical: ToAnimatedValue::from_animated_value(animated.vertical) + } + } + } } #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Clone, Debug, HasViewportPercentage, PartialEq, ToCss)] pub struct SpecifiedValue { - pub horizontal: Length, - pub vertical: Option<Length>, + pub horizontal: NonNegativeLength, + pub vertical: Option<NonNegativeLength>, } #[inline] pub fn get_initial_value() -> computed_value::T { + use values::computed::NonNegativeAu; computed_value::T { - horizontal: Au(0), - vertical: Au(0), + horizontal: NonNegativeAu::zero(), + vertical: NonNegativeAu::zero(), } } @@ -121,14 +139,14 @@ ${helpers.single_keyword("caption-side", "top bottom", (None, None) => Err(StyleParseError::UnspecifiedError.into()), (Some(length), None) => { Ok(SpecifiedValue { - horizontal: length, + horizontal: length.into(), vertical: None, }) } (Some(horizontal), Some(vertical)) => { Ok(SpecifiedValue { - horizontal: horizontal, - vertical: Some(vertical), + horizontal: horizontal.into(), + vertical: Some(vertical.into()), }) } (None, Some(_)) => unreachable!(), diff --git a/components/style/properties/longhand/inherited_text.mako.rs b/components/style/properties/longhand/inherited_text.mako.rs index 80f0624d55f..8384671de0e 100644 --- a/components/style/properties/longhand/inherited_text.mako.rs +++ b/components/style/properties/longhand/inherited_text.mako.rs @@ -9,7 +9,7 @@ ${helpers.predefined_type("line-height", "LineHeight", "computed::LineHeight::normal()", - animation_value_type="ComputedValue", + animation_value_type="LineHeight", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css2/visudet.html#propdef-line-height")} @@ -230,8 +230,8 @@ ${helpers.single_keyword("text-align-last", if context.is_root_element { return get_initial_value(); } - let parent = context.inherited_style().get_inheritedtext().clone_text_align(); - let ltr = context.inherited_style().writing_mode.is_bidi_ltr(); + let parent = context.builder.get_parent_inheritedtext().clone_text_align(); + let ltr = context.builder.inherited_writing_mode().is_bidi_ltr(); match (parent, ltr) { (computed_value::T::start, true) => computed_value::T::left, (computed_value::T::start, false) => computed_value::T::right, @@ -241,7 +241,7 @@ ${helpers.single_keyword("text-align-last", } } SpecifiedValue::MozCenterOrInherit => { - let parent = context.inherited_style().get_inheritedtext().clone_text_align(); + let parent = context.builder.get_parent_inheritedtext().clone_text_align(); if parent == computed_value::T::start { computed_value::T::center } else { @@ -340,7 +340,7 @@ ${helpers.predefined_type("word-spacing", overline: None, line_through: None, }, - _ => context.inherited_style().get_inheritedtext().clone__servo_text_decorations_in_effect() + _ => context.builder.get_parent_inheritedtext().clone__servo_text_decorations_in_effect() }; result.underline = maybe(context.style().get_text().has_underline() @@ -714,10 +714,9 @@ ${helpers.predefined_type("text-emphasis-color", "Color", ${helpers.predefined_type( - "-moz-tab-size", "LengthOrNumber", - "::values::Either::Second(8.0)", - "parse_non_negative", - products="gecko", animation_value_type="ComputedValue", + "-moz-tab-size", "length::NonNegativeLengthOrNumber", + "::values::Either::Second(From::from(8.0))", + products="gecko", animation_value_type="::values::computed::length::NonNegativeLengthOrNumber", spec="https://drafts.csswg.org/css-text-3/#tab-size-property")} @@ -742,9 +741,9 @@ ${helpers.predefined_type( ${helpers.predefined_type("-webkit-text-stroke-width", "BorderSideWidth", - "Au::from_px(0)", + "::values::computed::NonNegativeAu::from_px(0)", initial_specified_value="specified::BorderSideWidth::Length(specified::Length::zero())", - computed_type="::app_units::Au", + computed_type="::values::computed::NonNegativeAu", products="gecko", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-width", diff --git a/components/style/properties/longhand/outline.mako.rs b/components/style/properties/longhand/outline.mako.rs index d7b62dd3cfc..f08537f6545 100644 --- a/components/style/properties/longhand/outline.mako.rs +++ b/components/style/properties/longhand/outline.mako.rs @@ -64,10 +64,10 @@ ${helpers.predefined_type("outline-color", "Color", "computed_value::T::currentc ${helpers.predefined_type("outline-width", "BorderSideWidth", - "Au::from_px(3)", + "::values::computed::NonNegativeAu::from_px(3)", initial_specified_value="specified::BorderSideWidth::Medium", - computed_type="::app_units::Au", - animation_value_type="ComputedValue", + computed_type="::values::computed::NonNegativeAu", + animation_value_type="NonNegativeAu", spec="https://drafts.csswg.org/css-ui/#propdef-outline-width")} // The -moz-outline-radius-* properties are non-standard and not on a standards track. @@ -76,7 +76,7 @@ ${helpers.predefined_type("outline-width", "computed::LengthOrPercentage::zero().into()", products="gecko", boxed=True, - animation_value_type="ComputedValue", + animation_value_type="BorderCornerRadius", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius)")} % endfor diff --git a/components/style/properties/longhand/padding.mako.rs b/components/style/properties/longhand/padding.mako.rs index 53035c32efb..49d9b1bd722 100644 --- a/components/style/properties/longhand/padding.mako.rs +++ b/components/style/properties/longhand/padding.mako.rs @@ -14,11 +14,10 @@ if side[1]: spec = "https://drafts.csswg.org/css-logical-props/#propdef-padding-%s" % side[1] %> - ${helpers.predefined_type("padding-%s" % side[0], "LengthOrPercentage", - "computed::LengthOrPercentage::Length(Au(0))", - "parse_non_negative", + ${helpers.predefined_type("padding-%s" % side[0], "NonNegativeLengthOrPercentage", + "computed::NonNegativeLengthOrPercentage::zero()", alias=maybe_moz_logical_alias(product, side, "-moz-padding-%s"), - animation_value_type="ComputedValue", + animation_value_type="NonNegativeLengthOrPercentage", logical = side[1], spec = spec, flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_PLACEHOLDER", diff --git a/components/style/properties/longhand/position.mako.rs b/components/style/properties/longhand/position.mako.rs index 04d0f295eb1..2ea32e99845 100644 --- a/components/style/properties/longhand/position.mako.rs +++ b/components/style/properties/longhand/position.mako.rs @@ -108,7 +108,7 @@ ${helpers.single_keyword("flex-wrap", "nowrap wrap wrap-reverse", ${helpers.predefined_type(name="justify-items", type="JustifyItems", - initial_value="specified::JustifyItems::auto()", + initial_value="computed::JustifyItems::auto()", spec="https://drafts.csswg.org/css-align/#propdef-justify-items", animation_value_type="discrete")} @@ -117,17 +117,17 @@ ${helpers.single_keyword("flex-wrap", "nowrap wrap wrap-reverse", % endif // Flex item properties -${helpers.predefined_type("flex-grow", "Number", - "0.0", "parse_non_negative", +${helpers.predefined_type("flex-grow", "NonNegativeNumber", + "From::from(0.0)", spec="https://drafts.csswg.org/css-flexbox/#flex-grow-property", extra_prefixes="webkit", - animation_value_type="ComputedValue")} + animation_value_type="NonNegativeNumber")} -${helpers.predefined_type("flex-shrink", "Number", - "1.0", "parse_non_negative", +${helpers.predefined_type("flex-shrink", "NonNegativeNumber", + "From::from(1.0)", spec="https://drafts.csswg.org/css-flexbox/#flex-shrink-property", extra_prefixes="webkit", - animation_value_type="ComputedValue")} + animation_value_type="NonNegativeNumber")} // https://drafts.csswg.org/css-align/#align-self-property % if product == "servo": @@ -166,7 +166,7 @@ ${helpers.predefined_type("order", "Integer", "0", logical=False, spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property", extra_prefixes="webkit", - animation_value_type="ComputedValue")} + animation_value_type="MozLength")} % else: // FIXME: This property should be animatable. ${helpers.predefined_type("flex-basis", @@ -187,17 +187,17 @@ ${helpers.predefined_type("order", "Integer", "0", ${helpers.gecko_size_type("%s" % size, "MozLength", "auto()", logical, spec=spec % size, - animation_value_type="ComputedValue")} + animation_value_type="MozLength")} // min-width, min-height, min-block-size, min-inline-size, // max-width, max-height, max-block-size, max-inline-size ${helpers.gecko_size_type("min-%s" % size, "MozLength", "auto()", logical, spec=spec % size, - animation_value_type="ComputedValue")} + animation_value_type="MozLength")} ${helpers.gecko_size_type("max-%s" % size, "MaxLength", "none()", logical, spec=spec % size, - animation_value_type="ComputedValue")} + animation_value_type="MaxLength")} % else: // servo versions (no keyword support) ${helpers.predefined_type("%s" % size, @@ -249,11 +249,10 @@ ${helpers.predefined_type("object-position", % for kind in ["row", "column"]: ${helpers.predefined_type("grid-%s-gap" % kind, - "LengthOrPercentage", - "computed::LengthOrPercentage::Length(Au(0))", - "parse_non_negative", + "NonNegativeLengthOrPercentage", + "computed::NonNegativeLengthOrPercentage::zero()", spec="https://drafts.csswg.org/css-grid/#propdef-grid-%s-gap" % kind, - animation_value_type="ComputedValue", + animation_value_type="NonNegativeLengthOrPercentage", products="gecko")} % for range in ["start", "end"]: @@ -282,7 +281,7 @@ ${helpers.predefined_type("object-position", products="gecko", spec="https://drafts.csswg.org/css-grid/#propdef-grid-template-%ss" % kind, boxed=True, - animation_value_type="none")} + animation_value_type="discrete")} % endfor @@ -416,7 +415,7 @@ ${helpers.predefined_type("object-position", <%helpers:longhand name="grid-template-areas" spec="https://drafts.csswg.org/css-grid/#propdef-grid-template-areas" products="gecko" - animation_value_type="none" + animation_value_type="discrete" disable_when_testing="True" boxed="True"> use std::collections::HashMap; @@ -442,14 +441,14 @@ ${helpers.predefined_type("object-position", SpecifiedValue::parse(context, input) } - #[derive(Clone, PartialEq)] + #[derive(Clone, Debug, PartialEq)] pub struct TemplateAreas { pub areas: Box<[NamedArea]>, pub strings: Box<[Box<str>]>, pub width: u32, } - #[derive(Clone, PartialEq)] + #[derive(Clone, Debug, PartialEq)] pub struct NamedArea { pub name: Box<str>, pub rows: Range<u32>, diff --git a/components/style/properties/longhand/xul.mako.rs b/components/style/properties/longhand/xul.mako.rs index 5d9ec6623e2..6802f60460c 100644 --- a/components/style/properties/longhand/xul.mako.rs +++ b/components/style/properties/longhand/xul.mako.rs @@ -24,9 +24,9 @@ ${helpers.single_keyword("-moz-box-direction", "normal reverse", alias="-webkit-box-direction", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-direction)")} -${helpers.predefined_type("-moz-box-flex", "Number", "0.0", "parse_non_negative", +${helpers.predefined_type("-moz-box-flex", "NonNegativeNumber", "From::from(0.)", products="gecko", gecko_ffi_name="mBoxFlex", - animation_value_type="ComputedValue", + animation_value_type="NonNegativeNumber", alias="-webkit-box-flex", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-flex)")} diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index cdf2869f301..82b2f4cb73b 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -10,12 +10,13 @@ <%namespace name="helpers" file="/helpers.mako.rs" /> +#[cfg(feature = "servo")] use app_units::Au; use servo_arc::{Arc, UniqueArc}; use std::borrow::Cow; use std::collections::HashSet; use std::{fmt, mem, ops}; +#[cfg(feature = "gecko")] use std::ptr; -use app_units::Au; #[cfg(feature = "servo")] use cssparser::RGBA; use cssparser::{Parser, TokenSerializationType, serialize_identifier}; use cssparser::ParserInput; @@ -29,7 +30,7 @@ use font_metrics::FontMetricsProvider; #[cfg(feature = "servo")] use logical_geometry::{LogicalMargin, PhysicalSide}; use logical_geometry::WritingMode; use media_queries::Device; -use parser::{Parse, ParserContext}; +use parser::ParserContext; use properties::animated_properties::AnimatableLonghand; #[cfg(feature = "gecko")] use properties::longhands::system_font::SystemFont; use selector_parser::PseudoElement; @@ -37,11 +38,12 @@ use selectors::parser::SelectorParseError; #[cfg(feature = "servo")] use servo_config::prefs::PREFS; use shared_lock::StylesheetGuards; use style_traits::{PARSING_MODE_DEFAULT, HasViewportPercentage, ToCss, ParseError}; -use style_traits::{PropertyDeclarationParseError, StyleParseError}; +use style_traits::{PropertyDeclarationParseError, StyleParseError, ValueParseError}; use stylesheets::{CssRuleType, MallocSizeOf, MallocSizeOfFn, Origin, UrlExtraData}; #[cfg(feature = "servo")] use values::Either; use values::generics::text::LineHeight; use values::computed; +use values::computed::NonNegativeAu; use cascade_info::CascadeInfo; use rule_tree::{CascadeLevel, StrongRuleNode}; use self::computed_value_flags::ComputedValueFlags; @@ -420,12 +422,11 @@ impl CSSWideKeyword { } } -impl Parse for CSSWideKeyword { - fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { - let ident = input.expect_ident()?.clone(); - input.expect_exhausted()?; - CSSWideKeyword::from_ident(&ident) - .ok_or(SelectorParseError::UnexpectedIdent(ident).into()) +impl CSSWideKeyword { + fn parse(input: &mut Parser) -> Result<Self, ()> { + let ident = input.expect_ident().map_err(|_| ())?.clone(); + input.expect_exhausted().map_err(|_| ())?; + CSSWideKeyword::from_ident(&ident).ok_or(()) } } @@ -607,6 +608,7 @@ impl LonghandId { LonghandId::AnimationName | LonghandId::TransitionProperty | LonghandId::XLang | + LonghandId::XTextZoom | LonghandId::MozScriptLevel | LonghandId::MozMinFontSizeRatio | % endif @@ -1183,8 +1185,9 @@ impl PropertyId { } % endif % if product == "gecko": + use gecko_bindings::structs; let id = self.to_nscsspropertyid().unwrap(); - unsafe { bindings::Gecko_PropertyId_IsPrefEnabled(id) } + unsafe { structs::nsCSSProps_gPropertyEnabled[id as usize] } % endif }; @@ -1483,30 +1486,32 @@ impl PropertyDeclaration { id.check_allowed_in(rule_type, context.stylesheet_origin)?; match id { PropertyId::Custom(name) => { - let value = match input.try(|i| CSSWideKeyword::parse(context, i)) { + let value = match input.try(|i| CSSWideKeyword::parse(i)) { Ok(keyword) => DeclaredValueOwned::CSSWideKeyword(keyword), - Err(_) => match ::custom_properties::SpecifiedValue::parse(context, input) { + Err(()) => match ::custom_properties::SpecifiedValue::parse(context, input) { Ok(value) => DeclaredValueOwned::Value(value), - Err(_) => return Err(PropertyDeclarationParseError::InvalidValue(name.to_string().into())), + Err(e) => return Err(PropertyDeclarationParseError::InvalidValue(name.to_string().into(), + ValueParseError::from_parse_error(e))), } }; declarations.push(PropertyDeclaration::Custom(name, value)); Ok(()) } PropertyId::Longhand(id) => { - input.try(|i| CSSWideKeyword::parse(context, i)).map(|keyword| { + input.try(|i| CSSWideKeyword::parse(i)).map(|keyword| { PropertyDeclaration::CSSWideKeyword(id, keyword) - }).or_else(|_| { + }).or_else(|()| { input.look_for_var_functions(); let start = input.position(); input.parse_entirely(|input| id.parse_value(context, input)) - .or_else(|_| { + .or_else(|err| { while let Ok(_) = input.next() {} // Look for var() after the error. if input.seen_var_functions() { input.reset(start); let (first_token_type, css) = - ::custom_properties::parse_non_custom_with_var(input).map_err(|_| { - PropertyDeclarationParseError::InvalidValue(id.name().into()) + ::custom_properties::parse_non_custom_with_var(input).map_err(|e| { + PropertyDeclarationParseError::InvalidValue(id.name().into(), + ValueParseError::from_parse_error(e)) })?; Ok(PropertyDeclaration::WithVariables(id, Arc::new(UnparsedValue { css: css.into_owned(), @@ -1515,7 +1520,8 @@ impl PropertyDeclaration { from_shorthand: None, }))) } else { - Err(PropertyDeclarationParseError::InvalidValue(id.name().into())) + Err(PropertyDeclarationParseError::InvalidValue(id.name().into(), + ValueParseError::from_parse_error(err))) } }) }).map(|declaration| { @@ -1523,7 +1529,7 @@ impl PropertyDeclaration { }) } PropertyId::Shorthand(id) => { - if let Ok(keyword) = input.try(|i| CSSWideKeyword::parse(context, i)) { + if let Ok(keyword) = input.try(|i| CSSWideKeyword::parse(i)) { if id == ShorthandId::All { declarations.all_shorthand = AllShorthand::CSSWideKeyword(keyword) } else { @@ -1537,13 +1543,14 @@ impl PropertyDeclaration { let start = input.position(); // Not using parse_entirely here: each ${shorthand.ident}::parse_into function // needs to do so *before* pushing to `declarations`. - id.parse_into(declarations, context, input).or_else(|_| { + id.parse_into(declarations, context, input).or_else(|err| { while let Ok(_) = input.next() {} // Look for var() after the error. if input.seen_var_functions() { input.reset(start); let (first_token_type, css) = - ::custom_properties::parse_non_custom_with_var(input).map_err(|_| { - PropertyDeclarationParseError::InvalidValue(id.name().into()) + ::custom_properties::parse_non_custom_with_var(input).map_err(|e| { + PropertyDeclarationParseError::InvalidValue(id.name().into(), + ValueParseError::from_parse_error(e)) })?; let unparsed = Arc::new(UnparsedValue { css: css.into_owned(), @@ -1562,7 +1569,8 @@ impl PropertyDeclaration { } Ok(()) } else { - Err(PropertyDeclarationParseError::InvalidValue(id.name().into())) + Err(PropertyDeclarationParseError::InvalidValue(id.name().into(), + ValueParseError::from_parse_error(err))) } }) } @@ -1639,12 +1647,12 @@ pub use gecko_properties::style_structs; /// The module where all the style structs are defined. #[cfg(feature = "servo")] pub mod style_structs { - use app_units::Au; use fnv::FnvHasher; use super::longhands; use std::hash::{Hash, Hasher}; use logical_geometry::WritingMode; use media_queries::Device; + use values::computed::NonNegativeAu; % for style_struct in data.active_style_structs(): % if style_struct.name == "Font": @@ -1707,6 +1715,13 @@ pub mod style_structs { pub fn copy_${longhand.ident}_from(&mut self, other: &Self) { self.${longhand.ident} = other.${longhand.ident}.clone(); } + + /// Reset ${longhand.name} from the initial struct. + #[allow(non_snake_case)] + #[inline] + pub fn reset_${longhand.ident}(&mut self, other: &Self) { + self.copy_${longhand.ident}_from(other) + } % if longhand.need_clone: /// Get the computed value for ${longhand.name}. #[allow(non_snake_case)] @@ -1737,7 +1752,7 @@ pub mod style_structs { /// Whether the border-${side} property has nonzero width. #[allow(non_snake_case)] pub fn border_${side}_has_nonzero_width(&self) -> bool { - self.border_${side}_width != ::app_units::Au(0) + self.border_${side}_width != NonNegativeAu::zero() } % endfor % elif style_struct.name == "Font": @@ -1755,7 +1770,8 @@ pub mod style_structs { /// (Servo does not handle MathML, so this just calls copy_font_size_from) pub fn inherit_font_size_from(&mut self, parent: &Self, - _: Option<Au>, _: &Device) -> bool { + _: Option<NonNegativeAu>, + _: &Device) -> bool { self.copy_font_size_from(parent); false } @@ -1763,19 +1779,19 @@ pub mod style_structs { pub fn apply_font_size(&mut self, v: longhands::font_size::computed_value::T, _: &Self, - _: &Device) -> Option<Au> { + _: &Device) -> Option<NonNegativeAu> { self.set_font_size(v); None } /// (Servo does not handle MathML, so this does nothing) - pub fn apply_unconstrained_font_size(&mut self, _: Au) { + pub fn apply_unconstrained_font_size(&mut self, _: NonNegativeAu) { } % elif style_struct.name == "Outline": /// Whether the outline-width property is non-zero. #[inline] pub fn outline_has_nonzero_width(&self) -> bool { - self.outline_width != ::app_units::Au(0) + self.outline_width != NonNegativeAu::zero() } % elif style_struct.name == "Text": /// Whether the text decoration has an underline. @@ -2175,10 +2191,10 @@ impl ComputedValuesInner { pub fn logical_padding(&self) -> LogicalMargin<computed::LengthOrPercentage> { let padding_style = self.get_padding(); LogicalMargin::from_physical(self.writing_mode, SideOffsets2D::new( - padding_style.padding_top, - padding_style.padding_right, - padding_style.padding_bottom, - padding_style.padding_left, + padding_style.padding_top.0, + padding_style.padding_right.0, + padding_style.padding_bottom.0, + padding_style.padding_left.0, )) } @@ -2187,10 +2203,10 @@ impl ComputedValuesInner { pub fn border_width_for_writing_mode(&self, writing_mode: WritingMode) -> LogicalMargin<Au> { let border_style = self.get_border(); LogicalMargin::from_physical(writing_mode, SideOffsets2D::new( - border_style.border_top_width, - border_style.border_right_width, - border_style.border_bottom_width, - border_style.border_left_width, + border_style.border_top_width.0, + border_style.border_right_width.0, + border_style.border_bottom_width.0, + border_style.border_left_width.0, )) } @@ -2470,6 +2486,11 @@ pub struct StyleBuilder<'a> { /// `parent_style.unwrap_or(device.default_computed_values())`. inherited_style: &'a ComputedValues, + /// The style we're inheriting from for properties that don't inherit from + /// ::first-line. This is the same as inherited_style, unless + /// inherited_style is a ::first-line style. + inherited_style_ignoring_first_line: &'a ComputedValues, + /// The style we're getting reset structs from. reset_style: &'a ComputedValues, @@ -2477,14 +2498,15 @@ pub struct StyleBuilder<'a> { /// a subtree. parent_style: Option<<&'a ComputedValues>, - /// The pseudo-element this style will represent. - pseudo: Option<<&'a PseudoElement>, - /// The rule node representing the ordered list of rules matched for this /// node. rules: Option<StrongRuleNode>, custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>, + + /// The pseudo-element this style will represent. + pseudo: Option<<&'a PseudoElement>, + /// The writing mode flags. /// /// TODO(emilio): Make private. @@ -2507,6 +2529,7 @@ impl<'a> StyleBuilder<'a> { fn new( device: &'a Device, parent_style: Option<<&'a ComputedValues>, + parent_style_ignoring_first_line: Option<<&'a ComputedValues>, pseudo: Option<<&'a PseudoElement>, cascade_flags: CascadeFlags, rules: Option<StrongRuleNode>, @@ -2516,8 +2539,19 @@ impl<'a> StyleBuilder<'a> { flags: ComputedValueFlags, visited_style: Option<Arc<ComputedValues>>, ) -> Self { + debug_assert_eq!(parent_style.is_some(), parent_style_ignoring_first_line.is_some()); + #[cfg(feature = "gecko")] + debug_assert!(parent_style.is_none() || + ptr::eq(parent_style.unwrap(), + parent_style_ignoring_first_line.unwrap()) || + parent_style.unwrap().pseudo() == Some(PseudoElement::FirstLine)); let reset_style = device.default_computed_values(); let inherited_style = parent_style.unwrap_or(reset_style); + let inherited_style_ignoring_first_line = parent_style_ignoring_first_line.unwrap_or(reset_style); + // FIXME(bz): INHERIT_ALL seems like a fundamentally broken idea. I'm + // 99% sure it should give incorrect behavior for table anonymous box + // backgrounds, for example. This code doesn't attempt to make it play + // nice with inherited_style_ignoring_first_line. let reset_style = if cascade_flags.contains(INHERIT_ALL) { inherited_style } else { @@ -2528,6 +2562,7 @@ impl<'a> StyleBuilder<'a> { device, parent_style, inherited_style, + inherited_style_ignoring_first_line, reset_style, pseudo, rules, @@ -2556,10 +2591,15 @@ impl<'a> StyleBuilder<'a> { ) -> Self { let reset_style = device.default_computed_values(); let inherited_style = parent_style.unwrap_or(reset_style); + #[cfg(feature = "gecko")] + debug_assert!(parent_style.is_none() || + parent_style.unwrap().pseudo() != Some(PseudoElement::FirstLine)); StyleBuilder { device, parent_style, inherited_style, + // None of our callers pass in ::first-line parent styles. + inherited_style_ignoring_first_line: inherited_style, reset_style, pseudo, rules: None, // FIXME(emilio): Dubious... @@ -2582,7 +2622,12 @@ impl<'a> StyleBuilder<'a> { #[allow(non_snake_case)] pub fn inherit_${property.ident}(&mut self) { let inherited_struct = + % if property.style_struct.inherited: self.inherited_style.get_${property.style_struct.name_lower}(); + % else: + self.inherited_style_ignoring_first_line.get_${property.style_struct.name_lower}(); + % endif + self.${property.style_struct.ident}.mutate() .copy_${property.ident}_from( inherited_struct, @@ -2595,9 +2640,11 @@ impl<'a> StyleBuilder<'a> { /// Reset `${property.ident}` to the initial value. #[allow(non_snake_case)] pub fn reset_${property.ident}(&mut self) { - let reset_struct = self.reset_style.get_${property.style_struct.name_lower}(); + let reset_struct = + self.reset_style.get_${property.style_struct.name_lower}(); + self.${property.style_struct.ident}.mutate() - .copy_${property.ident}_from( + .reset_${property.ident}( reset_struct, % if property.logical: self.writing_mode, @@ -2639,6 +2686,7 @@ impl<'a> StyleBuilder<'a> { Self::new( device, Some(parent), + Some(parent), pseudo, CascadeFlags::empty(), /* rules = */ None, @@ -2655,9 +2703,9 @@ impl<'a> StyleBuilder<'a> { self.visited_style.is_some() } - /// Returns the style we're inheriting from. - pub fn inherited_style(&self) -> &'a ComputedValues { - self.inherited_style + /// Returns whether we're a pseudo-elements style. + pub fn is_pseudo_element(&self) -> bool { + self.pseudo.map_or(false, |p| !p.is_anon_box()) } /// Returns the style we're getting reset properties from. @@ -2752,6 +2800,42 @@ impl<'a> StyleBuilder<'a> { fn custom_properties(&self) -> Option<Arc<::custom_properties::CustomPropertiesMap>> { self.custom_properties.clone() } + + /// Access to various information about our inherited styles. We don't + /// expose an inherited ComputedValues directly, because in the + /// ::first-line case some of the inherited information needs to come from + /// one ComputedValues instance and some from a different one. + + /// Inherited font bits. + pub fn inherited_font_computation_data(&self) -> &FontComputationData { + &self.inherited_style.font_computation_data + } + + /// Inherited writing-mode. + pub fn inherited_writing_mode(&self) -> &WritingMode { + &self.inherited_style.writing_mode + } + + /// Inherited style flags. + pub fn inherited_flags(&self) -> &ComputedValueFlags { + &self.inherited_style.flags + } + + /// And access to inherited style structs. + % for style_struct in data.active_style_structs(): + /// Gets our inherited `${style_struct.name}`. We don't name these + /// accessors `inherited_${style_struct.name_lower}` because we already + /// have things like "box" vs "inherited_box" as struct names. Do the + /// next-best thing and call them `parent_${style_struct.name_lower}` + /// instead. + pub fn get_parent_${style_struct.name_lower}(&self) -> &style_structs::${style_struct.name} { + % if style_struct.inherited: + self.inherited_style.get_${style_struct.name_lower}() + % else: + self.inherited_style_ignoring_first_line.get_${style_struct.name_lower}() + % endif + } + % endfor } #[cfg(feature = "servo")] @@ -2867,6 +2951,7 @@ pub fn cascade( rule_node: &StrongRuleNode, guards: &StylesheetGuards, parent_style: Option<<&ComputedValues>, + parent_style_ignoring_first_line: Option<<&ComputedValues>, layout_parent_style: Option<<&ComputedValues>, visited_style: Option<Arc<ComputedValues>>, cascade_info: Option<<&mut CascadeInfo>, @@ -2874,6 +2959,12 @@ pub fn cascade( flags: CascadeFlags, quirks_mode: QuirksMode ) -> Arc<ComputedValues> { + debug_assert_eq!(parent_style.is_some(), parent_style_ignoring_first_line.is_some()); + #[cfg(feature = "gecko")] + debug_assert!(parent_style.is_none() || + ptr::eq(parent_style.unwrap(), + parent_style_ignoring_first_line.unwrap()) || + parent_style.unwrap().pseudo() == Some(PseudoElement::FirstLine)); let iter_declarations = || { rule_node.self_and_ancestors().flat_map(|node| { let cascade_level = node.cascade_level(); @@ -2919,6 +3010,7 @@ pub fn cascade( rule_node, iter_declarations, parent_style, + parent_style_ignoring_first_line, layout_parent_style, visited_style, cascade_info, @@ -2937,6 +3029,7 @@ pub fn apply_declarations<'a, F, I>( rules: &StrongRuleNode, iter_declarations: F, parent_style: Option<<&ComputedValues>, + parent_style_ignoring_first_line: Option<<&ComputedValues>, layout_parent_style: Option<<&ComputedValues>, visited_style: Option<Arc<ComputedValues>>, mut cascade_info: Option<<&mut CascadeInfo>, @@ -2949,6 +3042,12 @@ where I: Iterator<Item = (&'a PropertyDeclaration, CascadeLevel)>, { debug_assert!(layout_parent_style.is_none() || parent_style.is_some()); + debug_assert_eq!(parent_style.is_some(), parent_style_ignoring_first_line.is_some()); + #[cfg(feature = "gecko")] + debug_assert!(parent_style.is_none() || + ptr::eq(parent_style.unwrap(), + parent_style_ignoring_first_line.unwrap()) || + parent_style.unwrap().pseudo() == Some(PseudoElement::FirstLine)); let (inherited_style, layout_parent_style) = match parent_style { Some(parent_style) => { (parent_style, @@ -2983,6 +3082,7 @@ where builder: StyleBuilder::new( device, parent_style, + parent_style_ignoring_first_line, pseudo, flags, Some(rules.clone()), @@ -2996,6 +3096,7 @@ where cached_system_font: None, in_media_query: false, quirks_mode: quirks_mode, + for_smil_animation: false, }; let ignore_colors = !device.use_document_colors(); @@ -3114,6 +3215,23 @@ where let mut _skip_font_family = false; % if product == "gecko": + + // <svg:text> is not affected by text zoom, and it uses a preshint to + // disable it. We fix up the struct when this happens by unzooming + // its contained font values, which will have been zoomed in the parent + if seen.contains(LonghandId::XTextZoom) { + let zoom = context.builder.get_font().gecko().mAllowZoom; + let parent_zoom = context.style().get_parent_font().gecko().mAllowZoom; + if zoom != parent_zoom { + debug_assert!(!zoom, + "We only ever disable text zoom (in svg:text), never enable it"); + // can't borrow both device and font, use the take/put machinery + let mut font = context.builder.take_font(); + font.unzoom_fonts(context.device()); + context.builder.put_font(font); + } + } + // Whenever a single generic value is specified, gecko will do a bunch of // recalculation walking up the rule tree, including handling the font-size stuff. // It basically repopulates the font struct with the default font for a given @@ -3243,7 +3361,7 @@ pub fn adjust_border_width(style: &mut StyleBuilder) { // Like calling to_computed_value, which wouldn't type check. if style.get_border().clone_border_${side}_style().none_or_hidden() && style.get_border().border_${side}_has_nonzero_width() { - style.set_border_${side}_width(Au(0)); + style.set_border_${side}_width(NonNegativeAu::zero()); } % endfor } @@ -3267,7 +3385,7 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc<ComputedValues>, PhysicalSide::Top => (border.border_top_width, border.border_top_style), PhysicalSide::Bottom => (border.border_bottom_width, border.border_bottom_style), }; - if current_style == (Au(0), BorderStyle::none) { + if current_style == (NonNegativeAu::zero(), BorderStyle::none) { return; } } @@ -3275,19 +3393,19 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc<ComputedValues>, let border = Arc::make_mut(&mut style.border); match side { PhysicalSide::Left => { - border.border_left_width = Au(0); + border.border_left_width = NonNegativeAu::zero(); border.border_left_style = BorderStyle::none; } PhysicalSide::Right => { - border.border_right_width = Au(0); + border.border_right_width = NonNegativeAu::zero(); border.border_right_style = BorderStyle::none; } PhysicalSide::Bottom => { - border.border_bottom_width = Au(0); + border.border_bottom_width = NonNegativeAu::zero(); border.border_bottom_style = BorderStyle::none; } PhysicalSide::Top => { - border.border_top_width = Au(0); + border.border_top_width = NonNegativeAu::zero(); border.border_top_style = BorderStyle::none; } } @@ -3326,49 +3444,13 @@ macro_rules! css_properties_accessors { } } - +#[macro_export] macro_rules! longhand_properties_idents { ($macro_name: ident) => { $macro_name! { % for property in data.longhands: - ${property.ident} + { ${property.ident}, ${"true" if property.boxed else "false"} } % endfor } } } - -/// Testing function to check the size of all SpecifiedValues. -#[cfg(feature = "testing")] -pub fn test_size_of_specified_values() { - use std::mem::size_of; - let threshold = 24; - - let mut longhands = vec![]; - % for property in data.longhands: - longhands.push(("${property.name}", - size_of::<longhands::${property.ident}::SpecifiedValue>(), - ${"true" if property.boxed else "false"})); - % endfor - - let mut failing_messages = vec![]; - - for specified_value in longhands { - if specified_value.1 > threshold && !specified_value.2 { - failing_messages.push( - format!("Your changes have increased the size of {} SpecifiedValue to {}. The threshold is \ - currently {}. SpecifiedValues affect size of PropertyDeclaration enum and \ - increasing the size may negative affect style system performance. Please consider \ - using `boxed=\"True\"` in this longhand.", - specified_value.0, specified_value.1, threshold)); - } else if specified_value.1 <= threshold && specified_value.2 { - failing_messages.push( - format!("Your changes have decreased the size of {} SpecifiedValue to {}. Good work! \ - The threshold is currently {}. Please consider removing `boxed=\"True\"` from this longhand.", - specified_value.0, specified_value.1, threshold)); - } - } - - if !failing_messages.is_empty() { - panic!("{}", failing_messages.join("\n\n")); - } -} diff --git a/components/style/properties/shorthand/padding.mako.rs b/components/style/properties/shorthand/padding.mako.rs index 2972fb45259..592048cf56f 100644 --- a/components/style/properties/shorthand/padding.mako.rs +++ b/components/style/properties/shorthand/padding.mako.rs @@ -4,6 +4,6 @@ <%namespace name="helpers" file="/helpers.mako.rs" /> -${helpers.four_sides_shorthand("padding", "padding-%s", "specified::LengthOrPercentage::parse_non_negative", +${helpers.four_sides_shorthand("padding", "padding-%s", "specified::NonNegativeLengthOrPercentage::parse", spec="https://drafts.csswg.org/css-box-3/#propdef-padding", allow_quirks=True)} diff --git a/components/style/properties/shorthand/position.mako.rs b/components/style/properties/shorthand/position.mako.rs index c7653a48e15..f4221eae312 100644 --- a/components/style/properties/shorthand/position.mako.rs +++ b/components/style/properties/shorthand/position.mako.rs @@ -46,12 +46,13 @@ extra_prefixes="webkit" derive_serialize="True" spec="https://drafts.csswg.org/css-flexbox/#flex-property"> - use values::specified::Number; + use parser::Parse; + use values::specified::NonNegativeNumber; fn parse_flexibility<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) - -> Result<(Number, Option<Number>),ParseError<'i>> { - let grow = Number::parse_non_negative(context, input)?; - let shrink = input.try(|i| Number::parse_non_negative(context, i)).ok(); + -> Result<(NonNegativeNumber, Option<NonNegativeNumber>),ParseError<'i>> { + let grow = NonNegativeNumber::parse(context, input)?; + let shrink = input.try(|i| NonNegativeNumber::parse(context, i)).ok(); Ok((grow, shrink)) } @@ -63,8 +64,8 @@ if input.try(|input| input.expect_ident_matching("none")).is_ok() { return Ok(expanded! { - flex_grow: Number::new(0.0), - flex_shrink: Number::new(0.0), + flex_grow: NonNegativeNumber::new(0.0), + flex_shrink: NonNegativeNumber::new(0.0), flex_basis: longhands::flex_basis::SpecifiedValue::auto(), }) } @@ -89,8 +90,8 @@ return Err(StyleParseError::UnspecifiedError.into()) } Ok(expanded! { - flex_grow: grow.unwrap_or(Number::new(1.0)), - flex_shrink: shrink.unwrap_or(Number::new(1.0)), + flex_grow: grow.unwrap_or(NonNegativeNumber::new(1.0)), + flex_shrink: shrink.unwrap_or(NonNegativeNumber::new(1.0)), // Per spec, this should be SpecifiedValue::zero(), but all // browsers currently agree on using `0%`. This is a spec // change which hasn't been adopted by browsers: @@ -458,7 +459,7 @@ use properties::longhands::grid_auto_flow::computed_value::{AutoFlow, T as SpecifiedAutoFlow}; use values::{Either, None_}; use values::generics::grid::{GridTemplateComponent, TrackListType}; - use values::specified::{GenericGridTemplateComponent, LengthOrPercentage, TrackSize}; + use values::specified::{GenericGridTemplateComponent, NonNegativeLengthOrPercentage, TrackSize}; pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Longhands, ParseError<'i>> { @@ -519,8 +520,8 @@ grid_auto_columns: auto_cols, grid_auto_flow: flow, // This shorthand also resets grid gap - grid_row_gap: LengthOrPercentage::zero(), - grid_column_gap: LengthOrPercentage::zero(), + grid_row_gap: NonNegativeLengthOrPercentage::zero(), + grid_column_gap: NonNegativeLengthOrPercentage::zero(), }) } @@ -538,8 +539,8 @@ fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { // `grid` shorthand resets these properties. If they are not zero, that means they // are changed by longhands and in that case we should fail serializing `grid`. - if *self.grid_row_gap != LengthOrPercentage::zero() || - *self.grid_column_gap != LengthOrPercentage::zero() { + if *self.grid_row_gap != NonNegativeLengthOrPercentage::zero() || + *self.grid_column_gap != NonNegativeLengthOrPercentage::zero() { return Ok(()); } diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs index 0dc29232dac..1063cdba6c9 100644 --- a/components/style/rule_tree/mod.rs +++ b/components/style/rule_tree/mod.rs @@ -310,12 +310,14 @@ impl RuleTree { level: CascadeLevel, pdb: Option<ArcBorrow<Locked<PropertyDeclarationBlock>>>, path: &StrongRuleNode, - guards: &StylesheetGuards) + guards: &StylesheetGuards, + important_rules_changed: &mut bool) -> Option<StrongRuleNode> { debug_assert!(level.is_unique_per_element()); // TODO(emilio): Being smarter with lifetimes we could avoid a bit of // the refcount churn. let mut current = path.clone(); + *important_rules_changed = false; // First walk up until the first less-or-equally specific rule. let mut children = SmallVec::<[_; 10]>::new(); @@ -335,6 +337,8 @@ impl RuleTree { // special cases, and replacing them for a `while` loop, avoiding the // optimizations). if current.get().level == level { + *important_rules_changed |= level.is_important(); + if let Some(pdb) = pdb { // If the only rule at the level we're replacing is exactly the // same as `pdb`, we're done, and `path` is still valid. diff --git a/components/style/selector_map.rs b/components/style/selector_map.rs index 0a7ebb65612..feba256584b 100644 --- a/components/style/selector_map.rs +++ b/components/style/selector_map.rs @@ -9,19 +9,56 @@ use {Atom, LocalName}; use applicable_declarations::ApplicableDeclarationBlock; use context::QuirksMode; use dom::TElement; -use fnv::FnvHashMap; use pdqsort::sort_by; +use precomputed_hash::PrecomputedHash; use rule_tree::CascadeLevel; use selector_parser::SelectorImpl; use selectors::matching::{matches_selector, MatchingContext, ElementSelectorFlags}; use selectors::parser::{Component, Combinator, SelectorIter}; use selectors::parser::LocalName as LocalNameSelector; -use smallvec::VecLike; -use std::collections::HashMap; +use smallvec::{SmallVec, VecLike}; +use std::collections::{HashMap, HashSet}; use std::collections::hash_map; -use std::hash::Hash; +use std::hash::{BuildHasherDefault, Hash, Hasher}; use stylist::Rule; +/// A hasher implementation that doesn't hash anything, because it expects its +/// input to be a suitable u32 hash. +pub struct PrecomputedHasher { + hash: Option<u32>, +} + +impl Default for PrecomputedHasher { + fn default() -> Self { + Self { hash: None } + } +} + +/// A simple alias for a hashmap using PrecomputedHasher. +pub type PrecomputedHashMap<K, V> = HashMap<K, V, BuildHasherDefault<PrecomputedHasher>>; + +/// A simple alias for a hashset using PrecomputedHasher. +pub type PrecomputedHashSet<K> = HashSet<K, BuildHasherDefault<PrecomputedHasher>>; + +impl Hasher for PrecomputedHasher { + #[inline] + fn write(&mut self, _: &[u8]) { + unreachable!("Called into PrecomputedHasher with something that isn't \ + a u32") + } + + #[inline] + fn write_u32(&mut self, i: u32) { + debug_assert!(self.hash.is_none()); + self.hash = Some(i); + } + + #[inline] + fn finish(&self) -> u64 { + self.hash.expect("PrecomputedHasher wasn't fed?") as u64 + } +} + /// A trait to abstract over a given selector map entry. pub trait SelectorMapEntry : Sized + Clone { /// Gets the selector we should use to index in the selector map. @@ -49,16 +86,21 @@ pub trait SelectorMapEntry : Sized + Clone { /// element name, etc. will contain the Selectors that actually match that /// element. /// +/// We use a 1-entry SmallVec to avoid a separate heap allocation in the case +/// where we only have one entry, which is quite common. See measurements in: +/// * https://bugzilla.mozilla.org/show_bug.cgi?id=1363789#c5 +/// * https://bugzilla.mozilla.org/show_bug.cgi?id=681755 +/// /// TODO: Tune the initial capacity of the HashMap #[derive(Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct SelectorMap<T> { /// A hash from an ID to rules which contain that ID selector. - pub id_hash: MaybeCaseInsensitiveHashMap<Atom, Vec<T>>, + pub id_hash: MaybeCaseInsensitiveHashMap<Atom, SmallVec<[T; 1]>>, /// A hash from a class name to rules which contain that class selector. - pub class_hash: MaybeCaseInsensitiveHashMap<Atom, Vec<T>>, + pub class_hash: MaybeCaseInsensitiveHashMap<Atom, SmallVec<[T; 1]>>, /// A hash from local name to rules which contain that local name selector. - pub local_name_hash: FnvHashMap<LocalName, Vec<T>>, + pub local_name_hash: PrecomputedHashMap<LocalName, SmallVec<[T; 1]>>, /// Rules that don't have ID, class, or element selectors. pub other: Vec<T>, /// The number of entries in this map. @@ -213,12 +255,12 @@ impl<T: SelectorMapEntry> SelectorMap<T> { self.count += 1; if let Some(id_name) = get_id_name(entry.selector()) { - self.id_hash.entry(id_name, quirks_mode).or_insert_with(Vec::new).push(entry); + self.id_hash.entry(id_name, quirks_mode).or_insert_with(SmallVec::new).push(entry); return; } if let Some(class_name) = get_class_name(entry.selector()) { - self.class_hash.entry(class_name, quirks_mode).or_insert_with(Vec::new).push(entry); + self.class_hash.entry(class_name, quirks_mode).or_insert_with(SmallVec::new).push(entry); return; } @@ -361,10 +403,12 @@ impl<T: SelectorMapEntry> SelectorMap<T> { /// /// The first non-None value returned from |f| is returned. #[inline(always)] -fn find_from_left<F, R>(mut iter: SelectorIter<SelectorImpl>, - mut f: F) - -> Option<R> - where F: FnMut(&Component<SelectorImpl>) -> Option<R>, +fn find_from_left<F, R>( + mut iter: SelectorIter<SelectorImpl>, + mut f: F +) -> Option<R> +where + F: FnMut(&Component<SelectorImpl>) -> Option<R>, { for ss in &mut iter { if let Some(r) = f(ss) { @@ -390,8 +434,6 @@ fn find_from_left<F, R>(mut iter: SelectorIter<SelectorImpl>, pub fn get_id_name(iter: SelectorIter<SelectorImpl>) -> Option<Atom> { find_from_left(iter, |ss| { - // TODO(pradeep): Implement case-sensitivity based on the - // document type and quirks mode. if let Component::ID(ref id) = *ss { return Some(id.clone()); } @@ -404,8 +446,6 @@ pub fn get_id_name(iter: SelectorIter<SelectorImpl>) pub fn get_class_name(iter: SelectorIter<SelectorImpl>) -> Option<Atom> { find_from_left(iter, |ss| { - // TODO(pradeep): Implement case-sensitivity based on the - // document type and quirks mode. if let Component::Class(ref class) = *ss { return Some(class.clone()); } @@ -429,21 +469,23 @@ pub fn get_local_name(iter: SelectorIter<SelectorImpl>) } #[inline] -fn find_push<Str: Eq + Hash, V>(map: &mut FnvHashMap<Str, Vec<V>>, - key: Str, - value: V) { - map.entry(key).or_insert_with(Vec::new).push(value) +fn find_push<Str: Eq + Hash, V, VL>(map: &mut PrecomputedHashMap<Str, VL>, + key: Str, + value: V) + where VL: VecLike<V> + Default +{ + map.entry(key).or_insert_with(VL::default).push(value) } -/// Wrapper for FnvHashMap that does ASCII-case-insensitive lookup in quirks mode. +/// Wrapper for PrecomputedHashMap that does ASCII-case-insensitive lookup in quirks mode. #[derive(Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] -pub struct MaybeCaseInsensitiveHashMap<K: Hash + Eq, V>(FnvHashMap<K, V>); +pub struct MaybeCaseInsensitiveHashMap<K: PrecomputedHash + Hash + Eq, V>(PrecomputedHashMap<K, V>); impl<V> MaybeCaseInsensitiveHashMap<Atom, V> { /// Empty map pub fn new() -> Self { - MaybeCaseInsensitiveHashMap(FnvHashMap::default()) + MaybeCaseInsensitiveHashMap(PrecomputedHashMap::default()) } /// HashMap::entry diff --git a/components/style/selector_parser.rs b/components/style/selector_parser.rs index 3f5a43365cf..8399d5e6778 100644 --- a/components/style/selector_parser.rs +++ b/components/style/selector_parser.rs @@ -11,7 +11,7 @@ use selectors::Element; use selectors::parser::SelectorList; use std::fmt::Debug; use style_traits::ParseError; -use stylesheets::{Origin, Namespaces}; +use stylesheets::{Origin, Namespaces, UrlExtraData}; /// A convenient alias for the type that represents an attribute value used for /// selector parser implementation. @@ -52,6 +52,9 @@ pub struct SelectorParser<'a> { pub stylesheet_origin: Origin, /// The namespace set of the stylesheet. pub namespaces: &'a Namespaces, + /// The extra URL data of the stylesheet, which is used to look up + /// whether we are parsing a chrome:// URL style sheet. + pub url_data: Option<&'a UrlExtraData>, } impl<'a> SelectorParser<'a> { @@ -65,6 +68,7 @@ impl<'a> SelectorParser<'a> { let parser = SelectorParser { stylesheet_origin: Origin::Author, namespaces: &namespaces, + url_data: None, }; let mut input = ParserInput::new(input); SelectorList::parse(&parser, &mut CssParser::new(&mut input)) @@ -74,6 +78,12 @@ impl<'a> SelectorParser<'a> { pub fn in_user_agent_stylesheet(&self) -> bool { matches!(self.stylesheet_origin, Origin::UserAgent) } + + /// Whether we're parsing selectors in a stylesheet that has chrome + /// privilege. + pub fn in_chrome_stylesheet(&self) -> bool { + self.url_data.map_or(false, |d| d.is_chrome()) + } } /// This enumeration determines if a pseudo-element is eagerly cascaded or not. diff --git a/components/style/servo/media_queries.rs b/components/style/servo/media_queries.rs index 5545ab95051..9b47d231c97 100644 --- a/components/style/servo/media_queries.rs +++ b/components/style/servo/media_queries.rs @@ -60,7 +60,8 @@ impl Device { media_type: media_type, viewport_size: viewport_size, device_pixel_ratio: device_pixel_ratio, - root_font_size: AtomicIsize::new(font_size::get_initial_value().0 as isize), // FIXME(bz): Seems dubious? + // FIXME(bz): Seems dubious? + root_font_size: AtomicIsize::new(font_size::get_initial_value().value() as isize), used_root_font_size: AtomicBool::new(false), } } @@ -246,6 +247,7 @@ impl Range<specified::Length> { in_media_query: true, cached_system_font: None, quirks_mode: quirks_mode, + for_smil_animation: false, }; match *self { diff --git a/components/style/servo/restyle_damage.rs b/components/style/servo/restyle_damage.rs index f85e8b6b13c..0be480a2424 100644 --- a/components/style/servo/restyle_damage.rs +++ b/components/style/servo/restyle_damage.rs @@ -69,6 +69,17 @@ impl ServoRestyleDamage { StyleDifference::new(damage, change) } + /// Computes the `StyleDifference` between the two `ComputedValues` objects + /// for the case where the old and new style are both `display: none`. + /// + /// For Servo we never need to generate any damage for such elements. + pub fn compute_undisplayed_style_difference( + _old_style: &ComputedValues, + _new_style: &ComputedValues, + ) -> StyleDifference { + StyleDifference::new(Self::empty(), StyleChange::Unchanged) + } + /// Returns a bitmask that represents a flow that needs to be rebuilt and /// reflowed. /// diff --git a/components/style/servo/selector_parser.rs b/components/style/servo/selector_parser.rs index ae47b993ebc..784a839c800 100644 --- a/components/style/servo/selector_parser.rs +++ b/components/style/servo/selector_parser.rs @@ -13,7 +13,9 @@ use dom::{OpaqueNode, TElement, TNode}; use element_state::ElementState; use fnv::FnvHashMap; use invalidation::element::element_wrapper::ElementSnapshot; +use properties::ComputedValues; use properties::PropertyFlags; +use properties::longhands::display::computed_value as display; use selector_parser::{AttrValue as SelectorAttrValue, ElementExt, PseudoElementCascadeType, SelectorParser}; use selectors::Element; use selectors::attr::{AttrSelectorOperation, NamespaceConstraint, CaseSensitivity}; @@ -40,6 +42,8 @@ pub enum PseudoElement { Selection, // If/when :first-letter is added, update is_first_letter accordingly. + // If/when :first-line is added, update is_first_line accordingly. + // If/when ::first-letter, ::first-line, or ::placeholder are added, adjust // our property_restriction implementation to do property filtering for // them. Also, make sure the UA sheet has the !important rules some of the @@ -123,6 +127,12 @@ impl PseudoElement { false } + /// Whether the current pseudo element is :first-line + #[inline] + pub fn is_first_line(&self) -> bool { + false + } + /// Whether this pseudo-element is eagerly-cascaded. #[inline] pub fn is_eager(&self) -> bool { @@ -135,6 +145,18 @@ impl PseudoElement { self.cascade_type() == PseudoElementCascadeType::Lazy } + /// Whether this pseudo-element is for an anonymous box. + pub fn is_anon_box(&self) -> bool { + self.is_precomputed() + } + + /// Whether this pseudo-element skips flex/grid container + /// display-based fixup. + #[inline] + pub fn skip_item_based_display_fixup(&self) -> bool { + !self.is_before_or_after() + } + /// Whether this pseudo-element is precomputed. #[inline] pub fn is_precomputed(&self) -> bool { @@ -181,6 +203,21 @@ impl PseudoElement { pub fn property_restriction(&self) -> Option<PropertyFlags> { None } + + /// Whether this pseudo-element should actually exist if it has + /// the given styles. + pub fn should_exist(&self, style: &ComputedValues) -> bool + { + let display = style.get_box().clone_display(); + if display == display::T::none { + return false; + } + if self.is_before_or_after() && style.ineffective_content_property() { + return false; + } + + true + } } /// The type used for storing pseudo-class string arguments. diff --git a/components/style/sharing/checks.rs b/components/style/sharing/checks.rs index e7f8db5a54f..31296aed446 100644 --- a/components/style/sharing/checks.rs +++ b/components/style/sharing/checks.rs @@ -13,23 +13,42 @@ use dom::TElement; use servo_arc::Arc; use sharing::{StyleSharingCandidate, StyleSharingTarget}; -/// Whether, given two elements, they have pointer-equal computed values. +/// Whether styles may be shared across the children of the given parent elements. +/// This is used to share style across cousins. /// /// Both elements need to be styled already. -/// -/// This is used to know whether we can share style across cousins (if the two -/// parents have the same style). -pub fn same_computed_values<E>(first: Option<E>, second: Option<E>) -> bool +pub fn can_share_style_across_parents<E>(first: Option<E>, second: Option<E>) -> bool where E: TElement, { - let (a, b) = match (first, second) { + let (first, second) = match (first, second) { (Some(f), Some(s)) => (f, s), _ => return false, }; - let eq = Arc::ptr_eq(a.borrow_data().unwrap().styles.primary(), - b.borrow_data().unwrap().styles.primary()); - eq + debug_assert_ne!(first, second); + + let first_data = first.borrow_data().unwrap(); + let second_data = second.borrow_data().unwrap(); + + // If a parent element was already styled and we traversed past it without + // restyling it, that may be because our clever invalidation logic was able + // to prove that the styles of that element would remain unchanged despite + // changes to the id or class attributes. However, style sharing relies in + // the strong guarantee that all the classes and ids up the respective parent + // chains are identical. As such, if we skipped styling for one (or both) of + // the parents on this traversal, we can't share styles across cousins. + // + // This is a somewhat conservative check. We could tighten it by having the + // invalidation logic explicitly flag elements for which it ellided styling. + if first_data.restyle.traversed_without_styling() || + second_data.restyle.traversed_without_styling() { + return false; + } + + let same_computed_values = + Arc::ptr_eq(first_data.styles.primary(), second_data.styles.primary()); + + same_computed_values } /// Whether two elements have the same same style attribute (by pointer identity). diff --git a/components/style/sharing/mod.rs b/components/style/sharing/mod.rs index caa6f4afc86..27d911362f7 100644 --- a/components/style/sharing/mod.rs +++ b/components/style/sharing/mod.rs @@ -610,13 +610,14 @@ impl<E: TElement> StyleSharingCandidateCache<E> { } } - // Check that we have the same parent, or at least the same pointer - // identity for parent computed style. The latter check allows us to - // share style between cousins if the parents shared style. + // Check that we have the same parent, or at least that the parents + // share styles and permit sharing across their children. The latter + // check allows us to share style between cousins if the parents + // shared style. let parent = target.traversal_parent(); let candidate_parent = candidate.element.traversal_parent(); if parent != candidate_parent && - !checks::same_computed_values(parent, candidate_parent) { + !checks::can_share_style_across_parents(parent, candidate_parent) { miss!(Parent) } diff --git a/components/style/style_adjuster.rs b/components/style/style_adjuster.rs index 8222634317e..70d9880fb29 100644 --- a/components/style/style_adjuster.rs +++ b/components/style/style_adjuster.rs @@ -85,6 +85,22 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { } } + /// Compute a few common flags for both text and element's style. + pub fn set_bits(&mut self) { + use properties::computed_value_flags::IS_IN_DISPLAY_NONE_SUBTREE; + use properties::computed_value_flags::IS_IN_PSEUDO_ELEMENT_SUBTREE; + + if self.style.inherited_flags().contains(IS_IN_DISPLAY_NONE_SUBTREE) || + self.style.get_box().clone_display() == display::none { + self.style.flags.insert(IS_IN_DISPLAY_NONE_SUBTREE); + } + + if self.style.inherited_flags().contains(IS_IN_PSEUDO_ELEMENT_SUBTREE) || + self.style.is_pseudo_element() { + self.style.flags.insert(IS_IN_PSEUDO_ELEMENT_SUBTREE); + } + } + /// Adjust the style for text style. /// /// The adjustments here are a subset of the adjustments generally, because @@ -94,6 +110,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { #[cfg(feature = "gecko")] pub fn adjust_for_text(&mut self) { self.adjust_for_text_combine_upright(); + self.set_bits(); } /// Change writing mode of the text frame for text-combine-upright. @@ -225,7 +242,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { fn adjust_for_outline(&mut self) { if self.style.get_outline().clone_outline_style().none_or_hidden() && self.style.get_outline().outline_has_nonzero_width() { - self.style.mutate_outline().set_outline_width(Au(0)); + self.style.mutate_outline().set_outline_width(Au(0).into()); } } @@ -446,7 +463,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { let relevant_link_visited = if flags.contains(IS_LINK) { flags.contains(IS_VISITED_LINK) } else { - self.style.inherited_style().flags.contains(IS_RELEVANT_LINK_VISITED) + self.style.inherited_flags().contains(IS_RELEVANT_LINK_VISITED) }; if relevant_link_visited { @@ -454,6 +471,36 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { } } + /// Resolves "justify-items: auto" based on the inherited style if needed to + /// comply with: + /// + /// https://drafts.csswg.org/css-align/#valdef-justify-items-legacy + /// + /// (Note that "auto" is being renamed to "legacy") + #[cfg(feature = "gecko")] + fn adjust_for_justify_items(&mut self) { + use values::specified::align; + let justify_items = self.style.get_position().clone_justify_items(); + if justify_items.specified.0 != align::ALIGN_AUTO { + return; + } + + let parent_justify_items = + self.style.get_parent_position().clone_justify_items(); + + if !parent_justify_items.computed.0.contains(align::ALIGN_LEGACY) { + return; + } + + if parent_justify_items.computed == justify_items.computed { + return; + } + + self.style + .mutate_position() + .set_computed_justify_items(parent_justify_items.computed); + } + /// Adjusts the style to account for various fixups that don't fit naturally /// into the cascade. /// @@ -478,6 +525,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { self.adjust_for_table_text_align(); self.adjust_for_contain(); self.adjust_for_mathvariant(); + self.adjust_for_justify_items(); } #[cfg(feature = "servo")] { @@ -491,5 +539,6 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { { self.adjust_for_ruby(layout_parent_style, flags); } + self.set_bits(); } } diff --git a/components/style/style_resolver.rs b/components/style/style_resolver.rs index 306aba45e19..d83a5961c24 100644 --- a/components/style/style_resolver.rs +++ b/components/style/style_resolver.rs @@ -140,19 +140,10 @@ where parent_style: Option<&ComputedValues>, layout_parent_style: Option<&ComputedValues>, ) -> ElementStyles { - use properties::longhands::display::computed_value::T as display; - let primary_style = self.resolve_primary_style(parent_style, layout_parent_style); let mut pseudo_styles = EagerPseudoStyles::default(); - if primary_style.style.get_box().clone_display() == display::none { - return ElementStyles { - // FIXME(emilio): Remove the Option<>. - primary: Some(primary_style.style), - pseudos: pseudo_styles, - } - } if self.element.implemented_pseudo_element().is_none() { let layout_parent_style_for_pseudo = @@ -237,7 +228,6 @@ where &mut self, inputs: ElementCascadeInputs, ) -> ElementStyles { - use properties::longhands::display::computed_value::T as display; with_default_parent_styles(self.element, move |parent_style, layout_parent_style| { let primary_style = PrimaryStyle { style: self.cascade_style_and_visited( @@ -249,16 +239,7 @@ where }; let mut pseudo_styles = EagerPseudoStyles::default(); - let pseudo_array = inputs.pseudos.into_array(); - if pseudo_array.is_none() || - primary_style.style.get_box().clone_display() == display::none { - return ElementStyles { - primary: Some(primary_style.style), - pseudos: pseudo_styles, - } - } - - { + if let Some(mut pseudo_array) = inputs.pseudos.into_array() { let layout_parent_style_for_pseudo = if primary_style.style.is_display_contents() { layout_parent_style @@ -266,7 +247,7 @@ where Some(&*primary_style.style) }; - for (i, mut inputs) in pseudo_array.unwrap().iter_mut().enumerate() { + for (i, mut inputs) in pseudo_array.iter_mut().enumerate() { if let Some(inputs) = inputs.take() { let pseudo = PseudoElement::from_eager_index(i); pseudo_styles.set( @@ -461,7 +442,8 @@ where let mut cascade_info = CascadeInfo::new(); let mut cascade_flags = CascadeFlags::empty(); - if self.element.skip_root_and_item_based_display_fixup() { + if self.element.skip_root_and_item_based_display_fixup() || + pseudo.map_or(false, |p| p.skip_item_based_display_fixup()) { cascade_flags.insert(SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP); } @@ -498,6 +480,7 @@ where rules.unwrap_or(self.context.shared.stylist.rule_tree().root()), &self.context.shared.guards, parent_style, + parent_style, layout_parent_style, style_if_visited, Some(&mut cascade_info), diff --git a/components/style/stylesheets/font_feature_values_rule.rs b/components/style/stylesheets/font_feature_values_rule.rs new file mode 100644 index 00000000000..e18f9174c2b --- /dev/null +++ b/components/style/stylesheets/font_feature_values_rule.rs @@ -0,0 +1,389 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//! The [`@font-feature-values`][font-feature-values] at-rule. +//! +//! [font-feature-values]: https://drafts.csswg.org/css-fonts-3/#at-font-feature-values-rule + +use Atom; +use computed_values::font_family::FamilyName; +use cssparser::{AtRuleParser, AtRuleType, BasicParseError, DeclarationListParser, DeclarationParser, Parser}; +use cssparser::{CowRcStr, RuleListParser, SourceLocation, QualifiedRuleParser, Token, serialize_identifier}; +use error_reporting::ContextualParseError; +use parser::{ParserContext, log_css_error, Parse}; +use selectors::parser::SelectorParseError; +use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard}; +use std::fmt; +use style_traits::{ParseError, StyleParseError, ToCss}; +use stylesheets::CssRuleType; + +/// A @font-feature-values block declaration. +/// It is `<ident>: <integer>+`. +/// This struct can take 3 value types. +/// - `SingleValue` is to keep just one unsigned integer value. +/// - `PairValues` is to keep one or two unsigned integer values. +/// - `VectorValues` is to keep a list of unsigned integer values. +#[derive(Clone, Debug, PartialEq)] +pub struct FFVDeclaration<T> { + /// An `<ident>` for declaration name. + pub name: Atom, + /// An `<integer>+` for declaration value. + pub value: T, +} + +impl<T: ToCss> ToCss for FFVDeclaration<T> { + fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { + serialize_identifier(&self.name.to_string(), dest)?; + dest.write_str(": ")?; + self.value.to_css(dest)?; + dest.write_str(";") + } +} + +/// A @font-feature-values block declaration value that keeps one value. +#[derive(Clone, Debug, PartialEq)] +pub struct SingleValue(pub u32); + +impl Parse for SingleValue { + fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>) + -> Result<SingleValue, ParseError<'i>> { + match *input.next()? { + Token::Number { int_value: Some(v), .. } if v >= 0 => Ok(SingleValue(v as u32)), + ref t => Err(BasicParseError::UnexpectedToken(t.clone()).into()), + } + } +} + +impl ToCss for SingleValue { + fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { + write!(dest, "{}", self.0) + } +} + +/// A @font-feature-values block declaration value that keeps one or two values. +#[derive(Clone, Debug, PartialEq)] +pub struct PairValues(pub u32, pub Option<u32>); + +impl Parse for PairValues { + fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>) + -> Result<PairValues, ParseError<'i>> { + let first = match *input.next()? { + Token::Number { int_value: Some(a), .. } if a >= 0 => a as u32, + ref t => return Err(BasicParseError::UnexpectedToken(t.clone()).into()), + }; + match input.next() { + Ok(&Token::Number { int_value: Some(b), .. }) if b >= 0 => { + Ok(PairValues(first, Some(b as u32))) + } + // It can't be anything other than number. + Ok(t) => Err(BasicParseError::UnexpectedToken(t.clone()).into()), + // It can be just one value. + Err(_) => Ok(PairValues(first, None)) + } + } +} + +impl ToCss for PairValues { + fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { + write!(dest, "{}", self.0)?; + if let Some(second) = self.1 { + write!(dest, " {}", second)?; + } + Ok(()) + } +} + +/// A @font-feature-values block declaration value that keeps a list of values. +#[derive(Clone, Debug, PartialEq)] +pub struct VectorValues(pub Vec<u32>); + +impl Parse for VectorValues { + fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>) + -> Result<VectorValues, ParseError<'i>> { + let mut vec = vec![]; + loop { + match input.next() { + Ok(&Token::Number { int_value: Some(a), .. }) if a >= 0 => { + vec.push(a as u32); + }, + // It can't be anything other than number. + Ok(t) => return Err(BasicParseError::UnexpectedToken(t.clone()).into()), + Err(_) => break, + } + } + + if vec.len() == 0 { + return Err(BasicParseError::EndOfInput.into()); + } + + Ok(VectorValues(vec)) + } +} + +impl ToCss for VectorValues { + fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { + let mut iter = self.0.iter(); + let first = iter.next(); + if let Some(first) = first { + write!(dest, "{}", first)?; + for value in iter { + dest.write_str(" ")?; + write!(dest, "{}", value)?; + } + } + Ok(()) + } +} + +/// Parses a list of `FamilyName`s. +pub fn parse_family_name_list<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) + -> Result<Vec<FamilyName>, ParseError<'i>> { + input.parse_comma_separated(|i| FamilyName::parse(context, i)).map_err(|e| e.into()) +} + +/// @font-feature-values inside block parser. Parses a list of `FFVDeclaration`. +/// (`<ident>: <integer>+`) +struct FFVDeclarationsParser<'a, 'b: 'a, T: 'a> { + context: &'a ParserContext<'b>, + declarations: &'a mut Vec<FFVDeclaration<T>>, +} + +/// Default methods reject all at rules. +impl<'a, 'b, 'i, T> AtRuleParser<'i> for FFVDeclarationsParser<'a, 'b, T> { + type Prelude = (); + type AtRule = (); + type Error = SelectorParseError<'i, StyleParseError<'i>>; +} + +impl<'a, 'b, 'i, T> DeclarationParser<'i> for FFVDeclarationsParser<'a, 'b, T> + where T: Parse +{ + type Declaration = (); + type Error = SelectorParseError<'i, StyleParseError<'i>>; + + fn parse_value<'t>(&mut self, name: CowRcStr<'i>, input: &mut Parser<'i, 't>) + -> Result<(), ParseError<'i>> { + let value = input.parse_entirely(|i| T::parse(self.context, i))?; + let new = FFVDeclaration { + name: Atom::from(&*name), + value: value, + }; + update_or_push(&mut self.declarations, new); + Ok(()) + } +} + +macro_rules! font_feature_values_blocks { + ( + blocks = [ + $( #[$doc: meta] $name: tt $ident: ident / $ident_camel: ident: $ty: ty, )* + ] + ) => { + /// The [`@font-feature-values`][font-feature-values] at-rule. + /// + /// [font-feature-values]: https://drafts.csswg.org/css-fonts-3/#at-font-feature-values-rule + #[derive(Clone, Debug, PartialEq)] + pub struct FontFeatureValuesRule { + /// Font family list for @font-feature-values rule. + /// Family names cannot contain generic families. FamilyName + /// also accepts only non-generic names. + pub family_names: Vec<FamilyName>, + $( + #[$doc] + pub $ident: Vec<FFVDeclaration<$ty>>, + )* + /// The line and column of the rule's source code. + pub source_location: SourceLocation, + } + + impl FontFeatureValuesRule { + /// Creates an empty FontFeatureValuesRule with given location and family name list. + fn new(family_names: Vec<FamilyName>, location: SourceLocation) -> Self { + FontFeatureValuesRule { + family_names: family_names, + $( + $ident: vec![], + )* + source_location: location, + } + } + + /// Parses a `FontFeatureValuesRule`. + pub fn parse(context: &ParserContext, input: &mut Parser, + family_names: Vec<FamilyName>, location: SourceLocation) + -> FontFeatureValuesRule { + let mut rule = FontFeatureValuesRule::new(family_names, location); + + { + let mut iter = RuleListParser::new_for_nested_rule(input, FontFeatureValuesRuleParser { + context: context, + rule: &mut rule, + }); + while let Some(result) = iter.next() { + if let Err(err) = result { + let pos = err.span.start; + let error = ContextualParseError::UnsupportedRule( + iter.input.slice(err.span), err.error); + log_css_error(iter.input, pos, error, context); + } + } + } + rule + } + + /// Prints font family names. + pub fn font_family_to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { + let mut iter = self.family_names.iter(); + iter.next().unwrap().to_css(dest)?; + for val in iter { + dest.write_str(", ")?; + val.to_css(dest)?; + } + Ok(()) + } + + /// Prints inside of `@font-feature-values` block. + pub fn value_to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { + $( + if self.$ident.len() > 0 { + dest.write_str(concat!("@", $name, " {\n"))?; + let iter = self.$ident.iter(); + for val in iter { + val.to_css(dest)?; + dest.write_str("\n")? + } + dest.write_str("}\n")? + } + )* + Ok(()) + } + } + + impl ToCssWithGuard for FontFeatureValuesRule { + fn to_css<W>(&self, _guard: &SharedRwLockReadGuard, dest: &mut W) -> fmt::Result + where W: fmt::Write + { + dest.write_str("@font-feature-values ")?; + self.font_family_to_css(dest)?; + dest.write_str(" {\n")?; + self.value_to_css(dest)?; + dest.write_str("}") + } + } + + /// Updates with new value if same `ident` exists, otherwise pushes to the vector. + fn update_or_push<T>(vec: &mut Vec<FFVDeclaration<T>>, element: FFVDeclaration<T>) { + let position = vec.iter().position(|ref val| val.name == element.name); + if let Some(index) = position { + vec[index].value = element.value; + } else { + vec.push(element); + } + } + + /// Keeps the information about block type like @swash, @styleset etc. + enum BlockType { + $( + $ident_camel, + )* + } + + /// Parser for `FontFeatureValuesRule`. Parses all blocks + /// <feature-type> { + /// <feature-value-declaration-list> + /// } + /// <feature-type> = @stylistic | @historical-forms | @styleset | + /// @character-variant | @swash | @ornaments | @annotation + struct FontFeatureValuesRuleParser<'a> { + context: &'a ParserContext<'a>, + rule: &'a mut FontFeatureValuesRule, + } + + /// Default methods reject all qualified rules. + impl<'a, 'i> QualifiedRuleParser<'i> for FontFeatureValuesRuleParser<'a> { + type Prelude = (); + type QualifiedRule = (); + type Error = SelectorParseError<'i, StyleParseError<'i>>; + } + + impl<'a, 'i> AtRuleParser<'i> for FontFeatureValuesRuleParser<'a> { + type Prelude = BlockType; + type AtRule = (); + type Error = SelectorParseError<'i, StyleParseError<'i>>; + + fn parse_prelude<'t>(&mut self, + name: CowRcStr<'i>, + _input: &mut Parser<'i, 't>) + -> Result<AtRuleType<Self::Prelude, Self::AtRule>, ParseError<'i>> { + match_ignore_ascii_case! { &*name, + $( + $name => Ok(AtRuleType::WithBlock(BlockType::$ident_camel)), + )* + _ => Err(BasicParseError::AtRuleBodyInvalid.into()), + } + } + + fn parse_block<'t>(&mut self, prelude: Self::Prelude, input: &mut Parser<'i, 't>) + -> Result<Self::AtRule, ParseError<'i>> { + let context = ParserContext::new_with_rule_type(self.context, Some(CssRuleType::FontFeatureValues)); + match prelude { + $( + BlockType::$ident_camel => { + let parser = FFVDeclarationsParser { + context: &context, + declarations: &mut self.rule.$ident, + }; + + let mut iter = DeclarationListParser::new(input, parser); + while let Some(declaration) = iter.next() { + if let Err(err) = declaration { + let pos = err.span.start; + let error = ContextualParseError::UnsupportedKeyframePropertyDeclaration( + iter.input.slice(err.span), err.error); + log_css_error(iter.input, pos, error, &context); + } + } + }, + )* + } + + Ok(()) + } + } + } +} + +font_feature_values_blocks! { + blocks = [ + #[doc = "A @swash blocksck. \ + Specifies a feature name that will work with the swash() \ + functional notation of font-variant-alternates."] + "swash" swash / Swash: SingleValue, + + #[doc = "A @stylistic block. \ + Specifies a feature name that will work with the annotation() \ + functional notation of font-variant-alternates."] + "stylistic" stylistic / Stylistic: SingleValue, + + #[doc = "A @ornaments block. \ + Specifies a feature name that will work with the ornaments() ] \ + functional notation of font-variant-alternates."] + "ornaments" ornaments / Ornaments: SingleValue, + + #[doc = "A @annotation block. \ + Specifies a feature name that will work with the stylistic() \ + functional notation of font-variant-alternates."] + "annotation" annotation / Annotation: SingleValue, + + #[doc = "A @character-variant block. \ + Specifies a feature name that will work with the styleset() \ + functional notation of font-variant-alternates. The value can be a pair."] + "character-variant" character_variant / CharacterVariant: PairValues, + + #[doc = "A @styleset block. \ + Specifies a feature name that will work with the character-variant() \ + functional notation of font-variant-alternates. The value can be a list."] + "styleset" styleset / Styleset: VectorValues, + ] +} diff --git a/components/style/stylesheets/memory.rs b/components/style/stylesheets/memory.rs index 44a2e429d5b..39338502a25 100644 --- a/components/style/stylesheets/memory.rs +++ b/components/style/stylesheets/memory.rs @@ -4,6 +4,12 @@ //! Memory reporting for the style system when running inside of Gecko. +#[cfg(feature = "gecko")] +use gecko_bindings::bindings::Gecko_HaveSeenPtr; +#[cfg(feature = "gecko")] +use gecko_bindings::structs::SeenPtrs; +#[cfg(feature = "gecko")] +use servo_arc::Arc; use shared_lock::SharedRwLockReadGuard; use std::os::raw::c_void; @@ -14,11 +20,24 @@ use std::os::raw::c_void; /// do_malloc_size_of(), rather than directly. pub type MallocSizeOfFn = unsafe extern "C" fn(ptr: *const c_void) -> usize; +/// Servo-side counterpart to mozilla::SizeOfState. The only difference is that +/// this struct doesn't contain the SeenPtrs table, just a pointer to it. +#[cfg(feature = "gecko")] +pub struct SizeOfState { + /// Function that measures the size of heap blocks. + pub malloc_size_of: MallocSizeOfFn, + /// Table recording heap blocks that have already been measured. + pub seen_ptrs: *mut SeenPtrs, +} + /// Call malloc_size_of on ptr, first checking that the allocation isn't empty. -pub unsafe fn do_malloc_size_of<T>(malloc_size_of: MallocSizeOfFn, ptr: *const T) -> usize { - use std::mem::align_of; +pub unsafe fn is_empty<T>(ptr: *const T) -> bool { + return ptr as usize <= ::std::mem::align_of::<T>(); +} - if ptr as usize <= align_of::<T>() { +/// Call malloc_size_of on ptr, first checking that the allocation isn't empty. +pub unsafe fn do_malloc_size_of<T>(malloc_size_of: MallocSizeOfFn, ptr: *const T) -> usize { + if is_empty(ptr) { 0 } else { malloc_size_of(ptr as *const c_void) @@ -32,6 +51,15 @@ pub trait MallocSizeOf { fn malloc_size_of_children(&self, malloc_size_of: MallocSizeOfFn) -> usize; } +/// Like MallocSizeOf, but takes a SizeOfState which allows it to measure +/// graph-like structures such as those containing Arcs. +#[cfg(feature = "gecko")] +pub trait MallocSizeOfWithRepeats { + /// Measure the size of any heap-allocated structures that hang off this + /// value, but not the space taken up by the value itself. + fn malloc_size_of_children(&self, state: &mut SizeOfState) -> usize; +} + /// Like MallocSizeOf, but operates with the global SharedRwLockReadGuard /// locked. pub trait MallocSizeOfWithGuard { @@ -58,6 +86,19 @@ impl<T: MallocSizeOf> MallocSizeOf for Vec<T> { } } +#[cfg(feature = "gecko")] +impl<T: MallocSizeOfWithRepeats> MallocSizeOfWithRepeats for Arc<T> { + fn malloc_size_of_children(&self, state: &mut SizeOfState) -> usize { + let mut n = 0; + let heap_ptr = self.heap_ptr(); + if unsafe { !is_empty(heap_ptr) && !Gecko_HaveSeenPtr(state.seen_ptrs, heap_ptr) } { + n += unsafe { (state.malloc_size_of)(heap_ptr) }; + n += (**self).malloc_size_of_children(state); + } + n + } +} + impl<T: MallocSizeOfWithGuard> MallocSizeOfWithGuard for Vec<T> { fn malloc_size_of_children( &self, diff --git a/components/style/stylesheets/mod.rs b/components/style/stylesheets/mod.rs index c86c7c6f051..758bbdeb1a1 100644 --- a/components/style/stylesheets/mod.rs +++ b/components/style/stylesheets/mod.rs @@ -7,6 +7,7 @@ mod counter_style_rule; mod document_rule; mod font_face_rule; +pub mod font_feature_values_rule; pub mod import_rule; pub mod keyframes_rule; mod loader; @@ -33,11 +34,14 @@ use style_traits::PARSING_MODE_DEFAULT; pub use self::counter_style_rule::CounterStyleRule; pub use self::document_rule::DocumentRule; pub use self::font_face_rule::FontFaceRule; +pub use self::font_feature_values_rule::FontFeatureValuesRule; pub use self::import_rule::ImportRule; pub use self::keyframes_rule::KeyframesRule; pub use self::loader::StylesheetLoader; pub use self::media_rule::MediaRule; pub use self::memory::{MallocSizeOf, MallocSizeOfFn, MallocSizeOfWithGuard}; +#[cfg(feature = "gecko")] +pub use self::memory::{MallocSizeOfWithRepeats, SizeOfState}; pub use self::namespace_rule::NamespaceRule; pub use self::page_rule::PageRule; pub use self::rule_parser::{State, TopLevelRuleParser}; @@ -66,6 +70,11 @@ impl UrlExtraData { // TODO "(stylo: not supported)" } + + /// True if this URL scheme is chrome. + pub fn is_chrome(&self) -> bool { + self.mIsChrome + } } // XXX We probably need to figure out whether we should mark Eq here. @@ -103,6 +112,7 @@ pub enum CssRule { Style(Arc<Locked<StyleRule>>), Media(Arc<Locked<MediaRule>>), FontFace(Arc<Locked<FontFaceRule>>), + FontFeatureValues(Arc<Locked<FontFeatureValuesRule>>), CounterStyle(Arc<Locked<CounterStyleRule>>), Viewport(Arc<Locked<ViewportRule>>), Keyframes(Arc<Locked<KeyframesRule>>), @@ -125,6 +135,7 @@ impl MallocSizeOfWithGuard for CssRule { CssRule::Import(_) => 0, CssRule::Media(_) => 0, CssRule::FontFace(_) => 0, + CssRule::FontFeatureValues(_) => 0, CssRule::CounterStyle(_) => 0, CssRule::Keyframes(_) => 0, CssRule::Namespace(_) => 0, @@ -195,6 +206,7 @@ impl CssRule { CssRule::Import(_) => CssRuleType::Import, CssRule::Media(_) => CssRuleType::Media, CssRule::FontFace(_) => CssRuleType::FontFace, + CssRule::FontFeatureValues(_) => CssRuleType::FontFeatureValues, CssRule::CounterStyle(_) => CssRuleType::CounterStyle, CssRule::Keyframes(_) => CssRuleType::Keyframes, CssRule::Namespace(_) => CssRuleType::Namespace, @@ -250,18 +262,19 @@ impl CssRule { shared_lock: &shared_lock, loader: loader, state: state, + had_hierarchy_error: false, namespaces: Some(&mut *guard), }; - match parse_one_rule(&mut input, &mut rule_parser) { - Ok(result) => Ok((result, rule_parser.state)), - Err(_) => { - Err(match rule_parser.state { - State::Invalid => SingleRuleParseError::Hierarchy, - _ => SingleRuleParseError::Syntax, - }) - } - } + parse_one_rule(&mut input, &mut rule_parser) + .map(|result| (result, rule_parser.state)) + .map_err(|_| { + if rule_parser.take_had_hierarchy_error() { + SingleRuleParseError::Hierarchy + } else { + SingleRuleParseError::Syntax + } + }) } } @@ -298,6 +311,10 @@ impl DeepCloneWithLock for CssRule { CssRule::FontFace(Arc::new(lock.wrap( rule.clone_conditionally_gecko_or_servo()))) }, + CssRule::FontFeatureValues(ref arc) => { + let rule = arc.read_with(guard); + CssRule::FontFeatureValues(Arc::new(lock.wrap(rule.clone()))) + }, CssRule::CounterStyle(ref arc) => { let rule = arc.read_with(guard); CssRule::CounterStyle(Arc::new(lock.wrap( @@ -340,6 +357,7 @@ impl ToCssWithGuard for CssRule { CssRule::Import(ref lock) => lock.read_with(guard).to_css(guard, dest), CssRule::Style(ref lock) => lock.read_with(guard).to_css(guard, dest), CssRule::FontFace(ref lock) => lock.read_with(guard).to_css(guard, dest), + CssRule::FontFeatureValues(ref lock) => lock.read_with(guard).to_css(guard, dest), CssRule::CounterStyle(ref lock) => lock.read_with(guard).to_css(guard, dest), CssRule::Viewport(ref lock) => lock.read_with(guard).to_css(guard, dest), CssRule::Keyframes(ref lock) => lock.read_with(guard).to_css(guard, dest), diff --git a/components/style/stylesheets/rule_parser.rs b/components/style/stylesheets/rule_parser.rs index 9c223be1f5d..e96c85c74a9 100644 --- a/components/style/stylesheets/rule_parser.rs +++ b/components/style/stylesheets/rule_parser.rs @@ -5,6 +5,7 @@ //! Parsing of the stylesheet contents. use {Namespace, Prefix}; +use computed_values::font_family::FamilyName; use counter_style::{parse_counter_style_body, parse_counter_style_name}; use cssparser::{AtRuleParser, AtRuleType, Parser, QualifiedRuleParser, RuleListParser}; use cssparser::{CowRcStr, SourceLocation, BasicParseError}; @@ -21,9 +22,10 @@ use shared_lock::{Locked, SharedRwLock}; use str::starts_with_ignore_ascii_case; use style_traits::{StyleParseError, ParseError}; use stylesheets::{CssRule, CssRules, CssRuleType, Origin, StylesheetLoader}; -use stylesheets::{DocumentRule, KeyframesRule, MediaRule, NamespaceRule, PageRule}; -use stylesheets::{StyleRule, SupportsRule, ViewportRule}; +use stylesheets::{DocumentRule, FontFeatureValuesRule, KeyframesRule, MediaRule}; +use stylesheets::{NamespaceRule, PageRule, StyleRule, SupportsRule, ViewportRule}; use stylesheets::document_rule::DocumentCondition; +use stylesheets::font_feature_values_rule::parse_family_name_list; use stylesheets::keyframes_rule::parse_keyframe_list; use stylesheets::stylesheet::Namespaces; use stylesheets::supports_rule::SupportsCondition; @@ -45,6 +47,10 @@ pub struct TopLevelRuleParser<'a> { pub context: ParserContext<'a>, /// The current state of the parser. pub state: State, + /// Whether we have tried to parse was invalid due to being in the wrong + /// place (e.g. an @import rule was found while in the `Body` state). Reset + /// to `false` when `take_had_hierarchy_error` is called. + pub had_hierarchy_error: bool, /// The namespace map we use for parsing. Needs to start as `Some()`, and /// will be taken out after parsing namespace rules, and that reference will /// be moved to `ParserContext`. @@ -69,6 +75,16 @@ impl<'b> TopLevelRuleParser<'b> { pub fn state(&self) -> State { self.state } + + /// Returns whether we previously tried to parse a rule that was invalid + /// due to being in the wrong place (e.g. an @import rule was found after + /// a regular style rule). The state of this flag is reset when this + /// function is called. + pub fn take_had_hierarchy_error(&mut self) -> bool { + let had_hierarchy_error = self.had_hierarchy_error; + self.had_hierarchy_error = false; + had_hierarchy_error + } } /// The current state of the parser. @@ -82,9 +98,6 @@ pub enum State { Namespaces = 3, /// We're parsing the main body of the stylesheet. Body = 4, - /// We've found an invalid state (as, a namespace rule after style rules), - /// and the rest of the stylesheet should be ignored. - Invalid = 5, } #[derive(Clone, Debug)] @@ -101,6 +114,8 @@ pub enum VendorPrefix { pub enum AtRulePrelude { /// A @font-face rule prelude. FontFace(SourceLocation), + /// A @font-feature-values rule prelude, with its FamilyName list. + FontFeatureValues(Vec<FamilyName>, SourceLocation), /// A @counter-style rule prelude, with its counter style name. CounterStyle(CustomIdent), /// A @media rule prelude, with its media queries. @@ -149,8 +164,8 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> { match_ignore_ascii_case! { &*name, "import" => { if self.state > State::Imports { - self.state = State::Invalid; // "@import must be before any rule but @charset" + self.had_hierarchy_error = true; return Err(StyleParseError::UnexpectedImportRule.into()) } @@ -176,8 +191,8 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> { }, "namespace" => { if self.state > State::Namespaces { - self.state = State::Invalid; // "@namespace must be before any rule but @charset and @import" + self.had_hierarchy_error = true; return Err(StyleParseError::UnexpectedNamespaceRule.into()) } self.state = State::Namespaces; @@ -217,14 +232,12 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> { }, // @charset is removed by rust-cssparser if it’s the first rule in the stylesheet // anything left is invalid. - "charset" => return Err(StyleParseError::UnexpectedCharsetRule.into()), + "charset" => { + self.had_hierarchy_error = true; + return Err(StyleParseError::UnexpectedCharsetRule.into()) + } _ => {} } - // Don't allow starting with an invalid state - if self.state > State::Body { - self.state = State::Invalid; - return Err(StyleParseError::UnspecifiedError.into()); - } self.state = State::Body; // "Freeze" the namespace map (no more namespace rules can be parsed @@ -345,6 +358,14 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> { "font-face" => { Ok(AtRuleType::WithBlock(AtRulePrelude::FontFace(location))) }, + "font-feature-values" => { + if !cfg!(feature = "gecko") && !cfg!(feature = "testing") { + // Support for this rule is not fully implemented in Servo yet. + return Err(StyleParseError::UnsupportedAtRule(name.clone()).into()) + } + let family_names = parse_family_name_list(self.context, input)?; + Ok(AtRuleType::WithBlock(AtRulePrelude::FontFeatureValues(family_names, location))) + }, "counter-style" => { if !cfg!(feature = "gecko") { // Support for this rule is not fully implemented in Servo yet. @@ -413,6 +434,11 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> { Ok(CssRule::FontFace(Arc::new(self.shared_lock.wrap( parse_font_face_block(&context, input, location).into())))) } + AtRulePrelude::FontFeatureValues(family_names, location) => { + let context = ParserContext::new_with_rule_type(self.context, Some(CssRuleType::FontFeatureValues)); + Ok(CssRule::FontFeatureValues(Arc::new(self.shared_lock.wrap( + FontFeatureValuesRule::parse(&context, input, family_names, location))))) + } AtRulePrelude::CounterStyle(name) => { let context = ParserContext::new_with_rule_type(self.context, Some(CssRuleType::CounterStyle)); Ok(CssRule::CounterStyle(Arc::new(self.shared_lock.wrap( @@ -481,6 +507,7 @@ impl<'a, 'b, 'i> QualifiedRuleParser<'i> for NestedRuleParser<'a, 'b> { let selector_parser = SelectorParser { stylesheet_origin: self.stylesheet_origin, namespaces: self.context.namespaces.unwrap(), + url_data: Some(self.context.url_data), }; let location = get_location_with_offset(input.current_source_location(), diff --git a/components/style/stylesheets/rules_iterator.rs b/components/style/stylesheets/rules_iterator.rs index cb8f83abb7d..95a3ab8b388 100644 --- a/components/style/stylesheets/rules_iterator.rs +++ b/components/style/stylesheets/rules_iterator.rs @@ -86,7 +86,8 @@ impl<'a, 'b, C> Iterator for RulesIterator<'a, 'b, C> CssRule::CounterStyle(_) | CssRule::Viewport(_) | CssRule::Keyframes(_) | - CssRule::Page(_) => { + CssRule::Page(_) | + CssRule::FontFeatureValues(_) => { return Some(rule) }, CssRule::Import(ref import_rule) => { diff --git a/components/style/stylesheets/stylesheet.rs b/components/style/stylesheets/stylesheet.rs index 805a539ef98..7d7a0c86960 100644 --- a/components/style/stylesheets/stylesheet.rs +++ b/components/style/stylesheets/stylesheet.rs @@ -247,6 +247,7 @@ pub trait StylesheetInDocument { effective_style_rules(Style => StyleRule), effective_media_rules(Media => MediaRule), effective_font_face_rules(FontFace => FontFaceRule), + effective_font_face_feature_values_rules(FontFeatureValues => FontFeatureValuesRule), effective_counter_style_rules(CounterStyle => CounterStyleRule), effective_viewport_rules(Viewport => ViewportRule), effective_keyframes_rules(Keyframes => KeyframesRule), @@ -336,6 +337,7 @@ impl Stylesheet { loader: stylesheet_loader, context: context, state: State::Start, + had_hierarchy_error: false, namespaces: Some(namespaces), }; diff --git a/components/style/stylesheets/viewport_rule.rs b/components/style/stylesheets/viewport_rule.rs index 3e5a60bd34c..7d3339a9214 100644 --- a/components/style/stylesheets/viewport_rule.rs +++ b/components/style/stylesheets/viewport_rule.rs @@ -696,6 +696,10 @@ impl MaybeNew for ViewportConstraints { // // Note: DEVICE-ADAPT § 5. states that relative length values are // resolved against initial values + // + // Note, we set used_viewport_size flag for Gecko in au_viewport_size. + // If we ever start supporting ViewportRule in Gecko, we probably want + // to avoid doing so at this place. let initial_viewport = device.au_viewport_size(); let provider = get_metrics_provider_for_product(); @@ -709,6 +713,7 @@ impl MaybeNew for ViewportConstraints { cached_system_font: None, in_media_query: false, quirks_mode: quirks_mode, + for_smil_animation: false, }; // DEVICE-ADAPT § 9.3 Resolving 'extend-to-zoom' diff --git a/components/style/stylist.rs b/components/style/stylist.rs index e5e61752be4..9426ecd11f7 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -20,6 +20,7 @@ use properties::{self, CascadeFlags, ComputedValues}; use properties::{AnimationRules, PropertyDeclarationBlock}; #[cfg(feature = "servo")] use properties::INHERIT_ALL; +use properties::IS_LINK; use rule_tree::{CascadeLevel, RuleTree, StyleSource}; use selector_map::{SelectorMap, SelectorMapEntry}; use selector_parser::{SelectorImpl, PseudoElement}; @@ -50,9 +51,8 @@ pub use ::fnv::FnvHashMap; /// This structure holds all the selectors and device characteristics /// for a given document. The selectors are converted into `Rule`s -/// (defined in rust-selectors), and introduced in a `SelectorMap` -/// depending on the pseudo-element (see `PerPseudoElementSelectorMap`), -/// and stylesheet origin (see the fields of `PerPseudoElementSelectorMap`). +/// (defined in rust-selectors), and sorted into `SelectorMap`s keyed +/// off stylesheet origin and pseudo-element (see `CascadeData`). /// /// This structure is effectively created once per pipeline, in the /// LayoutThread corresponding to that pipeline. @@ -89,17 +89,14 @@ pub struct Stylist { /// had clear() called on it with no following rebuild()). is_cleared: bool, - /// The current selector maps, after evaluating media - /// rules against the current device. - element_map: PerPseudoElementSelectorMap, + /// Selector maps for all of the style sheets in the stylist, after + /// evalutaing media rules against the current device, split out per + /// cascade level. + cascade_data: CascadeData, /// The rule tree, that stores the results of selector matching. rule_tree: RuleTree, - /// The selector maps corresponding to a given pseudo-element - /// (depending on the implementation) - pseudos_map: FnvHashMap<PseudoElement, PerPseudoElementSelectorMap>, - /// A map with all the animations indexed by name. animations: FnvHashMap<Atom, KeyframesAnimation>, @@ -233,7 +230,7 @@ impl Stylist { /// be reset in clear(). #[inline] pub fn new(device: Device, quirks_mode: QuirksMode) -> Self { - let mut stylist = Stylist { + Stylist { viewport_constraints: None, device: device, is_device_dirty: true, @@ -241,8 +238,7 @@ impl Stylist { quirks_mode: quirks_mode, effective_media_query_results: EffectiveMediaQueryResults::new(), - element_map: PerPseudoElementSelectorMap::new(), - pseudos_map: Default::default(), + cascade_data: CascadeData::new(), animations: Default::default(), precomputed_pseudo_element_decls: Default::default(), rules_source_order: 0, @@ -256,15 +252,9 @@ impl Stylist { num_selectors: 0, num_declarations: 0, num_rebuilds: 0, - }; - - SelectorImpl::each_eagerly_cascaded_pseudo_element(|pseudo| { - stylist.pseudos_map.insert(pseudo, PerPseudoElementSelectorMap::new()); - }); + } // FIXME: Add iso-8859-9.css when the document’s encoding is ISO-8859-8. - - stylist } /// Returns the number of selectors. @@ -316,8 +306,7 @@ impl Stylist { // preserve current device self.is_device_dirty = true; // preserve current quirks_mode value - self.element_map = PerPseudoElementSelectorMap::new(); - self.pseudos_map = Default::default(); + self.cascade_data.clear(); self.animations.clear(); // Or set to Default::default()? self.precomputed_pseudo_element_decls = Default::default(); self.rules_source_order = 0; @@ -392,10 +381,6 @@ impl Stylist { self.device.account_for_viewport_rule(constraints); } - SelectorImpl::each_eagerly_cascaded_pseudo_element(|pseudo| { - self.pseudos_map.insert(pseudo, PerPseudoElementSelectorMap::new()); - }); - extra_data.clear(); if let Some(ua_stylesheets) = ua_stylesheets { @@ -419,8 +404,8 @@ impl Stylist { } SelectorImpl::each_precomputed_pseudo_element(|pseudo| { - if let Some(map) = self.pseudos_map.remove(&pseudo) { - let declarations = map.user_agent.get_universal_rules(CascadeLevel::UANormal); + if let Some(map) = self.cascade_data.user_agent.pseudos_map.remove(&pseudo) { + let declarations = map.get_universal_rules(CascadeLevel::UANormal); self.precomputed_pseudo_element_decls.insert(pseudo, declarations); } }); @@ -473,6 +458,10 @@ impl Stylist { self.effective_media_query_results.saw_effective(stylesheet); let origin = stylesheet.origin(guard); + + let origin_cascade_data = + self.cascade_data.borrow_mut_for_origin(&origin); + for rule in stylesheet.effective_rules(&self.device, guard) { match *rule { CssRule::Style(ref locked) => { @@ -481,39 +470,35 @@ impl Stylist { for selector in &style_rule.selectors.0 { self.num_selectors += 1; - let map = if let Some(pseudo) = selector.pseudo_element() { - self.pseudos_map - .entry(pseudo.canonical()) - .or_insert_with(PerPseudoElementSelectorMap::new) - .borrow_for_origin(&origin) - } else { - self.element_map.borrow_for_origin(&origin) - }; - let hashes = AncestorHashes::new(&selector, self.quirks_mode); - map.insert( - Rule::new(selector.clone(), - hashes.clone(), - locked.clone(), - self.rules_source_order), - self.quirks_mode); + origin_cascade_data + .borrow_mut_for_pseudo_or_insert(selector.pseudo_element()) + .insert( + Rule::new(selector.clone(), + hashes.clone(), + locked.clone(), + self.rules_source_order), + self.quirks_mode); self.invalidation_map.note_selector(selector, self.quirks_mode); - if needs_revalidation(&selector) { - self.selectors_for_cache_revalidation.insert( - RevalidationSelectorAndHashes::new(&selector, &hashes), - self.quirks_mode); - } - selector.visit(&mut AttributeAndStateDependencyVisitor { + let mut visitor = StylistSelectorVisitor { + needs_revalidation: false, + passed_rightmost_selector: false, attribute_dependencies: &mut self.attribute_dependencies, style_attribute_dependency: &mut self.style_attribute_dependency, state_dependencies: &mut self.state_dependencies, - }); - selector.visit(&mut MappedIdVisitor { mapped_ids: &mut self.mapped_ids, - }); + }; + + selector.visit(&mut visitor); + + if visitor.needs_revalidation { + self.selectors_for_cache_revalidation.insert( + RevalidationSelectorAndHashes::new(selector.clone(), hashes), + self.quirks_mode); + } } self.rules_source_order += 1; } @@ -637,6 +622,7 @@ impl Stylist { guards, parent, parent, + parent, None, None, font_metrics, @@ -726,6 +712,47 @@ impl Stylist { return None } + // FIXME(emilio): The lack of layout_parent_style here could be + // worrying, but we're probably dropping the display fixup for + // pseudos other than before and after, so it's probably ok. + // + // (Though the flags don't indicate so!) + Some(self.compute_style_with_inputs(inputs, + Some(pseudo), + guards, + parent_style, + parent_style, + parent_style, + font_metrics, + CascadeFlags::empty())) + } + + /// Computes a style using the given CascadeInputs. This can be used to + /// compute a style any time we know what rules apply and just need to use + /// the given parent styles. + /// + /// parent_style is the style to inherit from for properties affected by + /// first-line ancestors. + /// + /// parent_style_ignoring_first_line is the style to inherit from for + /// properties not affected by first-line ancestors. + /// + /// layout_parent_style is the style used for some property fixups. It's + /// the style of the nearest ancestor with a layout box. + /// + /// is_link should be true if we're computing style for a link; that affects + /// how :visited handling is done. + pub fn compute_style_with_inputs(&self, + inputs: &CascadeInputs, + pseudo: Option<&PseudoElement>, + guards: &StylesheetGuards, + parent_style: &ComputedValues, + parent_style_ignoring_first_line: &ComputedValues, + layout_parent_style: &ComputedValues, + font_metrics: &FontMetricsProvider, + cascade_flags: CascadeFlags) + -> Arc<ComputedValues> + { // We need to compute visited values if we have visited rules or if our // parent has visited values. let visited_values = if inputs.visited_rules.is_some() || parent_style.get_visited_style().is_some() { @@ -736,27 +763,37 @@ impl Stylist { Some(rules) => rules, None => inputs.rules.as_ref().unwrap(), }; - // We want to use the visited bits (if any) from our parent style as - // our parent. - let inherited_style = - parent_style.get_visited_style().unwrap_or(parent_style); - - // FIXME(emilio): The lack of layout_parent_style here could be - // worrying, but we're probably dropping the display fixup for - // pseudos other than before and after, so it's probably ok. - // - // (Though the flags don't indicate so!) + let inherited_style; + let inherited_style_ignoring_first_line; + let layout_parent_style_for_visited; + if cascade_flags.contains(IS_LINK) { + // We just want to use our parent style as our parent. + inherited_style = parent_style; + inherited_style_ignoring_first_line = parent_style_ignoring_first_line; + layout_parent_style_for_visited = layout_parent_style; + } else { + // We want to use the visited bits (if any) from our parent + // style as our parent. + inherited_style = + parent_style.get_visited_style().unwrap_or(parent_style); + inherited_style_ignoring_first_line = + parent_style_ignoring_first_line.get_visited_style().unwrap_or(parent_style_ignoring_first_line); + layout_parent_style_for_visited = + layout_parent_style.get_visited_style().unwrap_or(layout_parent_style); + } + let computed = properties::cascade(&self.device, - Some(pseudo), + pseudo, rule_node, guards, Some(inherited_style), - Some(inherited_style), + Some(inherited_style_ignoring_first_line), + Some(layout_parent_style_for_visited), None, None, font_metrics, - CascadeFlags::empty(), + cascade_flags, self.quirks_mode); Some(computed) @@ -772,17 +809,18 @@ impl Stylist { // difficult to assert that display: contents nodes never arrive here // (tl;dr: It doesn't apply for replaced elements and such, but the // computed value is still "contents"). - Some(properties::cascade(&self.device, - Some(pseudo), - rules, - guards, - Some(parent_style), - Some(parent_style), - visited_values, - None, - font_metrics, - CascadeFlags::empty(), - self.quirks_mode)) + properties::cascade(&self.device, + pseudo, + rules, + guards, + Some(parent_style), + Some(parent_style_ignoring_first_line), + Some(layout_parent_style), + visited_values, + None, + font_metrics, + cascade_flags, + self.quirks_mode) } /// Computes the cascade inputs for a lazily-cascaded pseudo-element. @@ -800,7 +838,8 @@ impl Stylist { { let pseudo = pseudo.canonical(); debug_assert!(pseudo.is_lazy()); - if self.pseudos_map.get(&pseudo).is_none() { + + if !self.cascade_data.has_rules_for_pseudo(&pseudo) { return CascadeInputs::default() } @@ -885,7 +924,7 @@ impl Stylist { if !declarations.is_empty() { let rule_node = self.rule_tree.insert_ordered_rules_with_important( - declarations.into_iter().map(|a| a.order_and_level()), + declarations.drain().map(|a| a.order_and_level()), guards); if rule_node != *self.rule_tree.root() { inputs.visited_rules = Some(rule_node); @@ -992,7 +1031,8 @@ impl Stylist { CssRule::Keyframes(..) | CssRule::Page(..) | CssRule::Viewport(..) | - CssRule::Document(..) => { + CssRule::Document(..) | + CssRule::FontFeatureValues(..) => { // Not affected by device changes. continue; } @@ -1059,17 +1099,6 @@ impl Stylist { self.quirks_mode = quirks_mode; } - /// Returns the correspond PerPseudoElementSelectorMap given PseudoElement. - fn get_map(&self, - pseudo_element: Option<&PseudoElement>) -> Option<&PerPseudoElementSelectorMap> - { - match pseudo_element { - Some(pseudo) => self.pseudos_map.get(pseudo), - None => Some(&self.element_map), - } - } - - /// Returns the applicable CSS declarations for the given element by /// treating us as an XBL stylesheet-only stylist. pub fn push_applicable_declarations_as_xbl_only_stylist<E, V>(&self, @@ -1083,21 +1112,19 @@ impl Stylist { MatchingContext::new(MatchingMode::Normal, None, self.quirks_mode); let mut dummy_flag_setter = |_: &E, _: ElementSelectorFlags| {}; - let map = match self.get_map(pseudo_element) { - Some(map) => map, - None => return, - }; let rule_hash_target = element.rule_hash_target(); - // nsXBLPrototypeResources::ComputeServoStyleSet() added XBL stylesheets under author - // (doc) level. - map.author.get_all_matching_rules(element, - &rule_hash_target, - applicable_declarations, - &mut matching_context, - self.quirks_mode, - &mut dummy_flag_setter, - CascadeLevel::XBL); + // nsXBLPrototypeResources::LoadResources() loads Chrome XBL style + // sheets under eAuthorSheetFeatures level. + if let Some(map) = self.cascade_data.author.borrow_for_pseudo(pseudo_element) { + map.get_all_matching_rules(element, + &rule_hash_target, + applicable_declarations, + &mut matching_context, + self.quirks_mode, + &mut dummy_flag_setter, + CascadeLevel::XBL); + } } /// Returns the applicable CSS declarations for the given element. @@ -1129,10 +1156,6 @@ impl Stylist { "Style attributes do not apply to pseudo-elements"); debug_assert!(pseudo_element.map_or(true, |p| !p.is_precomputed())); - let map = match self.get_map(pseudo_element) { - Some(map) => map, - None => return, - }; let rule_hash_target = element.rule_hash_target(); debug!("Determining if style is shareable: pseudo: {}", @@ -1141,13 +1164,15 @@ impl Stylist { let only_default_rules = rule_inclusion == RuleInclusion::DefaultOnly; // Step 1: Normal user-agent rules. - map.user_agent.get_all_matching_rules(element, - &rule_hash_target, - applicable_declarations, - context, - self.quirks_mode, - flags_setter, - CascadeLevel::UANormal); + if let Some(map) = self.cascade_data.user_agent.borrow_for_pseudo(pseudo_element) { + map.get_all_matching_rules(element, + &rule_hash_target, + applicable_declarations, + context, + self.quirks_mode, + flags_setter, + CascadeLevel::UANormal); + } if pseudo_element.is_none() && !only_default_rules { // Step 2: Presentational hints. @@ -1175,13 +1200,15 @@ impl Stylist { // Which may be more what you would probably expect. if rule_hash_target.matches_user_and_author_rules() { // Step 3a: User normal rules. - map.user.get_all_matching_rules(element, - &rule_hash_target, - applicable_declarations, - context, - self.quirks_mode, - flags_setter, - CascadeLevel::UserNormal); + if let Some(map) = self.cascade_data.user.borrow_for_pseudo(pseudo_element) { + map.get_all_matching_rules(element, + &rule_hash_target, + applicable_declarations, + context, + self.quirks_mode, + flags_setter, + CascadeLevel::UserNormal); + } } else { debug!("skipping user rules"); } @@ -1196,13 +1223,15 @@ impl Stylist { // See nsStyleSet::FileRules(). if !cut_off_inheritance { // Step 3c: Author normal rules. - map.author.get_all_matching_rules(element, - &rule_hash_target, - applicable_declarations, - context, - self.quirks_mode, - flags_setter, - CascadeLevel::AuthorNormal); + if let Some(map) = self.cascade_data.author.borrow_for_pseudo(pseudo_element) { + map.get_all_matching_rules(element, + &rule_hash_target, + applicable_declarations, + context, + self.quirks_mode, + flags_setter, + CascadeLevel::AuthorNormal); + } } else { debug!("skipping author normal rules due to cut off inheritance"); } @@ -1342,6 +1371,7 @@ impl Stylist { guards, Some(parent_style), Some(parent_style), + Some(parent_style), None, None, &metrics, @@ -1365,68 +1395,6 @@ impl Stylist { } } -/// Visitor to collect names that appear in attribute selectors and any -/// dependencies on ElementState bits. -struct AttributeAndStateDependencyVisitor<'a> { - attribute_dependencies: &'a mut BloomFilter, - style_attribute_dependency: &'a mut bool, - state_dependencies: &'a mut ElementState, -} - -impl<'a> SelectorVisitor for AttributeAndStateDependencyVisitor<'a> { - type Impl = SelectorImpl; - - fn visit_attribute_selector(&mut self, _ns: &NamespaceConstraint<&Namespace>, - name: &LocalName, lower_name: &LocalName) - -> bool { - if *lower_name == local_name!("style") { - *self.style_attribute_dependency = true; - } else { - self.attribute_dependencies.insert_hash(name.get_hash()); - self.attribute_dependencies.insert_hash(lower_name.get_hash()); - } - true - } - - fn visit_simple_selector(&mut self, s: &Component<SelectorImpl>) -> bool { - if let Component::NonTSPseudoClass(ref p) = *s { - self.state_dependencies.insert(p.state_flag()); - } - true - } -} - -/// Visitor to collect ids that appear in the rightmost portion of selectors. -struct MappedIdVisitor<'a> { - mapped_ids: &'a mut BloomFilter, -} - -impl<'a> SelectorVisitor for MappedIdVisitor<'a> { - type Impl = SelectorImpl; - - /// We just want to insert all the ids we find into mapped_ids. - fn visit_simple_selector(&mut self, s: &Component<SelectorImpl>) -> bool { - if let Component::ID(ref id) = *s { - self.mapped_ids.insert_hash(id.get_hash()); - } - true - } - - /// We want to stop as soon as we've moved off the rightmost ComplexSelector - /// that is not a psedo-element. That can be detected by a - /// visit_complex_selector call with a combinator other than None and - /// PseudoElement. Importantly, this call happens before we visit any of - /// the simple selectors in that ComplexSelector. - fn visit_complex_selector(&mut self, - _: SelectorIter<SelectorImpl>, - combinator: Option<Combinator>) -> bool { - match combinator { - None | Some(Combinator::PseudoElement) => true, - _ => false, - } - } -} - /// SelectorMapEntry implementation for use in our revalidation selector map. #[derive(Clone, Debug)] struct RevalidationSelectorAndHashes { @@ -1436,29 +1404,29 @@ struct RevalidationSelectorAndHashes { } impl RevalidationSelectorAndHashes { - fn new(selector: &Selector<SelectorImpl>, hashes: &AncestorHashes) -> Self { - // We basically want to check whether the first combinator is a - // pseudo-element combinator. If it is, we want to use the offset one - // past it. Otherwise, our offset is 0. - let mut index = 0; - let mut iter = selector.iter(); - - // First skip over the first ComplexSelector. We can't check what sort - // of combinator we have until we do that. - for _ in &mut iter { - index += 1; // Simple selector - } + fn new(selector: Selector<SelectorImpl>, hashes: AncestorHashes) -> Self { + let selector_offset = { + // We basically want to check whether the first combinator is a + // pseudo-element combinator. If it is, we want to use the offset + // one past it. Otherwise, our offset is 0. + let mut index = 0; + let mut iter = selector.iter(); + + // First skip over the first ComplexSelector. + // + // We can't check what sort of what combinator we have until we do + // that. + for _ in &mut iter { + index += 1; // Simple selector + } - let offset = match iter.next_sequence() { - Some(Combinator::PseudoElement) => index + 1, // +1 for the combinator - _ => 0 + match iter.next_sequence() { + Some(Combinator::PseudoElement) => index + 1, // +1 for the combinator + _ => 0 + } }; - RevalidationSelectorAndHashes { - selector: selector.clone(), - selector_offset: offset, - hashes: hashes.clone(), - } + RevalidationSelectorAndHashes { selector, selector_offset, hashes, } } } @@ -1468,119 +1436,251 @@ impl SelectorMapEntry for RevalidationSelectorAndHashes { } } -/// Visitor to determine whether a selector requires cache revalidation. -/// -/// Note that we just check simple selectors and eagerly return when the first -/// need for revalidation is found, so we don't need to store state on the -/// visitor. -/// -/// Also, note that it's important to check the whole selector, due to cousins -/// sharing arbitrarily deep in the DOM, not just the rightmost part of it -/// (unfortunately, though). -/// -/// With cousin sharing, we not only need to care about selectors in stuff like -/// foo:first-child, but also about selectors like p:first-child foo, since the -/// two parents may have shared style, and in that case we can test cousins -/// whose matching depends on the selector up in the chain. -/// -/// TODO(emilio): We can optimize when matching only siblings to only match the -/// rightmost selector until a descendant combinator is found, I guess, and in -/// general when we're sharing at depth `n`, to the `n + 1` sequences of -/// descendant combinators. -/// -/// I don't think that in presence of the bloom filter it's worth it, though. -struct RevalidationVisitor; +/// A selector visitor implementation that collects all the state the Stylist +/// cares about a selector. +struct StylistSelectorVisitor<'a> { + /// Whether the selector needs revalidation for the style sharing cache. + needs_revalidation: bool, + /// Whether we've past the rightmost compound selector, not counting + /// pseudo-elements. + passed_rightmost_selector: bool, + /// The filter with all the id's getting referenced from rightmost + /// selectors. + mapped_ids: &'a mut BloomFilter, + /// The filter with the local names of attributes there are selectors for. + attribute_dependencies: &'a mut BloomFilter, + /// Whether there's any attribute selector for the [style] attribute. + style_attribute_dependency: &'a mut bool, + /// All the states selectors in the page reference. + state_dependencies: &'a mut ElementState, +} -impl SelectorVisitor for RevalidationVisitor { - type Impl = SelectorImpl; +fn component_needs_revalidation( + c: &Component<SelectorImpl>, + passed_rightmost_selector: bool, +) -> bool { + match *c { + Component::ID(_) => { + // TODO(emilio): This could also check that the ID is not already in + // the rule hash. In that case, we could avoid making this a + // revalidation selector too. + // + // See https://bugzilla.mozilla.org/show_bug.cgi?id=1369611 + passed_rightmost_selector + } + Component::AttributeInNoNamespaceExists { .. } | + Component::AttributeInNoNamespace { .. } | + Component::AttributeOther(_) | + Component::Empty | + Component::FirstChild | + Component::LastChild | + Component::OnlyChild | + Component::NthChild(..) | + Component::NthLastChild(..) | + Component::NthOfType(..) | + Component::NthLastOfType(..) | + Component::FirstOfType | + Component::LastOfType | + Component::OnlyOfType => { + true + }, + Component::NonTSPseudoClass(ref p) => { + p.needs_cache_revalidation() + }, + _ => { + false + } + } +} +impl<'a> SelectorVisitor for StylistSelectorVisitor<'a> { + type Impl = SelectorImpl; - fn visit_complex_selector(&mut self, - _: SelectorIter<SelectorImpl>, - combinator: Option<Combinator>) -> bool { - let is_sibling_combinator = - combinator.map_or(false, |c| c.is_sibling()); + fn visit_complex_selector( + &mut self, + _: SelectorIter<SelectorImpl>, + combinator: Option<Combinator> + ) -> bool { + self.needs_revalidation = + self.needs_revalidation || combinator.map_or(false, |c| c.is_sibling()); + + // NOTE(emilio): This works properly right now because we can't store + // complex selectors in nested selectors, otherwise we may need to + // rethink this. + // + // Also, note that this call happens before we visit any of the simple + // selectors in the next ComplexSelector, so we can use this to skip + // looking at them. + self.passed_rightmost_selector = + self.passed_rightmost_selector || + !matches!(combinator, None | Some(Combinator::PseudoElement)); - !is_sibling_combinator + true } + fn visit_attribute_selector( + &mut self, + _ns: &NamespaceConstraint<&Namespace>, + name: &LocalName, + lower_name: &LocalName + ) -> bool { + if *lower_name == local_name!("style") { + *self.style_attribute_dependency = true; + } else { + self.attribute_dependencies.insert_hash(name.get_hash()); + self.attribute_dependencies.insert_hash(lower_name.get_hash()); + } + true + } - /// Check whether sequence of simple selectors containing this simple - /// selector to be explicitly matched against both the style sharing cache - /// entry and the candidate. - /// - /// We use this for selectors that can have different matching behavior - /// between siblings that are otherwise identical as far as the cache is - /// concerned. fn visit_simple_selector(&mut self, s: &Component<SelectorImpl>) -> bool { + self.needs_revalidation = + self.needs_revalidation || + component_needs_revalidation(s, self.passed_rightmost_selector); + match *s { - Component::AttributeInNoNamespaceExists { .. } | - Component::AttributeInNoNamespace { .. } | - Component::AttributeOther(_) | - Component::Empty | - // FIXME(bz) We really only want to do this for some cases of id - // selectors. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=1369611 - Component::ID(_) | - Component::FirstChild | - Component::LastChild | - Component::OnlyChild | - Component::NthChild(..) | - Component::NthLastChild(..) | - Component::NthOfType(..) | - Component::NthLastOfType(..) | - Component::FirstOfType | - Component::LastOfType | - Component::OnlyOfType => { - false - }, Component::NonTSPseudoClass(ref p) => { - !p.needs_cache_revalidation() - }, - _ => { - true + self.state_dependencies.insert(p.state_flag()); + } + Component::ID(ref id) if !self.passed_rightmost_selector => { + // We want to stop storing mapped ids as soon as we've moved off + // the rightmost ComplexSelector that is not a pseudo-element. + // + // That can be detected by a visit_complex_selector call with a + // combinator other than None and PseudoElement. + // + // Importantly, this call happens before we visit any of the + // simple selectors in that ComplexSelector. + // + // NOTE(emilio): See the comment regarding on when this may + // break in visit_complex_selector. + self.mapped_ids.insert_hash(id.get_hash()); } + _ => {}, } - } -} -/// Returns true if the given selector needs cache revalidation. -pub fn needs_revalidation(selector: &Selector<SelectorImpl>) -> bool { - let mut visitor = RevalidationVisitor; - !selector.visit(&mut visitor) + true + } } -/// Map that contains the CSS rules for a specific PseudoElement -/// (or lack of PseudoElement). +/// Data resulting from performing the CSS cascade. #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Debug)] -struct PerPseudoElementSelectorMap { +struct CascadeData { /// Rules from user agent stylesheets - user_agent: SelectorMap<Rule>, + user_agent: PerOriginCascadeData, /// Rules from author stylesheets - author: SelectorMap<Rule>, + author: PerOriginCascadeData, /// Rules from user stylesheets - user: SelectorMap<Rule>, + user: PerOriginCascadeData, } -impl PerPseudoElementSelectorMap { - #[inline] +impl CascadeData { fn new() -> Self { - PerPseudoElementSelectorMap { - user_agent: SelectorMap::new(), - author: SelectorMap::new(), - user: SelectorMap::new(), + CascadeData { + user_agent: PerOriginCascadeData::new(), + author: PerOriginCascadeData::new(), + user: PerOriginCascadeData::new(), } } #[inline] - fn borrow_for_origin(&mut self, origin: &Origin) -> &mut SelectorMap<Rule> { + fn borrow_mut_for_origin(&mut self, origin: &Origin) -> &mut PerOriginCascadeData { match *origin { Origin::UserAgent => &mut self.user_agent, Origin::Author => &mut self.author, Origin::User => &mut self.user, } } + + fn clear(&mut self) { + self.user_agent.clear(); + self.author.clear(); + self.user.clear(); + } + + fn has_rules_for_pseudo(&self, pseudo: &PseudoElement) -> bool { + self.iter_origins().any(|d| d.has_rules_for_pseudo(pseudo)) + } + + fn iter_origins(&self) -> CascadeDataIter { + CascadeDataIter { + cascade_data: &self, + cur: 0, + } + } +} + +struct CascadeDataIter<'a> { + cascade_data: &'a CascadeData, + cur: usize, +} + +impl<'a> Iterator for CascadeDataIter<'a> { + type Item = &'a PerOriginCascadeData; + + fn next(&mut self) -> Option<&'a PerOriginCascadeData> { + let result = match self.cur { + 0 => &self.cascade_data.user_agent, + 1 => &self.cascade_data.author, + 2 => &self.cascade_data.user, + _ => return None, + }; + self.cur += 1; + Some(result) + } +} + +/// Data resulting from performing the CSS cascade that is specific to a given +/// origin. +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Debug)] +struct PerOriginCascadeData { + /// Rules from stylesheets at this `CascadeData`'s origin. + element_map: SelectorMap<Rule>, + + /// Rules from stylesheets at this `CascadeData`'s origin that correspond + /// to a given pseudo-element. + pseudos_map: FnvHashMap<PseudoElement, SelectorMap<Rule>>, +} + +impl PerOriginCascadeData { + fn new() -> Self { + Self { + element_map: SelectorMap::new(), + pseudos_map: Default::default(), + } + } + + #[inline] + fn borrow_for_pseudo(&self, pseudo: Option<&PseudoElement>) -> Option<&SelectorMap<Rule>> { + match pseudo { + Some(pseudo) => self.pseudos_map.get(&pseudo.canonical()), + None => Some(&self.element_map), + } + } + + #[inline] + fn borrow_mut_for_pseudo_or_insert(&mut self, pseudo: Option<&PseudoElement>) -> &mut SelectorMap<Rule> { + match pseudo { + Some(pseudo) => { + self.pseudos_map + .entry(pseudo.canonical()) + .or_insert_with(SelectorMap::new) + } + None => &mut self.element_map, + } + } + + fn clear(&mut self) { + *self = Self::new(); + } + + fn has_rules_for_pseudo(&self, pseudo: &PseudoElement) -> bool { + // FIXME(emilio): We should probably make the pseudos map be an + // enumerated array. + self.pseudos_map.contains_key(pseudo) + } } /// A rule, that wraps a style rule, but represents a single selector of the @@ -1645,3 +1745,21 @@ impl Rule { } } } + +/// A function to be able to test the revalidation stuff. +pub fn needs_revalidation_for_testing(s: &Selector<SelectorImpl>) -> bool { + let mut attribute_dependencies = BloomFilter::new(); + let mut mapped_ids = BloomFilter::new(); + let mut style_attribute_dependency = false; + let mut state_dependencies = ElementState::empty(); + let mut visitor = StylistSelectorVisitor { + needs_revalidation: false, + passed_rightmost_selector: false, + attribute_dependencies: &mut attribute_dependencies, + style_attribute_dependency: &mut style_attribute_dependency, + state_dependencies: &mut state_dependencies, + mapped_ids: &mut mapped_ids, + }; + s.visit(&mut visitor); + visitor.needs_revalidation +} diff --git a/components/style/traversal.rs b/components/style/traversal.rs index 1f917aaee2a..cd90f568753 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -12,7 +12,11 @@ use matching::{ChildCascadeRequirement, MatchMethods}; use sharing::StyleSharingTarget; use smallvec::SmallVec; use style_resolver::StyleResolverForElement; +#[cfg(feature = "servo")] use style_traits::ToCss; use stylist::RuleInclusion; +use traversal_flags::{TraversalFlags, self}; +#[cfg(feature = "servo")] use values::Either; +#[cfg(feature = "servo")] use values::generics::image::Image; /// A per-traversal-level chunk of data. This is sent down by the traversal, and /// currently only holds the dom depth for the bloom filter. @@ -27,45 +31,6 @@ pub struct PerLevelTraversalData { pub current_dom_depth: usize, } -bitflags! { - /// Flags that control the traversal process. - pub flags TraversalFlags: u8 { - /// Traverse only unstyled children. - const UNSTYLED_CHILDREN_ONLY = 0x01, - /// Traverse only elements for animation restyles. - const ANIMATION_ONLY = 0x02, - /// Traverse without generating any change hints. - const FOR_RECONSTRUCT = 0x04, - /// Traverse triggered by CSS rule changes. - /// - /// Traverse and update all elements with CSS animations since - /// @keyframes rules may have changed - const FOR_CSS_RULE_CHANGES = 0x08, - } -} - -impl TraversalFlags { - /// Returns true if the traversal is for animation-only restyles. - pub fn for_animation_only(&self) -> bool { - self.contains(ANIMATION_ONLY) - } - - /// Returns true if the traversal is for unstyled children. - pub fn for_unstyled_children_only(&self) -> bool { - self.contains(UNSTYLED_CHILDREN_ONLY) - } - - /// Returns true if the traversal is for a frame reconstruction. - pub fn for_reconstruct(&self) -> bool { - self.contains(FOR_RECONSTRUCT) - } - - /// Returns true if the traversal is triggered by CSS rule changes. - pub fn for_css_rule_changes(&self) -> bool { - self.contains(FOR_CSS_RULE_CHANGES) - } -} - /// This structure exists to enforce that callers invoke pre_traverse, and also /// to pass information from the pre-traversal into the primary traversal. pub struct PreTraverseToken { @@ -208,12 +173,7 @@ pub trait DomTraversal<E: TElement> : Sync { shared_context: &SharedStyleContext, traversal_flags: TraversalFlags ) -> PreTraverseToken { - debug_assert!(!(traversal_flags.for_reconstruct() && - traversal_flags.for_unstyled_children_only()), - "must not specify FOR_RECONSTRUCT in combination with \ - UNSTYLED_CHILDREN_ONLY"); - - if traversal_flags.for_unstyled_children_only() { + if traversal_flags.contains(traversal_flags::UnstyledChildrenOnly) { if root.borrow_data().map_or(true, |d| d.has_styles() && d.styles.is_display_none()) { return PreTraverseToken { traverse: false, @@ -281,10 +241,6 @@ pub trait DomTraversal<E: TElement> : Sync { return true; } - if traversal_flags.for_reconstruct() { - return true; - } - // If the element is native-anonymous and an ancestor frame will be // reconstructed, the child and all its descendants will be destroyed. // In that case, we wouldn't need to traverse the subtree... @@ -356,9 +312,11 @@ pub trait DomTraversal<E: TElement> : Sync { // to traverse any element with damage so that we can perform fixup / // reconstruction on our way back up the tree. // - // We also need to traverse nodes with explicit damage and no other - // restyle data, so that this damage can be cleared. - if (cfg!(feature = "servo") || traversal_flags.for_reconstruct()) && + // In aggressively forgetful traversals (where we seek out and clear damage + // in addition to not computing it) we also need to traverse nodes with + // explicit damage and no other restyle data, so that this damage can be cleared. + if (cfg!(feature = "servo") || + traversal_flags.contains(traversal_flags::AggressivelyForgetful)) && !data.restyle.damage.is_empty() { return true; } @@ -433,6 +391,7 @@ pub fn resolve_style<E>( context: &mut StyleContext<E>, element: E, rule_inclusion: RuleInclusion, + ignore_existing_style: bool, ) -> ElementStyles where E: TElement, @@ -440,6 +399,7 @@ where use style_resolver::StyleResolverForElement; debug_assert!(rule_inclusion == RuleInclusion::DefaultOnly || + ignore_existing_style || element.borrow_data().map_or(true, |d| !d.has_styles()), "Why are we here?"); let mut ancestors_requiring_style_resolution = SmallVec::<[E; 16]>::new(); @@ -450,7 +410,7 @@ where let mut style = None; let mut ancestor = element.traversal_parent(); while let Some(current) = ancestor { - if rule_inclusion == RuleInclusion::All { + if rule_inclusion == RuleInclusion::All && !ignore_existing_style { if let Some(data) = current.borrow_data() { if let Some(ancestor_style) = data.styles.get_primary() { style = Some(ancestor_style.clone()); @@ -563,6 +523,14 @@ where element); clear_descendant_data(element) } + + // Inform any paint worklets of changed style, to speculatively + // evaluate the worklet code. In the case that the size hasn't changed, + // this will result in increased concurrency between script and layout. + notify_paint_worklet(context, data); + } else { + debug_assert!(data.has_styles()); + data.restyle.set_traversed_without_styling(); } // Now that matching and cascading is done, clear the bits corresponding to @@ -608,7 +576,6 @@ where // * We generated a reconstruct hint on self (which could mean that we // switched from display:none to something else, which means the children // need initial styling). - // * This is a reconstruct traversal. // * This is a servo non-incremental traversal. // // Additionally, there are a few scenarios where we avoid traversing the @@ -618,7 +585,6 @@ where !propagated_hint.is_empty() || context.thread_local.is_initial_style() || data.restyle.reconstructed_self() || - flags.for_reconstruct() || is_servo_nonincremental_layout(); traverse_children = traverse_children && @@ -636,17 +602,18 @@ where ); } - // If we are in a restyle for reconstruction, drop the existing restyle + // If we are in a forgetful traversal, drop the existing restyle // data here, since we won't need to perform a post-traversal to pick up // any change hints. - if context.shared.traversal_flags.for_reconstruct() { + if flags.contains(traversal_flags::Forgetful) { data.clear_restyle_state(); } // There are two cases when we want to clear the dity descendants bit here - // after styling this element. + // after styling this element. The first case is when we were explicitly + // asked to clear the bit by the caller. // - // The first case is when this element is the root of a display:none + // The second case is when this element is the root of a display:none // subtree, even if the style didn't change (since, if the style did change, // we'd have already cleared it above). // @@ -655,14 +622,16 @@ where // moderately expensive). Instead, DOM implementations can unconditionally // set the dirty descendants bit on any styled parent, and let the traversal // sort it out. - // - // The second case is when we are in a restyle for reconstruction, where we - // won't need to perform a post-traversal to pick up any change hints. - if data.styles.is_display_none() || - context.shared.traversal_flags.for_reconstruct() { + if flags.contains(traversal_flags::ClearDirtyDescendants) || + data.styles.is_display_none() { unsafe { element.unset_dirty_descendants(); } } + // Similarly, check if we're supposed to clear the animation bit. + if flags.contains(traversal_flags::ClearAnimationOnlyDirtyDescendants) { + unsafe { element.unset_animation_only_dirty_descendants(); } + } + context.thread_local.end_element(element); } @@ -759,6 +728,46 @@ where ) } +#[cfg(feature = "servo")] +fn notify_paint_worklet<E>(context: &StyleContext<E>, data: &ElementData) +where + E: TElement, +{ + // We speculatively evaluate any paint worklets during styling. + // This allows us to run paint worklets in parallel with style and layout. + // Note that this is wasted effort if the size of the node has + // changed, but in may cases it won't have. + if let Some(ref values) = data.styles.primary { + for image in &values.get_background().background_image.0 { + let (name, arguments) = match *image { + Either::Second(Image::PaintWorklet(ref worklet)) => (&worklet.name, &worklet.arguments), + _ => continue, + }; + let painter = match context.shared.registered_speculative_painters.get(name) { + Some(painter) => painter, + None => continue, + }; + let properties = painter.properties().iter() + .filter_map(|(name, id)| id.as_shorthand().err().map(|id| (name, id))) + .map(|(name, id)| (name.clone(), values.computed_value_to_string(id))) + .collect(); + let arguments = arguments.iter() + .map(|argument| argument.to_css_string()) + .collect(); + debug!("Notifying paint worklet {}.", painter.name()); + painter.speculatively_draw_a_paint_image(properties, arguments); + } + } +} + +#[cfg(feature = "gecko")] +fn notify_paint_worklet<E>(_context: &StyleContext<E>, _data: &ElementData) +where + E: TElement, +{ + // The CSS paint API is Servo-only at the moment +} + fn note_children<E, D, F>( context: &mut StyleContext<E>, element: E, @@ -819,10 +828,9 @@ where // Set the dirty descendants bit on the parent as needed, so that we // can find elements during the post-traversal. // - // If we are in a restyle for reconstruction, there is no need to - // perform a post-traversal, so we don't need to set the dirty - // descendants bit on the parent. - if !flags.for_reconstruct() && !is_initial_style { + // Note that these bits may be cleared again at the bottom of + // recalc_style_at if requested by the caller. + if !is_initial_style { if flags.for_animation_only() { unsafe { element.set_animation_only_dirty_descendants(); } } else { diff --git a/components/style/traversal_flags.rs b/components/style/traversal_flags.rs new file mode 100644 index 00000000000..a2e0cdc7515 --- /dev/null +++ b/components/style/traversal_flags.rs @@ -0,0 +1,72 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//! Flags that control the traversal process. +//! +//! We CamelCase rather than UPPER_CASING so that we can grep for the same +//! strings across gecko and servo. +#![allow(non_upper_case_globals)] + +bitflags! { + /// Flags that control the traversal process. + pub flags TraversalFlags: u32 { + /// Traverse only elements for animation restyles. + const AnimationOnly = 1 << 0, + /// Traverse and update all elements with CSS animations since + /// @keyframes rules may have changed. Triggered by CSS rule changes. + const ForCSSRuleChanges = 1 << 1, + /// Traverse only unstyled children of the root and their descendants. + const UnstyledChildrenOnly = 1 << 2, + /// A forgetful traversal ignores the previous state of the frame tree, and + /// thus does not compute damage or maintain other state describing the styles + /// pre-traversal. A forgetful traversal is usually the right thing if you + /// aren't going to do a post-traversal. + const Forgetful = 1 << 3, + /// Actively seeks out and clears change hints that may have been posted into + /// the tree. Nonsensical without also passing Forgetful. + const AggressivelyForgetful = 1 << 4, + /// Clears the dirty descendants bit in the subtree. + const ClearDirtyDescendants = 1 << 5, + /// Clears the animation-only dirty descendants bit in the subtree. + const ClearAnimationOnlyDirtyDescendants = 1 << 6, + } +} + +/// Asserts that all TraversalFlags flags have a matching ServoTraversalFlags value in gecko. +#[cfg(feature = "gecko")] +#[inline] +pub fn assert_traversal_flags_match() { + use gecko_bindings::structs; + + macro_rules! check_traversal_flags { + ( $( $a:ident => $b:ident ),*, ) => { + if cfg!(debug_assertions) { + let mut modes = TraversalFlags::all(); + $( + assert_eq!(structs::$a as usize, $b.bits() as usize, stringify!($b)); + modes.remove($b); + )* + assert_eq!(modes, TraversalFlags::empty(), "all TraversalFlags bits should have an assertion"); + } + } + } + + check_traversal_flags! { + ServoTraversalFlags_AnimationOnly => AnimationOnly, + ServoTraversalFlags_ForCSSRuleChanges => ForCSSRuleChanges, + ServoTraversalFlags_UnstyledChildrenOnly => UnstyledChildrenOnly, + ServoTraversalFlags_Forgetful => Forgetful, + ServoTraversalFlags_AggressivelyForgetful => AggressivelyForgetful, + ServoTraversalFlags_ClearDirtyDescendants => ClearDirtyDescendants, + ServoTraversalFlags_ClearAnimationOnlyDirtyDescendants => + ClearAnimationOnlyDirtyDescendants, + } +} + +impl TraversalFlags { + /// Returns true if the traversal is for animation-only restyles. + pub fn for_animation_only(&self) -> bool { + self.contains(AnimationOnly) + } +} diff --git a/components/style/values/animated/effects.rs b/components/style/values/animated/effects.rs index cb0fc8799d4..9bd3456d028 100644 --- a/components/style/values/animated/effects.rs +++ b/components/style/values/animated/effects.rs @@ -12,8 +12,8 @@ use std::cmp; #[cfg(not(feature = "gecko"))] use values::Impossible; use values::animated::{ToAnimatedValue, ToAnimatedZero}; -use values::computed::{Angle, Number}; -use values::computed::length::Length; +use values::computed::{Angle, NonNegativeNumber}; +use values::computed::length::{Length, NonNegativeLength}; use values::generics::effects::BoxShadow as GenericBoxShadow; use values::generics::effects::Filter as GenericFilter; use values::generics::effects::SimpleShadow as GenericSimpleShadow; @@ -32,7 +32,7 @@ pub type TextShadowList = ShadowList<SimpleShadow>; pub struct ShadowList<Shadow>(Vec<Shadow>); /// An animated value for a single `box-shadow`. -pub type BoxShadow = GenericBoxShadow<IntermediateColor, Length, Length>; +pub type BoxShadow = GenericBoxShadow<IntermediateColor, Length, NonNegativeLength, Length>; /// An animated value for the `filter` property. #[cfg_attr(feature = "servo", derive(HeapSizeOf))] @@ -41,14 +41,14 @@ pub struct FilterList(pub Vec<Filter>); /// An animated value for a single `filter`. #[cfg(feature = "gecko")] -pub type Filter = GenericFilter<Angle, Number, Length, SimpleShadow>; +pub type Filter = GenericFilter<Angle, NonNegativeNumber, NonNegativeLength, SimpleShadow>; /// An animated value for a single `filter`. #[cfg(not(feature = "gecko"))] -pub type Filter = GenericFilter<Angle, Number, Length, Impossible>; +pub type Filter = GenericFilter<Angle, NonNegativeNumber, NonNegativeLength, Impossible>; /// An animated value for the `drop-shadow()` filter. -pub type SimpleShadow = GenericSimpleShadow<IntermediateColor, Length, Length>; +pub type SimpleShadow = GenericSimpleShadow<IntermediateColor, Length, NonNegativeLength>; impl ToAnimatedValue for ComputedBoxShadowList { type AnimatedValue = BoxShadowList; diff --git a/components/style/values/animated/mod.rs b/components/style/values/animated/mod.rs index 63d85254598..49a53938e1e 100644 --- a/components/style/values/animated/mod.rs +++ b/components/style/values/animated/mod.rs @@ -9,7 +9,17 @@ //! module's raison d'être is to ultimately contain all these types. use app_units::Au; +use smallvec::SmallVec; +use std::cmp::max; use values::computed::Angle as ComputedAngle; +use values::computed::BorderCornerRadius as ComputedBorderCornerRadius; +use values::computed::GreaterThanOrEqualToOneNumber as ComputedGreaterThanOrEqualToOneNumber; +use values::computed::MaxLength as ComputedMaxLength; +use values::computed::MozLength as ComputedMozLength; +use values::computed::NonNegativeAu; +use values::computed::NonNegativeLengthOrPercentage as ComputedNonNegativeLengthOrPercentage; +use values::computed::NonNegativeNumber as ComputedNonNegativeNumber; +use values::computed::PositiveInteger as ComputedPositiveInteger; use values::specified::url::SpecifiedUrl; pub mod effects; @@ -62,6 +72,23 @@ where } } +impl<T> ToAnimatedValue for SmallVec<[T; 1]> +where + T: ToAnimatedValue, +{ + type AnimatedValue = SmallVec<[T::AnimatedValue; 1]>; + + #[inline] + fn to_animated_value(self) -> Self::AnimatedValue { + self.into_iter().map(T::to_animated_value).collect() + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + animated.into_iter().map(T::from_animated_value).collect() + } +} + /// Marker trait for computed values with the same representation during animations. pub trait AnimatedValueAsComputed {} @@ -88,6 +115,149 @@ where } } +impl ToAnimatedValue for ComputedNonNegativeNumber { + type AnimatedValue = Self; + + #[inline] + fn to_animated_value(self) -> Self { + self + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + animated.0.max(0.).into() + } +} + +impl ToAnimatedValue for ComputedGreaterThanOrEqualToOneNumber { + type AnimatedValue = Self; + + #[inline] + fn to_animated_value(self) -> Self { + self + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + animated.0.max(1.).into() + } +} + +impl ToAnimatedValue for NonNegativeAu { + type AnimatedValue = Self; + + #[inline] + fn to_animated_value(self) -> Self { + self + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + max(animated.0, Au(0)).into() + } +} + +impl ToAnimatedValue for ComputedPositiveInteger { + type AnimatedValue = Self; + + #[inline] + fn to_animated_value(self) -> Self { + self + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + max(animated.0, 0).into() + } +} + +impl ToAnimatedValue for ComputedNonNegativeLengthOrPercentage { + type AnimatedValue = Self; + + #[inline] + fn to_animated_value(self) -> Self { + self + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + animated.0.clamp_to_non_negative().into() + } +} + +impl ToAnimatedValue for ComputedBorderCornerRadius { + type AnimatedValue = Self; + + #[inline] + fn to_animated_value(self) -> Self { + self + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + ComputedBorderCornerRadius::new(animated.0.width.clamp_to_non_negative(), + animated.0.height.clamp_to_non_negative()) + } +} + +impl ToAnimatedValue for ComputedMaxLength { + type AnimatedValue = Self; + + #[inline] + fn to_animated_value(self) -> Self { + self + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + use values::computed::{LengthOrPercentageOrNone, Percentage}; + match animated { + ComputedMaxLength::LengthOrPercentageOrNone(lopn) => { + let result = match lopn { + LengthOrPercentageOrNone::Length(au) => { + LengthOrPercentageOrNone::Length(max(au, Au(0))) + }, + LengthOrPercentageOrNone::Percentage(percentage) => { + LengthOrPercentageOrNone::Percentage(Percentage(percentage.0.max(0.))) + } + _ => lopn + }; + ComputedMaxLength::LengthOrPercentageOrNone(result) + }, + _ => animated + } + } +} + +impl ToAnimatedValue for ComputedMozLength { + type AnimatedValue = Self; + + #[inline] + fn to_animated_value(self) -> Self { + self + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + use values::computed::{LengthOrPercentageOrAuto, Percentage}; + match animated { + ComputedMozLength::LengthOrPercentageOrAuto(lopa) => { + let result = match lopa { + LengthOrPercentageOrAuto::Length(au) => { + LengthOrPercentageOrAuto::Length(max(au, Au(0))) + }, + LengthOrPercentageOrAuto::Percentage(percentage) => { + LengthOrPercentageOrAuto::Percentage(Percentage(percentage.0.max(0.))) + } + _ => lopa + }; + ComputedMozLength::LengthOrPercentageOrAuto(result) + }, + _ => animated + } + } +} + /// Returns a value similar to `self` that represents zero. pub trait ToAnimatedZero: Sized { /// Returns a value that, when added with an underlying value, will produce the underlying diff --git a/components/style/values/computed/align.rs b/components/style/values/computed/align.rs new file mode 100644 index 00000000000..3d997915cad --- /dev/null +++ b/components/style/values/computed/align.rs @@ -0,0 +1,75 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//! Values for CSS Box Alignment properties +//! +//! https://drafts.csswg.org/css-align/ + +use std::fmt; +use style_traits::ToCss; +use values::computed::{ComputedValueAsSpecified, Context, ToComputedValue}; +use values::specified; + +pub use super::specified::{AlignItems, AlignJustifyContent, AlignJustifySelf}; + +/// The computed value for the `justify-items` property. +/// +/// Need to carry around both the specified and computed value to handle the +/// special legacy keyword. Sigh. +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +pub struct JustifyItems { + /// The specified value for the property. Can contain `auto`. + pub specified: specified::JustifyItems, + /// The computed value for the property. Cannot contain `auto`. + pub computed: specified::JustifyItems, +} + +impl ToCss for JustifyItems { + fn to_css<W>(&self, dest: &mut W) -> fmt::Result + where W: fmt::Write, + { + self.computed.to_css(dest) + } +} + +impl JustifyItems { + /// Returns the `auto` value. + pub fn auto() -> Self { + Self { + specified: specified::JustifyItems::auto(), + computed: specified::JustifyItems::normal(), + } + } +} + +impl ToComputedValue for specified::JustifyItems { + type ComputedValue = JustifyItems; + + /// https://drafts.csswg.org/css-align/#valdef-justify-items-legacy + fn to_computed_value(&self, _context: &Context) -> JustifyItems { + use values::specified::align; + let specified = *self; + let computed = + if self.0 != align::ALIGN_AUTO { + *self + } else { + // If the inherited value of `justify-items` includes the + // `legacy` keyword, `auto` computes to the inherited value, + // but we assume it computes to `normal`, and handle that + // special-case in StyleAdjuster. + Self::normal() + }; + + JustifyItems { specified, computed } + } + + #[inline] + fn from_computed_value(computed: &JustifyItems) -> Self { + computed.specified + } +} + +impl ComputedValueAsSpecified for AlignItems {} +impl ComputedValueAsSpecified for AlignJustifyContent {} +impl ComputedValueAsSpecified for AlignJustifySelf {} diff --git a/components/style/values/computed/background.rs b/components/style/values/computed/background.rs index a1de43c5fe6..d2781ac1891 100644 --- a/components/style/values/computed/background.rs +++ b/components/style/values/computed/background.rs @@ -5,7 +5,8 @@ //! Computed types for CSS values related to backgrounds. use properties::animated_properties::{Animatable, RepeatableListAnimatable}; -use values::animated::ToAnimatedZero; +use properties::longhands::background_size::computed_value::T as BackgroundSizeList; +use values::animated::{ToAnimatedValue, ToAnimatedZero}; use values::computed::length::LengthOrPercentageOrAuto; use values::generics::background::BackgroundSize as GenericBackgroundSize; @@ -56,3 +57,52 @@ impl ToAnimatedZero for BackgroundSize { #[inline] fn to_animated_zero(&self) -> Result<Self, ()> { Err(()) } } + +impl ToAnimatedValue for BackgroundSize { + type AnimatedValue = Self; + + #[inline] + fn to_animated_value(self) -> Self { + self + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + use app_units::Au; + use values::computed::Percentage; + let clamp_animated_value = |value: LengthOrPercentageOrAuto| -> LengthOrPercentageOrAuto { + match value { + LengthOrPercentageOrAuto::Length(len) => { + LengthOrPercentageOrAuto::Length(Au(::std::cmp::max(len.0, 0))) + }, + LengthOrPercentageOrAuto::Percentage(percent) => { + LengthOrPercentageOrAuto::Percentage(Percentage(percent.0.max(0.))) + }, + _ => value + } + }; + match animated { + GenericBackgroundSize::Explicit { width, height } => { + GenericBackgroundSize::Explicit { + width: clamp_animated_value(width), + height: clamp_animated_value(height) + } + }, + _ => animated + } + } +} + +impl ToAnimatedValue for BackgroundSizeList { + type AnimatedValue = Self; + + #[inline] + fn to_animated_value(self) -> Self { + self + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + BackgroundSizeList(ToAnimatedValue::from_animated_value(animated.0)) + } +} diff --git a/components/style/values/computed/effects.rs b/components/style/values/computed/effects.rs index b718ea7f265..fb87c58bf6f 100644 --- a/components/style/values/computed/effects.rs +++ b/components/style/values/computed/effects.rs @@ -6,23 +6,23 @@ #[cfg(not(feature = "gecko"))] use values::Impossible; -use values::computed::{Angle, Number}; +use values::computed::{Angle, NonNegativeNumber}; use values::computed::color::Color; -use values::computed::length::Length; +use values::computed::length::{Length, NonNegativeLength}; use values::generics::effects::BoxShadow as GenericBoxShadow; use values::generics::effects::Filter as GenericFilter; use values::generics::effects::SimpleShadow as GenericSimpleShadow; /// A computed value for a single shadow of the `box-shadow` property. -pub type BoxShadow = GenericBoxShadow<Color, Length, Length>; +pub type BoxShadow = GenericBoxShadow<Color, Length, NonNegativeLength, Length>; /// A computed value for a single `filter`. #[cfg(feature = "gecko")] -pub type Filter = GenericFilter<Angle, Number, Length, SimpleShadow>; +pub type Filter = GenericFilter<Angle, NonNegativeNumber, NonNegativeLength, SimpleShadow>; /// A computed value for a single `filter`. #[cfg(not(feature = "gecko"))] -pub type Filter = GenericFilter<Angle, Number, Length, Impossible>; +pub type Filter = GenericFilter<Angle, NonNegativeNumber, NonNegativeLength, Impossible>; /// A computed value for the `drop-shadow()` filter. -pub type SimpleShadow = GenericSimpleShadow<Color, Length, Length>; +pub type SimpleShadow = GenericSimpleShadow<Color, Length, NonNegativeLength>; diff --git a/components/style/values/computed/length.rs b/components/style/values/computed/length.rs index 8682487f47d..b3b7af805fd 100644 --- a/components/style/values/computed/length.rs +++ b/components/style/values/computed/length.rs @@ -11,6 +11,8 @@ use style_traits::ToCss; use style_traits::values::specified::AllowedLengthType; use super::{Number, ToComputedValue, Context}; use values::{Auto, CSSFloat, Either, ExtremumLength, None_, Normal, specified}; +use values::computed::{NonNegativeAu, NonNegativeNumber}; +use values::generics::NonNegative; use values::specified::length::{AbsoluteLength, FontBaseSize, FontRelativeLength}; use values::specified::length::ViewportPercentageLength; @@ -71,7 +73,7 @@ impl ToComputedValue for specified::NoCalcLength { specified::NoCalcLength::ViewportPercentage(length) => length.to_computed_value(context.viewport_size()), specified::NoCalcLength::ServoCharacterWidth(length) => - length.to_computed_value(context.style().get_font().clone_font_size()), + length.to_computed_value(context.style().get_font().clone_font_size().0), #[cfg(feature = "gecko")] specified::NoCalcLength::Physical(length) => length.to_computed_value(context), @@ -228,14 +230,14 @@ impl ToCss for CalcLengthOrPercentage { } } -impl ToComputedValue for specified::CalcLengthOrPercentage { - type ComputedValue = CalcLengthOrPercentage; - - fn to_computed_value(&self, context: &Context) -> CalcLengthOrPercentage { +impl specified::CalcLengthOrPercentage { + /// Compute the value, zooming any absolute units by the zoom function. + fn to_computed_value_with_zoom<F>(&self, context: &Context, zoom_fn: F) -> CalcLengthOrPercentage + where F: Fn(Au) -> Au { let mut length = Au(0); if let Some(absolute) = self.absolute { - length += absolute; + length += zoom_fn(absolute); } for val in &[self.vw.map(ViewportPercentageLength::Vw), @@ -263,6 +265,19 @@ impl ToComputedValue for specified::CalcLengthOrPercentage { } } + /// Compute font-size or line-height taking into account text-zoom if necessary. + pub fn to_computed_value_zoomed(&self, context: &Context) -> CalcLengthOrPercentage { + self.to_computed_value_with_zoom(context, |abs| context.maybe_zoom_text(abs.into()).0) + } +} + +impl ToComputedValue for specified::CalcLengthOrPercentage { + type ComputedValue = CalcLengthOrPercentage; + + fn to_computed_value(&self, context: &Context) -> CalcLengthOrPercentage { + self.to_computed_value_with_zoom(context, |abs| abs) + } + #[inline] fn from_computed_value(computed: &CalcLengthOrPercentage) -> Self { specified::CalcLengthOrPercentage { @@ -336,6 +351,20 @@ impl LengthOrPercentage { }, } } + + /// Returns the clamped non-negative values. + #[inline] + pub fn clamp_to_non_negative(self) -> Self { + match self { + LengthOrPercentage::Length(length) => { + LengthOrPercentage::Length(Au(::std::cmp::max(length.0, 0))) + }, + LengthOrPercentage::Percentage(percentage) => { + LengthOrPercentage::Percentage(Percentage(percentage.0.max(0.))) + }, + _ => self + } + } } impl fmt::Debug for LengthOrPercentage { @@ -537,6 +566,43 @@ impl ToComputedValue for specified::LengthOrPercentageOrNone { } } +/// A wrapper of LengthOrPercentage, whose value must be >= 0. +pub type NonNegativeLengthOrPercentage = NonNegative<LengthOrPercentage>; + +impl From<NonNegativeAu> for NonNegativeLengthOrPercentage { + #[inline] + fn from(length: NonNegativeAu) -> Self { + LengthOrPercentage::Length(length.0).into() + } +} + +impl From<LengthOrPercentage> for NonNegativeLengthOrPercentage { + #[inline] + fn from(lop: LengthOrPercentage) -> Self { + NonNegative::<LengthOrPercentage>(lop) + } +} + +impl NonNegativeLengthOrPercentage { + /// Get zero value. + #[inline] + pub fn zero() -> Self { + NonNegative::<LengthOrPercentage>(LengthOrPercentage::zero()) + } + + /// Returns true if the computed value is absolute 0 or 0%. + #[inline] + pub fn is_definitely_zero(&self) -> bool { + self.0.is_definitely_zero() + } + + /// Returns the used value. + #[inline] + pub fn to_used_value(&self, containing_length: Au) -> Au { + self.0.to_used_value(containing_length) + } +} + /// A computed `<length>` value. pub type Length = Au; @@ -560,8 +626,20 @@ impl LengthOrNumber { /// Either a computed `<length>` or the `normal` keyword. pub type LengthOrNormal = Either<Length, Normal>; +/// A wrapper of Length, whose value must be >= 0. +pub type NonNegativeLength = NonNegativeAu; + +/// Either a computed NonNegativeLength or the `auto` keyword. +pub type NonNegativeLengthOrAuto = Either<NonNegativeLength, Auto>; + +/// Either a computed NonNegativeLength or the `normal` keyword. +pub type NonNegativeLengthOrNormal = Either<NonNegativeLength, Normal>; + +/// Either a computed NonNegativeLength or a NonNegativeNumber value. +pub type NonNegativeLengthOrNumber = Either<NonNegativeLength, NonNegativeNumber>; + /// A value suitable for a `min-width`, `min-height`, `width` or `height` property. -/// See specified/values/length.rs for more details. +/// See values/specified/length.rs for more details. #[allow(missing_docs)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Clone, Copy, Debug, PartialEq, ToCss)] @@ -605,7 +683,7 @@ impl ToComputedValue for specified::MozLength { } /// A value suitable for a `max-width` or `max-height` property. -/// See specified/values/length.rs for more details. +/// See values/specified/length.rs for more details. #[allow(missing_docs)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Clone, Copy, Debug, PartialEq, ToCss)] diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index b8a1f1bcb8a..8cbcbca7eea 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -17,7 +17,8 @@ use std::f64; use std::f64::consts::PI; use std::fmt; use style_traits::ToCss; -use super::{CSSFloat, CSSInteger, RGBA}; +use super::{CSSFloat, CSSInteger}; +use super::generics::{GreaterThanOrEqualToOne, NonNegative}; use super::generics::grid::{TrackBreadth as GenericTrackBreadth, TrackSize as GenericTrackSize}; use super::generics::grid::GridTemplateComponent as GenericGridTemplateComponent; use super::generics::grid::TrackList as GenericTrackList; @@ -25,6 +26,8 @@ use super::specified; pub use app_units::Au; pub use properties::animated_properties::TransitionProperty; +#[cfg(feature = "gecko")] +pub use self::align::{AlignItems, AlignJustifyContent, AlignJustifySelf, JustifyItems}; pub use self::background::BackgroundSize; pub use self::border::{BorderImageSlice, BorderImageWidth, BorderImageSideWidth}; pub use self::border::{BorderRadius, BorderCornerRadius}; @@ -36,17 +39,19 @@ pub use self::image::{Gradient, GradientItem, Image, ImageLayer, LineDirection, pub use self::gecko::ScrollSnapPoint; pub use self::rect::LengthOrNumberRect; pub use super::{Auto, Either, None_}; -#[cfg(feature = "gecko")] -pub use super::specified::{AlignItems, AlignJustifyContent, AlignJustifySelf, JustifyItems}; pub use super::specified::{BorderStyle, UrlOrNone}; pub use super::generics::grid::GridLine; pub use super::specified::url::SpecifiedUrl; pub use self::length::{CalcLengthOrPercentage, Length, LengthOrNone, LengthOrNumber, LengthOrPercentage}; pub use self::length::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone, MaxLength, MozLength, Percentage}; +pub use self::length::NonNegativeLengthOrPercentage; pub use self::position::Position; +pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind, SVGStrokeDashArray, SVGWidth}; pub use self::text::{InitialLetter, LetterSpacing, LineHeight, WordSpacing}; pub use self::transform::{TimingFunction, TransformOrigin}; +#[cfg(feature = "gecko")] +pub mod align; pub mod background; pub mod basic_shape; pub mod border; @@ -59,6 +64,7 @@ pub mod gecko; pub mod length; pub mod position; pub mod rect; +pub mod svg; pub mod text; pub mod transform; @@ -95,6 +101,12 @@ pub struct Context<'a> { /// The quirks mode of this context. pub quirks_mode: QuirksMode, + + /// Whether this computation is being done for a SMIL animation. + /// + /// This is used to allow certain properties to generate out-of-range + /// values, which SMIL allows. + pub for_smil_animation: bool, } impl<'a> Context<'a> { @@ -113,11 +125,6 @@ impl<'a> Context<'a> { self.builder.device.au_viewport_size() } - /// The style we're inheriting from. - pub fn inherited_style(&self) -> &ComputedValues { - self.builder.inherited_style() - } - /// The default computed style we're getting our reset style from. pub fn default_style(&self) -> &ComputedValues { self.builder.default_style() @@ -127,6 +134,26 @@ impl<'a> Context<'a> { pub fn style(&self) -> &StyleBuilder { &self.builder } + + + /// Apply text-zoom if enabled + #[cfg(feature = "gecko")] + pub fn maybe_zoom_text(&self, size: NonNegativeAu) -> NonNegativeAu { + // We disable zoom for <svg:text> by unsetting the + // -x-text-zoom property, which leads to a false value + // in mAllowZoom + if self.style().get_font().gecko.mAllowZoom { + self.device().zoom_text(size.0).into() + } else { + size + } + } + + /// (Servo doesn't do text-zoom) + #[cfg(feature = "servo")] + pub fn maybe_zoom_text(&self, size: NonNegativeAu) -> NonNegativeAu { + size + } } /// An iterator over a slice of computed values @@ -395,40 +422,44 @@ impl ToCss for Time { } } -#[cfg(feature = "gecko")] -impl ToComputedValue for specified::JustifyItems { - type ComputedValue = JustifyItems; - - // https://drafts.csswg.org/css-align/#valdef-justify-items-auto - fn to_computed_value(&self, context: &Context) -> JustifyItems { - use values::specified::align; - // If the inherited value of `justify-items` includes the `legacy` keyword, `auto` computes - // to the inherited value. - if self.0 == align::ALIGN_AUTO { - let inherited = context.inherited_style().get_position().clone_justify_items(); - if inherited.0.contains(align::ALIGN_LEGACY) { - return inherited - } - } - return *self +impl ComputedValueAsSpecified for specified::BorderStyle {} + +/// A `<number>` value. +pub type Number = CSSFloat; + +/// A wrapper of Number, but the value >= 0. +pub type NonNegativeNumber = NonNegative<CSSFloat>; + +impl From<CSSFloat> for NonNegativeNumber { + #[inline] + fn from(number: CSSFloat) -> NonNegativeNumber { + NonNegative::<CSSFloat>(number) } +} +impl From<NonNegativeNumber> for CSSFloat { #[inline] - fn from_computed_value(computed: &JustifyItems) -> Self { - *computed + fn from(number: NonNegativeNumber) -> CSSFloat { + number.0 } } -#[cfg(feature = "gecko")] -impl ComputedValueAsSpecified for specified::AlignItems {} -#[cfg(feature = "gecko")] -impl ComputedValueAsSpecified for specified::AlignJustifyContent {} -#[cfg(feature = "gecko")] -impl ComputedValueAsSpecified for specified::AlignJustifySelf {} -impl ComputedValueAsSpecified for specified::BorderStyle {} +/// A wrapper of Number, but the value >= 1. +pub type GreaterThanOrEqualToOneNumber = GreaterThanOrEqualToOne<CSSFloat>; -/// A `<number>` value. -pub type Number = CSSFloat; +impl From<CSSFloat> for GreaterThanOrEqualToOneNumber { + #[inline] + fn from(number: CSSFloat) -> GreaterThanOrEqualToOneNumber { + GreaterThanOrEqualToOne::<CSSFloat>(number) + } +} + +impl From<GreaterThanOrEqualToOneNumber> for CSSFloat { + #[inline] + fn from(number: GreaterThanOrEqualToOneNumber) -> CSSFloat { + number.0 + } +} #[allow(missing_docs)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] @@ -481,34 +512,25 @@ impl IntegerOrAuto { } } -/// Computed SVG Paint value -pub type SVGPaint = ::values::generics::SVGPaint<RGBA>; -/// Computed SVG Paint Kind value -pub type SVGPaintKind = ::values::generics::SVGPaintKind<RGBA>; +/// A wrapper of Integer, but only accept a value >= 1. +pub type PositiveInteger = GreaterThanOrEqualToOne<CSSInteger>; -impl Default for SVGPaint { - fn default() -> Self { - SVGPaint { - kind: ::values::generics::SVGPaintKind::None, - fallback: None, - } +impl From<CSSInteger> for PositiveInteger { + #[inline] + fn from(int: CSSInteger) -> PositiveInteger { + GreaterThanOrEqualToOne::<CSSInteger>(int) } } -impl SVGPaint { - /// Opaque black color - pub fn black() -> Self { - let rgba = RGBA::from_floats(0., 0., 0., 1.); - SVGPaint { - kind: ::values::generics::SVGPaintKind::Color(rgba), - fallback: None, - } - } -} +/// PositiveInteger | auto +pub type PositiveIntegerOrAuto = Either<PositiveInteger, Auto>; /// <length> | <percentage> | <number> pub type LengthOrPercentageOrNumber = Either<Number, LengthOrPercentage>; +/// NonNegativeLengthOrPercentage | NonNegativeNumber +pub type NonNegativeLengthOrPercentageOrNumber = Either<NonNegativeNumber, NonNegativeLengthOrPercentage>; + #[derive(Clone, PartialEq, Eq, Copy, Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] @@ -586,3 +608,40 @@ impl ClipRectOrAuto { /// <color> | auto pub type ColorOrAuto = Either<Color, Auto>; + +/// A wrapper of Au, but the value >= 0. +pub type NonNegativeAu = NonNegative<Au>; + +impl NonNegativeAu { + /// Return a zero value. + #[inline] + pub fn zero() -> Self { + NonNegative::<Au>(Au(0)) + } + + /// Return a NonNegativeAu from pixel. + #[inline] + pub fn from_px(px: i32) -> Self { + NonNegative::<Au>(Au::from_px(::std::cmp::max(px, 0))) + } + + /// Get the inner value of |NonNegativeAu.0|. + #[inline] + pub fn value(self) -> i32 { + (self.0).0 + } + + /// Scale this NonNegativeAu. + #[inline] + pub fn scale_by(self, factor: f32) -> Self { + // scale this by zero if factor is negative. + NonNegative::<Au>(self.0.scale_by(factor.max(0.))) + } +} + +impl From<Au> for NonNegativeAu { + #[inline] + fn from(au: Au) -> NonNegativeAu { + NonNegative::<Au>(au) + } +} diff --git a/components/style/values/computed/svg.rs b/components/style/values/computed/svg.rs new file mode 100644 index 00000000000..43613baa8c4 --- /dev/null +++ b/components/style/values/computed/svg.rs @@ -0,0 +1,72 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//! Computed types for SVG properties. + +use app_units::Au; +use values::{Either, RGBA}; +use values::computed::{LengthOrPercentageOrNumber, Opacity}; +use values::computed::{NonNegativeAu, NonNegativeLengthOrPercentageOrNumber}; +use values::generics::svg as generic; + +/// Computed SVG Paint value +pub type SVGPaint = generic::SVGPaint<RGBA>; +/// Computed SVG Paint Kind value +pub type SVGPaintKind = generic::SVGPaintKind<RGBA>; + +impl Default for SVGPaint { + fn default() -> Self { + SVGPaint { + kind: generic::SVGPaintKind::None, + fallback: None, + } + } +} + +impl SVGPaint { + /// Opaque black color + pub fn black() -> Self { + let rgba = RGBA::from_floats(0., 0., 0., 1.); + SVGPaint { + kind: generic::SVGPaintKind::Color(rgba), + fallback: None, + } + } +} + +/// <length> | <percentage> | <number> | context-value +pub type SVGLength = generic::SVGLength<LengthOrPercentageOrNumber>; + +impl From<Au> for SVGLength { + fn from(length: Au) -> Self { + generic::SVGLength::Length(Either::Second(length.into())) + } +} + +/// An non-negative wrapper of SVGLength. +pub type SVGWidth = generic::SVGLength<NonNegativeLengthOrPercentageOrNumber>; + +impl From<NonNegativeAu> for SVGWidth { + fn from(length: NonNegativeAu) -> Self { + generic::SVGLength::Length(Either::Second(length.into())) + } +} + +/// [ <length> | <percentage> | <number> ]# | context-value +pub type SVGStrokeDashArray = generic::SVGStrokeDashArray<NonNegativeLengthOrPercentageOrNumber>; + +impl Default for SVGStrokeDashArray { + fn default() -> Self { + generic::SVGStrokeDashArray::Values(vec![]) + } +} + +/// <opacity-value> | context-fill-opacity | context-stroke-opacity +pub type SVGOpacity = generic::SVGOpacity<Opacity>; + +impl Default for SVGOpacity { + fn default() -> Self { + generic::SVGOpacity::Opacity(1.) + } +} diff --git a/components/style/values/computed/text.rs b/components/style/values/computed/text.rs index c6902515c2a..7376616ba5e 100644 --- a/components/style/values/computed/text.rs +++ b/components/style/values/computed/text.rs @@ -4,10 +4,10 @@ //! Computed types for text properties. -use app_units::Au; use properties::animated_properties::Animatable; use values::{CSSInteger, CSSFloat}; use values::animated::ToAnimatedZero; +use values::computed::{NonNegativeAu, NonNegativeNumber}; use values::computed::length::{Length, LengthOrPercentage}; use values::generics::text::InitialLetter as GenericInitialLetter; use values::generics::text::LineHeight as GenericLineHeight; @@ -23,7 +23,7 @@ pub type LetterSpacing = Spacing<Length>; pub type WordSpacing = Spacing<LengthOrPercentage>; /// A computed value for the `line-height` property. -pub type LineHeight = GenericLineHeight<CSSFloat, Au>; +pub type LineHeight = GenericLineHeight<NonNegativeNumber, NonNegativeAu>; impl Animatable for LineHeight { #[inline] diff --git a/components/style/values/generics/effects.rs b/components/style/values/generics/effects.rs index f0a6cbc0b8b..9105123f5ab 100644 --- a/components/style/values/generics/effects.rs +++ b/components/style/values/generics/effects.rs @@ -12,9 +12,9 @@ use values::specified::url::SpecifiedUrl; /// A generic value for a single `box-shadow`. #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Clone, Debug, HasViewportPercentage, PartialEq, ToAnimatedValue)] -pub struct BoxShadow<Color, SizeLength, ShapeLength> { +pub struct BoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> { /// The base shadow. - pub base: SimpleShadow<Color, SizeLength, ShapeLength>, + pub base: SimpleShadow<Color, SizeLength, BlurShapeLength>, /// The spread radius. pub spread: ShapeLength, /// Whether this is an inset box shadow. @@ -77,10 +77,14 @@ pub struct SimpleShadow<Color, SizeLength, ShapeLength> { pub blur: ShapeLength, } -impl<Color, SizeLength, ShapeLength> ToCss for BoxShadow<Color, SizeLength, ShapeLength> +impl<Color, SizeLength, BlurShapeLength, ShapeLength> ToCss for BoxShadow<Color, + SizeLength, + BlurShapeLength, + ShapeLength> where Color: ToCss, SizeLength: ToCss, + BlurShapeLength: ToCss, ShapeLength: ToCss, { fn to_css<W>(&self, dest: &mut W) -> fmt::Result diff --git a/components/style/values/generics/image.rs b/components/style/values/generics/image.rs index 874912aeaf8..5da5a68563c 100644 --- a/components/style/values/generics/image.rs +++ b/components/style/values/generics/image.rs @@ -8,6 +8,7 @@ use Atom; use cssparser::serialize_identifier; +use custom_properties::SpecifiedValue; use std::fmt; use style_traits::{HasViewportPercentage, ToCss}; use values::computed::ComputedValueAsSpecified; @@ -136,17 +137,26 @@ pub struct ColorStop<Color, LengthOrPercentage> { /// Specified values for a paint worklet. /// https://drafts.css-houdini.org/css-paint-api/ -#[derive(Clone, Debug, PartialEq, ToComputedValue)] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct PaintWorklet { /// The name the worklet was registered with. pub name: Atom, + /// The arguments for the worklet. + /// TODO: store a parsed representation of the arguments. + pub arguments: Vec<SpecifiedValue>, } +impl ComputedValueAsSpecified for PaintWorklet {} + impl ToCss for PaintWorklet { fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { dest.write_str("paint(")?; serialize_identifier(&*self.name.to_string(), dest)?; + for argument in &self.arguments { + dest.write_str(", ")?; + argument.to_css(dest)?; + } dest.write_str(")") } } diff --git a/components/style/values/generics/mod.rs b/components/style/values/generics/mod.rs index 1ad56e08d53..f87b7a88de5 100644 --- a/components/style/values/generics/mod.rs +++ b/components/style/values/generics/mod.rs @@ -11,7 +11,6 @@ use parser::{Parse, ParserContext}; use std::fmt; use style_traits::{Comma, OneOrMoreSeparated, ParseError, StyleParseError, ToCss}; use super::CustomIdent; -use values::specified::url::SpecifiedUrl; pub mod background; pub mod basic_shape; @@ -24,6 +23,7 @@ pub mod grid; pub mod image; pub mod position; pub mod rect; +pub mod svg; pub mod text; pub mod transform; @@ -253,89 +253,12 @@ impl ToCss for FontSettingTagFloat { } } +/// A wrapper of Non-negative values. +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, PartialOrd, ToComputedValue, ToCss)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))] +pub struct NonNegative<T>(pub T); -/// An SVG paint value -/// -/// https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] -#[derive(Clone, Debug, PartialEq, ToAnimatedValue, ToComputedValue, ToCss)] -pub struct SVGPaint<ColorType> { - /// The paint source - pub kind: SVGPaintKind<ColorType>, - /// The fallback color - pub fallback: Option<ColorType>, -} - -/// An SVG paint value without the fallback -/// -/// Whereas the spec only allows PaintServer -/// to have a fallback, Gecko lets the context -/// properties have a fallback as well. -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] -#[derive(Clone, Debug, PartialEq, ToAnimatedValue, ToComputedValue, ToCss)] -pub enum SVGPaintKind<ColorType> { - /// `none` - None, - /// `<color>` - Color(ColorType), - /// `url(...)` - PaintServer(SpecifiedUrl), - /// `context-fill` - ContextFill, - /// `context-stroke` - ContextStroke, -} - -impl<ColorType> SVGPaintKind<ColorType> { - /// Parse a keyword value only - fn parse_ident<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { - try_match_ident_ignore_ascii_case! { input.expect_ident()?, - "none" => Ok(SVGPaintKind::None), - "context-fill" => Ok(SVGPaintKind::ContextFill), - "context-stroke" => Ok(SVGPaintKind::ContextStroke), - } - } -} - -/// Parse SVGPaint's fallback. -/// fallback is keyword(none) or Color. -/// https://svgwg.org/svg2-draft/painting.html#SpecifyingPaint -fn parse_fallback<'i, 't, ColorType: Parse>(context: &ParserContext, - input: &mut Parser<'i, 't>) - -> Option<ColorType> { - if input.try(|i| i.expect_ident_matching("none")).is_ok() { - None - } else { - input.try(|i| ColorType::parse(context, i)).ok() - } -} - -impl<ColorType: Parse> Parse for SVGPaint<ColorType> { - fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { - if let Ok(url) = input.try(|i| SpecifiedUrl::parse(context, i)) { - Ok(SVGPaint { - kind: SVGPaintKind::PaintServer(url), - fallback: parse_fallback(context, input), - }) - } else if let Ok(kind) = input.try(SVGPaintKind::parse_ident) { - if let SVGPaintKind::None = kind { - Ok(SVGPaint { - kind: kind, - fallback: None, - }) - } else { - Ok(SVGPaint { - kind: kind, - fallback: parse_fallback(context, input), - }) - } - } else if let Ok(color) = input.try(|i| ColorType::parse(context, i)) { - Ok(SVGPaint { - kind: SVGPaintKind::Color(color), - fallback: None, - }) - } else { - Err(StyleParseError::UnspecifiedError.into()) - } - } -} +/// A wrapper of greater-than-or-equal-to-one values. +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, PartialOrd, ToComputedValue, ToCss)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))] +pub struct GreaterThanOrEqualToOne<T>(pub T); diff --git a/components/style/values/generics/svg.rs b/components/style/values/generics/svg.rs new file mode 100644 index 00000000000..557a63fd24c --- /dev/null +++ b/components/style/values/generics/svg.rs @@ -0,0 +1,153 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//! Generic types for CSS values in SVG + +use cssparser::Parser; +use parser::{Parse, ParserContext}; +use std::fmt; +use style_traits::{ParseError, StyleParseError, ToCss}; +use values::specified::url::SpecifiedUrl; + +/// An SVG paint value +/// +/// https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Clone, Debug, PartialEq, ToAnimatedValue, ToComputedValue, ToCss)] +pub struct SVGPaint<ColorType> { + /// The paint source + pub kind: SVGPaintKind<ColorType>, + /// The fallback color + pub fallback: Option<ColorType>, +} + +/// An SVG paint value without the fallback +/// +/// Whereas the spec only allows PaintServer +/// to have a fallback, Gecko lets the context +/// properties have a fallback as well. +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Clone, Debug, PartialEq, ToAnimatedValue, ToComputedValue, ToCss)] +pub enum SVGPaintKind<ColorType> { + /// `none` + None, + /// `<color>` + Color(ColorType), + /// `url(...)` + PaintServer(SpecifiedUrl), + /// `context-fill` + ContextFill, + /// `context-stroke` + ContextStroke, +} + +impl<ColorType> SVGPaintKind<ColorType> { + /// Parse a keyword value only + fn parse_ident<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { + try_match_ident_ignore_ascii_case! { input.expect_ident()?, + "none" => Ok(SVGPaintKind::None), + "context-fill" => Ok(SVGPaintKind::ContextFill), + "context-stroke" => Ok(SVGPaintKind::ContextStroke), + } + } +} + +/// Parse SVGPaint's fallback. +/// fallback is keyword(none) or Color. +/// https://svgwg.org/svg2-draft/painting.html#SpecifyingPaint +fn parse_fallback<'i, 't, ColorType: Parse>(context: &ParserContext, + input: &mut Parser<'i, 't>) + -> Option<ColorType> { + if input.try(|i| i.expect_ident_matching("none")).is_ok() { + None + } else { + input.try(|i| ColorType::parse(context, i)).ok() + } +} + +impl<ColorType: Parse> Parse for SVGPaint<ColorType> { + fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { + if let Ok(url) = input.try(|i| SpecifiedUrl::parse(context, i)) { + Ok(SVGPaint { + kind: SVGPaintKind::PaintServer(url), + fallback: parse_fallback(context, input), + }) + } else if let Ok(kind) = input.try(SVGPaintKind::parse_ident) { + if let SVGPaintKind::None = kind { + Ok(SVGPaint { + kind: kind, + fallback: None, + }) + } else { + Ok(SVGPaint { + kind: kind, + fallback: parse_fallback(context, input), + }) + } + } else if let Ok(color) = input.try(|i| ColorType::parse(context, i)) { + Ok(SVGPaint { + kind: SVGPaintKind::Color(color), + fallback: None, + }) + } else { + Err(StyleParseError::UnspecifiedError.into()) + } + } +} + +/// An SVG length value supports `context-value` in addition to length. +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Clone, Copy, Debug, PartialEq, HasViewportPercentage, ToAnimatedValue, ToComputedValue, ToCss)] +pub enum SVGLength<LengthType> { + /// `<length> | <percentage> | <number>` + Length(LengthType), + /// `context-value` + ContextValue, +} + +/// Generic value for stroke-dasharray. +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Clone, Debug, PartialEq, HasViewportPercentage, ToAnimatedValue, ToComputedValue)] +pub enum SVGStrokeDashArray<LengthType> { + /// `[ <length> | <percentage> | <number> ]#` + Values(Vec<LengthType>), + /// `context-value` + ContextValue, +} + +impl<LengthType> ToCss for SVGStrokeDashArray<LengthType> where LengthType: ToCss { + fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { + match self { + &SVGStrokeDashArray::Values(ref values) => { + let mut iter = values.iter(); + if let Some(first) = iter.next() { + first.to_css(dest)?; + for item in iter { + dest.write_str(", ")?; + item.to_css(dest)?; + } + Ok(()) + } else { + dest.write_str("none") + } + } + &SVGStrokeDashArray::ContextValue => { + dest.write_str("context-value") + } + } + } +} + +/// An SVG opacity value accepts `context-{fill,stroke}-opacity` in +/// addition to opacity value. +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Clone, Copy, Debug, PartialEq, HasViewportPercentage, ToComputedValue, ToCss)] +pub enum SVGOpacity<OpacityType> { + /// `<opacity-value>` + Opacity(OpacityType), + /// `context-fill-opacity` + ContextFillOpacity, + /// `context-stroke-opacity` + ContextStrokeOpacity, +} diff --git a/components/style/values/generics/text.rs b/components/style/values/generics/text.rs index 995752ce70f..94be4a6db8c 100644 --- a/components/style/values/generics/text.rs +++ b/components/style/values/generics/text.rs @@ -104,7 +104,7 @@ where /// A generic value for the `line-height` property. #[cfg_attr(feature = "servo", derive(HeapSizeOf))] -#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, ToCss)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, ToAnimatedValue, ToCss)] pub enum LineHeight<Number, LengthOrPercentage> { /// `normal` Normal, diff --git a/components/style/values/specified/align.rs b/components/style/values/specified/align.rs index d56c42d639c..dc7fd43ed94 100644 --- a/components/style/values/specified/align.rs +++ b/components/style/values/specified/align.rs @@ -292,6 +292,12 @@ impl JustifyItems { JustifyItems(ALIGN_AUTO) } + /// The value 'normal' + #[inline] + pub fn normal() -> Self { + JustifyItems(ALIGN_NORMAL) + } + /// Whether this value has extra flags. #[inline] pub fn has_extra_flags(self) -> bool { diff --git a/components/style/values/specified/border.rs b/components/style/values/specified/border.rs index 6a6da001db3..419074babe6 100644 --- a/components/style/values/specified/border.rs +++ b/components/style/values/specified/border.rs @@ -4,11 +4,10 @@ //! Specified types for CSS values related to borders. -use app_units::Au; use cssparser::Parser; use parser::{Parse, ParserContext}; use style_traits::ParseError; -use values::computed::{Context, ToComputedValue}; +use values::computed::{Context, NonNegativeAu, ToComputedValue}; use values::generics::border::BorderCornerRadius as GenericBorderCornerRadius; use values::generics::border::BorderImageSideWidth as GenericBorderImageSideWidth; use values::generics::border::BorderImageSlice as GenericBorderImageSlice; @@ -72,7 +71,7 @@ impl Parse for BorderSideWidth { } impl ToComputedValue for BorderSideWidth { - type ComputedValue = Au; + type ComputedValue = NonNegativeAu; #[inline] fn to_computed_value(&self, context: &Context) -> Self::ComputedValue { @@ -84,12 +83,12 @@ impl ToComputedValue for BorderSideWidth { BorderSideWidth::Medium => Length::from_px(3.).to_computed_value(context), BorderSideWidth::Thick => Length::from_px(5.).to_computed_value(context), BorderSideWidth::Length(ref length) => length.to_computed_value(context) - } + }.into() } #[inline] fn from_computed_value(computed: &Self::ComputedValue) -> Self { - BorderSideWidth::Length(ToComputedValue::from_computed_value(computed)) + BorderSideWidth::Length(ToComputedValue::from_computed_value(&computed.0)) } } diff --git a/components/style/values/specified/color.rs b/components/style/values/specified/color.rs index 2f91768cc5c..1b2a8c69707 100644 --- a/components/style/values/specified/color.rs +++ b/components/style/values/specified/color.rs @@ -13,7 +13,7 @@ use parser::{ParserContext, Parse}; use properties::longhands::color::SystemColor; use std::fmt; use std::io::Write; -use style_traits::{ToCss, ParseError, StyleParseError}; +use style_traits::{ToCss, ParseError, StyleParseError, ValueParseError}; use super::AllowQuirks; use values::computed::{Color as ComputedColor, Context, ToComputedValue}; @@ -76,24 +76,28 @@ impl Parse for Color { _ => None, }; input.reset(start_position); - if let Ok(value) = input.try(CSSParserColor::parse) { - Ok(match value { - CSSParserColor::CurrentColor => Color::CurrentColor, - CSSParserColor::RGBA(rgba) => Color::Numeric { - parsed: rgba, - authored: authored, - }, - }) - } else { - #[cfg(feature = "gecko")] { - if let Ok(system) = input.try(SystemColor::parse) { - Ok(Color::System(system)) - } else { - gecko::SpecialColorKeyword::parse(input).map(Color::Special) + match input.try(CSSParserColor::parse) { + Ok(value) => + Ok(match value { + CSSParserColor::CurrentColor => Color::CurrentColor, + CSSParserColor::RGBA(rgba) => Color::Numeric { + parsed: rgba, + authored: authored, + }, + }), + Err(e) => { + #[cfg(feature = "gecko")] { + if let Ok(system) = input.try(SystemColor::parse) { + return Ok(Color::System(system)); + } else if let Ok(c) = gecko::SpecialColorKeyword::parse(input) { + return Ok(Color::Special(c)); + } + } + match e { + BasicParseError::UnexpectedToken(t) => + Err(StyleParseError::ValueError(ValueParseError::InvalidColor(t)).into()), + e => Err(e.into()) } - } - #[cfg(not(feature = "gecko"))] { - Err(StyleParseError::UnspecifiedError.into()) } } } @@ -161,11 +165,13 @@ impl Color { input: &mut Parser<'i, 't>, allow_quirks: AllowQuirks) -> Result<Self, ParseError<'i>> { - input.try(|i| Self::parse(context, i)).or_else(|_| { + input.try(|i| Self::parse(context, i)).or_else(|e| { if !allow_quirks.allowed(context.quirks_mode) { - return Err(StyleParseError::UnspecifiedError.into()); + return Err(e); } - Color::parse_quirky_color(input).map(|rgba| Color::rgba(rgba)) + Color::parse_quirky_color(input) + .map(|rgba| Color::rgba(rgba)) + .map_err(|_| e) }) } diff --git a/components/style/values/specified/effects.rs b/components/style/values/specified/effects.rs index 134827e958e..27bf0f531aa 100644 --- a/components/style/values/specified/effects.rs +++ b/components/style/values/specified/effects.rs @@ -9,28 +9,29 @@ use parser::{Parse, ParserContext}; use style_traits::{ParseError, StyleParseError}; #[cfg(not(feature = "gecko"))] use values::Impossible; -use values::computed::{Context, Number as ComputedNumber, ToComputedValue}; +use values::computed::{Context, NonNegativeNumber as ComputedNonNegativeNumber, ToComputedValue}; use values::computed::effects::BoxShadow as ComputedBoxShadow; use values::computed::effects::SimpleShadow as ComputedSimpleShadow; +use values::generics::NonNegative; use values::generics::effects::BoxShadow as GenericBoxShadow; use values::generics::effects::Filter as GenericFilter; use values::generics::effects::SimpleShadow as GenericSimpleShadow; use values::specified::{Angle, NumberOrPercentage}; use values::specified::color::Color; -use values::specified::length::Length; +use values::specified::length::{Length, NonNegativeLength}; #[cfg(feature = "gecko")] use values::specified::url::SpecifiedUrl; /// A specified value for a single shadow of the `box-shadow` property. -pub type BoxShadow = GenericBoxShadow<Option<Color>, Length, Option<Length>>; +pub type BoxShadow = GenericBoxShadow<Option<Color>, Length, Option<NonNegativeLength>, Option<Length>>; /// A specified value for a single `filter`. #[cfg(feature = "gecko")] -pub type Filter = GenericFilter<Angle, Factor, Length, SimpleShadow>; +pub type Filter = GenericFilter<Angle, Factor, NonNegativeLength, SimpleShadow>; /// A specified value for a single `filter`. #[cfg(not(feature = "gecko"))] -pub type Filter = GenericFilter<Angle, Factor, Length, Impossible>; +pub type Filter = GenericFilter<Angle, Factor, NonNegativeLength, Impossible>; /// A value for the `<factor>` parts in `Filter`. #[derive(Clone, Debug, HasViewportPercentage, PartialEq, ToCss)] @@ -48,25 +49,25 @@ impl Parse for Factor { } impl ToComputedValue for Factor { - type ComputedValue = ComputedNumber; + type ComputedValue = ComputedNonNegativeNumber; #[inline] fn to_computed_value(&self, context: &Context) -> Self::ComputedValue { use values::computed::NumberOrPercentage; match self.0.to_computed_value(context) { - NumberOrPercentage::Number(n) => n, - NumberOrPercentage::Percentage(p) => p.0, + NumberOrPercentage::Number(n) => n.into(), + NumberOrPercentage::Percentage(p) => p.0.into(), } } #[inline] fn from_computed_value(computed: &Self::ComputedValue) -> Self { - Factor(NumberOrPercentage::Number(ToComputedValue::from_computed_value(computed))) + Factor(NumberOrPercentage::Number(ToComputedValue::from_computed_value(&computed.0))) } } /// A specified value for the `drop-shadow()` filter. -pub type SimpleShadow = GenericSimpleShadow<Option<Color>, Length, Option<Length>>; +pub type SimpleShadow = GenericSimpleShadow<Option<Color>, Length, Option<NonNegativeLength>>; impl Parse for BoxShadow { fn parse<'i, 't>( @@ -91,7 +92,7 @@ impl Parse for BoxShadow { let (blur, spread) = match i.try::<_, _, ParseError>(|i| Length::parse_non_negative(context, i)) { Ok(blur) => { let spread = i.try(|i| Length::parse(context, i)).ok(); - (Some(blur), spread) + (Some(blur.into()), spread) }, Err(_) => (None, None), }; @@ -162,7 +163,7 @@ impl Parse for Filter { let function = input.expect_function()?.clone(); input.parse_nested_block(|i| { try_match_ident_ignore_ascii_case! { function, - "blur" => Ok(GenericFilter::Blur(Length::parse_non_negative(context, i)?)), + "blur" => Ok(GenericFilter::Blur((Length::parse_non_negative(context, i)?).into())), "brightness" => Ok(GenericFilter::Brightness(Factor::parse(context, i)?)), "contrast" => Ok(GenericFilter::Contrast(Factor::parse(context, i)?)), "grayscale" => Ok(GenericFilter::Grayscale(Factor::parse(context, i)?)), @@ -192,7 +193,7 @@ impl Parse for SimpleShadow { color: color, horizontal: horizontal, vertical: vertical, - blur: blur, + blur: blur.map(NonNegative::<Length>), }) } } @@ -208,7 +209,7 @@ impl ToComputedValue for SimpleShadow { horizontal: self.horizontal.to_computed_value(context), vertical: self.vertical.to_computed_value(context), blur: - self.blur.as_ref().unwrap_or(&Length::zero()).to_computed_value(context), + self.blur.as_ref().unwrap_or(&NonNegativeLength::zero()).to_computed_value(context), } } diff --git a/components/style/values/specified/image.rs b/components/style/values/specified/image.rs index 840f4ed1cf3..687c6f17d43 100644 --- a/components/style/values/specified/image.rs +++ b/components/style/values/specified/image.rs @@ -9,6 +9,7 @@ use Atom; use cssparser::{Parser, Token, BasicParseError}; +use custom_properties::SpecifiedValue; use parser::{Parse, ParserContext}; use selectors::parser::SelectorParseError; #[cfg(feature = "servo")] @@ -685,14 +686,14 @@ impl LineDirection { input.try(|i| { let to_ident = i.try(|i| i.expect_ident_matching("to")); match *compat_mode { - /// `to` keyword is mandatory in modern syntax. + // `to` keyword is mandatory in modern syntax. CompatMode::Modern => to_ident?, // Fall back to Modern compatibility mode in case there is a `to` keyword. // According to Gecko, `-moz-linear-gradient(to ...)` should serialize like // `linear-gradient(to ...)`. CompatMode::Moz if to_ident.is_ok() => *compat_mode = CompatMode::Modern, - /// There is no `to` keyword in webkit prefixed syntax. If it's consumed, - /// parsing should throw an error. + // There is no `to` keyword in webkit prefixed syntax. If it's consumed, + // parsing should throw an error. CompatMode::WebKit if to_ident.is_ok() => { return Err(SelectorParseError::UnexpectedIdent("to".into()).into()) }, @@ -874,12 +875,17 @@ impl Parse for ColorStop { } impl Parse for PaintWorklet { - fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { + fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { input.expect_function_matching("paint")?; - input.parse_nested_block(|i| { - let name = i.expect_ident()?; + input.parse_nested_block(|input| { + let name = Atom::from(&**input.expect_ident()?); + let arguments = input.try(|input| { + input.expect_comma()?; + input.parse_comma_separated(|input| Ok(*SpecifiedValue::parse(context, input)?)) + }).unwrap_or(vec![]); Ok(PaintWorklet { - name: Atom::from(name.as_ref()), + name: name, + arguments: arguments, }) }) } diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index c3591bdf484..8959743655e 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -21,6 +21,8 @@ use super::{AllowQuirks, Number, ToComputedValue}; use values::{Auto, CSSFloat, Either, FONT_MEDIUM_PX, None_, Normal}; use values::ExtremumLength; use values::computed::{self, Context}; +use values::generics::NonNegative; +use values::specified::NonNegativeNumber; use values::specified::calc::CalcNode; pub use values::specified::calc::CalcLengthOrPercentage; @@ -92,8 +94,8 @@ impl FontBaseSize { pub fn resolve(&self, context: &Context) -> Au { match *self { FontBaseSize::Custom(size) => size, - FontBaseSize::CurrentStyle => context.style().get_font().clone_font_size(), - FontBaseSize::InheritedStyle => context.inherited_style().get_font().clone_font_size(), + FontBaseSize::CurrentStyle => context.style().get_font().clone_font_size().0, + FontBaseSize::InheritedStyle => context.style().get_parent_font().clone_font_size().0, } } } @@ -703,6 +705,57 @@ impl<T: Parse> Either<Length, T> { } } +/// A wrapper of Length, whose value must be >= 0. +pub type NonNegativeLength = NonNegative<Length>; + +impl From<NoCalcLength> for NonNegativeLength { + #[inline] + fn from(len: NoCalcLength) -> Self { + NonNegative::<Length>(Length::NoCalc(len)) + } +} + +impl From<Length> for NonNegativeLength { + #[inline] + fn from(len: Length) -> Self { + NonNegative::<Length>(len) + } +} + +impl<T: Parse> Parse for Either<NonNegativeLength, T> { + #[inline] + fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { + if let Ok(v) = input.try(|input| T::parse(context, input)) { + return Ok(Either::Second(v)); + } + Length::parse_internal(context, input, AllowedLengthType::NonNegative, AllowQuirks::No) + .map(NonNegative::<Length>).map(Either::First) + } +} + +impl NonNegativeLength { + /// Returns a `zero` length. + #[inline] + pub fn zero() -> Self { + Length::zero().into() + } + + /// Get an absolute length from a px value. + #[inline] + pub fn from_px(px_value: CSSFloat) -> Self { + Length::from_px(px_value.max(0.)).into() + } +} + +/// Either a NonNegativeLength or the `normal` keyword. +pub type NonNegativeLengthOrNormal = Either<NonNegativeLength, Normal>; + +/// Either a NonNegativeLength or the `auto` keyword. +pub type NonNegativeLengthOrAuto = Either<NonNegativeLength, Auto>; + +/// Either a NonNegativeLength or a NonNegativeNumber value. +pub type NonNegativeLengthOrNumber = Either<NonNegativeLength, NonNegativeNumber>; + /// A percentage value. #[derive(Clone, Copy, Debug, Default, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] @@ -1185,6 +1238,41 @@ impl Parse for LengthOrPercentageOrNone { } } +/// A wrapper of LengthOrPercentage, whose value must be >= 0. +pub type NonNegativeLengthOrPercentage = NonNegative<LengthOrPercentage>; + +impl From<NoCalcLength> for NonNegativeLengthOrPercentage { + #[inline] + fn from(len: NoCalcLength) -> Self { + NonNegative::<LengthOrPercentage>(LengthOrPercentage::from(len)) + } +} + +impl Parse for NonNegativeLengthOrPercentage { + #[inline] + fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { + LengthOrPercentage::parse_non_negative(context, input).map(NonNegative::<LengthOrPercentage>) + } +} + +impl NonNegativeLengthOrPercentage { + #[inline] + /// Returns a `zero` length. + pub fn zero() -> Self { + NonNegative::<LengthOrPercentage>(LengthOrPercentage::zero()) + } + + /// Parses a length or a percentage, allowing the unitless length quirk. + /// https://quirks.spec.whatwg.org/#the-unitless-length-quirk + #[inline] + pub fn parse_quirky<'i, 't>(context: &ParserContext, + input: &mut Parser<'i, 't>, + allow_quirks: AllowQuirks) -> Result<Self, ParseError<'i>> { + LengthOrPercentage::parse_non_negative_quirky(context, input, allow_quirks) + .map(NonNegative::<LengthOrPercentage>) + } +} + /// Either a `<length>` or the `none` keyword. pub type LengthOrNone = Either<Length, None_>; diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index a3026907bde..9a2dd857efc 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -18,6 +18,7 @@ use style_traits::{ToCss, ParseError, StyleParseError}; use style_traits::values::specified::AllowedNumericType; use super::{Auto, CSSFloat, CSSInteger, Either, None_}; use super::computed::{self, Context, ToComputedValue}; +use super::generics::{GreaterThanOrEqualToOne, NonNegative}; use super::generics::grid::{TrackBreadth as GenericTrackBreadth, TrackSize as GenericTrackSize}; use super::generics::grid::TrackList as GenericTrackList; use values::computed::ComputedValueAsSpecified; @@ -41,8 +42,10 @@ pub use self::length::{FontRelativeLength, Length, LengthOrNone, LengthOrNumber} pub use self::length::{LengthOrPercentage, LengthOrPercentageOrAuto}; pub use self::length::{LengthOrPercentageOrNone, MaxLength, MozLength}; pub use self::length::{NoCalcLength, Percentage, ViewportPercentageLength}; +pub use self::length::NonNegativeLengthOrPercentage; pub use self::rect::LengthOrNumberRect; pub use self::position::{Position, PositionComponent}; +pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind, SVGStrokeDashArray, SVGWidth}; pub use self::text::{InitialLetter, LetterSpacing, LineHeight, WordSpacing}; pub use self::transform::{TimingFunction, TransformOrigin}; pub use super::generics::grid::GridLine; @@ -64,6 +67,7 @@ pub mod image; pub mod length; pub mod position; pub mod rect; +pub mod svg; pub mod text; pub mod transform; @@ -309,11 +313,22 @@ impl BorderStyle { } } +/// Time unit. +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, Eq)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +pub enum TimeUnit { + /// `s` + Second, + /// `ms` + Millisecond, +} + /// A time in seconds according to CSS-VALUES § 6.2. -#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, PartialOrd)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct Time { seconds: CSSFloat, + unit: TimeUnit, was_calc: bool, } @@ -322,6 +337,7 @@ impl Time { pub fn from_seconds(seconds: CSSFloat) -> Self { Time { seconds: seconds, + unit: TimeUnit::Second, was_calc: false, } } @@ -343,14 +359,15 @@ impl Time { from_calc: bool) -> Result<Time, ()> { - let seconds = match_ignore_ascii_case! { unit, - "s" => value, - "ms" => value / 1000.0, + let (seconds, unit) = match_ignore_ascii_case! { unit, + "s" => (value, TimeUnit::Second), + "ms" => (value / 1000.0, TimeUnit::Millisecond), _ => return Err(()) }; Ok(Time { seconds: seconds, + unit: unit, was_calc: from_calc, }) } @@ -359,6 +376,7 @@ impl Time { pub fn from_calc(seconds: CSSFloat) -> Self { Time { seconds: seconds, + unit: TimeUnit::Second, was_calc: true, } } @@ -407,6 +425,7 @@ impl ToComputedValue for Time { fn from_computed_value(computed: &Self::ComputedValue) -> Self { Time { seconds: computed.seconds(), + unit: TimeUnit::Second, was_calc: false, } } @@ -423,7 +442,16 @@ impl ToCss for Time { if self.was_calc { dest.write_str("calc(")?; } - write!(dest, "{}s", self.seconds)?; + match self.unit { + TimeUnit::Second => { + self.seconds.to_css(dest)?; + dest.write_str("s")?; + } + TimeUnit::Millisecond => { + (self.seconds * 1000.).to_css(dest)?; + dest.write_str("ms")?; + } + } if self.was_calc { dest.write_str(")")?; } @@ -507,6 +535,33 @@ impl ToCss for Number { } } +/// A Number which is >= 0.0. +pub type NonNegativeNumber = NonNegative<Number>; + +impl Parse for NonNegativeNumber { + fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { + parse_number_with_clamping_mode(context, input, AllowedNumericType::NonNegative) + .map(NonNegative::<Number>) + } +} + +impl NonNegativeNumber { + /// Returns a new non-negative number with the value `val`. + pub fn new(val: CSSFloat) -> Self { + NonNegative::<Number>(Number::new(val.max(0.))) + } +} + +/// A Number which is >= 1.0. +pub type GreaterThanOrEqualToOneNumber = GreaterThanOrEqualToOne<Number>; + +impl Parse for GreaterThanOrEqualToOneNumber { + fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { + parse_number_with_clamping_mode(context, input, AllowedNumericType::AtLeastOne) + .map(GreaterThanOrEqualToOne::<Number>) + } +} + /// <number> | <percentage> /// /// Accepts only non-negative numbers. @@ -566,7 +621,14 @@ impl ToComputedValue for Opacity { #[inline] fn to_computed_value(&self, context: &Context) -> CSSFloat { - self.0.to_computed_value(context).min(1.0).max(0.0) + let value = self.0.to_computed_value(context); + if context.for_smil_animation { + // SMIL expects to be able to interpolate between out-of-range + // opacity values. + value + } else { + value.min(1.0).max(0.0) + } } #[inline] @@ -680,6 +742,19 @@ impl IntegerOrAuto { } } +/// A wrapper of Integer, with value >= 1. +pub type PositiveInteger = GreaterThanOrEqualToOne<Integer>; + +impl Parse for PositiveInteger { + #[inline] + fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { + Integer::parse_positive(context, input).map(GreaterThanOrEqualToOne::<Integer>) + } +} + +/// PositiveInteger | auto +pub type PositiveIntegerOrAuto = Either<PositiveInteger, Auto>; + #[allow(missing_docs)] pub type UrlOrNone = Either<SpecifiedUrl, None_>; @@ -696,30 +771,11 @@ pub type TrackList = GenericTrackList<LengthOrPercentage>; /// `<grid-template-rows> | <grid-template-columns>` pub type GridTemplateComponent = GenericGridTemplateComponent<LengthOrPercentage>; -no_viewport_percentage!(SVGPaint); - -/// Specified SVG Paint value -pub type SVGPaint = ::values::generics::SVGPaint<RGBAColor>; - -/// Specified SVG Paint Kind value -pub type SVGPaintKind = ::values::generics::SVGPaintKind<RGBAColor>; - /// <length> | <percentage> | <number> pub type LengthOrPercentageOrNumber = Either<Number, LengthOrPercentage>; -impl LengthOrPercentageOrNumber { - /// parse a <length-percentage> | <number> enforcing that the contents aren't negative - pub fn parse_non_negative<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) - -> Result<Self, ParseError<'i>> { - // NB: Parse numbers before Lengths so we are consistent about how to - // recognize and serialize "0". - if let Ok(num) = input.try(|i| Number::parse_non_negative(context, i)) { - return Ok(Either::First(num)) - } - - LengthOrPercentage::parse_non_negative(context, input).map(Either::Second) - } -} +/// NonNegativeLengthOrPercentage | NonNegativeNumber +pub type NonNegativeLengthOrPercentageOrNumber = Either<NonNegativeNumber, NonNegativeLengthOrPercentage>; #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] diff --git a/components/style/values/specified/svg.rs b/components/style/values/specified/svg.rs new file mode 100644 index 00000000000..8ee5736bbd7 --- /dev/null +++ b/components/style/values/specified/svg.rs @@ -0,0 +1,116 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//! Specified types for SVG properties. + +use cssparser::Parser; +use parser::{Parse, ParserContext}; +use style_traits::{CommaWithSpace, ParseError, Separator, StyleParseError}; +use values::generics::svg as generic; +use values::specified::{LengthOrPercentageOrNumber, NonNegativeLengthOrPercentageOrNumber, Opacity}; +use values::specified::color::RGBAColor; + +/// Specified SVG Paint value +pub type SVGPaint = generic::SVGPaint<RGBAColor>; + +no_viewport_percentage!(SVGPaint); + +/// Specified SVG Paint Kind value +pub type SVGPaintKind = generic::SVGPaintKind<RGBAColor>; + +#[cfg(feature = "gecko")] +fn is_context_value_enabled() -> bool { + // The prefs can only be mutated on the main thread, so it is safe + // to read whenever we are on the main thread or the main thread is + // blocked. + use gecko_bindings::structs::mozilla; + unsafe { mozilla::StylePrefs_sOpentypeSVGEnabled } +} +#[cfg(not(feature = "gecko"))] +fn is_context_value_enabled() -> bool { + false +} + +fn parse_context_value<'i, 't, T>(input: &mut Parser<'i, 't>, value: T) + -> Result<T, ParseError<'i>> { + if is_context_value_enabled() { + if input.expect_ident_matching("context-value").is_ok() { + return Ok(value); + } + } + Err(StyleParseError::UnspecifiedError.into()) +} + +/// <length> | <percentage> | <number> | context-value +pub type SVGLength = generic::SVGLength<LengthOrPercentageOrNumber>; + +impl Parse for SVGLength { + fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) + -> Result<Self, ParseError<'i>> { + input.try(|i| LengthOrPercentageOrNumber::parse(context, i)) + .map(Into::into) + .or_else(|_| parse_context_value(input, generic::SVGLength::ContextValue)) + } +} + +impl From<LengthOrPercentageOrNumber> for SVGLength { + fn from(length: LengthOrPercentageOrNumber) -> Self { + generic::SVGLength::Length(length) + } +} + +/// A non-negative version of SVGLength. +pub type SVGWidth = generic::SVGLength<NonNegativeLengthOrPercentageOrNumber>; + +impl Parse for SVGWidth { + fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) + -> Result<Self, ParseError<'i>> { + input.try(|i| NonNegativeLengthOrPercentageOrNumber::parse(context, i)) + .map(Into::into) + .or_else(|_| parse_context_value(input, generic::SVGLength::ContextValue)) + } +} + +impl From<NonNegativeLengthOrPercentageOrNumber> for SVGWidth { + fn from(length: NonNegativeLengthOrPercentageOrNumber) -> Self { + generic::SVGLength::Length(length) + } +} + +/// [ <length> | <percentage> | <number> ]# | context-value +pub type SVGStrokeDashArray = generic::SVGStrokeDashArray<NonNegativeLengthOrPercentageOrNumber>; + +impl Parse for SVGStrokeDashArray { + fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) + -> Result<Self, ParseError<'i>> { + if let Ok(values) = input.try(|i| CommaWithSpace::parse(i, |i| { + NonNegativeLengthOrPercentageOrNumber::parse(context, i) + })) { + Ok(generic::SVGStrokeDashArray::Values(values)) + } else if let Ok(_) = input.try(|i| i.expect_ident_matching("none")) { + Ok(generic::SVGStrokeDashArray::Values(vec![])) + } else { + parse_context_value(input, generic::SVGStrokeDashArray::ContextValue) + } + } +} + +/// <opacity-value> | context-fill-opacity | context-stroke-opacity +pub type SVGOpacity = generic::SVGOpacity<Opacity>; + +impl Parse for SVGOpacity { + fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) + -> Result<Self, ParseError<'i>> { + if let Ok(opacity) = input.try(|i| Opacity::parse(context, i)) { + Ok(generic::SVGOpacity::Opacity(opacity)) + } else if is_context_value_enabled() { + try_match_ident_ignore_ascii_case! { input.expect_ident()?, + "context-fill-opacity" => Ok(generic::SVGOpacity::ContextFillOpacity), + "context-stroke-opacity" => Ok(generic::SVGOpacity::ContextStrokeOpacity), + } + } else { + Err(StyleParseError::UnspecifiedError.into()) + } + } +} diff --git a/components/style/values/specified/text.rs b/components/style/values/specified/text.rs index 2c0395128c6..8341d6236f1 100644 --- a/components/style/values/specified/text.rs +++ b/components/style/values/specified/text.rs @@ -14,8 +14,9 @@ use values::computed::text::LineHeight as ComputedLineHeight; use values::generics::text::InitialLetter as GenericInitialLetter; use values::generics::text::LineHeight as GenericLineHeight; use values::generics::text::Spacing; -use values::specified::{AllowQuirks, Integer, Number}; +use values::specified::{AllowQuirks, Integer, NonNegativeNumber, Number}; use values::specified::length::{FontRelativeLength, Length, LengthOrPercentage, NoCalcLength}; +use values::specified::length::NonNegativeLengthOrPercentage; /// A specified type for the `initial-letter` property. pub type InitialLetter = GenericInitialLetter<Number, Integer>; @@ -27,7 +28,7 @@ pub type LetterSpacing = Spacing<Length>; pub type WordSpacing = Spacing<LengthOrPercentage>; /// A specified value for the `line-height` property. -pub type LineHeight = GenericLineHeight<Number, LengthOrPercentage>; +pub type LineHeight = GenericLineHeight<NonNegativeNumber, NonNegativeLengthOrPercentage>; impl Parse for InitialLetter { fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { @@ -58,11 +59,11 @@ impl Parse for WordSpacing { impl Parse for LineHeight { fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { - if let Ok(number) = input.try(|i| Number::parse_non_negative(context, i)) { + if let Ok(number) = input.try(|i| NonNegativeNumber::parse(context, i)) { return Ok(GenericLineHeight::Number(number)) } - if let Ok(lop) = input.try(|i| LengthOrPercentage::parse_non_negative(context, i)) { - return Ok(GenericLineHeight::Length(lop)) + if let Ok(nlop) = input.try(|i| NonNegativeLengthOrPercentage::parse(context, i)) { + return Ok(GenericLineHeight::Length(nlop)) } let ident = input.expect_ident()?; match ident { @@ -94,24 +95,29 @@ impl ToComputedValue for LineHeight { GenericLineHeight::Number(number) => { GenericLineHeight::Number(number.to_computed_value(context)) }, - GenericLineHeight::Length(LengthOrPercentage::Length(ref length)) => { - GenericLineHeight::Length(length.to_computed_value(context)) - }, - GenericLineHeight::Length(LengthOrPercentage::Percentage(p)) => { - let font_relative_length = - Length::NoCalc(NoCalcLength::FontRelative(FontRelativeLength::Em(p.0))); - GenericLineHeight::Length(font_relative_length.to_computed_value(context)) - }, - GenericLineHeight::Length(LengthOrPercentage::Calc(ref calc)) => { - let computed_calc = calc.to_computed_value(context); - let font_relative_length = - Length::NoCalc(NoCalcLength::FontRelative(FontRelativeLength::Em(computed_calc.percentage()))); - let absolute_length = computed_calc.unclamped_length(); - let computed_length = computed_calc.clamping_mode.clamp( - absolute_length + font_relative_length.to_computed_value(context) - ); - GenericLineHeight::Length(computed_length) - }, + GenericLineHeight::Length(ref non_negative_lop) => { + let result = match non_negative_lop.0 { + LengthOrPercentage::Length(ref length) => { + context.maybe_zoom_text(length.to_computed_value(context).into()) + }, + LengthOrPercentage::Percentage(ref p) => { + let font_relative_length = + Length::NoCalc(NoCalcLength::FontRelative(FontRelativeLength::Em(p.0))); + font_relative_length.to_computed_value(context).into() + } + LengthOrPercentage::Calc(ref calc) => { + let computed_calc = calc.to_computed_value_zoomed(context); + let font_relative_length = + Length::NoCalc(NoCalcLength::FontRelative( + FontRelativeLength::Em(computed_calc.percentage()))); + let absolute_length = computed_calc.unclamped_length(); + computed_calc.clamping_mode.clamp( + absolute_length + font_relative_length.to_computed_value(context) + ).into() + } + }; + GenericLineHeight::Length(result) + } } } @@ -126,12 +132,10 @@ impl ToComputedValue for LineHeight { GenericLineHeight::MozBlockHeight }, GenericLineHeight::Number(ref number) => { - GenericLineHeight::Number(Number::from_computed_value(number)) + GenericLineHeight::Number(NonNegativeNumber::from_computed_value(number)) }, GenericLineHeight::Length(ref length) => { - GenericLineHeight::Length(LengthOrPercentage::Length( - NoCalcLength::from_computed_value(length) - )) + GenericLineHeight::Length(NoCalcLength::from_computed_value(&length.0).into()) } } } diff --git a/components/style/values/specified/transform.rs b/components/style/values/specified/transform.rs index ef087e3fcdf..e3b3e1e51f7 100644 --- a/components/style/values/specified/transform.rs +++ b/components/style/values/specified/transform.rs @@ -134,8 +134,8 @@ impl<S> OriginComponent<S> { #[cfg(feature = "gecko")] #[inline] fn allow_frames_timing() -> bool { - use gecko_bindings::bindings; - unsafe { bindings::Gecko_IsFramesTimingEnabled() } + use gecko_bindings::structs::mozilla; + unsafe { mozilla::StylePrefs_sFramesTimingFunctionEnabled } } #[cfg(feature = "servo")] diff --git a/components/style_derive/to_css.rs b/components/style_derive/to_css.rs index 9bc19dc0695..2dbf8731e45 100644 --- a/components/style_derive/to_css.rs +++ b/components/style_derive/to_css.rs @@ -151,7 +151,7 @@ fn where_predicate(ty: syn::Ty) -> syn::WherePredicate { /// Transforms "FooBar" to "foo-bar". /// -/// If the first Camel segment is "Moz"" or "Webkit", the result string +/// If the first Camel segment is "Moz" or "Webkit", the result string /// is prepended with "-". fn to_css_identifier(mut camel_case: &str) -> String { camel_case = camel_case.trim_right_matches('_'); diff --git a/components/style_traits/Cargo.toml b/components/style_traits/Cargo.toml index a4dcdc20fc5..a52f0662c0a 100644 --- a/components/style_traits/Cargo.toml +++ b/components/style_traits/Cargo.toml @@ -10,7 +10,7 @@ name = "style_traits" path = "lib.rs" [features] -servo = ["heapsize", "heapsize_derive", "serde", "cssparser/heapsize", "cssparser/serde"] +servo = ["heapsize", "heapsize_derive", "serde", "servo_atoms", "cssparser/heapsize", "cssparser/serde", "webrender_api"] gecko = [] [dependencies] @@ -22,3 +22,5 @@ heapsize = {version = "0.4", optional = true} heapsize_derive = {version = "0.1", optional = true} selectors = { path = "../selectors" } serde = {version = "1.0", optional = true} +webrender_api = {git = "https://github.com/servo/webrender", optional = true} +servo_atoms = {path = "../atoms", optional = true} diff --git a/components/style_traits/lib.rs b/components/style_traits/lib.rs index 1747783e2b0..78bb0e3e0e7 100644 --- a/components/style_traits/lib.rs +++ b/components/style_traits/lib.rs @@ -21,9 +21,21 @@ extern crate euclid; #[cfg(feature = "servo")] #[macro_use] extern crate heapsize_derive; extern crate selectors; #[cfg(feature = "servo")] #[macro_use] extern crate serde; +#[cfg(feature = "servo")] extern crate webrender_api; +#[cfg(feature = "servo")] extern crate servo_atoms; + +#[cfg(feature = "servo")] pub use webrender_api::DevicePixel; use cssparser::{CowRcStr, Token}; use selectors::parser::SelectorParseError; +#[cfg(feature = "servo")] use servo_atoms::Atom; + +/// One hardware pixel. +/// +/// This unit corresponds to the smallest addressable element of the display hardware. +#[cfg(not(feature = "servo"))] +#[derive(Copy, Clone, Debug)] +pub enum DevicePixel {} /// Opaque type stored in type-unsafe work queues for parallel layout. /// Must be transmutable to and from `TNode`. @@ -59,12 +71,6 @@ impl PinchZoomFactor { #[derive(Clone, Copy, Debug)] pub enum CSSPixel {} -/// One hardware pixel. -/// -/// This unit corresponds to the smallest addressable element of the display hardware. -#[derive(Copy, Clone, Debug)] -pub enum DevicePixel {} - // In summary, the hierarchy of pixel units and the factors to convert from one to the next: // // DevicePixel @@ -118,10 +124,31 @@ pub enum StyleParseError<'i> { UnspecifiedError, /// An unexpected token was found within a namespace rule. UnexpectedTokenWithinNamespace(Token<'i>), + /// An error was encountered while parsing a property value. + ValueError(ValueParseError<'i>), +} + +/// Specific errors that can be encountered while parsing property values. +#[derive(Clone, Debug, PartialEq)] +pub enum ValueParseError<'i> { + /// An invalid token was encountered while parsing a color value. + InvalidColor(Token<'i>), +} + +impl<'i> ValueParseError<'i> { + /// Attempt to extract a ValueParseError value from a ParseError. + pub fn from_parse_error(this: ParseError<'i>) -> Option<ValueParseError<'i>> { + match this { + cssparser::ParseError::Custom( + SelectorParseError::Custom( + StyleParseError::ValueError(e))) => Some(e), + _ => None, + } + } } /// The result of parsing a property declaration. -#[derive(Eq, PartialEq, Clone, Debug)] +#[derive(PartialEq, Clone, Debug)] pub enum PropertyDeclarationParseError<'i> { /// The property declaration was for an unknown property. UnknownProperty(CowRcStr<'i>), @@ -130,7 +157,7 @@ pub enum PropertyDeclarationParseError<'i> { /// The property declaration was for a disabled experimental property. ExperimentalProperty, /// The property declaration contained an invalid value. - InvalidValue(CowRcStr<'i>), + InvalidValue(CowRcStr<'i>, Option<ValueParseError<'i>>), /// The declaration contained an animation property, and we were parsing /// this as a keyframe block (so that property should be ignored). /// @@ -180,3 +207,9 @@ impl ParsingMode { } } +#[cfg(feature = "servo")] +/// Speculatively execute paint code in the worklet thread pool. +pub trait SpeculativePainter: Send + Sync { + /// https://drafts.css-houdini.org/css-paint-api/#draw-a-paint-image + fn speculatively_draw_a_paint_image(&self, properties: Vec<(Atom, String)>, arguments: Vec<String>); +} diff --git a/components/url/lib.rs b/components/url/lib.rs index b862e312bc2..e8e8b1acce1 100644 --- a/components/url/lib.rs +++ b/components/url/lib.rs @@ -85,6 +85,10 @@ impl ServoUrl { scheme == "https" || scheme == "wss" } + pub fn is_chrome(&self) -> bool { + self.scheme() == "chrome" + } + pub fn as_str(&self) -> &str { self.0.as_str() } diff --git a/etc/ci/buildbot_steps.yml b/etc/ci/buildbot_steps.yml index 89fa5303940..f6b45f11c16 100644 --- a/etc/ci/buildbot_steps.yml +++ b/etc/ci/buildbot_steps.yml @@ -27,6 +27,8 @@ mac-rel-wpt4: - ./mach build --release - ./mach test-wpt --release --processes 4 --total-chunks 4 --this-chunk 4 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed - ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --use-tracker + - ./mach test-wpt --release --pref dom.servoparser.async_html_tokenizer.enabled --processes=8 --log-raw test-async-parsing.log --log-errorsummary async-parsing-errorsummary.log --always-succeed domparsing html/syntax html/dom/documents html/dom/dynamic-markup-insertion + - ./mach filter-intermittents async-parsing-errorsummary.log --log-intermittents async-parsing-intermittents.log --log-filteredsummary filtered-async-parsing-errorsummary.log --use-tracker mac-dev-unit: - ./mach clean-nightlies --keep 3 --force diff --git a/ports/cef/core.rs b/ports/cef/core.rs index 7fcac74d848..c3bef096f85 100644 --- a/ports/cef/core.rs +++ b/ports/cef/core.rs @@ -13,8 +13,6 @@ use servo_config::opts; use std::ffi; use std::str; -const MAX_RENDERING_THREADS: usize = 128; - //static HOME_URL: &'static str = "http://s27.postimg.org/vqbtrolyr/servo.jpg"; static CEF_API_HASH_UNIVERSAL: &'static [u8] = b"8efd129f4afc344bd04b2feb7f73a149b6c4e27f\0"; @@ -57,16 +55,6 @@ pub extern "C" fn cef_initialize(args: *const cef_main_args_t, } } - let rendering_threads = unsafe { - if ((*settings).rendering_threads as usize) < 1 { - 1 - } else if (*settings).rendering_threads as usize > MAX_RENDERING_THREADS { - MAX_RENDERING_THREADS - } else { - (*settings).rendering_threads as usize - } - }; - let mut temp_opts = opts::default_opts(); temp_opts.headless = false; temp_opts.hard_fail = false; diff --git a/ports/cef/types.rs b/ports/cef/types.rs index f8d8685d8a0..3cba9bf950c 100644 --- a/ports/cef/types.rs +++ b/ports/cef/types.rs @@ -727,11 +727,6 @@ pub struct cef_settings { // of the background color but will be otherwise ignored. // pub background_color: cef_color_t, - - // - // Determines how many rendering threads are used. - // - pub rendering_threads: c_int, } // diff --git a/ports/cef/window.rs b/ports/cef/window.rs index b598e35abdd..4fe62cfd601 100644 --- a/ports/cef/window.rs +++ b/ports/cef/window.rs @@ -19,7 +19,7 @@ use wrappers::CefWrap; use compositing::compositor_thread::EventLoopWaker; use compositing::windowing::{WindowEvent, WindowMethods}; -use euclid::{Point2D, TypedPoint2D, TypedRect, Size2D, TypedSize2D, ScaleFactor}; +use euclid::{Point2D, TypedPoint2D, Size2D, TypedSize2D, ScaleFactor}; use gleam::gl; use msg::constellation_msg::{Key, KeyModifiers}; use net_traits::net_error_list::NetError; @@ -31,7 +31,6 @@ use std::ffi::CString; use std::os::raw::{c_char, c_void}; use std::ptr; use std::rc::Rc; -use std::sync::mpsc::{Sender, channel}; use servo_url::ServoUrl; use style_traits::cursor::Cursor; use style_traits::DevicePixel; @@ -39,6 +38,7 @@ use style_traits::DevicePixel; extern crate x11; #[cfg(target_os="linux")] use self::x11::xlib::{XInitThreads,XOpenDisplay}; +use webrender_api::{DeviceUintSize, DeviceUintRect}; #[cfg(target_os="linux")] pub static mut DISPLAY: *mut c_void = 0 as *mut c_void; @@ -47,7 +47,7 @@ pub static mut DISPLAY: *mut c_void = 0 as *mut c_void; #[derive(Clone)] pub struct Window { cef_browser: RefCell<Option<CefBrowser>>, - size: TypedSize2D<u32, DevicePixel>, + size: DeviceUintSize, gl: Rc<gl::Gl>, } @@ -175,7 +175,7 @@ impl WindowMethods for Window { self.gl.clone() } - fn framebuffer_size(&self) -> TypedSize2D<u32, DevicePixel> { + fn framebuffer_size(&self) -> DeviceUintSize { let browser = self.cef_browser.borrow(); match *browser { None => self.size, @@ -206,16 +206,16 @@ impl WindowMethods for Window { } } - TypedSize2D::new(rect.width as u32, rect.height as u32) + DeviceUintSize::new(rect.width as u32, rect.height as u32) } } } } - fn window_rect(&self) -> TypedRect<u32, DevicePixel> { + fn window_rect(&self) -> DeviceUintRect { let size = self.framebuffer_size(); let origin = TypedPoint2D::zero(); - TypedRect::new(origin, size) + DeviceUintRect::new(origin, size) } fn size(&self) -> TypedSize2D<f32, DeviceIndependentPixel> { diff --git a/ports/geckolib/error_reporter.rs b/ports/geckolib/error_reporter.rs index e829737fa73..6b10077aa0f 100644 --- a/ports/geckolib/error_reporter.rs +++ b/ports/geckolib/error_reporter.rs @@ -9,6 +9,7 @@ use cssparser::{Parser, SourcePosition, ParseError as CssParseError, Token, BasicParseError}; use cssparser::CowRcStr; use selectors::parser::SelectorParseError; +use std::ptr; use style::error_reporting::{ParseErrorReporter, ContextualParseError}; use style::gecko_bindings::bindings::{Gecko_CreateCSSErrorReporter, Gecko_DestroyCSSErrorReporter}; use style::gecko_bindings::bindings::Gecko_ReportUnexpectedCSSError; @@ -17,7 +18,7 @@ use style::gecko_bindings::structs::ErrorReporter as GeckoErrorReporter; use style::gecko_bindings::structs::URLExtraData as RawUrlExtraData; use style::gecko_bindings::sugar::refptr::RefPtr; use style::stylesheets::UrlExtraData; -use style_traits::{ParseError, StyleParseError, PropertyDeclarationParseError}; +use style_traits::{ParseError, StyleParseError, PropertyDeclarationParseError, ValueParseError}; /// Wrapper around an instance of Gecko's CSS error reporter. pub struct ErrorReporter(*mut GeckoErrorReporter); @@ -76,7 +77,7 @@ fn escape_css_ident(ident: &str) -> String { return ident.into() } - let mut escaped = String::new(); + let mut escaped = String::with_capacity(ident.len()); // A leading dash does not need to be escaped as long as it is not the // *only* character in the identifier. @@ -185,10 +186,67 @@ fn token_to_str<'a>(t: Token<'a>) -> String { } } +enum Action { + Nothing, + Skip, + Drop, +} + trait ErrorHelpers<'a> { fn error_data(self) -> (CowRcStr<'a>, ParseError<'a>); - fn error_param(self) -> ErrorString<'a>; - fn to_gecko_message(&self) -> &'static [u8]; + fn error_params(self) -> (ErrorString<'a>, Option<ErrorString<'a>>); + fn to_gecko_message(&self) -> (Option<&'static [u8]>, &'static [u8], Action); +} + +fn extract_error_param<'a>(err: ParseError<'a>) -> Option<ErrorString<'a>> { + Some(match err { + CssParseError::Basic(BasicParseError::UnexpectedToken(t)) => + ErrorString::UnexpectedToken(t), + + CssParseError::Basic(BasicParseError::AtRuleInvalid(i)) => + ErrorString::Snippet(format!("@{}", escape_css_ident(&i)).into()), + + CssParseError::Custom(SelectorParseError::Custom( + StyleParseError::PropertyDeclaration( + PropertyDeclarationParseError::InvalidValue(property, None)))) => + ErrorString::Snippet(property), + + CssParseError::Custom(SelectorParseError::UnexpectedIdent(ident)) => + ErrorString::Ident(ident), + + CssParseError::Custom(SelectorParseError::ExpectedNamespace(namespace)) => + ErrorString::Ident(namespace), + + CssParseError::Custom(SelectorParseError::Custom( + StyleParseError::PropertyDeclaration( + PropertyDeclarationParseError::UnknownProperty(property)))) => + ErrorString::Ident(property), + + CssParseError::Custom(SelectorParseError::Custom( + StyleParseError::UnexpectedTokenWithinNamespace(token))) => + ErrorString::UnexpectedToken(token), + + _ => return None, + }) +} + +fn extract_value_error_param<'a>(err: ValueParseError<'a>) -> ErrorString<'a> { + match err { + ValueParseError::InvalidColor(t) => ErrorString::UnexpectedToken(t), + } +} + +/// If an error parameter is present in the given error, return it. Additionally return +/// a second parameter if it exists, for use in the prefix for the eventual error message. +fn extract_error_params<'a>(err: ParseError<'a>) -> Option<(ErrorString<'a>, Option<ErrorString<'a>>)> { + match err { + CssParseError::Custom(SelectorParseError::Custom( + StyleParseError::PropertyDeclaration( + PropertyDeclarationParseError::InvalidValue(property, Some(e))))) => + Some((ErrorString::Snippet(property.into()), Some(extract_value_error_param(e)))), + + err => extract_error_param(err).map(|e| (e, None)), + } } impl<'a> ErrorHelpers<'a> for ContextualParseError<'a> { @@ -196,7 +254,9 @@ impl<'a> ErrorHelpers<'a> for ContextualParseError<'a> { match self { ContextualParseError::UnsupportedPropertyDeclaration(s, err) | ContextualParseError::UnsupportedFontFaceDescriptor(s, err) | + ContextualParseError::UnsupportedFontFeatureValuesDescriptor(s, err) | ContextualParseError::InvalidKeyframeRule(s, err) | + ContextualParseError::InvalidFontFeatureValuesRule(s, err) | ContextualParseError::UnsupportedKeyframePropertyDeclaration(s, err) | ContextualParseError::InvalidRule(s, err) | ContextualParseError::UnsupportedRule(s, err) | @@ -213,78 +273,59 @@ impl<'a> ErrorHelpers<'a> for ContextualParseError<'a> { } } - fn error_param(self) -> ErrorString<'a> { - match self.error_data() { - (_, CssParseError::Basic(BasicParseError::UnexpectedToken(t))) => - ErrorString::UnexpectedToken(t), - - (_, CssParseError::Basic(BasicParseError::AtRuleInvalid(i))) => - ErrorString::Snippet(format!("@{}", escape_css_ident(&i)).into()), - - (_, CssParseError::Custom(SelectorParseError::Custom( - StyleParseError::PropertyDeclaration( - PropertyDeclarationParseError::InvalidValue(property))))) => - ErrorString::Snippet(property), - - (_, CssParseError::Custom(SelectorParseError::UnexpectedIdent(ident))) => - ErrorString::Ident(ident), - - (_, CssParseError::Custom(SelectorParseError::ExpectedNamespace(namespace))) => - ErrorString::Ident(namespace), - - (_, CssParseError::Custom(SelectorParseError::Custom( - StyleParseError::PropertyDeclaration( - PropertyDeclarationParseError::UnknownProperty(property))))) => - ErrorString::Ident(property), - - (_, CssParseError::Custom(SelectorParseError::Custom( - StyleParseError::UnexpectedTokenWithinNamespace(token)))) => - ErrorString::UnexpectedToken(token), - - (s, _) => ErrorString::Snippet(s) - } + fn error_params(self) -> (ErrorString<'a>, Option<ErrorString<'a>>) { + let (s, error) = self.error_data(); + extract_error_params(error).unwrap_or((ErrorString::Snippet(s), None)) } - fn to_gecko_message(&self) -> &'static [u8] { - match *self { + fn to_gecko_message(&self) -> (Option<&'static [u8]>, &'static [u8], Action) { + let (msg, action): (&[u8], Action) = match *self { ContextualParseError::UnsupportedPropertyDeclaration( _, CssParseError::Basic(BasicParseError::UnexpectedToken(_))) | ContextualParseError::UnsupportedPropertyDeclaration( _, CssParseError::Basic(BasicParseError::AtRuleInvalid(_))) => - b"PEParseDeclarationDeclExpected\0", + (b"PEParseDeclarationDeclExpected\0", Action::Skip), ContextualParseError::UnsupportedPropertyDeclaration( _, CssParseError::Custom(SelectorParseError::Custom( StyleParseError::PropertyDeclaration( - PropertyDeclarationParseError::InvalidValue(_))))) => - b"PEValueParsingError\0", + PropertyDeclarationParseError::InvalidValue(_, ref err))))) => { + let prefix = match *err { + Some(ValueParseError::InvalidColor(_)) => Some(&b"PEColorNotColor\0"[..]), + _ => None, + }; + return (prefix, b"PEValueParsingError\0", Action::Drop); + } ContextualParseError::UnsupportedPropertyDeclaration(..) => - b"PEUnknownProperty\0", + (b"PEUnknownProperty\0", Action::Drop), ContextualParseError::UnsupportedFontFaceDescriptor(..) => - b"PEUnknwnFontDesc\0", + (b"PEUnknwnFontDesc\0", Action::Skip), ContextualParseError::InvalidKeyframeRule(..) => - b"PEKeyframeBadName\0", + (b"PEKeyframeBadName\0", Action::Nothing), ContextualParseError::UnsupportedKeyframePropertyDeclaration(..) => - b"PEBadSelectorKeyframeRuleIgnored\0", + (b"PEBadSelectorKeyframeRuleIgnored\0", Action::Nothing), ContextualParseError::InvalidRule( _, CssParseError::Custom(SelectorParseError::ExpectedNamespace(_))) => - b"PEUnknownNamespacePrefix\0", + (b"PEUnknownNamespacePrefix\0", Action::Nothing), ContextualParseError::InvalidRule( _, CssParseError::Custom(SelectorParseError::Custom( StyleParseError::UnexpectedTokenWithinNamespace(_)))) => - b"PEAtNSUnexpected\0", + (b"PEAtNSUnexpected\0", Action::Nothing), ContextualParseError::InvalidRule(..) => - b"PEBadSelectorRSIgnored\0", + (b"PEBadSelectorRSIgnored\0", Action::Nothing), ContextualParseError::UnsupportedRule(..) => - b"PEDeclDropped\0", + (b"PEDeclDropped\0", Action::Nothing), ContextualParseError::UnsupportedViewportDescriptorDeclaration(..) | ContextualParseError::UnsupportedCounterStyleDescriptorDeclaration(..) | ContextualParseError::InvalidCounterStyleWithoutSymbols(..) | ContextualParseError::InvalidCounterStyleNotEnoughSymbols(..) | ContextualParseError::InvalidCounterStyleWithoutAdditiveSymbols | ContextualParseError::InvalidCounterStyleExtendsWithSymbols | - ContextualParseError::InvalidCounterStyleExtendsWithAdditiveSymbols => - b"PEUnknownAtRule\0", - } + ContextualParseError::InvalidCounterStyleExtendsWithAdditiveSymbols | + ContextualParseError::UnsupportedFontFeatureValuesDescriptor(..) | + ContextualParseError::InvalidFontFeatureValuesRule(..) => + (b"PEUnknownAtRule\0", Action::Skip), + }; + (None, msg, action) } } @@ -293,13 +334,21 @@ impl ParseErrorReporter for ErrorReporter { input: &mut Parser, position: SourcePosition, error: ContextualParseError<'a>, - url: &UrlExtraData, + _url: &UrlExtraData, line_number_offset: u64) { let location = input.source_location(position); let line_number = location.line + line_number_offset as u32; - let name = error.to_gecko_message(); - let param = error.error_param().into_str(); + let (pre, name, action) = error.to_gecko_message(); + let suffix = match action { + Action::Nothing => ptr::null(), + Action::Skip => b"PEDeclSkipped\0".as_ptr(), + Action::Drop => b"PEDeclDropped\0".as_ptr(), + }; + let (param, pre_param) = error.error_params(); + let param = param.into_str(); + let pre_param = pre_param.map(|p| p.into_str()); + let pre_param_ptr = pre_param.as_ref().map_or(ptr::null(), |p| p.as_ptr()); // The CSS source text is unused and will be removed in bug 1381188. let source = ""; unsafe { @@ -307,11 +356,14 @@ impl ParseErrorReporter for ErrorReporter { name.as_ptr() as *const _, param.as_ptr() as *const _, param.len() as u32, + pre.map_or(ptr::null(), |p| p.as_ptr()) as *const _, + pre_param_ptr as *const _, + pre_param.as_ref().map_or(0, |p| p.len()) as u32, + suffix as *const _, source.as_ptr() as *const _, source.len() as u32, line_number as u32, - location.column as u32, - url.mBaseURI.raw::<nsIURI>()); + location.column as u32); } } } diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 0026c7212e8..1fa8516acc9 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -2,7 +2,6 @@ * 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/. */ -use atomic_refcell::AtomicRefMut; use cssparser::{Parser, ParserInput}; use cssparser::ToCss as ParserToCss; use env_logger::LogBuilder; @@ -14,8 +13,7 @@ use std::fmt::Write; use std::ptr; use style::context::{CascadeInputs, QuirksMode, SharedStyleContext, StyleContext}; use style::context::ThreadLocalStyleContext; -use style::data::{ElementData, ElementStyles, RestyleData}; -use style::dom::{AnimationOnlyDirtyDescendants, DirtyDescendants}; +use style::data::ElementStyles; use style::dom::{ShowSubtreeData, TElement, TNode}; use style::element_state::ElementState; use style::error_reporting::{NullReporter, ParseErrorReporter}; @@ -26,11 +24,11 @@ use style::gecko::restyle_damage::GeckoRestyleDamage; use style::gecko::selector_parser::PseudoElement; use style::gecko::traversal::RecalcStyleOnly; use style::gecko::wrapper::GeckoElement; -use style::gecko_bindings::bindings; use style::gecko_bindings::bindings::{RawGeckoElementBorrowed, RawGeckoElementBorrowedOrNull}; use style::gecko_bindings::bindings::{RawGeckoKeyframeListBorrowed, RawGeckoKeyframeListBorrowedMut}; use style::gecko_bindings::bindings::{RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockStrong}; use style::gecko_bindings::bindings::{RawServoDocumentRule, RawServoDocumentRuleBorrowed}; +use style::gecko_bindings::bindings::{RawServoFontFeatureValuesRule, RawServoFontFeatureValuesRuleBorrowed}; use style::gecko_bindings::bindings::{RawServoImportRule, RawServoImportRuleBorrowed}; use style::gecko_bindings::bindings::{RawServoKeyframe, RawServoKeyframeBorrowed, RawServoKeyframeStrong}; use style::gecko_bindings::bindings::{RawServoKeyframesRule, RawServoKeyframesRuleBorrowed}; @@ -61,6 +59,7 @@ use style::gecko_bindings::bindings::RawGeckoServoStyleRuleListBorrowedMut; use style::gecko_bindings::bindings::RawServoAnimationValueBorrowed; use style::gecko_bindings::bindings::RawServoAnimationValueMapBorrowedMut; use style::gecko_bindings::bindings::RawServoAnimationValueStrong; +use style::gecko_bindings::bindings::RawServoAnimationValueTableBorrowed; use style::gecko_bindings::bindings::RawServoStyleRuleBorrowed; use style::gecko_bindings::bindings::ServoStyleContextBorrowedOrNull; use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t; @@ -76,7 +75,9 @@ use style::gecko_bindings::structs::IterationCompositeOperation; use style::gecko_bindings::structs::MallocSizeOf; use style::gecko_bindings::structs::RawGeckoGfxMatrix4x4; use style::gecko_bindings::structs::RawGeckoPresContextOwned; +use style::gecko_bindings::structs::SeenPtrs; use style::gecko_bindings::structs::ServoElementSnapshotTable; +use style::gecko_bindings::structs::ServoTraversalFlags; use style::gecko_bindings::structs::StyleRuleInclusion; use style::gecko_bindings::structs::URLExtraData; use style::gecko_bindings::structs::nsCSSValueSharedList; @@ -88,15 +89,16 @@ use style::gecko_bindings::structs::nsresult; use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasFFI, HasArcFFI, HasBoxFFI}; use style::gecko_bindings::sugar::ownership::{HasSimpleFFI, Strong}; use style::gecko_bindings::sugar::refptr::RefPtr; -use style::gecko_properties::{self, style_structs}; -use style::invalidation::element::restyle_hints::{self, RestyleHint}; +use style::gecko_properties::style_structs; +use style::invalidation::element::restyle_hints; use style::media_queries::{MediaList, parse_media_query_list}; use style::parallel; -use style::parser::ParserContext; -use style::properties::{ComputedValues, Importance}; -use style::properties::{IS_FIELDSET_CONTENT, LonghandIdSet}; +use style::parser::{ParserContext, self}; +use style::properties::{CascadeFlags, ComputedValues, Importance}; +use style::properties::{IS_FIELDSET_CONTENT, IS_LINK, IS_VISITED_LINK, LonghandIdSet}; use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, PropertyId, ShorthandId}; use style::properties::{SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP, SourcePropertyDeclaration, StyleBuilder}; +use style::properties::PROHIBIT_DISPLAY_CONTENTS; use style::properties::animated_properties::{Animatable, AnimatableLonghand, AnimationValue}; use style::properties::animated_properties::compare_property_priority; use style::properties::parse_one_declaration_into; @@ -107,8 +109,9 @@ use style::shared_lock::{SharedRwLockReadGuard, StylesheetGuards, ToCssWithGuard use style::string_cache::Atom; use style::style_adjuster::StyleAdjuster; use style::stylesheets::{CssRule, CssRules, CssRuleType, CssRulesHelpers, DocumentRule}; -use style::stylesheets::{ImportRule, KeyframesRule, MallocSizeOfWithGuard, MediaRule}; -use style::stylesheets::{NamespaceRule, Origin, PageRule, StyleRule, SupportsRule}; +use style::stylesheets::{FontFeatureValuesRule, ImportRule, KeyframesRule, MallocSizeOfWithGuard}; +use style::stylesheets::{MallocSizeOfWithRepeats, MediaRule}; +use style::stylesheets::{NamespaceRule, Origin, PageRule, SizeOfState, StyleRule, SupportsRule}; use style::stylesheets::StylesheetContents; use style::stylesheets::StylesheetLoader as StyleStylesheetLoader; use style::stylesheets::keyframes_rule::{Keyframe, KeyframeSelector, KeyframesStepValue}; @@ -116,9 +119,9 @@ use style::stylesheets::supports_rule::parse_condition_or_declaration; use style::stylist::RuleInclusion; use style::thread_state; use style::timer::Timer; -use style::traversal::{ANIMATION_ONLY, DomTraversal, FOR_CSS_RULE_CHANGES, FOR_RECONSTRUCT}; -use style::traversal::{TraversalDriver, TraversalFlags, UNSTYLED_CHILDREN_ONLY}; +use style::traversal::{DomTraversal, TraversalDriver}; use style::traversal::resolve_style; +use style::traversal_flags::{TraversalFlags, self}; use style::values::{CustomIdent, KeyframesName}; use style::values::animated::ToAnimatedZero; use style::values::computed::Context; @@ -140,8 +143,6 @@ static mut DUMMY_URL_DATA: *mut URLExtraData = 0 as *mut URLExtraData; #[no_mangle] pub extern "C" fn Servo_Initialize(dummy_url_data: *mut URLExtraData) { - use style::parser::assert_parsing_mode_match; - // Initialize logging. let mut builder = LogBuilder::new(); let default_level = if cfg!(debug_assertions) { "warn" } else { "error" }; @@ -155,10 +156,8 @@ pub extern "C" fn Servo_Initialize(dummy_url_data: *mut URLExtraData) { // Perform some debug-only runtime assertions. restyle_hints::assert_restyle_hints_match(); - assert_parsing_mode_match(); - - // Initialize some static data. - gecko_properties::initialize(); + parser::assert_parsing_mode_match(); + traversal_flags::assert_traversal_flags_match(); // Initialize the dummy url data unsafe { DUMMY_URL_DATA = dummy_url_data; } @@ -166,9 +165,6 @@ pub extern "C" fn Servo_Initialize(dummy_url_data: *mut URLExtraData) { #[no_mangle] pub extern "C" fn Servo_Shutdown() { - // Clear some static data to avoid shutdown leaks. - gecko_properties::shutdown(); - // The dummy url will be released after shutdown, so clear the // reference to avoid use-after-free. unsafe { DUMMY_URL_DATA = ptr::null_mut(); } @@ -184,13 +180,9 @@ fn create_shared_context<'a>(global_style_data: &GlobalStyleData, traversal_flags: TraversalFlags, snapshot_map: &'a ServoElementSnapshotTable) -> SharedStyleContext<'a> { - let visited_styles_enabled = - unsafe { bindings::Gecko_AreVisitedLinksEnabled() } && - !per_doc_data.is_private_browsing_enabled(); - SharedStyleContext { stylist: &per_doc_data.stylist, - visited_styles_enabled: visited_styles_enabled, + visited_styles_enabled: per_doc_data.visited_styles_enabled(), options: global_style_data.options.clone(), guards: StylesheetGuards::same(guard), timer: Timer::new(), @@ -259,32 +251,16 @@ fn traverse_subtree(element: GeckoElement, pub extern "C" fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed, raw_data: RawServoStyleSetBorrowed, snapshots: *const ServoElementSnapshotTable, - root_behavior: structs::TraversalRootBehavior, - restyle_behavior: structs::TraversalRestyleBehavior) + raw_flags: ServoTraversalFlags) -> bool { - use self::structs::TraversalRestyleBehavior as Restyle; - use self::structs::TraversalRootBehavior as Root; + let traversal_flags = TraversalFlags::from_bits_truncate(raw_flags); debug_assert!(!snapshots.is_null()); let element = GeckoElement(root); - debug!("Servo_TraverseSubtree: {:?} {:?}", element, restyle_behavior); - - let traversal_flags = match (root_behavior, restyle_behavior) { - (Root::Normal, Restyle::Normal) | - (Root::Normal, Restyle::ForNewlyBoundElement) | - (Root::Normal, Restyle::ForThrottledAnimationFlush) - => TraversalFlags::empty(), - (Root::UnstyledChildrenOnly, Restyle::Normal) | - (Root::UnstyledChildrenOnly, Restyle::ForNewlyBoundElement) - => UNSTYLED_CHILDREN_ONLY, - (Root::Normal, Restyle::ForCSSRuleChanges) => FOR_CSS_RULE_CHANGES, - (Root::Normal, Restyle::ForReconstruct) => FOR_RECONSTRUCT, - _ => panic!("invalid combination of TraversalRootBehavior and TraversalRestyleBehavior"), - }; // It makes no sense to do an animation restyle when we're restyling // newly-inserted content. - if !traversal_flags.contains(UNSTYLED_CHILDREN_ONLY) { + if !traversal_flags.contains(traversal_flags::UnstyledChildrenOnly) { let needs_animation_only_restyle = element.has_animation_only_dirty_descendants() || element.has_animation_restyle_hints(); @@ -292,12 +268,12 @@ pub extern "C" fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed, if needs_animation_only_restyle { traverse_subtree(element, raw_data, - traversal_flags | ANIMATION_ONLY, + traversal_flags | traversal_flags::AnimationOnly, unsafe { &*snapshots }); } } - if restyle_behavior == Restyle::ForThrottledAnimationFlush { + if traversal_flags.for_animation_only() { return element.has_animation_only_dirty_descendants() || element.borrow_data().unwrap().restyle.is_restyle(); } @@ -307,14 +283,6 @@ pub extern "C" fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed, traversal_flags, unsafe { &*snapshots }); - if restyle_behavior == Restyle::ForNewlyBoundElement { - // In this mode, we only ever restyle new elements, so there is no - // need for a post-traversal, and the borrow_data().unwrap() call below - // could panic, so we don't bother computing whether a post-traversal - // is required. - return false; - } - element.has_dirty_descendants() || element.has_animation_only_dirty_descendants() || element.borrow_data().unwrap().restyle.contains_restyle_data() @@ -407,7 +375,7 @@ pub extern "C" fn Servo_AnimationValues_ComputeDistance(from: RawServoAnimationV #[no_mangle] pub extern "C" fn Servo_AnimationCompose(raw_value_map: RawServoAnimationValueMapBorrowedMut, - base_values: *mut ::std::os::raw::c_void, + base_values: RawServoAnimationValueTableBorrowed, css_property: nsCSSPropertyID, segment: RawGeckoAnimationPropertySegmentBorrowed, last_segment: RawGeckoAnimationPropertySegmentBorrowed, @@ -780,6 +748,24 @@ pub extern "C" fn Servo_Element_ClearData(element: RawGeckoElementBorrowed) { } #[no_mangle] +pub extern "C" fn Servo_Element_SizeOfExcludingThis(malloc_size_of: MallocSizeOf, + seen_ptrs: *mut SeenPtrs, + element: RawGeckoElementBorrowed) -> usize { + let malloc_size_of = malloc_size_of.unwrap(); + let element = GeckoElement(element); + let borrow = element.borrow_data(); + if let Some(data) = borrow { + let mut state = SizeOfState { + malloc_size_of: malloc_size_of, + seen_ptrs: seen_ptrs, + }; + (*data).malloc_size_of_children(&mut state) + } else { + 0 + } +} + +#[no_mangle] pub extern "C" fn Servo_StyleSheet_Empty(mode: SheetParsingMode) -> RawServoStyleSheetContentsStrong { let global_style_data = &*GLOBAL_STYLE_DATA; let origin = match mode { @@ -865,6 +851,7 @@ pub extern "C" fn Servo_StyleSet_AppendStyleSheet( #[no_mangle] pub extern "C" fn Servo_StyleSet_MediumFeaturesChanged( raw_data: RawServoStyleSetBorrowed, + viewport_units_used: *mut bool, ) -> bool { let global_style_data = &*GLOBAL_STYLE_DATA; let guard = global_style_data.shared_lock.read(); @@ -881,11 +868,16 @@ pub extern "C" fn Servo_StyleSet_MediumFeaturesChanged( // less often. let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); + unsafe { + *viewport_units_used = data.stylist.device().used_viewport_size(); + } data.stylist.device_mut().reset_computed_values(); - data.stylist.media_features_change_changed_style( + let rules_changed = data.stylist.media_features_change_changed_style( data.stylesheets.iter(), &guard, - ) + ); + + rules_changed } #[no_mangle] @@ -1224,6 +1216,12 @@ impl_group_rule_funcs! { (Document, DocumentRule, RawServoDocumentRule), to_css: Servo_DocumentRule_GetCssText, } +impl_basic_rule_funcs! { (FontFeatureValues, FontFeatureValuesRule, RawServoFontFeatureValuesRule), + getter: Servo_CssRules_GetFontFeatureValuesRuleAt, + debug: Servo_FontFeatureValuesRule_Debug, + to_css: Servo_FontFeatureValuesRule_GetCssText, +} + macro_rules! impl_getter_for_embedded_rule { ($getter:ident: $name:ident -> $ty:ty) => { #[no_mangle] @@ -1515,6 +1513,22 @@ pub extern "C" fn Servo_DocumentRule_GetConditionText(rule: RawServoDocumentRule } #[no_mangle] +pub extern "C" fn Servo_FontFeatureValuesRule_GetFontFamily(rule: RawServoFontFeatureValuesRuleBorrowed, + result: *mut nsAString) { + read_locked_arc(rule, |rule: &FontFeatureValuesRule| { + rule.font_family_to_css(unsafe { result.as_mut().unwrap() }).unwrap(); + }) +} + +#[no_mangle] +pub extern "C" fn Servo_FontFeatureValuesRule_GetValueText(rule: RawServoFontFeatureValuesRuleBorrowed, + result: *mut nsAString) { + read_locked_arc(rule, |rule: &FontFeatureValuesRule| { + rule.value_to_css(unsafe { result.as_mut().unwrap() }).unwrap(); + }) +} + +#[no_mangle] pub extern "C" fn Servo_ComputedValues_GetForAnonymousBox(parent_style_or_null: ServoStyleContextBorrowedOrNull, pseudo_tag: *mut nsIAtom, raw_data: RawServoStyleSetBorrowed) @@ -1611,7 +1625,10 @@ pub extern "C" fn Servo_HasAuthorSpecifiedRules(element: RawGeckoElementBorrowed { let element = GeckoElement(element); - let data = element.borrow_data().unwrap(); + let data = + element.borrow_data() + .expect("calling Servo_HasAuthorSpecifiedRules on an unstyled element"); + let primary_style = data.styles.primary(); let guard = (*GLOBAL_STYLE_DATA).shared_lock.read(); @@ -1659,9 +1676,27 @@ fn get_pseudo_style( }) }, _ => { - debug_assert!(inherited_styles.is_none() || - ptr::eq(inherited_styles.unwrap(), - &**styles.primary())); + // Unfortunately, we can't assert that inherited_styles, if + // present, is pointer-equal to styles.primary(), or even + // equal in any meaningful way. The way it can fail is as + // follows. Say we append an element with a ::before, + // ::after, or ::first-line to a parent with a ::first-line, + // such that the element ends up on the first line of the + // parent (e.g. it's an inline-block in the case it has a + // ::first-line, or any container in the ::before/::after + // cases). Then gecko will update its frame's style to + // inherit from the parent's ::first-line. The next time we + // try to get the ::before/::after/::first-line style for + // the kid, we'll likely pass in the frame's style as + // inherited_styles, but that's not pointer-identical to + // styles.primary(), because it got reparented. + // + // Now in practice this turns out to be OK, because all the + // cases in which there's a mismatch go ahead and reparent + // styles again as needed to make sure the ::first-line + // affects all the things it should affect. But it makes it + // impossible to assert anything about the two styles + // matching here, unfortunately. styles.pseudos.get(&pseudo).cloned() }, } @@ -1746,6 +1781,7 @@ pub extern "C" fn Servo_ComputedValues_Inherit( #[no_mangle] pub extern "C" fn Servo_ComputedValues_GetStyleBits(values: ServoStyleContextBorrowed) -> u64 { use style::properties::computed_value_flags::*; + // FIXME(emilio): We could do this more efficiently I'm quite sure. let flags = values.flags; let mut result = 0; if flags.contains(IS_RELEVANT_LINK_VISITED) { @@ -1760,6 +1796,12 @@ pub extern "C" fn Servo_ComputedValues_GetStyleBits(values: ServoStyleContextBor if flags.contains(IS_TEXT_COMBINED) { result |= structs::NS_STYLE_IS_TEXT_COMBINED as u64; } + if flags.contains(IS_IN_PSEUDO_ELEMENT_SUBTREE) { + result |= structs::NS_STYLE_HAS_PSEUDO_ELEMENT_DATA as u64; + } + if flags.contains(IS_IN_DISPLAY_NONE_SUBTREE) { + result |= structs::NS_STYLE_IN_DISPLAY_NONE_SUBTREE as u64; + } result } @@ -1808,14 +1850,9 @@ pub extern "C" fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextOwned) } #[no_mangle] -pub extern "C" fn Servo_StyleSet_RebuildData(raw_data: RawServoStyleSetBorrowed) { - let global_style_data = &*GLOBAL_STYLE_DATA; - let guard = global_style_data.shared_lock.read(); - +pub extern "C" fn Servo_StyleSet_RebuildCachedData(raw_data: RawServoStyleSetBorrowed) { let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); - data.stylist.device_mut().reset(); - data.stylesheets.force_dirty(); - data.flush_stylesheets::<GeckoElement>(&guard, None); + data.stylist.device_mut().rebuild_cached_data(); } #[no_mangle] @@ -2703,64 +2740,19 @@ pub extern "C" fn Servo_CSSSupports(cond: *const nsACString) -> bool { } } -/// Only safe to call on the main thread, with exclusive access to the element and -/// its ancestors. -unsafe fn maybe_restyle<'a>(data: &'a mut AtomicRefMut<ElementData>, - element: GeckoElement, - animation_only: bool) - -> Option<&'a mut RestyleData> -{ - // Don't generate a useless RestyleData if the element hasn't been styled. - if !data.has_styles() { - return None; - } - - // Propagate the bit up the chain. - if let Some(p) = element.traversal_parent() { - if animation_only { - p.note_descendants::<AnimationOnlyDirtyDescendants>(); - } else { - p.note_descendants::<DirtyDescendants>(); - } - }; - - bindings::Gecko_SetOwnerDocumentNeedsStyleFlush(element.0); - - // Ensure and return the RestyleData. - Some(&mut data.restyle) -} - #[no_mangle] pub extern "C" fn Servo_NoteExplicitHints(element: RawGeckoElementBorrowed, restyle_hint: nsRestyleHint, change_hint: nsChangeHint) { - let element = GeckoElement(element); - let damage = GeckoRestyleDamage::new(change_hint); - debug!("Servo_NoteExplicitHints: {:?}, restyle_hint={:?}, change_hint={:?}", - element, restyle_hint, change_hint); - - let restyle_hint: RestyleHint = restyle_hint.into(); - debug_assert!(!(restyle_hint.has_animation_hint() && - restyle_hint.has_non_animation_hint()), - "Animation restyle hints should not appear with non-animation restyle hints"); - - let mut maybe_data = element.mutate_data(); - let maybe_restyle_data = maybe_data.as_mut().and_then(|d| unsafe { - maybe_restyle(d, element, restyle_hint.has_animation_hint()) - }); - if let Some(restyle_data) = maybe_restyle_data { - restyle_data.hint.insert(restyle_hint.into()); - restyle_data.damage |= damage; - } else { - debug!("(Element not styled, discarding hints)"); - } + GeckoElement(element).note_explicit_hints(restyle_hint, change_hint); } #[no_mangle] pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed, - restyle_behavior: structs::TraversalRestyleBehavior, + raw_flags: ServoTraversalFlags, was_restyled: *mut bool) -> nsChangeHint { + let flags = TraversalFlags::from_bits_truncate(raw_flags); let mut was_restyled = unsafe { was_restyled.as_mut().unwrap() }; let element = GeckoElement(element); @@ -2769,9 +2761,14 @@ pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed, *was_restyled = data.restyle.is_restyle(); let damage = data.restyle.damage; - if restyle_behavior == structs::TraversalRestyleBehavior::ForThrottledAnimationFlush { - debug_assert!(data.restyle.is_restyle() || damage.is_empty(), - "Restyle damage should be empty if the element was not restyled"); + if flags.for_animation_only() { + if !*was_restyled { + // Don't touch elements if the element was not restyled + // in throttled animation flush. + debug!("Skip post traversal for throttled animation flush {:?} restyle={:?}", + element, data.restyle); + return nsChangeHint(0); + } // In the case where we call this function for post traversal for // flusing throttled animations (i.e. without normal restyle // traversal), we need to preserve restyle hints for normal restyle @@ -2799,11 +2796,10 @@ pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed, #[no_mangle] pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed, _raw_data: RawServoStyleSetBorrowed, - restyle_behavior: structs::TraversalRestyleBehavior) + raw_flags: ServoTraversalFlags) -> ServoStyleContextStrong { - use self::structs::TraversalRestyleBehavior as Restyle; - + let flags = TraversalFlags::from_bits_truncate(raw_flags); let element = GeckoElement(element); debug!("Servo_ResolveStyle: {:?}", element); let data = @@ -2813,22 +2809,30 @@ pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed, assert!(data.has_styles(), "Resolving style on unstyled element"); // In the case where we process for throttled animation, there remaings // restyle hints other than animation hints. - let flags = if restyle_behavior == Restyle::ForThrottledAnimationFlush { - ANIMATION_ONLY - } else { - TraversalFlags::empty() - }; debug_assert!(element.has_current_styles_for_traversal(&*data, flags), "Resolving style on {:?} without current styles: {:?}", element, data); data.styles.primary().clone().into() } #[no_mangle] +pub extern "C" fn Servo_ResolveStyleAllowStale(element: RawGeckoElementBorrowed) + -> ServoStyleContextStrong +{ + let element = GeckoElement(element); + debug!("Servo_ResolveStyleAllowStale: {:?}", element); + let data = + element.borrow_data().expect("Resolving style on unstyled element"); + assert!(data.has_styles(), "Resolving style on unstyled element"); + data.styles.primary().clone().into() +} + +#[no_mangle] pub extern "C" fn Servo_ResolveStyleLazily(element: RawGeckoElementBorrowed, pseudo_type: CSSPseudoElementType, rule_inclusion: StyleRuleInclusion, snapshots: *const ServoElementSnapshotTable, - raw_data: RawServoStyleSetBorrowed) + raw_data: RawServoStyleSetBorrowed, + ignore_existing_styles: bool) -> ServoStyleContextStrong { debug_assert!(!snapshots.is_null()); @@ -2859,8 +2863,9 @@ pub extern "C" fn Servo_ResolveStyleLazily(element: RawGeckoElementBorrowed, // In the common case we already have the style. Check that before setting // up all the computation machinery. (Don't use it when we're getting - // default styles, though.) - if rule_inclusion == RuleInclusion::All { + // default styles or in a bfcached document (as indicated by + // ignore_existing_styles), though.) + if rule_inclusion == RuleInclusion::All && !ignore_existing_styles { let styles = element.mutate_data().and_then(|d| { if d.has_styles() { Some(finish(&d.styles)) @@ -2885,10 +2890,63 @@ pub extern "C" fn Servo_ResolveStyleLazily(element: RawGeckoElementBorrowed, thread_local: &mut tlc, }; - let styles = resolve_style(&mut context, element, rule_inclusion); + let styles = resolve_style(&mut context, element, rule_inclusion, ignore_existing_styles); finish(&styles).into() } +#[no_mangle] +pub extern "C" fn Servo_ReparentStyle(style_to_reparent: ServoStyleContextBorrowed, + parent_style: ServoStyleContextBorrowed, + parent_style_ignoring_first_line: ServoStyleContextBorrowed, + layout_parent_style: ServoStyleContextBorrowed, + element: RawGeckoElementBorrowedOrNull, + raw_data: RawServoStyleSetBorrowed) + -> ServoStyleContextStrong +{ + let global_style_data = &*GLOBAL_STYLE_DATA; + let guard = global_style_data.shared_lock.read(); + let doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow(); + let inputs = CascadeInputs::new_from_style(style_to_reparent); + let metrics = get_metrics_provider_for_product(); + let pseudo = style_to_reparent.pseudo(); + let element = element.map(GeckoElement); + + let mut cascade_flags = CascadeFlags::empty(); + if style_to_reparent.is_anon_box() { + cascade_flags.insert(SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP); + } + if let Some(element) = element { + if element.is_link() { + cascade_flags.insert(IS_LINK); + if element.is_visited_link() && + doc_data.visited_styles_enabled() { + cascade_flags.insert(IS_VISITED_LINK); + } + }; + + if element.is_native_anonymous() { + cascade_flags.insert(PROHIBIT_DISPLAY_CONTENTS); + } + } + if let Some(pseudo) = pseudo.as_ref() { + cascade_flags.insert(PROHIBIT_DISPLAY_CONTENTS); + if pseudo.is_fieldset_content() { + cascade_flags.insert(IS_FIELDSET_CONTENT); + } + } + + doc_data.stylist + .compute_style_with_inputs(&inputs, + pseudo.as_ref(), + &StylesheetGuards::same(&guard), + parent_style, + parent_style_ignoring_first_line, + layout_parent_style, + &metrics, + cascade_flags) + .into() +} + #[cfg(feature = "gecko_debug")] fn simulate_compute_values_failure(property: &PropertyValuePair) -> bool { let p = property.mProperty; @@ -2907,6 +2965,7 @@ fn create_context<'a>( style: &'a ComputedValues, parent_style: Option<&'a ComputedValues>, pseudo: Option<&'a PseudoElement>, + for_smil_animation: bool, ) -> Context<'a> { Context { is_root_element: false, @@ -2920,6 +2979,7 @@ fn create_context<'a>( cached_system_font: None, in_media_query: false, quirks_mode: per_doc_data.stylist.quirks_mode(), + for_smil_animation, } } @@ -2989,7 +3049,14 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(keyframes: RawGeckoKeyframeLis let parent_style = parent_data.as_ref().map(|d| d.styles.primary()).map(|x| &**x); let pseudo = style.pseudo(); - let mut context = create_context(&data, &metrics, &style, parent_style, pseudo.as_ref()); + let mut context = create_context( + &data, + &metrics, + &style, + parent_style, + pseudo.as_ref(), + /* for_smil_animation = */ false, + ); let global_style_data = &*GLOBAL_STYLE_DATA; let guard = global_style_data.shared_lock.read(); @@ -3069,7 +3136,14 @@ pub extern "C" fn Servo_GetAnimationValues(declarations: RawServoDeclarationBloc let parent_style = parent_data.as_ref().map(|d| d.styles.primary()).map(|x| &**x); let pseudo = style.pseudo(); - let mut context = create_context(&data, &metrics, &style, parent_style, pseudo.as_ref()); + let mut context = create_context( + &data, + &metrics, + &style, + parent_style, + pseudo.as_ref(), + /* for_smil_animation = */ true + ); let default_values = data.default_computed_values(); let global_style_data = &*GLOBAL_STYLE_DATA; @@ -3098,7 +3172,14 @@ pub extern "C" fn Servo_AnimationValue_Compute(element: RawGeckoElementBorrowed, let parent_style = parent_data.as_ref().map(|d| d.styles.primary()).map(|x| &**x); let pseudo = style.pseudo(); - let mut context = create_context(&data, &metrics, style, parent_style, pseudo.as_ref()); + let mut context = create_context( + &data, + &metrics, + style, + parent_style, + pseudo.as_ref(), + /* for_smil_animation = */ false + ); let default_values = data.default_computed_values(); let global_style_data = &*GLOBAL_STYLE_DATA; diff --git a/ports/geckolib/lib.rs b/ports/geckolib/lib.rs index 37f33245656..7c2c9debc82 100644 --- a/ports/geckolib/lib.rs +++ b/ports/geckolib/lib.rs @@ -4,7 +4,6 @@ #![deny(warnings)] -extern crate atomic_refcell; extern crate cssparser; extern crate env_logger; extern crate libc; diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs index b3ea8be90c0..2dbd0aecd38 100644 --- a/ports/glutin/window.rs +++ b/ports/glutin/window.rs @@ -8,7 +8,7 @@ use NestedEventLoopListener; use compositing::compositor_thread::EventLoopWaker; use compositing::windowing::{AnimationState, MouseWindowEvent}; use compositing::windowing::{WindowEvent, WindowMethods}; -use euclid::{Point2D, Size2D, TypedPoint2D, TypedVector2D, TypedRect, ScaleFactor, TypedSize2D}; +use euclid::{Point2D, Size2D, TypedPoint2D, TypedVector2D, ScaleFactor, TypedSize2D}; #[cfg(target_os = "windows")] use gdi32; use gleam::gl; @@ -43,7 +43,7 @@ use style_traits::DevicePixel; use style_traits::cursor::Cursor; #[cfg(target_os = "windows")] use user32; -use webrender_api::ScrollLocation; +use webrender_api::{DeviceUintRect, DeviceUintSize, ScrollLocation}; #[cfg(target_os = "windows")] use winapi; @@ -962,24 +962,24 @@ impl WindowMethods for Window { self.gl.clone() } - fn framebuffer_size(&self) -> TypedSize2D<u32, DevicePixel> { + fn framebuffer_size(&self) -> DeviceUintSize { match self.kind { WindowKind::Window(ref window) => { let scale_factor = window.hidpi_factor() as u32; // TODO(ajeffrey): can this fail? let (width, height) = window.get_inner_size().expect("Failed to get window inner size."); - TypedSize2D::new(width * scale_factor, height * scale_factor) + DeviceUintSize::new(width, height) * scale_factor } WindowKind::Headless(ref context) => { - TypedSize2D::new(context.width, context.height) + DeviceUintSize::new(context.width, context.height) } } } - fn window_rect(&self) -> TypedRect<u32, DevicePixel> { + fn window_rect(&self) -> DeviceUintRect { let size = self.framebuffer_size(); let origin = TypedPoint2D::zero(); - TypedRect::new(origin, size) + DeviceUintRect::new(origin, size) } fn size(&self) -> TypedSize2D<f32, DeviceIndependentPixel> { diff --git a/rust-commit-hash b/rust-commit-hash index b55425a5311..d4f08fe9764 100644 --- a/rust-commit-hash +++ b/rust-commit-hash @@ -1 +1 @@ -504328a31a211814f9cac6de84c5a7ed154f58eb +599be0d18f4c6ddf36366d2a5a2ca6dc65886896 diff --git a/rust-stable-version b/rust-stable-version index 092afa15df4..815d5ca06d5 100644 --- a/rust-stable-version +++ b/rust-stable-version @@ -1 +1 @@ -1.17.0 +1.19.0 diff --git a/tests/unit/gfx/font_cache_thread.rs b/tests/unit/gfx/font_cache_thread.rs index 91e5b712dc7..e60ca8b9ba4 100644 --- a/tests/unit/gfx/font_cache_thread.rs +++ b/tests/unit/gfx/font_cache_thread.rs @@ -5,7 +5,7 @@ use cssparser::SourceLocation; use gfx::font_cache_thread::FontCacheThread; use ipc_channel::ipc; -use style::computed_values::font_family::FamilyName; +use style::computed_values::font_family::{FamilyName, FamilyNameSyntax}; use style::font_face::{FontFaceRuleData, Source}; #[test] @@ -15,11 +15,11 @@ fn test_local_web_font() { let font_cache_thread = FontCacheThread::new(inp_chan, None); let family_name = FamilyName { name: From::from("test family"), - quoted: true, + syntax: FamilyNameSyntax::Quoted, }; let variant_name = FamilyName { name: From::from("test font face"), - quoted: true, + syntax: FamilyNameSyntax::Quoted, }; let font_face_rule = FontFaceRuleData { family: Some(family_name.clone()), diff --git a/tests/unit/script/textinput.rs b/tests/unit/script/textinput.rs index 620368b4d8f..708a24f9649 100644 --- a/tests/unit/script/textinput.rs +++ b/tests/unit/script/textinput.rs @@ -7,8 +7,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use msg::constellation_msg::{ALT, CONTROL, SUPER}; -use msg::constellation_msg::{Key, KeyModifiers}; +#[cfg(target_os = "macos")] +use msg::constellation_msg::{ALT, SUPER}; +use msg::constellation_msg::{Key, KeyModifiers, CONTROL}; use script::clipboard_provider::DummyClipboardContext; use script::test::DOMString; use script::textinput::{TextInput, TextPoint, Selection, Lines, Direction, SelectionDirection}; diff --git a/tests/unit/style/Cargo.toml b/tests/unit/style/Cargo.toml index 51a0278c989..53585feb667 100644 --- a/tests/unit/style/Cargo.toml +++ b/tests/unit/style/Cargo.toml @@ -9,9 +9,6 @@ name = "style_tests" path = "lib.rs" doctest = false -[features] -testing = ["style/testing"] - [dependencies] byteorder = "1.0" app_units = "0.5" diff --git a/tests/unit/style/lib.rs b/tests/unit/style/lib.rs index 0647a59251f..572a608d212 100644 --- a/tests/unit/style/lib.rs +++ b/tests/unit/style/lib.rs @@ -19,7 +19,7 @@ extern crate servo_atoms; extern crate servo_config; extern crate servo_url; #[macro_use] extern crate size_of_test; -extern crate style; +#[macro_use] extern crate style; extern crate style_traits; extern crate test; @@ -32,6 +32,8 @@ mod parsing; mod properties; mod rule_tree; mod size_of; +#[path = "../stylo/specified_values.rs"] +mod specified_values; mod str; mod stylesheets; mod stylist; diff --git a/tests/unit/style/parsing/mod.rs b/tests/unit/style/parsing/mod.rs index ed69ee9fe70..5f2a86514d2 100644 --- a/tests/unit/style/parsing/mod.rs +++ b/tests/unit/style/parsing/mod.rs @@ -60,6 +60,7 @@ fn assert_computed_serialization<C, F, T>(f: F, input: &'static str, output: &st font_metrics_provider: &ServoMetricsProvider, in_media_query: false, quirks_mode: QuirksMode::NoQuirks, + for_smil_animation: false, }; let parsed = parse(f, input).unwrap(); diff --git a/tests/unit/style/parsing/selectors.rs b/tests/unit/style/parsing/selectors.rs index 15611dd093c..8d6e94fd471 100644 --- a/tests/unit/style/parsing/selectors.rs +++ b/tests/unit/style/parsing/selectors.rs @@ -14,6 +14,7 @@ fn parse_selector<'i, 't>(input: &mut Parser<'i, 't>) -> Result<SelectorList<Sel let parser = SelectorParser { stylesheet_origin: Origin::UserAgent, namespaces: &ns, + url_data: None, }; SelectorList::parse(&parser, input) } diff --git a/tests/unit/style/properties/serialization.rs b/tests/unit/style/properties/serialization.rs index 59013d1a01e..3cf56a1dc7f 100644 --- a/tests/unit/style/properties/serialization.rs +++ b/tests/unit/style/properties/serialization.rs @@ -268,10 +268,12 @@ mod shorthand_serialization { #[test] fn padding_should_serialize_correctly() { + use style::values::specified::NonNegativeLengthOrPercentage; + let mut properties = Vec::new(); - let px_10 = LengthOrPercentage::Length(NoCalcLength::from_px(10f32)); - let px_15 = LengthOrPercentage::Length(NoCalcLength::from_px(15f32)); + let px_10: NonNegativeLengthOrPercentage = NoCalcLength::from_px(10f32).into(); + let px_15: NonNegativeLengthOrPercentage = NoCalcLength::from_px(15f32).into(); properties.push(PropertyDeclaration::PaddingTop(px_10.clone())); properties.push(PropertyDeclaration::PaddingRight(px_15.clone())); properties.push(PropertyDeclaration::PaddingBottom(px_10)); @@ -556,12 +558,12 @@ mod shorthand_serialization { #[test] fn flex_should_serialize_all_available_properties() { - use style::values::specified::{Number, Percentage}; + use style::values::specified::{NonNegativeNumber, Percentage}; let mut properties = Vec::new(); - let grow = Number::new(2f32); - let shrink = Number::new(3f32); + let grow = NonNegativeNumber::new(2f32); + let shrink = NonNegativeNumber::new(3f32); let basis = FlexBasis::Length(Percentage::new(0.5f32).into()); @@ -1239,13 +1241,15 @@ mod shorthand_serialization { #[test] fn box_shadow_should_serialize_correctly() { + use style::values::specified::length::NonNegativeLength; + let mut properties = Vec::new(); let shadow_val = BoxShadow { base: SimpleShadow { color: None, horizontal: Length::from_px(1f32), vertical: Length::from_px(2f32), - blur: Some(Length::from_px(3f32)), + blur: Some(NonNegativeLength::from_px(3f32)), }, spread: Some(Length::from_px(4f32)), inset: false, diff --git a/tests/unit/style/size_of.rs b/tests/unit/style/size_of.rs index 486fecf4e25..3f15a8d24e4 100644 --- a/tests/unit/style/size_of.rs +++ b/tests/unit/style/size_of.rs @@ -12,8 +12,3 @@ size_of_test!(test_size_of_property_declaration, properties::PropertyDeclaration // This is huge, but we allocate it on the stack and then never move it, // we only pass `&mut SourcePropertyDeclaration` references around. size_of_test!(test_size_of_parsed_declaration, properties::SourcePropertyDeclaration, 576); - -#[test] -fn size_of_specified_values() { - ::style::properties::test_size_of_specified_values(); -} diff --git a/tests/unit/style/stylesheets.rs b/tests/unit/style/stylesheets.rs index f41686c76ff..17833893cf4 100644 --- a/tests/unit/style/stylesheets.rs +++ b/tests/unit/style/stylesheets.rs @@ -14,20 +14,24 @@ use servo_url::ServoUrl; use std::borrow::ToOwned; use std::sync::Mutex; use std::sync::atomic::AtomicBool; +use style::computed_values::font_family::{FamilyName, FamilyNameSyntax}; use style::context::QuirksMode; use style::error_reporting::{ParseErrorReporter, ContextualParseError}; use style::media_queries::MediaList; use style::properties::Importance; use style::properties::{CSSWideKeyword, DeclaredValueOwned, PropertyDeclaration, PropertyDeclarationBlock}; use style::properties::longhands; -use style::properties::longhands::animation_play_state; +use style::properties::longhands::animation_timing_function; use style::shared_lock::SharedRwLock; use style::stylesheets::{Origin, Namespaces}; use style::stylesheets::{Stylesheet, StylesheetContents, NamespaceRule, CssRule, CssRules, StyleRule, KeyframesRule}; +use style::stylesheets::font_feature_values_rule::{FFVDeclaration, FontFeatureValuesRule}; +use style::stylesheets::font_feature_values_rule::{SingleValue, PairValues, VectorValues}; use style::stylesheets::keyframes_rule::{Keyframe, KeyframeSelector, KeyframePercentage}; use style::values::{KeyframesName, CustomIdent}; use style::values::computed::Percentage; use style::values::specified::{LengthOrPercentageOrAuto, PositionComponent}; +use style::values::specified::transform::TimingFunction; pub fn block_from<I>(iterable: I) -> PropertyDeclarationBlock where I: IntoIterator<Item=(PropertyDeclaration, Importance)> { @@ -62,8 +66,16 @@ fn test_parse_stylesheet() { width: 100%; width: 50% !important; /* !important not allowed here */ animation-name: 'foo'; /* animation properties not allowed here */ - animation-play-state: running; /* … except animation-play-state */ + animation-timing-function: ease; /* … except animation-timing-function */ } + } + @font-feature-values test { + @swash { foo: 12; bar: 24; } + @swash { bar: 36; baz: 48; } + @stylistic { fooo: 14; } + @rubbish { shouldnt-parse: 1; } + @styleset { hello: 10 11 12; } + @character-variant { ok: 78 2; } }"; let url = ServoUrl::parse("about::test").unwrap(); let lock = SharedRwLock::new(); @@ -226,9 +238,9 @@ fn test_parse_stylesheet() { (PropertyDeclaration::Width( LengthOrPercentageOrAuto::Percentage(Percentage(1.))), Importance::Normal), - (PropertyDeclaration::AnimationPlayState( - animation_play_state::SpecifiedValue( - vec![animation_play_state::SingleSpecifiedValue::running])), + (PropertyDeclaration::AnimationTimingFunction( + animation_timing_function::SpecifiedValue( + vec![TimingFunction::ease()])), Importance::Normal), ]))), })), @@ -238,6 +250,50 @@ fn test_parse_stylesheet() { line: 16, column: 19, }, + }))), + CssRule::FontFeatureValues(Arc::new(stylesheet.shared_lock.wrap(FontFeatureValuesRule { + family_names: vec![FamilyName { + name: Atom::from("test"), + syntax: FamilyNameSyntax::Identifiers(String::from("test")), + }], + swash: vec![ + FFVDeclaration { + name: "foo".into(), + value: SingleValue(12 as u32), + }, + FFVDeclaration { + name: "bar".into(), + value: SingleValue(36 as u32), + }, + FFVDeclaration { + name: "baz".into(), + value: SingleValue(48 as u32), + } + ], + stylistic: vec![ + FFVDeclaration { + name: "fooo".into(), + value: SingleValue(14 as u32), + } + ], + ornaments: vec![], + annotation: vec![], + character_variant: vec![ + FFVDeclaration { + name: "ok".into(), + value: PairValues(78 as u32, Some(2 as u32)), + }, + ], + styleset: vec![ + FFVDeclaration { + name: "hello".into(), + value: VectorValues(vec![10 as u32, 11 as u32, 12 as u32]), + }, + ], + source_location: SourceLocation { + line: 25, + column: 29, + }, }))) ], &stylesheet.shared_lock), @@ -322,7 +378,7 @@ fn test_report_error_stylesheet() { let error = errors.pop().unwrap(); assert_eq!("Unsupported property declaration: 'display: invalid;', \ - Custom(PropertyDeclaration(InvalidValue(\"display\")))", error.message); + Custom(PropertyDeclaration(InvalidValue(\"display\", None)))", error.message); assert_eq!(8, error.line); assert_eq!(8, error.column); diff --git a/tests/unit/style/stylist.rs b/tests/unit/style/stylist.rs index da9a9478957..dcc288a20b4 100644 --- a/tests/unit/style/stylist.rs +++ b/tests/unit/style/stylist.rs @@ -20,7 +20,7 @@ use style::selector_parser::{SelectorImpl, SelectorParser}; use style::shared_lock::SharedRwLock; use style::stylesheets::StyleRule; use style::stylist::{Stylist, Rule}; -use style::stylist::needs_revalidation; +use style::stylist::needs_revalidation_for_testing; use style::thread_state; /// Helper method to get some Rules from selector strings. @@ -83,13 +83,12 @@ fn test_revalidation_selectors() { "div > span", // ID selectors. - "#foo1", // FIXME(bz) This one should not be a revalidation - // selector once we fix - // https://bugzilla.mozilla.org/show_bug.cgi?id=1369611 + "#foo1", "#foo2::before", "#foo3 > span", - "#foo1 > span", // FIXME(bz) This one should not be a - // revalidation selector either. + "#foo1 > span", // FIXME(bz): This one should not be a + // revalidation selector, since #foo1 should be in the + // rule hash. // Attribute selectors. "div[foo]", @@ -126,13 +125,11 @@ fn test_revalidation_selectors() { // Selectors in the ancestor chain (needed for cousin sharing). "p:first-child span", ]).into_iter() - .filter(|s| needs_revalidation(&s)) + .filter(|s| needs_revalidation_for_testing(&s)) .collect::<Vec<_>>(); let reference = parse_selectors(&[ // ID selectors. - "#foo1", - "#foo2::before", "#foo3 > span", "#foo1 > span", diff --git a/tests/unit/stylo/Cargo.toml b/tests/unit/stylo/Cargo.toml index 21eab2958a1..b3381276ff1 100644 --- a/tests/unit/stylo/Cargo.toml +++ b/tests/unit/stylo/Cargo.toml @@ -11,9 +11,6 @@ name = "stylo_tests" path = "lib.rs" doctest = false -[features] -testing = ["style/testing"] - [dependencies] atomic_refcell = "0.1" cssparser = "0.18" diff --git a/tests/unit/stylo/check_bindings.py b/tests/unit/stylo/check_bindings.py index f4cdc5b6655..b337aa7665a 100755 --- a/tests/unit/stylo/check_bindings.py +++ b/tests/unit/stylo/check_bindings.py @@ -24,10 +24,7 @@ with open(INPUT_FILE, "r") as bindings, open(OUTPUT_FILE, "w+") as tests: for line in bindings: match = pattern.search(line) - - # GetStyleVariables is a Servo_* function, but temporarily defined on - # the gecko side - if match and match.group(1) != "GetStyleVariables": + if match: tests.write(TEMPLATE.format(name=match.group(1))) tests.write("}\n") diff --git a/tests/unit/stylo/lib.rs b/tests/unit/stylo/lib.rs index 05a32869c4e..45b9d63a9fd 100644 --- a/tests/unit/stylo/lib.rs +++ b/tests/unit/stylo/lib.rs @@ -14,6 +14,7 @@ extern crate style_traits; mod sanity_checks; mod size_of; +mod specified_values; mod servo_function_signatures; diff --git a/tests/unit/stylo/size_of.rs b/tests/unit/stylo/size_of.rs index 4f4521df9e2..3a830e1c40a 100644 --- a/tests/unit/stylo/size_of.rs +++ b/tests/unit/stylo/size_of.rs @@ -47,8 +47,3 @@ size_of_test!(test_size_of_rule_node, RuleNode, 80); // This is huge, but we allocate it on the stack and then never move it, // we only pass `&mut SourcePropertyDeclaration` references around. size_of_test!(test_size_of_parsed_declaration, style::properties::SourcePropertyDeclaration, 704); - -#[test] -fn size_of_specified_values() { - ::style::properties::test_size_of_specified_values(); -} diff --git a/tests/unit/stylo/specified_values.rs b/tests/unit/stylo/specified_values.rs new file mode 100644 index 00000000000..484f9534502 --- /dev/null +++ b/tests/unit/stylo/specified_values.rs @@ -0,0 +1,49 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +use style; + +#[test] +fn size_of_specified_values() { + use std::mem::size_of; + let threshold = 24; + + let mut bad_properties = vec![]; + + macro_rules! check_property { + ( $( { $name: ident, $boxed: expr } )+ ) => { + $( + let size = size_of::<style::properties::longhands::$name::SpecifiedValue>(); + let is_boxed = $boxed; + if (!is_boxed && size > threshold) || (is_boxed && size <= threshold) { + bad_properties.push(("$name", size, is_boxed)); + } + )+ + } + } + + longhand_properties_idents!(check_property); + + let mut failing_messages = vec![]; + + for bad_prop in bad_properties { + if !bad_prop.2 { + failing_messages.push( + format!("Your changes have increased the size of {} SpecifiedValue to {}. The threshold is \ + currently {}. SpecifiedValues affect size of PropertyDeclaration enum and \ + increasing the size may negative affect style system performance. Please consider \ + using `boxed=\"True\"` in this longhand.", + bad_prop.0, bad_prop.1, threshold)); + } else if bad_prop.2 { + failing_messages.push( + format!("Your changes have decreased the size of {} SpecifiedValue to {}. Good work! \ + The threshold is currently {}. Please consider removing `boxed=\"True\"` from this longhand.", + bad_prop.0, bad_prop.1, threshold)); + } + } + + if !failing_messages.is_empty() { + panic!("{}", failing_messages.join("\n\n")); + } +} diff --git a/tests/wpt/README.md b/tests/wpt/README.md index 8382e206aad..1c01473bd71 100644 --- a/tests/wpt/README.md +++ b/tests/wpt/README.md @@ -64,9 +64,12 @@ environment. Running the tests manually -------------------------- +(See also [the relevant section of the upstream README][upstream-running].) + It can be useful to run a test without the interference of the test runner, for -example when using a debugger such as `gdb`. In that case, start the server by -first adding the following to the system's hosts file: +example when using a debugger such as `gdb`. + +To do this, first add the following to the system's hosts file: 127.0.0.1 www.web-platform.test 127.0.0.1 www1.web-platform.test @@ -75,9 +78,35 @@ first adding the following to the system's hosts file: 127.0.0.1 xn--n8j6ds53lwwkrqhv28a.web-platform.test 127.0.0.1 xn--lve-6lad.web-platform.test -and then running `python serve` from `tests/wpt/web-platform-tests`. +Then, navigate to `tests/wpt/web-platform-tests`. Next, create a directory, +e.g. `local-resources/`, to contain a local copy of the +`resources/testharnessreport.js` file. The version in the repository is +actually a Python format string that has substitution done on it by +`harness/wptrunner/environment.py` to configure test output. Then, place a +modified copy of the `testharnessreport.js` file in that directory, removing +the format string variable: + + mkdir local-resources + cp resources/testharnessreport.js local-resources/ + $EDITOR local-resources/testharnessreport.js + # Replace `output:%(output)d` with `output:1` or `output:0`. + +Now create a configuration file at `config.json` for the web-platform-tests +server (configuration options you don't specify will be loaded from the +defaults at `config.default.json`) with the following contents: + + {"aliases": [ + {"url-path": "/resources/testharnessreport.js", + "local-dir": "local-resources" + } + ] + } + +Finally, you can run `python serve` from `tests/wpt/web-platform-tests`. Then navigate Servo to `http://web-platform.test:8000/path/to/test`. +[upstream-running]: https://github.com/w3c/web-platform-tests#running-the-tests + Running the tests in Firefox ---------------------------- diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-1.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-1.htm.ini deleted file mode 100644 index 8b92d2cee28..00000000000 --- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-1.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[attachment-local-clipping-image-1.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-2.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-2.htm.ini deleted file mode 100644 index ccfa81e106b..00000000000 --- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-2.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[attachment-local-clipping-image-2.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-3.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-3.htm.ini deleted file mode 100644 index 650a371c595..00000000000 --- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-3.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[attachment-local-clipping-image-3.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-4.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-4.htm.ini deleted file mode 100644 index 5d6a3d38484..00000000000 --- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-4.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[attachment-local-clipping-image-4.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-5.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-5.htm.ini deleted file mode 100644 index 176412407e3..00000000000 --- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-5.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[attachment-local-clipping-image-5.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-6.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-6.htm.ini deleted file mode 100644 index c58b15efad7..00000000000 --- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-clipping-image-6.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[attachment-local-clipping-image-6.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-positioning-2.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-positioning-2.htm.ini deleted file mode 100644 index 294802ca0c9..00000000000 --- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-positioning-2.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[attachment-local-positioning-2.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-positioning-5.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-positioning-5.htm.ini deleted file mode 100644 index 94f0d1bdfc9..00000000000 --- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-local-positioning-5.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[attachment-local-positioning-5.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-scroll-positioning-1.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-scroll-positioning-1.htm.ini deleted file mode 100644 index c01b934ef28..00000000000 --- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/attachment-scroll-positioning-1.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[attachment-scroll-positioning-1.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/scroll-positioned-multiple-background-images.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/scroll-positioned-multiple-background-images.htm.ini deleted file mode 100644 index e4b266d8a0d..00000000000 --- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/scroll-positioned-multiple-background-images.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[scroll-positioned-multiple-background-images.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-transforms-1_dev/html/css-transforms-3d-on-anonymous-block-001.htm.ini b/tests/wpt/metadata-css/css-transforms-1_dev/html/css-transforms-3d-on-anonymous-block-001.htm.ini deleted file mode 100644 index 59ea4059dbe..00000000000 --- a/tests/wpt/metadata-css/css-transforms-1_dev/html/css-transforms-3d-on-anonymous-block-001.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[css-transforms-3d-on-anonymous-block-001.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 43f8f110edd..155f9a504d4 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -1583,6 +1583,18 @@ {} ] ], + "css/fixed_position_css_clip.html": [ + [ + "/_mozilla/css/fixed_position_css_clip.html", + [ + [ + "/_mozilla/css/fixed_position_css_clip_ref.html", + "==" + ] + ], + {} + ] + ], "css/fixed_width_overrides_child_intrinsic_width_a.html": [ [ "/_mozilla/css/fixed_width_overrides_child_intrinsic_width_a.html", @@ -8179,6 +8191,11 @@ {} ] ], + "css/fixed_position_css_clip_ref.html": [ + [ + {} + ] + ], "css/fixed_width_overrides_child_intrinsic_width_ref.html": [ [ {} @@ -23064,6 +23081,14 @@ "fe23d2dc9a4507b3b632518a53f21900d0e4d1d7", "support" ], + "css/fixed_position_css_clip.html": [ + "2bf1fb572a72fbb4a7a35b8c8b08960b48ccf408", + "reftest" + ], + "css/fixed_position_css_clip_ref.html": [ + "ad0341fc9f843177ccf53a1667b5016c234b7651", + "support" + ], "css/fixed_width_overrides_child_intrinsic_width_a.html": [ "88cf78524712525ad4252c8a420c9b9f545b2621", "reftest" diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-003.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-003.html.ini index 4d64cf8cc17..3456082d906 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-003.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-003.html.ini @@ -1,4 +1,4 @@ [geometry-background-image-003.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17674 + bug: https://github.com/w3c/web-platform-tests/issues/6601 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-border-image-005.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-border-image-005.html.ini index 3b1eb7e58f9..698327ced1d 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-border-image-005.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-border-image-005.html.ini @@ -1,4 +1,4 @@ [geometry-border-image-005.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17451 + bug: https://github.com/w3c/web-platform-tests/issues/6610 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/paint-arguments.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/paint-arguments.html.ini deleted file mode 100644 index 64a88871ab3..00000000000 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/paint-arguments.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[paint-arguments.html] - type: reftest - expected: FAIL - bug: https://github.com/servo/servo/issues/17435 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/paint-function-arguments.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/paint-function-arguments.html.ini deleted file mode 100644 index 80fbfd4780c..00000000000 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/paint-function-arguments.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[paint-function-arguments.html] - type: reftest - expected: FAIL - bug: https://github.com/servo/servo/issues/17435 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/paint2d-zoom.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/paint2d-zoom.html.ini index 28c6ee11fbb..2e2c7da2351 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/paint2d-zoom.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/paint2d-zoom.html.ini @@ -1,4 +1,4 @@ [paint2d-zoom.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17674 + bug: https://github.com/w3c/web-platform-tests/issues/6610 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-002.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-002.html.ini index a717b68bf42..62235af2bed 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-002.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-002.html.ini @@ -1,4 +1,4 @@ [parse-input-arguments-002.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17435 + bug: https://github.com/servo/servo/issues/17852 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-003.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-003.html.ini index 67813fc3cbc..7f9510423eb 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-003.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-003.html.ini @@ -1,4 +1,4 @@ [parse-input-arguments-003.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17435 + bug: https://github.com/servo/servo/issues/17852 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-005.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-005.html.ini index 03624fca377..e6e779786ad 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-005.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-005.html.ini @@ -1,4 +1,4 @@ [parse-input-arguments-005.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17435 + bug: https://github.com/servo/servo/issues/17852 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-006.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-006.html.ini index fb190835abd..ae94f1f8a9c 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-006.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-006.html.ini @@ -1,4 +1,4 @@ [parse-input-arguments-006.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17435 + bug: https://github.com/servo/servo/issues/17852 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-008.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-008.html.ini index bef2034cccd..d98d019bdf6 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-008.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-008.html.ini @@ -1,4 +1,4 @@ [parse-input-arguments-008.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17435 + bug: https://github.com/servo/servo/issues/17852 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-009.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-009.html.ini index a28813feb2a..fcf29006fb5 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-009.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-009.html.ini @@ -1,4 +1,4 @@ [parse-input-arguments-009.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17435 + bug: https://github.com/servo/servo/issues/17852 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-010.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-010.html.ini index 17956bbfa35..e33e2a45e2d 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-010.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-010.html.ini @@ -1,4 +1,4 @@ [parse-input-arguments-010.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17435 + bug: https://github.com/servo/servo/issues/17852 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-011.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-011.html.ini index 7e721c32198..f75167a90d9 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-011.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-011.html.ini @@ -1,4 +1,4 @@ [parse-input-arguments-011.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17435 + bug: https://github.com/servo/servo/issues/17852 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-012.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-012.html.ini index 1c1b2f28927..cb2edbc3677 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-012.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-012.html.ini @@ -1,4 +1,4 @@ [parse-input-arguments-012.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17435 + bug: https://github.com/servo/servo/issues/17852 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-016.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-016.html.ini index 567031ee41e..a6a654a478f 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-016.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/parse-input-arguments-016.html.ini @@ -1,4 +1,4 @@ [parse-input-arguments-016.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17435 + bug: https://github.com/servo/servo/issues/17852 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/style-background-image.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/style-background-image.html.ini index 5632e4c5931..b5b74284aa0 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/style-background-image.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/style-background-image.html.ini @@ -1,4 +1,4 @@ [style-background-image.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17579 + bug: https://github.com/servo/servo/issues/17378 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/style-before-pseudo.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/style-before-pseudo.html.ini index c3ae11d8b7c..8e3e18c50ad 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/style-before-pseudo.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/style-before-pseudo.html.ini @@ -1,4 +1,4 @@ [style-before-pseudo.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17579 + bug: https://github.com/servo/servo/issues/17854 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/style-first-letter-pseudo.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/style-first-letter-pseudo.html.ini index 521e635bece..55518de2716 100644 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/style-first-letter-pseudo.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/css-paint-api/style-first-letter-pseudo.html.ini @@ -1,4 +1,4 @@ [style-first-letter-pseudo.html] type: reftest expected: FAIL - bug: https://github.com/servo/servo/issues/17579 + bug: https://github.com/servo/servo/issues/17854 diff --git a/tests/wpt/mozilla/tests/css/fixed_position_css_clip.html b/tests/wpt/mozilla/tests/css/fixed_position_css_clip.html new file mode 100644 index 00000000000..e8979e3b15f --- /dev/null +++ b/tests/wpt/mozilla/tests/css/fixed_position_css_clip.html @@ -0,0 +1,40 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>Fixed position elements should be clipped by parent CSS clips</title> + <link rel="match" href="fixed_position_css_clip_ref.html"> + <style> + body { + margin: 0px; + } + + #base { + position: absolute; + left; 0px; + top: 0px; + background: red; + width: 100px; + height: 100px; + clip: rect(0, auto, auto, 0); + } + + #fixed { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: green; + } + </style> + </head> + <body> + <div id="base"> + <!-- Even though this fixed position child is positioned and clipped by the + containing block, it should also be clipped by the CSS clip of its + non-containing block parent. --> + <div id="fixed"></div> + </div> + </body> +</html> diff --git a/tests/wpt/mozilla/tests/css/fixed_position_css_clip_ref.html b/tests/wpt/mozilla/tests/css/fixed_position_css_clip_ref.html new file mode 100644 index 00000000000..2eb73b74768 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/fixed_position_css_clip_ref.html @@ -0,0 +1,24 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>Fixed position elements should be clipped by parent CSS clips</title> + <style> + body { + margin: 0px; + } + + #box { + left; 0px; + top: 0px; + background: green; + width: 100px; + height: 100px; + clip: rect(0, auto, auto, 0); + } + </style> + </head> + <body> + <div id="box"> + </body> +</html> |