diff --git a/Cargo.lock b/Cargo.lock index 48eb0a0f..f26a27f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -101,7 +101,7 @@ dependencies = [ "bitflags 2.5.0", "cc", "cesu8", - "jni 0.21.1", + "jni", "jni-sys", "libc", "log", @@ -124,30 +124,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" -[[package]] -name = "android_injected_glue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80b9e34fcbf29c0563547cb2ecce9b49504597cad6166769b1e4efb45c6c2951" - -[[package]] -name = "android_log-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ecc8056bf6ab9892dcd53216c83d1597487d7dacac16c8df6b877d127df9937" - -[[package]] -name = "android_logger" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c494134f746c14dc653a35a4ea5aca24ac368529da5370ecf41fe0341c35772f" -dependencies = [ - "android_log-sys", - "env_logger 0.10.2", - "log", - "once_cell", -] - [[package]] name = "android_system_properties" version = "0.1.5" @@ -157,12 +133,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anyhow" -version = "1.0.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" - [[package]] name = "app_units" version = "0.7.5" @@ -173,25 +143,6 @@ dependencies = [ "serde", ] -[[package]] -name = "arboard" -version = "3.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2041f1943049c7978768d84e6d0fd95de98b76d6c4727b09e78ec253d29fa58" -dependencies = [ - "clipboard-win", - "core-graphics", - "image", - "log", - "objc", - "objc-foundation", - "objc_id", - "parking_lot", - "thiserror", - "windows-sys 0.48.0", - "x11rb", -] - [[package]] name = "arrayref" version = "0.3.7" @@ -233,28 +184,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "async-stream" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] - [[package]] name = "async-tungstenite" version = "0.23.0" @@ -292,16 +221,16 @@ checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "background_hang_monitor" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "backtrace", "crossbeam-channel", "ipc-channel", - "lazy_static", "libc", "log", "mach2", "msg", - "nix 0.27.1", + "nix", "serde_json", "unwind-sys", ] @@ -432,6 +361,7 @@ dependencies = [ [[package]] name = "bluetooth" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "bitflags 2.5.0", "bluetooth_traits", @@ -450,6 +380,7 @@ dependencies = [ [[package]] name = "bluetooth_traits" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "embedder_traits", "ipc-channel", @@ -466,6 +397,7 @@ checksum = "19b23557dd27704797128f9db2816416bef20dad62d4a9768714eeb65f07d296" [[package]] name = "blurmac" version = "0.1.0" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "log", "objc", @@ -539,20 +471,6 @@ name = "bytemuck" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] [[package]] name = "byteorder" @@ -595,6 +513,7 @@ dependencies = [ [[package]] name = "canvas" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "bitflags 2.5.0", "byteorder", @@ -618,7 +537,6 @@ dependencies = [ "style", "style_traits", "surfman", - "time 0.1.45", "webrender", "webrender_api", "webrender_traits", @@ -629,6 +547,7 @@ dependencies = [ [[package]] name = "canvas_traits" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "crossbeam-channel", "euclid", @@ -642,7 +561,6 @@ dependencies = [ "servo_config", "sparkle", "style", - "time 0.1.45", "webrender_api", "webxr-api", ] @@ -673,16 +591,6 @@ dependencies = [ "nom", ] -[[package]] -name = "cfg-expr" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" -dependencies = [ - "smallvec", - "target-lexicon", -] - [[package]] name = "cfg-if" version = "1.0.0" @@ -730,12 +638,19 @@ dependencies = [ ] [[package]] -name = "clipboard-win" -version = "5.3.1" +name = "cocoa" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79f4473f5144e20d9aceaf2972478f06ddf687831eafeeb434fbaf0acc4144ad" +checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" dependencies = [ - "error-code", + "bitflags 1.3.2", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics 0.22.3", + "foreign-types 0.3.2", + "libc", + "objc", ] [[package]] @@ -748,7 +663,7 @@ dependencies = [ "block", "cocoa-foundation", "core-foundation", - "core-graphics", + "core-graphics 0.23.2", "foreign-types 0.5.0", "libc", "objc", @@ -794,32 +709,10 @@ dependencies = [ "memchr", ] -[[package]] -name = "compiletest_rs" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7225fee1bcf9247bb3a1b1a2d7ecfe2f7a990e549a09d766a257a4ae30dac0d6" -dependencies = [ - "diff", - "filetime", - "getopts", - "lazy_static", - "libc", - "log", - "miow", - "regex", - "rustfix", - "serde", - "serde_derive", - "serde_json", - "tempfile", - "tester", - "winapi", -] - [[package]] name = "compositing" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "canvas", "compositing_traits", @@ -846,7 +739,7 @@ dependencies = [ "servo_url", "style_traits", "time 0.1.45", - "toml 0.5.11", + "toml", "webrender", "webrender_api", "webxr", @@ -855,6 +748,7 @@ dependencies = [ [[package]] name = "compositing_traits" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "canvas", "crossbeam-channel", @@ -884,6 +778,7 @@ dependencies = [ [[package]] name = "constellation" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "background_hang_monitor", "backtrace", @@ -973,6 +868,19 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types 0.3.2", + "libc", +] + [[package]] name = "core-graphics" version = "0.23.2" @@ -1004,7 +912,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9d2790b5c08465d49f8dc05c8bcae9fea467855947db39b0f8145c091aaced5" dependencies = [ "core-foundation", - "core-graphics", + "core-graphics 0.23.2", "foreign-types 0.5.0", "libc", ] @@ -1070,14 +978,6 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" -[[package]] -name = "crown" -version = "0.1.0" -dependencies = [ - "compiletest_rs", - "once_cell", -] - [[package]] name = "crunchy" version = "0.2.2" @@ -1204,18 +1104,12 @@ dependencies = [ [[package]] name = "deny_public_fields" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "syn 2.0.60", "synstructure 0.13.1", ] -[[package]] -name = "deny_public_fields_tests" -version = "0.0.1" -dependencies = [ - "deny_public_fields", -] - [[package]] name = "deranged" version = "0.3.11" @@ -1251,6 +1145,7 @@ dependencies = [ [[package]] name = "devtools" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "chrono", "crossbeam-channel", @@ -1272,6 +1167,7 @@ dependencies = [ [[package]] name = "devtools_traits" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "bitflags 2.5.0", "http", @@ -1285,12 +1181,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - [[package]] name = "digest" version = "0.10.7" @@ -1351,6 +1241,7 @@ dependencies = [ [[package]] name = "dom_struct" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "quote", "syn 2.0.60", @@ -1359,6 +1250,7 @@ dependencies = [ [[package]] name = "domobject_derive" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "proc-macro2", "quote", @@ -1400,77 +1292,16 @@ dependencies = [ "wio", ] -[[package]] -name = "ecolor" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03cfe80b1890e1a8cdbffc6044d6872e814aaf6011835a2a5e2db0e5c5c4ef4e" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "egui" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180f595432a5b615fc6b74afef3955249b86cfea72607b40740a4cd60d5297d0" -dependencies = [ - "ahash", - "epaint", - "log", - "nohash-hasher", -] - -[[package]] -name = "egui-winit" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4d44f8d89f70d4480545eb2346b76ea88c3022e9f4706cebc799dbe8b004a2" -dependencies = [ - "arboard", - "egui", - "log", - "raw-window-handle", - "smithay-clipboard", - "web-time", - "winit", -] - -[[package]] -name = "egui_glow" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08e3be8728b4c59493dbfec041c657e6725bdeafdbd49aef3f1dbb9e551fa01" -dependencies = [ - "bytemuck", - "egui", - "egui-winit", - "glow", - "log", - "memoffset", - "wasm-bindgen", - "web-sys", - "winit", -] - [[package]] name = "either" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" -[[package]] -name = "emath" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6916301ecf80448f786cdf3eb51d9dbdd831538732229d49119e2d4312eaaf09" -dependencies = [ - "bytemuck", -] - [[package]] name = "embedder_traits" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "cfg-if", "crossbeam-channel", @@ -1534,16 +1365,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "env_logger" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" -dependencies = [ - "log", - "regex", -] - [[package]] name = "env_logger" version = "0.10.2" @@ -1557,22 +1378,6 @@ dependencies = [ "termcolor", ] -[[package]] -name = "epaint" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77b9fdf617dd7f58b0c8e6e9e4a1281f730cde0831d40547da446b2bb76a47af" -dependencies = [ - "ab_glyph", - "ahash", - "bytemuck", - "ecolor", - "emath", - "log", - "nohash-hasher", - "parking_lot", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -1589,12 +1394,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "error-code" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0474425d51df81997e2f90a21591180b38eccf27292d755f3e30750225c175b" - [[package]] name = "etagere" version = "0.2.10" @@ -1705,7 +1504,7 @@ dependencies = [ "bitflags 2.5.0", "byteorder", "core-foundation", - "core-graphics", + "core-graphics 0.23.2", "core-text", "dirs-next", "dwrote", @@ -1814,12 +1613,6 @@ dependencies = [ "new_debug_unreachable", ] -[[package]] -name = "futures" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" - [[package]] name = "futures" version = "0.3.30" @@ -1897,7 +1690,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ - "futures 0.1.31", "futures-channel", "futures-core", "futures-io", @@ -1972,13 +1764,14 @@ dependencies = [ [[package]] name = "gfx" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "app_units", "atomic_refcell", "bitflags 2.5.0", "byteorder", "core-foundation", - "core-graphics", + "core-graphics 0.23.2", "core-text", "cssparser", "dwrote", @@ -1997,568 +1790,126 @@ dependencies = [ "net_traits", "parking_lot", "range", - "serde", - "servo_allocator", - "servo_arc", - "servo_atoms", - "servo_url", - "smallvec", - "style", - "surfman", - "truetype", - "ucd", - "unicode-bidi", - "unicode-script", - "webrender_api", - "xi-unicode", - "xml-rs", - "yeslogic-fontconfig-sys", -] - -[[package]] -name = "gfx_traits" -version = "0.0.1" -dependencies = [ - "malloc_size_of", - "malloc_size_of_derive", - "range", - "serde", - "webrender_api", -] - -[[package]] -name = "gif" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" -dependencies = [ - "color_quant", - "weezl", -] - -[[package]] -name = "gilrs" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b54e5e39844ab5cddaf3bbbdfdc2923a6cb34e36818b95618da4e3f26302c24c" -dependencies = [ - "fnv", - "gilrs-core", - "log", - "uuid", - "vec_map", -] - -[[package]] -name = "gilrs-core" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c132270a155f2548e67d66e731075c336c39098afc555752f3df8f882c720e" -dependencies = [ - "core-foundation", - "inotify", - "io-kit-sys", - "js-sys", - "libc", - "libudev-sys", - "log", - "nix 0.28.0", - "uuid", - "vec_map", - "wasm-bindgen", - "web-sys", - "windows", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - -[[package]] -name = "gio-sys" -version = "0.19.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4bdbef451b0f0361e7f762987cc6bebd5facab1d535e85a3cf1115dfb08db40" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", - "windows-sys 0.52.0", -] - -[[package]] -name = "git2" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" -dependencies = [ - "bitflags 2.5.0", - "libc", - "libgit2-sys", - "log", - "url", -] - -[[package]] -name = "gl_generator" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" -dependencies = [ - "khronos_api", - "log", - "xml-rs", -] - -[[package]] -name = "gleam" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0173481f2bb6e809bf4985de2e86c83876d84d2805830e3301cd37355e897f0f" -dependencies = [ - "gl_generator", -] - -[[package]] -name = "glib" -version = "0.19.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be682de2914107f591efdbe2debf05d9ad70726310ee2b6a3802a697649fcc55" -dependencies = [ - "bitflags 2.5.0", - "futures-channel", - "futures-core", - "futures-executor", - "futures-task", - "futures-util", - "gio-sys", - "glib-macros", - "glib-sys", - "gobject-sys", - "libc", - "memchr", - "smallvec", - "thiserror", -] - -[[package]] -name = "glib-macros" -version = "0.19.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed782fa3e949c31146671da6e7a227a5e7d354660df1db6d0aac4974dc82a3c" -dependencies = [ - "heck", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.60", -] - -[[package]] -name = "glib-sys" -version = "0.19.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767d23ead9bbdfcbb1c2242c155c8128a7d13dde7bf69c176f809546135e2282" -dependencies = [ - "libc", - "system-deps", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "glow" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" -dependencies = [ - "js-sys", - "slotmap", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "glslopt" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee5be629003d587bab188f3e2e3b010aa2cde7c41ec967b3a244f388d4d81877" -dependencies = [ - "cc", -] - -[[package]] -name = "gobject-sys" -version = "0.19.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3787b0bfacca12bb25f8f822b0dbee9f7e4a86e6469a29976d332d2c14c945b" -dependencies = [ - "glib-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gpu-alloc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" -dependencies = [ - "bitflags 2.5.0", - "gpu-alloc-types", -] - -[[package]] -name = "gpu-alloc-types" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "gpu-descriptor" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" -dependencies = [ - "bitflags 2.5.0", - "gpu-descriptor-types", - "hashbrown 0.14.3", -] - -[[package]] -name = "gpu-descriptor-types" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "gstreamer" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6f2d7dcde4b42b5297d25e9f51914cacfa148c99ba6ddabebf006fb2b18c20" -dependencies = [ - "cfg-if", - "futures-channel", - "futures-core", - "futures-util", - "glib", - "gstreamer-sys", - "itertools 0.12.1", - "libc", - "muldiv", - "num-integer", - "num-rational", - "once_cell", - "option-operations", - "paste", - "pin-project-lite", - "smallvec", - "thiserror", -] - -[[package]] -name = "gstreamer-app" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50184e88d3462a796a5924fb329839c102b22f9383c1636323fa4ef5255dea92" -dependencies = [ - "futures-core", - "futures-sink", - "glib", - "gstreamer", - "gstreamer-app-sys", - "gstreamer-base", - "libc", -] - -[[package]] -name = "gstreamer-app-sys" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6771c0939f286fb261525494a0aad29435b37e802284756bab24afe3bbca7476" -dependencies = [ - "glib-sys", - "gstreamer-base-sys", - "gstreamer-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gstreamer-audio" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73a5de9ced05f9650168a74c7a4afeddbf3e63af595a7d56a700765be3b4869c" -dependencies = [ - "cfg-if", - "glib", - "gstreamer", - "gstreamer-audio-sys", - "gstreamer-base", - "libc", - "once_cell", - "smallvec", -] - -[[package]] -name = "gstreamer-audio-sys" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d92a1e2a915874f70f0a33c3ea4589bc6b66a138b6ec8bb6acedf49bdec2c3" -dependencies = [ - "glib-sys", - "gobject-sys", - "gstreamer-base-sys", - "gstreamer-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gstreamer-base" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514c71195b53c7eced4842b66ca9149833e41cf6a1d949e45e2ca4a4fa929850" -dependencies = [ - "atomic_refcell", - "cfg-if", - "glib", - "gstreamer", - "gstreamer-base-sys", - "libc", -] - -[[package]] -name = "gstreamer-base-sys" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "286591e0f85bbda1adf9bab6f21d015acd9ca0a4d4acb61da65e3d0487e23c4e" -dependencies = [ - "glib-sys", - "gobject-sys", - "gstreamer-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gstreamer-gl" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d21c0c5fbf74018a0254b3ab77bca0a5b2c0f002bcfd910c09113ae90a95d98" -dependencies = [ - "glib", - "gstreamer", - "gstreamer-base", - "gstreamer-gl-sys", - "gstreamer-video", - "libc", - "once_cell", -] - -[[package]] -name = "gstreamer-gl-egl" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfde7bf67f5f7c87e1ff29cdeea4918530d677b51e3f4847121ada44f1fab139" -dependencies = [ - "glib", - "gstreamer", - "gstreamer-gl", - "gstreamer-gl-egl-sys", - "libc", -] - -[[package]] -name = "gstreamer-gl-egl-sys" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c9ec3c03af5d4ed3e58ddbca4eea13e90e01b88e37f6c0689b26e05168eb7bf" -dependencies = [ - "glib-sys", - "gstreamer-gl-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gstreamer-gl-sys" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61d1e3b9b02abc23835e9d770f2bd705b67a50406ea37e963b4526a77c6a7cd8" -dependencies = [ - "glib-sys", - "gobject-sys", - "gstreamer-base-sys", - "gstreamer-sys", - "gstreamer-video-sys", - "libc", - "system-deps", + "serde", + "servo_allocator", + "servo_arc", + "servo_atoms", + "servo_url", + "smallvec", + "style", + "surfman", + "truetype", + "ucd", + "unicode-bidi", + "unicode-script", + "webrender_api", + "xi-unicode", + "xml-rs", + "yeslogic-fontconfig-sys", ] [[package]] -name = "gstreamer-gl-x11" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ed82941c84668d89dbf81f220083422268c22ec6ab4991806649ed6758cec8" +name = "gfx_traits" +version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ - "glib", - "gstreamer", - "gstreamer-gl", - "gstreamer-gl-x11-sys", - "libc", + "malloc_size_of", + "malloc_size_of_derive", + "range", + "serde", + "webrender_api", ] [[package]] -name = "gstreamer-gl-x11-sys" -version = "0.22.0" +name = "gif" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b59f2782f5e71e3ef5fd534598938966a4dc3911f2540807f7d13b586e4ed1" +checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" dependencies = [ - "glib-sys", - "gstreamer-gl-sys", - "libc", - "system-deps", + "color_quant", + "weezl", ] [[package]] -name = "gstreamer-player" -version = "0.22.0" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5950d1d194935b27a0b2af99afe83dc9697149a1b55230f16c51eefe798c4a51" -dependencies = [ - "glib", - "gstreamer", - "gstreamer-player-sys", - "gstreamer-video", - "libc", -] +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] -name = "gstreamer-player-sys" -version = "0.22.0" +name = "gl_generator" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ff7af3d3c4692a36ce1c4695b2a3a6563d8e5724feded38def679bd755202f" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" dependencies = [ - "glib-sys", - "gobject-sys", - "gstreamer-sys", - "gstreamer-video-sys", - "libc", - "system-deps", + "khronos_api", + "log", + "xml-rs", ] [[package]] -name = "gstreamer-sdp" -version = "0.22.0" +name = "gleam" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f9aa459d119aa787efc18edcc591736e1e6cd488835825d1807532456ba2dbd" +checksum = "0173481f2bb6e809bf4985de2e86c83876d84d2805830e3301cd37355e897f0f" dependencies = [ - "glib", - "gstreamer", - "gstreamer-sdp-sys", + "gl_generator", ] [[package]] -name = "gstreamer-sdp-sys" -version = "0.22.0" +name = "glob" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d80dfc4811c67ca66586b4e470f85ab25aca4ea92bd2ba2665552c1dd0e5609" -dependencies = [ - "glib-sys", - "gstreamer-sys", - "libc", - "system-deps", -] +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] -name = "gstreamer-sys" -version = "0.22.2" +name = "glslopt" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5ddf526b3bf90ea627224c804f00b8bcb0452e3b447978b4d5092f8e8ff5918" +checksum = "ee5be629003d587bab188f3e2e3b010aa2cde7c41ec967b3a244f388d4d81877" dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", + "cc", ] [[package]] -name = "gstreamer-video" -version = "0.22.4" +name = "gpu-alloc" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc0a96481ecfcdd120d5057bb7ab5a6f6cd392cc34ba1e8b86cac3ba082f788" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "cfg-if", - "futures-channel", - "glib", - "gstreamer", - "gstreamer-base", - "gstreamer-video-sys", - "libc", - "once_cell", - "thiserror", + "bitflags 2.5.0", + "gpu-alloc-types", ] [[package]] -name = "gstreamer-video-sys" -version = "0.22.1" +name = "gpu-alloc-types" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ea7996ba44fbbf563aeeda96e24259efc9f06b407854d837ee58e260d7ba78" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "glib-sys", - "gobject-sys", - "gstreamer-base-sys", - "gstreamer-sys", - "libc", - "system-deps", + "bitflags 2.5.0", ] [[package]] -name = "gstreamer-webrtc" -version = "0.22.0" +name = "gpu-descriptor" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4b120a15362865dedc4417ca605dd734f5699b75f42cfef08a9140dd333426" +checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ - "glib", - "gstreamer", - "gstreamer-sdp", - "gstreamer-webrtc-sys", - "libc", + "bitflags 2.5.0", + "gpu-descriptor-types", + "hashbrown 0.14.3", ] [[package]] -name = "gstreamer-webrtc-sys" -version = "0.22.0" +name = "gpu-descriptor-types" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8968383c25abb00bdc434d21d92947654e3656503ccb24c8f1218cd96342c073" +checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" dependencies = [ - "glib-sys", - "gstreamer-sdp-sys", - "gstreamer-sys", - "libc", - "system-deps", + "bitflags 2.5.0", ] -[[package]] -name = "gvr-sys" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2a8e6ed12756f9e5fd8d50019e4f6839f50cf95f82657353e9d860730a5f797" - [[package]] name = "h2" version = "0.3.26" @@ -2595,7 +1946,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb86e2fef3ba40cebffb8fa2cba811f06aa5c5fd296a4e469473e5398d166594" dependencies = [ "cc", - "core-graphics", + "core-graphics 0.23.2", "core-text", "foreign-types 0.5.0", "freetype-sys", @@ -2643,12 +1994,6 @@ dependencies = [ "http", ] -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -2779,6 +2124,7 @@ dependencies = [ [[package]] name = "hyper_serde" version = "0.13.2" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "cookie 0.12.0", "headers", @@ -2787,7 +2133,6 @@ dependencies = [ "mime", "serde", "serde_bytes", - "serde_test", "time 0.1.45", ] @@ -2960,36 +2305,6 @@ dependencies = [ "serde", ] -[[package]] -name = "inotify" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd168d97690d0b8c412d6b6c10360277f4d7ee495c5d0d5d5fe0854923255cc" -dependencies = [ - "bitflags 1.3.2", - "inotify-sys", - "libc", -] - -[[package]] -name = "inotify-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" -dependencies = [ - "libc", -] - -[[package]] -name = "io-kit-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617ee6cf8e3f66f3b4ea67a4058564628cde41901316e19f559e14c7c72c5e7b" -dependencies = [ - "core-foundation-sys", - "mach2", -] - [[package]] name = "io-surface" version = "0.15.1" @@ -3076,20 +2391,6 @@ dependencies = [ "libc", ] -[[package]] -name = "jni" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24967112a1e4301ca5342ea339763613a37592b8a6ce6cf2e4494537c7a42faf" -dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", -] - [[package]] name = "jni" version = "0.21.1" @@ -3142,6 +2443,7 @@ dependencies = [ [[package]] name = "jstraceable_derive" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "proc-macro2", "syn 2.0.60", @@ -3178,6 +2480,7 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "layout_2013" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "app_units", "atomic_refcell", @@ -3221,6 +2524,7 @@ dependencies = [ [[package]] name = "layout_2020" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "app_units", "atomic_refcell", @@ -3236,12 +2540,10 @@ dependencies = [ "gfx_traits", "html5ever", "ipc-channel", - "lazy_static", "log", "msg", "net_traits", "parking_lot", - "quickcheck", "range", "rayon", "script_layout_interface", @@ -3264,6 +2566,7 @@ dependencies = [ [[package]] name = "layout_thread_2013" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "app_units", "crossbeam-channel", @@ -3304,6 +2607,7 @@ dependencies = [ [[package]] name = "layout_thread_2020" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "app_units", "crossbeam-channel", @@ -3397,18 +2701,6 @@ dependencies = [ "take_mut", ] -[[package]] -name = "libgit2-sys" -version = "0.16.2+1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" -dependencies = [ - "cc", - "libc", - "libz-sys", - "pkg-config", -] - [[package]] name = "libloading" version = "0.7.4" @@ -3449,6 +2741,7 @@ dependencies = [ [[package]] name = "libservo" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "background_hang_monitor", "bluetooth", @@ -3462,13 +2755,12 @@ dependencies = [ "devtools", "devtools_traits", "embedder_traits", - "env_logger 0.10.2", + "env_logger", "euclid", "gaol", "gfx", "gfx_traits", "gleam", - "gstreamer", "ipc-channel", "keyboard-types", "layout_thread_2013", @@ -3486,7 +2778,6 @@ dependencies = [ "script_traits", "servo-media", "servo-media-dummy", - "servo-media-gstreamer", "servo_config", "servo_geometry", "servo_url", @@ -3503,16 +2794,6 @@ dependencies = [ "webxr-api", ] -[[package]] -name = "libudev-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c8469b4a23b962c1396b9b451dda50ef5b283e8dd309d69033475fa9b334324" -dependencies = [ - "libc", - "pkg-config", -] - [[package]] name = "libz-sys" version = "1.1.16" @@ -3630,14 +2911,6 @@ dependencies = [ "synstructure 0.12.6", ] -[[package]] -name = "malloc_size_of_tests" -version = "0.0.1" -dependencies = [ - "malloc_size_of", - "servo_arc", -] - [[package]] name = "markup5ever" version = "0.12.1" @@ -3661,6 +2934,7 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "media" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "euclid", "fnv", @@ -3689,15 +2963,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - [[package]] name = "metal" version = "0.24.0" @@ -3730,6 +2995,7 @@ dependencies = [ [[package]] name = "metrics" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "gfx_traits", "ipc-channel", @@ -3743,19 +3009,6 @@ dependencies = [ "servo_url", ] -[[package]] -name = "metrics_tests" -version = "0.0.1" -dependencies = [ - "gfx_traits", - "ipc-channel", - "metrics", - "msg", - "profile_traits", - "servo_url", - "time 0.1.45", -] - [[package]] name = "mime" version = "0.3.17" @@ -3810,15 +3063,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", -] - [[package]] name = "mozangle" version = "0.5.1" @@ -3866,6 +3110,7 @@ dependencies = [ [[package]] name = "msg" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "ipc-channel", "lazy_static", @@ -3877,12 +3122,6 @@ dependencies = [ "webrender_api", ] -[[package]] -name = "muldiv" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956787520e75e9bd233246045d19f42fb73242759cc57fba9611d940ae96d4b0" - [[package]] name = "naga" version = "0.19.0" @@ -3915,7 +3154,8 @@ dependencies = [ "log", "ndk-sys", "num_enum", - "raw-window-handle", + "raw-window-handle 0.5.2", + "raw-window-handle 0.6.0", "thiserror", ] @@ -3937,6 +3177,7 @@ dependencies = [ [[package]] name = "net" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "async-recursion", "async-tungstenite", @@ -3950,7 +3191,7 @@ dependencies = [ "devtools_traits", "embedder_traits", "flate2", - "futures 0.3.30", + "futures", "generic-array", "headers", "http", @@ -3985,7 +3226,6 @@ dependencies = [ "tokio", "tokio-rustls", "tokio-stream", - "tokio-test", "tungstenite", "url", "uuid", @@ -3996,6 +3236,7 @@ dependencies = [ [[package]] name = "net_traits" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "content-security-policy", "cookie 0.12.0", @@ -4042,30 +3283,12 @@ dependencies = [ "libc", ] -[[package]] -name = "nix" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" -dependencies = [ - "bitflags 2.5.0", - "cfg-if", - "cfg_aliases", - "libc", -] - [[package]] name = "nodrop" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" -[[package]] -name = "nohash-hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" - [[package]] name = "nom" version = "7.1.3" @@ -4112,17 +3335,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.18" @@ -4164,15 +3376,6 @@ dependencies = [ "syn 2.0.60", ] -[[package]] -name = "num_threads" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" -dependencies = [ - "libc", -] - [[package]] name = "objc" version = "0.2.7" @@ -4249,15 +3452,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "option-operations" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c26d27bb1aeab65138e4bf7666045169d1717febcc9ff870166be8348b223d0" -dependencies = [ - "paste", -] - [[package]] name = "orbclient" version = "0.3.47" @@ -4291,6 +3485,12 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "owo-colors" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" + [[package]] name = "parking_lot" version = "0.12.2" @@ -4491,6 +3691,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pixels" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "euclid", "malloc_size_of", @@ -4592,6 +3793,7 @@ dependencies = [ [[package]] name = "profile" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "ipc-channel", "jemalloc-sys", @@ -4604,19 +3806,10 @@ dependencies = [ "task_info", ] -[[package]] -name = "profile_tests" -version = "0.0.1" -dependencies = [ - "ipc-channel", - "profile", - "profile_traits", - "servo_config", -] - [[package]] name = "profile_traits" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "crossbeam-channel", "ipc-channel", @@ -4651,17 +3844,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "quickcheck" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6" -dependencies = [ - "env_logger 0.8.4", - "log", - "rand", -] - [[package]] name = "quote" version = "1.0.36" @@ -4713,6 +3895,7 @@ dependencies = [ [[package]] name = "range" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "malloc_size_of", "malloc_size_of_derive", @@ -4741,6 +3924,12 @@ dependencies = [ "typed-arena", ] +[[package]] +name = "raw-window-handle" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" + [[package]] name = "raw-window-handle" version = "0.6.0" @@ -4895,24 +4084,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustfix" -version = "0.6.1" +name = "rustc_version" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd2853d9e26988467753bd9912c3a126f642d05d229a4b53f5752ee36c56481" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "anyhow", - "log", - "serde", - "serde_json", + "semver", ] [[package]] @@ -4959,12 +4136,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "rustversion" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" - [[package]] name = "ryu" version = "1.0.17" @@ -4995,8 +4166,8 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "script" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ - "accountable-refcell", "app_units", "arrayvec", "atomic_refcell", @@ -5095,6 +4266,7 @@ dependencies = [ [[package]] name = "script_layout_interface" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "app_units", "atomic_refcell", @@ -5123,19 +4295,10 @@ dependencies = [ "webrender_api", ] -[[package]] -name = "script_tests" -version = "0.0.1" -dependencies = [ - "euclid", - "keyboard-types", - "script", - "servo_url", -] - [[package]] name = "script_traits" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "bitflags 2.5.0", "bluetooth_traits", @@ -5262,24 +4425,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_spanned" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_test" -version = "1.0.176" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a2f49ace1498612d14f7e0b8245519584db8299541dfe31a06374a828d620ab" -dependencies = [ - "serde", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -5363,79 +4508,6 @@ dependencies = [ "servo-media-webrtc", ] -[[package]] -name = "servo-media-gstreamer" -version = "0.1.0" -source = "git+https://github.com/servo/media#45756bef67037ade0f4f0125d579fdc3f3d457c8" -dependencies = [ - "byte-slice-cast", - "glib", - "glib-sys", - "gstreamer", - "gstreamer-app", - "gstreamer-audio", - "gstreamer-base", - "gstreamer-player", - "gstreamer-sdp", - "gstreamer-sys", - "gstreamer-video", - "gstreamer-webrtc", - "ipc-channel", - "lazy_static", - "log", - "mime", - "once_cell", - "servo-media", - "servo-media-audio", - "servo-media-gstreamer-render", - "servo-media-gstreamer-render-android", - "servo-media-gstreamer-render-unix", - "servo-media-player", - "servo-media-streams", - "servo-media-traits", - "servo-media-webrtc", - "url", -] - -[[package]] -name = "servo-media-gstreamer-render" -version = "0.1.0" -source = "git+https://github.com/servo/media#45756bef67037ade0f4f0125d579fdc3f3d457c8" -dependencies = [ - "gstreamer", - "gstreamer-video", - "servo-media-player", -] - -[[package]] -name = "servo-media-gstreamer-render-android" -version = "0.1.0" -source = "git+https://github.com/servo/media#45756bef67037ade0f4f0125d579fdc3f3d457c8" -dependencies = [ - "glib", - "gstreamer", - "gstreamer-gl", - "gstreamer-gl-egl", - "gstreamer-video", - "servo-media-gstreamer-render", - "servo-media-player", -] - -[[package]] -name = "servo-media-gstreamer-render-unix" -version = "0.1.0" -source = "git+https://github.com/servo/media#45756bef67037ade0f4f0125d579fdc3f3d457c8" -dependencies = [ - "glib", - "gstreamer", - "gstreamer-gl", - "gstreamer-gl-egl", - "gstreamer-gl-x11", - "gstreamer-video", - "servo-media-gstreamer-render", - "servo-media-player", -] - [[package]] name = "servo-media-player" version = "0.1.0" @@ -5476,6 +4548,7 @@ dependencies = [ [[package]] name = "servo_allocator" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "jemalloc-sys", "jemallocator", @@ -5505,6 +4578,7 @@ dependencies = [ [[package]] name = "servo_config" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "dirs-next", "embedder_traits", @@ -5525,6 +4599,7 @@ dependencies = [ [[package]] name = "servo_config_plugins" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "itertools 0.12.1", "proc-macro2", @@ -5535,6 +4610,7 @@ dependencies = [ [[package]] name = "servo_geometry" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "app_units", "euclid", @@ -5546,6 +4622,7 @@ dependencies = [ [[package]] name = "servo_rand" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "lazy_static", "log", @@ -5558,6 +4635,7 @@ dependencies = [ [[package]] name = "servo_url" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "malloc_size_of", "malloc_size_of_derive", @@ -5569,43 +4647,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "servoshell" -version = "0.0.1" -dependencies = [ - "arboard", - "backtrace", - "cc", - "cfg-if", - "egui", - "egui-winit", - "egui_glow", - "euclid", - "getopts", - "gilrs", - "gleam", - "glow", - "image", - "keyboard-types", - "lazy_static", - "libc", - "libservo", - "log", - "raw-window-handle", - "servo-media", - "servo_allocator", - "shellwords", - "sig", - "surfman", - "tinyfiledialogs", - "url", - "vergen", - "webxr", - "winapi", - "winit", - "winres", -] - [[package]] name = "sha1" version = "0.10.6" @@ -5628,31 +4669,12 @@ dependencies = [ "digest", ] -[[package]] -name = "shellwords" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e515aa4699a88148ed5ef96413ceef0048ce95b43fbc955a33bde0a70fcae6" -dependencies = [ - "lazy_static", - "regex", -] - [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "sig" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6567e29578f9bfade6a5d94a32b9a4256348358d2a3f448cab0021f9a02614a2" -dependencies = [ - "libc", -] - [[package]] name = "signpost" version = "0.1.0" @@ -5664,27 +4686,6 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" -[[package]] -name = "simpleservo_jniapi" -version = "0.0.1" -dependencies = [ - "android_logger", - "cc", - "getopts", - "gl_generator", - "ipc-channel", - "jni 0.18.0", - "libc", - "libloading 0.8.3", - "libservo", - "log", - "serde_json", - "servo-media", - "surfman", - "vergen", - "webxr", -] - [[package]] name = "siphasher" version = "0.3.11" @@ -5708,15 +4709,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "slotmap" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" -dependencies = [ - "version_check", -] - [[package]] name = "smallbitvec" version = "2.5.3" @@ -5757,17 +4749,6 @@ dependencies = [ "xkeysym", ] -[[package]] -name = "smithay-clipboard" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c091e7354ea8059d6ad99eace06dd13ddeedbb0ac72d40a9a6e7ff790525882d" -dependencies = [ - "libc", - "smithay-client-toolkit", - "wayland-backend", -] - [[package]] name = "smol_str" version = "0.2.1" @@ -5949,24 +4930,6 @@ dependencies = [ "synstructure 0.13.1", ] -[[package]] -name = "style_tests" -version = "0.0.1" -dependencies = [ - "app_units", - "cssparser", - "euclid", - "html5ever", - "rayon", - "selectors", - "serde_json", - "servo_arc", - "servo_atoms", - "style", - "style_traits", - "url", -] - [[package]] name = "style_traits" version = "0.0.1" @@ -5992,16 +4955,16 @@ dependencies = [ [[package]] name = "surfman" -version = "0.9.3" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d43b99fd15373be8ef0ab83114da9e40d37211f99846b292d72543c4bd3d58d6" +checksum = "2a10a79c436583753fa108971470dd42f2111ce068f1b6fdebd981a96f920bdf" dependencies = [ "bitflags 1.3.2", "cfg_aliases", "cgl", - "cocoa", + "cocoa 0.24.1", "core-foundation", - "core-graphics", + "core-graphics 0.22.3", "euclid", "fnv", "gl_generator", @@ -6012,7 +4975,7 @@ dependencies = [ "mach2", "metal 0.24.0", "objc", - "raw-window-handle", + "raw-window-handle 0.5.2", "servo-display-link", "sparkle", "wayland-sys 0.30.1", @@ -6084,19 +5047,6 @@ dependencies = [ "syn 2.0.60", ] -[[package]] -name = "system-deps" -version = "6.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" -dependencies = [ - "cfg-expr", - "heck", - "pkg-config", - "toml 0.8.9", - "version-compare", -] - [[package]] name = "take_mut" version = "0.2.2" @@ -6114,15 +5064,10 @@ dependencies = [ "xattr", ] -[[package]] -name = "target-lexicon" -version = "0.12.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" - [[package]] name = "task_info" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "cc", ] @@ -6151,17 +5096,6 @@ dependencies = [ "utf-8", ] -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - [[package]] name = "termcolor" version = "1.4.1" @@ -6171,19 +5105,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "tester" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e8bf7e0eb2dd7b4228cc1b6821fc5114cd6841ae59f652a85488c016091e5f" -dependencies = [ - "cfg-if", - "getopts", - "libc", - "num_cpus", - "term", -] - [[package]] name = "thin-vec" version = "0.2.13" @@ -6240,9 +5161,7 @@ checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", - "libc", "num-conv", - "num_threads", "powerfmt", "serde", "time-core", @@ -6296,16 +5215,6 @@ dependencies = [ "strict-num", ] -[[package]] -name = "tinyfiledialogs" -version = "3.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "848eb50d6d21430349d82418c2244f611b1ad3e1c52c675320338b3102d06554" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "tinystr" version = "0.7.5" @@ -6405,19 +5314,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-test" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2468baabc3311435b55dd935f702f42cd1b8abb7e754fb7dfb16bd36aa88f9f7" -dependencies = [ - "async-stream", - "bytes", - "futures-core", - "tokio", - "tokio-stream", -] - [[package]] name = "tokio-util" version = "0.7.10" @@ -6441,26 +5337,11 @@ dependencies = [ "serde", ] -[[package]] -name = "toml" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - [[package]] name = "toml_datetime" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" -dependencies = [ - "serde", -] [[package]] name = "toml_edit" @@ -6469,8 +5350,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap 2.2.6", - "serde", - "serde_spanned", "toml_datetime", "winnow", ] @@ -6701,36 +5580,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] -name = "vec_map" -version = "0.8.2" +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "vergen" -version = "8.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" +name = "verso" +version = "0.0.1" dependencies = [ - "anyhow", - "cfg-if", - "git2", - "rustversion", - "time 0.3.36", + "block", + "cfg_aliases", + "cocoa 0.25.0", + "core-graphics 0.23.2", + "crossbeam-channel", + "getopts", + "libservo", + "log", + "objc", + "objc_id", + "owo-colors", + "raw-window-handle 0.5.2", + "surfman", + "thiserror", + "winit", ] -[[package]] -name = "version-compare" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "void" version = "1.0.2" @@ -7027,6 +5902,7 @@ dependencies = [ [[package]] name = "webdriver_server" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "base64", "compositing_traits", @@ -7054,6 +5930,7 @@ dependencies = [ [[package]] name = "webgpu" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "arrayvec", "euclid", @@ -7143,6 +6020,7 @@ dependencies = [ [[package]] name = "webrender_traits" version = "0.0.1" +source = "git+https://github.com/servo/servo.git?rev=ff3cd14#ff3cd1494ea5c333d8f53450ccd50fe3a287e2a1" dependencies = [ "euclid", "webrender_api", @@ -7153,12 +6031,10 @@ name = "webxr" version = "0.0.1" source = "git+https://github.com/servo/webxr#88fd368d1cc110db0f6f5000de2e22a14c9423b5" dependencies = [ - "android_injected_glue", "bindgen", "crossbeam-channel", "euclid", "gl_generator", - "gvr-sys", "log", "serde", "sparkle", @@ -7176,7 +6052,6 @@ dependencies = [ "ipc-channel", "log", "serde", - "time 0.1.45", ] [[package]] @@ -7239,7 +6114,7 @@ dependencies = [ "parking_lot", "profiling", "range-alloc", - "raw-window-handle", + "raw-window-handle 0.6.0", "rustc-hash", "smallvec", "thiserror", @@ -7540,7 +6415,7 @@ dependencies = [ "calloop", "cfg_aliases", "core-foundation", - "core-graphics", + "core-graphics 0.23.2", "cursor-icon", "icrate", "js-sys", @@ -7553,7 +6428,8 @@ dependencies = [ "once_cell", "orbclient", "percent-encoding", - "raw-window-handle", + "raw-window-handle 0.5.2", + "raw-window-handle 0.6.0", "redox_syscall 0.3.5", "rustix", "sctk-adwaita", @@ -7583,15 +6459,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winres" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c" -dependencies = [ - "toml 0.5.11", -] - [[package]] name = "wio" version = "0.2.2" @@ -7607,7 +6474,7 @@ version = "0.1.0" source = "git+https://github.com/servo/webrender?branch=0.64#9d354adf8955b1390dd56db89e6d5a9ea7880391" dependencies = [ "core-foundation", - "core-graphics", + "core-graphics 0.23.2", "core-text", "dwrote", "euclid", @@ -7848,4 +6715,4 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ "simd-adler32", -] \ No newline at end of file +] diff --git a/src/app.rs b/src/app.rs index 3fc7b05e..cccb1b3d 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,104 +1,92 @@ -use std::rc::Rc; - use servo::{ compositing::{ windowing::{EmbedderEvent, EmbedderMethods}, CompositeTarget, }, - embedder_traits::{Cursor, EmbedderMsg, EventLoopWaker}, + embedder_traits::EventLoopWaker, servo_url::ServoUrl, Servo, TopLevelBrowsingContextId, }; -use winit::{ - event::Event, - event_loop::{ControlFlow, EventLoopProxy, EventLoopWindowTarget}, - window::{CursorIcon, Window}, -}; +use winit::{event::Event, event_loop::EventLoopProxy, window::Window as WinitWindow}; -use crate::{prefs, resources, webview::WebView}; +use crate::{ + prefs, resources, + window::{GLWindow, Window}, +}; -/// Status of webview. +/// Status of Verso instance. #[derive(Clone, Copy, Debug, Default)] pub enum Status { - /// Nothing happed to this webview yet + /// Nothing important to Verso at the moment. #[default] None, - /// Loading of webview has started. - LoadStart, - /// Loading of webivew has completed. - LoadComplete, + /// One of webviews is animating. + Animating, /// Verso has shut down. Shutdown, } /// Main entry point of Verso browser. pub struct Verso { - servo: Option>, - webview_id: Option, - webview: Rc, + servo: Option>, + window: Window, events: Vec, - // TODO following fields should move to webvew status: Status, } impl Verso { /// Create an Verso instance from winit's window and event loop proxy. - pub fn new(window: Window, proxy: EventLoopProxy<()>) -> Self { + pub fn new(window: WinitWindow, proxy: EventLoopProxy<()>) -> Self { resources::init(); prefs::init(); - let webview = Rc::new(WebView::new(window)); + let mut window = Window::new(window); let callback = Box::new(Embedder(proxy)); let mut init_servo = Servo::new( callback, - webview.clone(), + window.gl_window(), Some(String::from( "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0", )), CompositeTarget::Fbo, ); - - let url = ServoUrl::parse("https://servo.org/").unwrap(); - init_servo - .servo - .handle_events(vec![EmbedderEvent::NewWebView(url, init_servo.browser_id)]); + window.set_webview_id(init_servo.browser_id); + + let demo_path = std::env::current_dir().unwrap().join("demo.html"); + let demo_url = ServoUrl::from_file_path(demo_path.to_str().unwrap()).unwrap(); + let demo_id = TopLevelBrowsingContextId::new(); + let url = ServoUrl::parse("https://wusyong.github.io/").unwrap(); + init_servo.servo.handle_events(vec![ + EmbedderEvent::NewWebView(url, init_servo.browser_id), + EmbedderEvent::NewWebView(demo_url, demo_id), + ]); init_servo.servo.setup_logging(); Verso { servo: Some(init_servo.servo), - webview, + window, events: vec![], - webview_id: None, status: Status::None, } } - /// Run an iteration of Servo handling cycle. An iteration will perform following actions: + /// Run an iteration of Verso handling cycle. An iteration will perform following actions: /// - /// - Set the control flow of winit event loop - /// - Hnadle Winit's event, create Servo's embedder event and push to Yipppee's event queue. + /// - Hnadle Winit's event, create Servo's embedder event and push to Verso's event queue. /// - Consume Servo's messages and then send all embedder events to Servo. /// - And the last step is returning the status of Verso. - pub fn run(&mut self, event: Event<()>, evl: &EventLoopWindowTarget<()>) -> Status { - self.set_control_flow(&event, evl); + pub fn run(&mut self, event: Event<()>) -> Status { self.handle_winit_event(event); self.handle_servo_messages(); + log::trace!("Verso sets status to: {:?}", self.status); self.status } - fn set_control_flow(&self, event: &Event<()>, evl: &EventLoopWindowTarget<()>) { - let control_flow = if !self.webview.is_animating() || *event == Event::Suspended { - ControlFlow::Wait - } else { - ControlFlow::Poll - }; - evl.set_control_flow(control_flow); - log::trace!("Verso sets control flow to: {control_flow:?}"); - } - fn handle_winit_event(&mut self, event: Event<()>) { log::trace!("Verso is creating ebedder event from: {event:?}"); match event { - Event::Suspended => {} + Event::Suspended => { + self.status = Status::None; + } Event::Resumed | Event::UserEvent(()) => { self.events.push(EmbedderEvent::Idle); } @@ -106,7 +94,7 @@ impl Verso { window_id: _, event, } => self - .webview + .window .handle_winit_window_event(&mut self.servo, &mut self.events, &event), e => log::warn!("Verso hasn't supported this event yet: {e:?}"), } @@ -117,96 +105,30 @@ impl Verso { return; }; - let mut need_present = false; - - servo.get_events().into_iter().for_each(|(w, m)| { - log::trace!("Verso is handling servo message: {m:?} with browser id: {w:?}"); - match m { - EmbedderMsg::WebViewOpened(w) => { - if self.webview_id.is_none() { - self.webview_id = Some(w); - } - self.events.push(EmbedderEvent::FocusWebView(w)); - } - EmbedderMsg::ReadyToPresent(_w) => { - need_present = true; - } - EmbedderMsg::LoadStart => self.status = Status::LoadStart, - EmbedderMsg::LoadComplete => self.status = Status::LoadComplete, - EmbedderMsg::SetCursor(cursor) => { - let winit_cursor = match cursor { - Cursor::Default => CursorIcon::Default, - Cursor::Pointer => CursorIcon::Pointer, - Cursor::ContextMenu => CursorIcon::ContextMenu, - Cursor::Help => CursorIcon::Help, - Cursor::Progress => CursorIcon::Progress, - Cursor::Wait => CursorIcon::Wait, - Cursor::Cell => CursorIcon::Cell, - Cursor::Crosshair => CursorIcon::Crosshair, - Cursor::Text => CursorIcon::Text, - Cursor::VerticalText => CursorIcon::VerticalText, - Cursor::Alias => CursorIcon::Alias, - Cursor::Copy => CursorIcon::Copy, - Cursor::Move => CursorIcon::Move, - Cursor::NoDrop => CursorIcon::NoDrop, - Cursor::NotAllowed => CursorIcon::NotAllowed, - Cursor::Grab => CursorIcon::Grab, - Cursor::Grabbing => CursorIcon::Grabbing, - Cursor::EResize => CursorIcon::EResize, - Cursor::NResize => CursorIcon::NResize, - Cursor::NeResize => CursorIcon::NeResize, - Cursor::NwResize => CursorIcon::NwResize, - Cursor::SResize => CursorIcon::SResize, - Cursor::SeResize => CursorIcon::SeResize, - Cursor::SwResize => CursorIcon::SwResize, - Cursor::WResize => CursorIcon::WResize, - Cursor::EwResize => CursorIcon::EwResize, - Cursor::NsResize => CursorIcon::NsResize, - Cursor::NeswResize => CursorIcon::NeswResize, - Cursor::NwseResize => CursorIcon::NwseResize, - Cursor::ColResize => CursorIcon::ColResize, - Cursor::RowResize => CursorIcon::RowResize, - Cursor::AllScroll => CursorIcon::AllScroll, - Cursor::ZoomIn => CursorIcon::ZoomIn, - Cursor::ZoomOut => CursorIcon::ZoomOut, - _ => CursorIcon::Default, - }; - self.webview.window.set_cursor_icon(winit_cursor); - } - EmbedderMsg::AllowNavigationRequest(pipeline_id, _url) => { - if w.is_some() { - self.events - .push(EmbedderEvent::AllowNavigationResponse(pipeline_id, true)); - } - } - EmbedderMsg::WebViewClosed(_w) => { - self.events.push(EmbedderEvent::Quit); - } - EmbedderMsg::Shutdown => { - self.status = Status::Shutdown; - } - e => { - log::warn!("Verso hasn't supported handling this message yet: {e:?}") - } - } - }); + let need_present = + self.window + .handle_servo_messages(servo, &mut self.events, &mut self.status); log::trace!("Verso is handling embedder events: {:?}", self.events); if servo.handle_events(self.events.drain(..)) { servo.repaint_synchronously(); - self.webview.paint(servo); + self.window.paint(servo); } else if need_present { - self.webview.request_redraw(); + self.window.request_redraw(); } if let Status::Shutdown = self.status { log::trace!("Verso is shutting down Servo"); self.servo.take().map(Servo::deinit); + } else if self.window.is_animating() { + self.status = Status::Animating; + } else { + self.status = Status::None; } } /// Helper method to access Servo instance. This can be used to check if Servo is shut down as well. - pub fn servo(&mut self) -> &mut Option> { + pub fn servo(&mut self) -> &mut Option> { &mut self.servo } diff --git a/src/lib.rs b/src/lib.rs index 34fcb0f1..df1c2269 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,9 +13,11 @@ pub mod prefs; /// Utilities to access resource files pub mod resources; /// Utilities to write tests. -pub mod test; -/// Web view types to handle web browsing contexts and window. +// pub mod test; +/// Web view types to handle web browsing contexts. pub mod webview; +/// Verso's window types to handle Winit's window. +pub mod window; pub use app::{Status, Verso}; pub use errors::{Error, Result}; diff --git a/src/main.rs b/src/main.rs index 15393785..c63dadff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ use verso::{Result, Status, Verso}; -use winit::{dpi::PhysicalSize, event_loop::EventLoop, window::WindowBuilder}; +use winit::event_loop::{ControlFlow, DeviceEvents}; +use winit::{event_loop::EventLoop, window::WindowBuilder}; /* window decoration */ #[cfg(target_os = "macos")] @@ -17,9 +18,9 @@ use winit::platform::macos::WindowBuilderExtMacOS; fn main() -> Result<()> { let event_loop = EventLoop::new()?; + event_loop.listen_device_events(DeviceEvents::Never); let window = WindowBuilder::new() .with_title("(*゚▽゚)ノ Verso") - .with_inner_size(PhysicalSize::new(1000, 500)) .build(&event_loop)?; #[cfg(target_os = "macos")] @@ -31,9 +32,10 @@ fn main() -> Result<()> { } let mut verso = Verso::new(window, event_loop.create_proxy()); - event_loop.run(move |event, evl| match verso.run(event, evl) { + event_loop.run(move |event, evl| match verso.run(event) { + Status::None => evl.set_control_flow(ControlFlow::Wait), + Status::Animating => evl.set_control_flow(ControlFlow::Poll), Status::Shutdown => evl.exit(), - _ => (), })?; Ok(()) diff --git a/src/webview.rs b/src/webview.rs index 2fffa131..28b2ea1b 100644 --- a/src/webview.rs +++ b/src/webview.rs @@ -1,271 +1,57 @@ -use std::{cell::Cell, rc::Rc}; +use std::cell::Cell; -use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle}; -use servo::{ - compositing::windowing::{ - AnimationState, EmbedderCoordinates, EmbedderEvent, MouseWindowEvent, WindowMethods, - }, - euclid::{Point2D, Scale, Size2D, UnknownUnit}, - gl, - rendering_context::RenderingContext, - script_traits::{TouchEventType, WheelDelta, WheelMode}, - webrender_api::{ - units::{DeviceIntPoint, DeviceIntRect, DevicePoint, LayoutVector2D}, - ScrollLocation, - }, - Servo, -}; -use surfman::{Connection, GLApi, SurfaceType}; -use winit::{ - dpi::PhysicalPosition, - event::{ElementState, TouchPhase, WindowEvent}, - window::Window, -}; +use servo::{msg::constellation_msg::WebViewId, url::ServoUrl}; /// A web view is an area to display web browsing context. It's what user will treat as a "web page". pub struct WebView { - /// Access to webrender surfman - pub rendering_context: RenderingContext, - animation_state: Cell, - /// Access to winit winodw - pub window: Window, - mouse_position: Cell>, - /// Access to webrender gl - pub webrender_gl: Rc, + id: WebViewId, + history: Cell>, + current: Cell, } impl WebView { /// Create a web view from winit window. - pub fn new(window: Window) -> Self { - let window_size = window.inner_size(); - let window_size = Size2D::new(window_size.width as i32, window_size.height as i32); - let display_handle = window.raw_display_handle(); - let connection = Connection::from_raw_display_handle(display_handle) - .expect("Failed to create connection"); - let adapter = connection - .create_adapter() - .expect("Failed to create adapter"); - let native_widget = connection - .create_native_widget_from_raw_window_handle(window.raw_window_handle(), window_size) - .expect("Failed to create native widget"); - let surface_type = SurfaceType::Widget { native_widget }; - let rendering_context = RenderingContext::create(&connection, &adapter, surface_type) - .expect("Failed to create rendering context"); - log::trace!("Created rendering context for window {:?}", window); - let webrender_gl = match rendering_context.connection().gl_api() { - GLApi::GL => unsafe { gl::GlFns::load_with(|s| rendering_context.get_proc_address(s)) }, - GLApi::GLES => unsafe { - gl::GlesFns::load_with(|s| rendering_context.get_proc_address(s)) - }, - }; - debug_assert_eq!(webrender_gl.get_error(), gl::NO_ERROR); - + pub fn new(id: WebViewId) -> Self { Self { - rendering_context, - animation_state: Cell::new(AnimationState::Idle), - window, - mouse_position: Cell::new(PhysicalPosition::default()), - webrender_gl, + id, + history: Cell::new(vec![]), + current: Cell::new(0), } } - /// Check if web view is animating. - pub fn is_animating(&self) -> bool { - self.animation_state.get() == AnimationState::Animating - } - - /// Resize the web view. - pub fn resize(&self, size: Size2D) { - let _ = self.rendering_context.resize(size); + /// Get web view ID of this window. + pub fn id(&self) -> WebViewId { + self.id } - /// Request winit window to emit redraw event. - pub fn request_redraw(&self) { - self.window.request_redraw(); - } - - /// Paint offscreen framebuffer to winit window. - pub fn paint(&self, servo: &mut Servo) { - if let Some(fbo) = servo.offscreen_framebuffer_id() { - let viewport = self.get_coordinates().get_flipped_viewport(); - let webrender_gl = &self.webrender_gl; - - let target_fbo = self - .rendering_context - .context_surface_info() - .unwrap_or(None) - .map(|info| info.framebuffer_object) - .unwrap_or(0); - - webrender_gl.bind_framebuffer(gl::READ_FRAMEBUFFER, fbo); - webrender_gl.bind_framebuffer(gl::DRAW_FRAMEBUFFER, target_fbo); - - let x = viewport.min.x; - let y = viewport.min.y; - let width = viewport.size().width; - let height = viewport.size().height; - webrender_gl.blit_framebuffer( - x, - y, - x + width, - y + height, - x, - y, - x + width, - y + height, - gl::COLOR_BUFFER_BIT, - gl::NEAREST, - ); - - debug_assert_eq!( - ( - self.webrender_gl.get_error(), - self.webrender_gl.check_frame_buffer_status(gl::FRAMEBUFFER) - ), - (gl::NO_ERROR, gl::FRAMEBUFFER_COMPLETE) - ); - - servo.present(); - } - } - - /// Handle winit window event. - pub fn handle_winit_window_event( - &self, - servo: &mut Option>, - events: &mut Vec, - event: &winit::event::WindowEvent, - ) { - match event { - WindowEvent::RedrawRequested => { - let Some(servo) = servo.as_mut() else { - return; - }; - - self.paint(servo); - events.push(EmbedderEvent::Idle); - } - WindowEvent::Resized(size) => { - let size = Size2D::new(size.width, size.height); - let _ = self.resize(size.to_i32()); - events.push(EmbedderEvent::WindowResize); - } - WindowEvent::CursorMoved { position, .. } => { - let event: DevicePoint = DevicePoint::new(position.x as f32, position.y as f32); - self.mouse_position.set(*position); - events.push(EmbedderEvent::MouseWindowMoveEventClass(event)); - } - WindowEvent::MouseInput { state, button, .. } => { - let button: servo::script_traits::MouseButton = match button { - winit::event::MouseButton::Left => servo::script_traits::MouseButton::Left, - winit::event::MouseButton::Right => servo::script_traits::MouseButton::Right, - winit::event::MouseButton::Middle => servo::script_traits::MouseButton::Middle, - _ => { - log::warn!("Verso hasn't supported this mouse button yet: {button:?}"); - return; - } - }; - let position = Point2D::new( - self.mouse_position.get().x as f32, - self.mouse_position.get().y as f32, - ); - - let event: MouseWindowEvent = match state { - ElementState::Pressed => MouseWindowEvent::MouseDown(button, position), - ElementState::Released => MouseWindowEvent::MouseUp(button, position), - }; - events.push(EmbedderEvent::MouseWindowEventClass(event)); - - // winit didn't send click event, so we send it after mouse up - if *state == ElementState::Released { - let event: MouseWindowEvent = MouseWindowEvent::Click(button, position); - events.push(EmbedderEvent::MouseWindowEventClass(event)); - } - } - WindowEvent::TouchpadMagnify { delta, .. } => { - events.push(EmbedderEvent::Zoom(1.0 + *delta as f32)); - } - WindowEvent::MouseWheel { delta, phase, .. } => { - // FIXME: Pixels per line, should be configurable (from browser setting?) and vary by zoom level. - const LINE_HEIGHT: f32 = 38.0; - - let (mut x, mut y, mode) = match delta { - winit::event::MouseScrollDelta::LineDelta(x, y) => { - (*x as f64, (*y * LINE_HEIGHT) as f64, WheelMode::DeltaLine) - } - winit::event::MouseScrollDelta::PixelDelta(position) => { - let position = position.to_logical::(self.window.scale_factor()); - (position.x, position.y, WheelMode::DeltaPixel) - } - }; - - // Wheel Event - events.push(EmbedderEvent::Wheel( - WheelDelta { x, y, z: 0.0, mode }, - DevicePoint::new( - self.mouse_position.get().x as f32, - self.mouse_position.get().y as f32, - ), - )); - - // Scroll Event - // Do one axis at a time. - if y.abs() >= x.abs() { - x = 0.0; - } else { - y = 0.0; - } - - let phase: TouchEventType = match phase { - TouchPhase::Started => TouchEventType::Down, - TouchPhase::Moved => TouchEventType::Move, - TouchPhase::Ended => TouchEventType::Up, - TouchPhase::Cancelled => TouchEventType::Cancel, - }; - - events.push(EmbedderEvent::Scroll( - ScrollLocation::Delta(LayoutVector2D::new(x as f32, y as f32)), - DeviceIntPoint::new( - self.mouse_position.get().x as i32, - self.mouse_position.get().y as i32, - ), - phase, - )); - } - WindowEvent::CloseRequested => { - events.push(EmbedderEvent::Quit); - } - e => log::warn!("Verso hasn't supported this window event yet: {e:?}"), - } + /// Set the history URLs and current index of the webview + pub fn set_history(&self, history: Vec, current: usize) { + self.history.replace(history); + self.current.replace(current); } } -unsafe impl Send for WebView {} -unsafe impl Sync for WebView {} - -impl WindowMethods for WebView { - fn get_coordinates(&self) -> EmbedderCoordinates { - let size = self.window.inner_size(); - let pos = Point2D::new(0, 0); - let viewport = Size2D::new(size.width as i32, size.height as i32); +/// A panel is a special web view that focus on controlling states around window. It can be treatedd as +/// the control panel or navigation bar of the window depending on usages. +pub struct Panel { + id: Option, +} - let size = self.window.available_monitors().nth(0).unwrap().size(); - let screen = Size2D::new(size.width as i32, size.height as i32); - EmbedderCoordinates { - hidpi_factor: Scale::new(self.window.scale_factor() as f32), - screen, - screen_avail: screen, - window: (viewport, pos), - framebuffer: viewport, - viewport: DeviceIntRect::from_origin_and_size(pos, viewport), - } +impl Panel { + /// Create a panel from winit window. + pub fn new() -> Self { + Self { id: None } } - fn set_animation_state(&self, state: AnimationState) { - self.animation_state.set(state); + /// Set web view ID of this panel. + pub fn set_id(&mut self, id: WebViewId) { + self.id = Some(id); } - fn rendering_context(&self) -> RenderingContext { - self.rendering_context.clone() + /// Get web view ID of this panel. + /// + /// We assume this is always called after `set_id`. Calling before it will cause panic. + pub fn id(&self) -> WebViewId { + self.id.unwrap() } } diff --git a/src/window.rs b/src/window.rs new file mode 100644 index 00000000..e610ddd6 --- /dev/null +++ b/src/window.rs @@ -0,0 +1,468 @@ +use std::{cell::Cell, ops::Deref, rc::Rc}; + +use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle}; +use servo::{ + compositing::windowing::{ + AnimationState, EmbedderCoordinates, EmbedderEvent, MouseWindowEvent, WindowMethods, + }, + embedder_traits::{Cursor, EmbedderMsg}, + euclid::{Point2D, Scale, Size2D, UnknownUnit}, + gl, + msg::constellation_msg::WebViewId, + rendering_context::RenderingContext, + script_traits::{TouchEventType, WheelDelta, WheelMode}, + webrender_api::{ + units::{DeviceIntPoint, DeviceIntRect, DevicePoint, LayoutVector2D}, + ScrollLocation, + }, + Servo, +}; +use surfman::{Connection, GLApi, SurfaceType}; +use winit::{ + dpi::PhysicalPosition, + event::{ElementState, TouchPhase, WindowEvent}, + window::{CursorIcon, Window as WinitWindow}, +}; + +use crate::{ + webview::{Panel, WebView}, + Status, +}; + +/// A Verso window is a Winit window containing several web views. +pub struct Window { + /// Access to winit window with webrender context. + gl_window: Rc, + /// The main control panel of this window. + panel: Panel, + /// The web view of this window. + webview: Option, + /// Access to webrender gl + webrender_gl: Rc, + /// The mouse physical position in the web view. + mouse_position: Cell>, +} + +impl Window { + /// Create a Verso window from winit window. + pub fn new(window: WinitWindow) -> Self { + let window_size = window.inner_size(); + let window_size = Size2D::new(window_size.width as i32, window_size.height as i32); + let display_handle = window.raw_display_handle(); + let connection = Connection::from_raw_display_handle(display_handle) + .expect("Failed to create connection"); + let adapter = connection + .create_adapter() + .expect("Failed to create adapter"); + let native_widget = connection + .create_native_widget_from_raw_window_handle(window.raw_window_handle(), window_size) + .expect("Failed to create native widget"); + let surface_type = SurfaceType::Widget { native_widget }; + let rendering_context = RenderingContext::create(&connection, &adapter, surface_type) + .expect("Failed to create rendering context"); + log::trace!("Created rendering context for window {:?}", window); + let webrender_gl = match rendering_context.connection().gl_api() { + GLApi::GL => unsafe { gl::GlFns::load_with(|s| rendering_context.get_proc_address(s)) }, + GLApi::GLES => unsafe { + gl::GlesFns::load_with(|s| rendering_context.get_proc_address(s)) + }, + }; + debug_assert_eq!(webrender_gl.get_error(), gl::NO_ERROR); + + Self { + gl_window: Rc::new(GLWindow::new(window, rendering_context)), + panel: Panel::new(), + webview: None, + webrender_gl, + mouse_position: Cell::new(PhysicalPosition::default()), + } + } + + /// Set web view ID of this window. + pub fn set_webview_id(&mut self, id: WebViewId) { + self.panel.set_id(id); + } + + /// Return the reference counted GLWindow. + pub fn gl_window(&self) -> Rc { + return self.gl_window.clone(); + } + + /// Handle winit window event. + pub fn handle_winit_window_event( + &self, + servo: &mut Option>, + events: &mut Vec, + event: &winit::event::WindowEvent, + ) { + match event { + WindowEvent::RedrawRequested => { + let Some(servo) = servo.as_mut() else { + return; + }; + + self.paint(servo); + events.push(EmbedderEvent::Idle); + } + WindowEvent::Resized(size) => { + let size = Size2D::new(size.width, size.height); + let _ = self.resize(size.to_i32()); + events.push(EmbedderEvent::WindowResize); + } + WindowEvent::CursorMoved { position, .. } => { + let event: DevicePoint = DevicePoint::new(position.x as f32, position.y as f32); + self.mouse_position.set(*position); + events.push(EmbedderEvent::MouseWindowMoveEventClass(event)); + } + WindowEvent::MouseInput { state, button, .. } => { + let button: servo::script_traits::MouseButton = match button { + winit::event::MouseButton::Left => servo::script_traits::MouseButton::Left, + winit::event::MouseButton::Right => servo::script_traits::MouseButton::Right, + winit::event::MouseButton::Middle => servo::script_traits::MouseButton::Middle, + _ => { + log::warn!( + "Verso Window hasn't supported this mouse button yet: {button:?}" + ); + return; + } + }; + let position = Point2D::new( + self.mouse_position.get().x as f32, + self.mouse_position.get().y as f32, + ); + + let event: MouseWindowEvent = match state { + ElementState::Pressed => MouseWindowEvent::MouseDown(button, position), + ElementState::Released => MouseWindowEvent::MouseUp(button, position), + }; + events.push(EmbedderEvent::MouseWindowEventClass(event)); + + // winit didn't send click event, so we send it after mouse up + if *state == ElementState::Released { + let event: MouseWindowEvent = MouseWindowEvent::Click(button, position); + events.push(EmbedderEvent::MouseWindowEventClass(event)); + } + } + WindowEvent::TouchpadMagnify { delta, .. } => { + events.push(EmbedderEvent::Zoom(1.0 + *delta as f32)); + } + WindowEvent::MouseWheel { delta, phase, .. } => { + // FIXME: Pixels per line, should be configurable (from browser setting?) and vary by zoom level. + const LINE_HEIGHT: f32 = 38.0; + + let (mut x, mut y, mode) = match delta { + winit::event::MouseScrollDelta::LineDelta(x, y) => { + (*x as f64, (*y * LINE_HEIGHT) as f64, WheelMode::DeltaLine) + } + winit::event::MouseScrollDelta::PixelDelta(position) => { + let position = position.to_logical::(self.window.scale_factor()); + (position.x, position.y, WheelMode::DeltaPixel) + } + }; + + // Wheel Event + events.push(EmbedderEvent::Wheel( + WheelDelta { x, y, z: 0.0, mode }, + DevicePoint::new( + self.mouse_position.get().x as f32, + self.mouse_position.get().y as f32, + ), + )); + + // Scroll Event + // Do one axis at a time. + if y.abs() >= x.abs() { + x = 0.0; + } else { + y = 0.0; + } + + let phase: TouchEventType = match phase { + TouchPhase::Started => TouchEventType::Down, + TouchPhase::Moved => TouchEventType::Move, + TouchPhase::Ended => TouchEventType::Up, + TouchPhase::Cancelled => TouchEventType::Cancel, + }; + + events.push(EmbedderEvent::Scroll( + ScrollLocation::Delta(LayoutVector2D::new(x as f32, y as f32)), + DeviceIntPoint::new( + self.mouse_position.get().x as i32, + self.mouse_position.get().y as i32, + ), + phase, + )); + } + WindowEvent::CloseRequested => { + events.push(EmbedderEvent::Quit); + } + e => log::warn!("Verso Window hasn't supported this window event yet: {e:?}"), + } + } + + /// Handle servo messages and return a boolean to indicate servo needs to present or not. + pub fn handle_servo_messages( + &mut self, + servo: &mut Servo, + events: &mut Vec, + status: &mut Status, + ) -> bool { + let mut need_present = false; + servo.get_events().into_iter().for_each(|(w, m)| { + // TODO Move each arm into their own methods. + match w { + // Handle message in Verso Panel + Some(p) if p == self.panel.id() => { + log::trace!("Verso Panel {p:?} is handling servo message: {m:?}",); + match m { + EmbedderMsg::LoadStart | EmbedderMsg::HeadParsed => { + need_present = false; + } + EmbedderMsg::LoadComplete => { + need_present = true; + } + EmbedderMsg::WebViewOpened(w) => { + let mut rect = self.get_coordinates().get_viewport().to_f32(); + rect.max.y /= 10.; + events.push(EmbedderEvent::FocusWebView(w)); + events.push(EmbedderEvent::MoveResizeWebView(w, rect)); + } + EmbedderMsg::WebViewClosed(_w) => { + events.push(EmbedderEvent::Quit); + } + EmbedderMsg::WebViewFocused(w) => { + events.push(EmbedderEvent::ShowWebView(w, false)); + } + EmbedderMsg::HistoryChanged(..) + | EmbedderMsg::ChangePageTitle(..) + | EmbedderMsg::AllowNavigationRequest(..) => { + log::trace!("Verso Panel ignores this message: {m:?}") + } + e => { + log::warn!( + "Verso Panel hasn't supported handling this message yet: {e:?}" + ) + } + } + } + // Handle message in Verso WebView + Some(w) => { + log::trace!("Verso WebView {w:?} is handling servo message: {m:?}",); + match m { + EmbedderMsg::LoadStart | EmbedderMsg::HeadParsed => { + need_present = false; + } + EmbedderMsg::LoadComplete => { + need_present = true; + } + EmbedderMsg::WebViewOpened(w) => { + let webview = WebView::new(w); + self.webview = Some(webview); + + let mut rect = self.get_coordinates().get_viewport().to_f32(); + rect.min.y = rect.max.y / 10.; + events.push(EmbedderEvent::FocusWebView(w)); + events.push(EmbedderEvent::MoveResizeWebView(w, rect)); + } + EmbedderMsg::WebViewClosed(_w) => { + self.webview = None; + } + EmbedderMsg::WebViewFocused(w) => { + events.push(EmbedderEvent::ShowWebView(w, false)); + } + e => { + log::warn!( + "Verso WebView hasn't supported handling this message yet: {e:?}" + ) + } + } + } + // Handle message in Verso Window + None => { + log::trace!("Verso Window is handling servo message: {m:?}"); + match m { + EmbedderMsg::ReadyToPresent(_w) => { + need_present = true; + } + EmbedderMsg::SetCursor(cursor) => { + self.set_cursor_icon(cursor); + } + EmbedderMsg::Shutdown => { + *status = Status::Shutdown; + } + e => { + log::warn!( + "Verso Window hasn't supported handling this message yet: {e:?}" + ) + } + } + } + } + }); + + need_present + } + + /// Paint offscreen framebuffer to winit window. + pub fn paint(&self, servo: &mut Servo) { + if let Some(fbo) = servo.offscreen_framebuffer_id() { + let viewport = self.gl_window.get_coordinates().get_flipped_viewport(); + let webrender_gl = &self.webrender_gl; + + let target_fbo = self + .gl_window + .rendering_context + .context_surface_info() + .unwrap_or(None) + .map(|info| info.framebuffer_object) + .unwrap_or(0); + + webrender_gl.bind_framebuffer(gl::READ_FRAMEBUFFER, fbo); + webrender_gl.bind_framebuffer(gl::DRAW_FRAMEBUFFER, target_fbo); + + let x = viewport.min.x; + let y = viewport.min.y; + let width = viewport.size().width; + let height = viewport.size().height; + webrender_gl.blit_framebuffer( + x, + y, + x + width, + y + height, + x, + y, + x + width, + y + height, + gl::COLOR_BUFFER_BIT, + gl::NEAREST, + ); + + debug_assert_eq!( + ( + self.webrender_gl.get_error(), + self.webrender_gl.check_frame_buffer_status(gl::FRAMEBUFFER) + ), + (gl::NO_ERROR, gl::FRAMEBUFFER_COMPLETE) + ); + + servo.present(); + } + } + + /// Queues a Winit's [`WindowEvent::RedrawRequested`] event to be emitted that aligns with the windowing system drawing loop. + pub fn request_redraw(&self) { + self.window.request_redraw() + } + /// Check if window's web view is animating. + pub fn is_animating(&self) -> bool { + self.gl_window.is_animating() + } + + /// Resize the rendering context. + pub fn resize(&self, size: Size2D) { + let _ = self.gl_window.rendering_context.resize(size); + } + + /// Set cursor icon of the window. + pub fn set_cursor_icon(&self, cursor: Cursor) { + let winit_cursor = match cursor { + Cursor::Default => CursorIcon::Default, + Cursor::Pointer => CursorIcon::Pointer, + Cursor::ContextMenu => CursorIcon::ContextMenu, + Cursor::Help => CursorIcon::Help, + Cursor::Progress => CursorIcon::Progress, + Cursor::Wait => CursorIcon::Wait, + Cursor::Cell => CursorIcon::Cell, + Cursor::Crosshair => CursorIcon::Crosshair, + Cursor::Text => CursorIcon::Text, + Cursor::VerticalText => CursorIcon::VerticalText, + Cursor::Alias => CursorIcon::Alias, + Cursor::Copy => CursorIcon::Copy, + Cursor::Move => CursorIcon::Move, + Cursor::NoDrop => CursorIcon::NoDrop, + Cursor::NotAllowed => CursorIcon::NotAllowed, + Cursor::Grab => CursorIcon::Grab, + Cursor::Grabbing => CursorIcon::Grabbing, + Cursor::EResize => CursorIcon::EResize, + Cursor::NResize => CursorIcon::NResize, + Cursor::NeResize => CursorIcon::NeResize, + Cursor::NwResize => CursorIcon::NwResize, + Cursor::SResize => CursorIcon::SResize, + Cursor::SeResize => CursorIcon::SeResize, + Cursor::SwResize => CursorIcon::SwResize, + Cursor::WResize => CursorIcon::WResize, + Cursor::EwResize => CursorIcon::EwResize, + Cursor::NsResize => CursorIcon::NsResize, + Cursor::NeswResize => CursorIcon::NeswResize, + Cursor::NwseResize => CursorIcon::NwseResize, + Cursor::ColResize => CursorIcon::ColResize, + Cursor::RowResize => CursorIcon::RowResize, + Cursor::AllScroll => CursorIcon::AllScroll, + Cursor::ZoomIn => CursorIcon::ZoomIn, + Cursor::ZoomOut => CursorIcon::ZoomOut, + _ => CursorIcon::Default, + }; + self.window.set_cursor_icon(winit_cursor); + } +} + +/// A winit window with webrender rendering context. +pub struct GLWindow { + /// Access to webrender rendering context + rendering_context: RenderingContext, + /// Animation state set by Servo to indicate if the webview is still rendering. + animation_state: Cell, + /// Access to winit window + window: WinitWindow, +} + +impl GLWindow { + /// Create a web view from winit window. + pub fn new(window: WinitWindow, rendering_context: RenderingContext) -> Self { + Self { + rendering_context, + animation_state: Cell::new(AnimationState::Idle), + window, + } + } + + /// Check if web view is animating. + pub fn is_animating(&self) -> bool { + self.animation_state.get() == AnimationState::Animating + } +} + +impl WindowMethods for GLWindow { + fn get_coordinates(&self) -> EmbedderCoordinates { + let size = self.window.inner_size(); + let pos = Point2D::new(0, 0); + let viewport = Size2D::new(size.width as i32, size.height as i32); + + let size = self.window.available_monitors().nth(0).unwrap().size(); + let screen = Size2D::new(size.width as i32, size.height as i32); + EmbedderCoordinates { + hidpi_factor: Scale::new(self.window.scale_factor() as f32), + screen, + screen_avail: screen, + window: (viewport, pos), + framebuffer: viewport, + viewport: DeviceIntRect::from_origin_and_size(pos, viewport), + } + } + + fn set_animation_state(&self, state: AnimationState) { + self.animation_state.set(state); + } + + fn rendering_context(&self) -> RenderingContext { + self.rendering_context.clone() + } +} + +impl Deref for Window { + type Target = GLWindow; + + fn deref(&self) -> &Self::Target { + &self.gl_window + } +}