diff --git a/Cargo.lock b/Cargo.lock index c9199fc..d6d97f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6590,7 +6590,7 @@ dependencies = [ [[package]] name = "servo" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "accesskit", "bitflags 2.11.0", @@ -6651,7 +6651,7 @@ dependencies = [ [[package]] name = "servo-allocator" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "libc", "tikv-jemalloc-sys", @@ -6662,7 +6662,7 @@ dependencies = [ [[package]] name = "servo-background-hang-monitor" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "backtrace", "crossbeam-channel", @@ -6677,7 +6677,7 @@ dependencies = [ [[package]] name = "servo-background-hang-monitor-api" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "serde", "servo-base", @@ -6686,7 +6686,7 @@ dependencies = [ [[package]] name = "servo-base" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "accesskit", "crossbeam-channel", @@ -6711,7 +6711,7 @@ dependencies = [ [[package]] name = "servo-canvas" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "bytemuck", "crossbeam-channel", @@ -6736,7 +6736,7 @@ dependencies = [ [[package]] name = "servo-canvas-traits" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "crossbeam-channel", "euclid", @@ -6758,7 +6758,7 @@ dependencies = [ [[package]] name = "servo-config" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "serde", "serde_json", @@ -6770,7 +6770,7 @@ dependencies = [ [[package]] name = "servo-config-macro" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "proc-macro2", "quote", @@ -6781,7 +6781,7 @@ dependencies = [ [[package]] name = "servo-constellation" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "backtrace", "content-security-policy", @@ -6828,7 +6828,7 @@ dependencies = [ [[package]] name = "servo-constellation-traits" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "content-security-policy", "encoding_rs", @@ -6863,7 +6863,7 @@ dependencies = [ [[package]] name = "servo-deny-public-fields" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "syn", "synstructure", @@ -6872,7 +6872,7 @@ dependencies = [ [[package]] name = "servo-devtools" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "atomic_refcell", "base64 0.22.1", @@ -6901,7 +6901,7 @@ dependencies = [ [[package]] name = "servo-devtools-traits" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "bitflags 2.11.0", "http 1.4.0", @@ -6920,7 +6920,7 @@ dependencies = [ [[package]] name = "servo-dom-struct" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "proc-macro2", "quote", @@ -6930,7 +6930,7 @@ dependencies = [ [[package]] name = "servo-embedder-traits" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "accesskit", "bitflags 2.11.0", @@ -6963,7 +6963,7 @@ dependencies = [ [[package]] name = "servo-fonts" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "app_units", "bitflags 2.11.0", @@ -7016,7 +7016,7 @@ dependencies = [ [[package]] name = "servo-fonts-traits" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "atomic_refcell", "dwrote", @@ -7039,7 +7039,7 @@ dependencies = [ [[package]] name = "servo-geometry" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "app_units", "euclid", @@ -7052,7 +7052,7 @@ dependencies = [ [[package]] name = "servo-hyper-serde" version = "0.13.2" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "cookie 0.18.1", "headers 0.4.1", @@ -7066,7 +7066,7 @@ dependencies = [ [[package]] name = "servo-jstraceable-derive" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "proc-macro2", "syn", @@ -7076,7 +7076,7 @@ dependencies = [ [[package]] name = "servo-layout" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "accesskit", "app_units", @@ -7130,7 +7130,7 @@ dependencies = [ [[package]] name = "servo-layout-api" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "app_units", "atomic_refcell", @@ -7164,7 +7164,7 @@ dependencies = [ [[package]] name = "servo-malloc-size-of" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "accountable-refcell", "app_units", @@ -7204,7 +7204,7 @@ dependencies = [ [[package]] name = "servo-media" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "once_cell", "servo-media-audio", @@ -7217,7 +7217,7 @@ dependencies = [ [[package]] name = "servo-media-audio" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "byte-slice-cast", "euclid", @@ -7240,7 +7240,7 @@ dependencies = [ [[package]] name = "servo-media-derive" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "proc-macro2", "quote", @@ -7250,7 +7250,7 @@ dependencies = [ [[package]] name = "servo-media-dummy" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "ipc-channel", "servo-media", @@ -7264,7 +7264,7 @@ dependencies = [ [[package]] name = "servo-media-player" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "ipc-channel", "malloc_size_of_derive", @@ -7278,7 +7278,7 @@ dependencies = [ [[package]] name = "servo-media-streams" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "malloc_size_of_derive", "servo-malloc-size-of", @@ -7288,7 +7288,7 @@ dependencies = [ [[package]] name = "servo-media-thread" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "euclid", "ipc-channel", @@ -7306,7 +7306,7 @@ dependencies = [ [[package]] name = "servo-media-traits" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "malloc_size_of_derive", "servo-malloc-size-of", @@ -7315,7 +7315,7 @@ dependencies = [ [[package]] name = "servo-media-webrtc" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "log", "servo-media-streams", @@ -7325,7 +7325,7 @@ dependencies = [ [[package]] name = "servo-metrics" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "malloc_size_of_derive", "servo-base", @@ -7340,7 +7340,7 @@ dependencies = [ [[package]] name = "servo-net" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "async-compression", "async-recursion", @@ -7409,7 +7409,7 @@ dependencies = [ [[package]] name = "servo-net-traits" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "content-security-policy", "cookie 0.18.1", @@ -7449,7 +7449,7 @@ dependencies = [ [[package]] name = "servo-paint" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "bitflags 2.11.0", "crossbeam-channel", @@ -7486,7 +7486,7 @@ dependencies = [ [[package]] name = "servo-paint-api" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "bitflags 2.11.0", "crossbeam-channel", @@ -7522,7 +7522,7 @@ dependencies = [ [[package]] name = "servo-pixels" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "euclid", "image", @@ -7537,7 +7537,7 @@ dependencies = [ [[package]] name = "servo-profile" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "libc", "log", @@ -7556,7 +7556,7 @@ dependencies = [ [[package]] name = "servo-profile-traits" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "crossbeam-channel", "ipc-channel", @@ -7573,7 +7573,7 @@ dependencies = [ [[package]] name = "servo-script" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "aes", "aes-gcm", @@ -7712,7 +7712,7 @@ dependencies = [ [[package]] name = "servo-script-bindings" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "bitflags 2.11.0", "crossbeam-channel", @@ -7750,7 +7750,7 @@ dependencies = [ [[package]] name = "servo-script-traits" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "accesskit", "content-security-policy", @@ -7787,7 +7787,7 @@ dependencies = [ [[package]] name = "servo-storage" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "libc", "log", @@ -7817,7 +7817,7 @@ dependencies = [ [[package]] name = "servo-storage-traits" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "malloc_size_of_derive", "serde", @@ -7831,7 +7831,7 @@ dependencies = [ [[package]] name = "servo-timers" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "crossbeam-channel", "malloc_size_of_derive", @@ -7841,7 +7841,7 @@ dependencies = [ [[package]] name = "servo-tracing" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "proc-macro2", "quote", @@ -7851,7 +7851,7 @@ dependencies = [ [[package]] name = "servo-url" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "encoding_rs", "malloc_size_of_derive", @@ -7865,7 +7865,7 @@ dependencies = [ [[package]] name = "servo-webgl" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "bitflags 2.11.0", "byteorder", @@ -7889,7 +7889,7 @@ dependencies = [ [[package]] name = "servo-webgpu" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "arrayvec", "euclid", @@ -7908,7 +7908,7 @@ dependencies = [ [[package]] name = "servo-webgpu-traits" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "arrayvec", "malloc_size_of_derive", @@ -7924,7 +7924,7 @@ dependencies = [ [[package]] name = "servo-webxr" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "crossbeam-channel", "euclid", @@ -7943,7 +7943,7 @@ dependencies = [ [[package]] name = "servo-webxr-api" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "euclid", "ipc-channel", @@ -7959,7 +7959,7 @@ dependencies = [ [[package]] name = "servo-xpath" version = "0.0.1" -source = "git+https://github.com/marcoallegretti/servo?rev=f0bb1aaf981b65c8dddc848bb647045d4c777d11#f0bb1aaf981b65c8dddc848bb647045d4c777d11" +source = "git+https://github.com/marcoallegretti/servo?rev=e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163#e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" dependencies = [ "log", "malloc_size_of_derive", diff --git a/README.md b/README.md index 54f107b..c346d89 100644 --- a/README.md +++ b/README.md @@ -96,9 +96,9 @@ See `docs/security.md`. Key points: ## Servo fork -- Servo: `https://github.com/marcoallegretti/servo` at `f0bb1aaf`, pinned by revision +- Servo: `https://github.com/marcoallegretti/servo` at `e5d9a518`, pinned by revision - Stylo: `https://github.com/marcoallegretti/stylo` at `f1ba4969`, through the root `[patch]` -- Patches: `backdrop-filter` parsing (Stylo) and rendering (Servo) +- Patches: `backdrop-filter` parsing (Stylo) and rendering (Servo), rooting of compiled classic scripts and `navigator.servo` exposure (Servo) - See `crates/weft-servo-shell/SERVO_PIN.md` for Servo integration status and known limitations ## Contributing diff --git a/crates/weft-app-shell/Cargo.toml b/crates/weft-app-shell/Cargo.toml index 1fd1448..ef2ecd9 100644 --- a/crates/weft-app-shell/Cargo.toml +++ b/crates/weft-app-shell/Cargo.toml @@ -27,7 +27,7 @@ toml = { version = "0.8", optional = true } [dependencies.servo] git = "https://github.com/marcoallegretti/servo" -rev = "f0bb1aaf981b65c8dddc848bb647045d4c777d11" +rev = "e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" optional = true default-features = false diff --git a/crates/weft-app-shell/src/embedder.rs b/crates/weft-app-shell/src/embedder.rs index 37880f1..81aec1d 100644 --- a/crates/weft-app-shell/src/embedder.rs +++ b/crates/weft-app-shell/src/embedder.rs @@ -48,6 +48,16 @@ impl ServoDelegate for WeftServoDelegate { fn notify_error(&self, error: servo::ServoError) { tracing::error!(?error, "Servo error"); } + + /// Loads not tied to the webview, such as `navigator.sendBeacon()`, + /// worklets and notification icons, also come from the application page, + /// and none of them is needed: all are refused. + fn load_web_resource(&self, load: servo::WebResourceLoad) { + let url = load.request().url.clone(); + tracing::warn!(%url, "resource load outside the webview denied"); + load.intercept(servo::WebResourceResponse::new(url)) + .cancel(); + } } /// Frame and load progress reported by Servo, shared with the event loop. @@ -65,6 +75,11 @@ struct WeftWebViewDelegate { signals: Arc, /// URL prefix of the application's UI directory; see `ui_scope`. scope: String, + /// The UI directory with symbolic links resolved, if it exists. + ui_dir: Option, + /// The bridge's WebSocket handshake URL, as the network layer requests it + /// (`ws:` becomes `http:`). + bridge: String, } impl WebViewDelegate for WeftWebViewDelegate { @@ -84,6 +99,25 @@ impl WebViewDelegate for WeftWebViewDelegate { } } + /// Every resource the webview loads passes through here, including + /// `fetch()`, XHR, subresources and WebSocket handshakes. The page may + /// read its own UI files and open the session bridge; any other local + /// file or network destination is refused with a network error. Network + /// access belongs to the component, under its fetch grants. + /// + /// On a redirect Servo reports the first URL of the chain again, not the + /// target, so every redirect is refused. + fn load_web_resource(&self, _webview: servo::WebView, load: servo::WebResourceLoad) { + let request = load.request(); + let url = request.url.clone(); + if !request.is_redirect && self.allows(&ServoUrl::from_url(url.clone())) { + return; + } + tracing::warn!(%url, "resource outside the application denied"); + load.intercept(servo::WebResourceResponse::new(url)) + .cancel(); + } + fn notify_load_status_changed(&self, webview: servo::WebView, status: LoadStatus) { if status != LoadStatus::Complete { return; @@ -142,6 +176,39 @@ fn in_scope(url: &str, scope: &str) -> bool { }) } +impl WeftWebViewDelegate { + /// Whether an application page may load `url`: a file inside its UI + /// directory, also after resolving symbolic links, an inline (`data:`, + /// `blob:`) resource, `about:blank`, or the session bridge. + fn allows(&self, url: &ServoUrl) -> bool { + match url.scheme() { + "file" => { + in_scope(url.as_str(), &self.scope) + && self.ui_dir.as_deref().is_some_and(|dir| { + url.to_file_path() + .ok() + .and_then(|path| path.canonicalize().ok()) + .is_some_and(|path| path.starts_with(dir)) + }) + } + "data" | "blob" => true, + "about" => url.as_str() == "about:blank", + _ => url.as_str() == self.bridge, + } + } +} + +/// The UI directory behind the URL prefix `scope`, with symbolic links +/// resolved. +fn ui_dir(scope: &str) -> Option { + ServoUrl::parse(scope) + .ok()? + .to_file_path() + .ok()? + .canonicalize() + .ok() +} + /// `value` as a single-quoted JavaScript string literal. fn js_string(value: &str) -> String { let mut literal = String::with_capacity(value.len() + 2); @@ -428,6 +495,8 @@ impl ApplicationHandler for App { .delegate(Rc::new(WeftWebViewDelegate { signals: Arc::clone(&self.signals), scope: ui_scope(&self.url), + ui_dir: ui_dir(&ui_scope(&self.url)), + bridge: format!("http://127.0.0.1:{}/app", self.ws_port), })) .user_content_manager(ucm) .url(self.url.clone().into_url()) diff --git a/crates/weft-servo-shell/Cargo.toml b/crates/weft-servo-shell/Cargo.toml index ef8cf89..b853710 100644 --- a/crates/weft-servo-shell/Cargo.toml +++ b/crates/weft-servo-shell/Cargo.toml @@ -27,7 +27,7 @@ tungstenite = "0.24" [dependencies.servo] git = "https://github.com/marcoallegretti/servo" -rev = "f0bb1aaf981b65c8dddc848bb647045d4c777d11" +rev = "e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" optional = true default-features = false diff --git a/crates/weft-servo-shell/SERVO_PIN.md b/crates/weft-servo-shell/SERVO_PIN.md index 3b1ebfd..5925f8d 100644 --- a/crates/weft-servo-shell/SERVO_PIN.md +++ b/crates/weft-servo-shell/SERVO_PIN.md @@ -6,13 +6,17 @@ The selected revisions are the ones recorded in the workspace `Cargo.lock`. | Dependency | Source | Revision | Selected by | |------------|--------|----------|-------------| -| Servo (`servo` crate) | | `f0bb1aaf981b65c8dddc848bb647045d4c777d11` | `rev` in both shell crates' `Cargo.toml` | +| Servo (`servo` crate) | | `e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163` | `rev` in both shell crates' `Cargo.toml` | | Stylo (`stylo`, `selectors`, `servo_arc`, ...) | | `f1ba4969536d63f2e319a561e466c03e78b4a076` | `[patch."https://github.com/servo/stylo"]` in the root `Cargo.toml` | -The Servo revision is `servo-weft` commit `8e7dc40` (backdrop-filter rendering) -plus `f0bb1aa`, which fixes that commit's `servo-layout` build errors. It lives -on the fork branch `fix/backdrop-filter-build-errors` until it is merged into -`servo-weft`; keep that branch until then so the revision stays fetchable. +The Servo revision is `servo-weft` commit `8e7dc40` (backdrop-filter rendering), +plus `f0bb1aa`, which fixes that commit's `servo-layout` build errors, plus +`b87e5a6` and `e5d9a51`, which keep compiled classic scripts traced until +they run, and `5d90f51`, which withholds `navigator.servo` from +`about:blank` and `about:srcdoc` documents. It lives +on the fork branch `fix/root-pending-classic-scripts`, which is based on +`fix/backdrop-filter-build-errors`, until both are merged into `servo-weft`; +keep those branches until then so the revisions stay fetchable. Servo's own `[patch]` table for Stylo does not apply to WEFT, because Cargo only honours patches in the root workspace. Without the root override, WEFT @@ -37,7 +41,7 @@ servo-embed = ["dep:servo", "dep:winit", "dep:softbuffer"] [dependencies.servo] git = "https://github.com/marcoallegretti/servo" -rev = "f0bb1aaf981b65c8dddc848bb647045d4c777d11" +rev = "e5d9a518ebddb5ebd6af404d1fd4e00ea0f77163" optional = true default-features = false @@ -155,7 +159,7 @@ exercised is listed as unverified. rather than tracking a branch, so a rebuild selects the same code. A pinned revision must stay reachable from a published branch: never force-push, rebase or delete a branch that contains a revision a WEFT lockfile selects. -Today Servo `f0bb1aa` is reachable only from `fix/backdrop-filter-build-errors` +Today Servo `e5d9a51` is reachable only from `fix/root-pending-classic-scripts` and Stylo `f1ba496` only from Stylo's `servo-weft`. To move to new revisions: @@ -182,3 +186,5 @@ Each fork patch keeps its purpose, upstream status and removal condition here. | Stylo: parse `backdrop-filter` for Servo | stylo `f1ba496` | Remove the `layout.unimplemented` gate | Not submitted | Upstream Stylo parses it for Servo | | Servo: render `backdrop-filter` | servo `8e7dc40` | Stacking context and display list support | servo/servo issue [#41567](https://github.com/servo/servo/issues/41567) | Equivalent upstream support | | Servo: fix `build_backdrop_filter` types | servo `f0bb1aa` | Make `servo-layout` compile | Part of the patch above | Same as above | +| Servo: trace compiled classic scripts | servo `b87e5a6`, `e5d9a51` | A parser-blocking script waiting for a stylesheet was freed by a garbage collection and crashed the content process when it ran | Not submitted | Upstream traces `ClassicScript::record` | +| Servo: no `navigator.servo` for blank and srcdoc documents | servo `5d90f51` | An application's `about:srcdoc` frame could change engine preferences | Not submitted | Upstream limits `ServoInternals` exposure the same way | diff --git a/docs/architecture.md b/docs/architecture.md index fd59065..c5bfd3f 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -16,7 +16,7 @@ System UI host. Renders one WebView pointing at `system-ui.html` using the embed ### weft-app-shell -Per-application Servo host. Spawned by `weft-appd` after the Wasm runtime signals READY. Takes `` and `` as arguments. Resolves `weft-app:///ui/index.html` and injects the `weftIpc` WebSocket bridge into the page. The bridge authenticates with the per-session token from `WEFT_BRIDGE_TOKEN` and can only exchange messages with its own session. It is installed only in top-level documents inside the application's UI directory, and top-level navigation outside that directory is denied; framed documents never receive the bridge. Registers with the compositor as window type `application`. Exits when the appd session ends. +Per-application Servo host. Spawned by `weft-appd` after the Wasm runtime signals READY. Takes `` and `` as arguments. Resolves `weft-app:///ui/index.html` and injects the `weftIpc` WebSocket bridge into the page. The bridge authenticates with the per-session token from `WEFT_BRIDGE_TOKEN` and can only exchange messages with its own session. It is installed only in top-level documents inside the application's UI directory, and top-level navigation outside that directory is denied; framed documents never receive the bridge. Every resource the page loads (subresources, `fetch()`, XHR, workers and WebSocket handshakes) is checked by the shell: the page may load files inside its UI directory, also after symbolic links are resolved, inline `data:` and `blob:` resources, `about:blank` and the session bridge; any other local file or network destination, and every redirect, fails with a network error. Loads Servo does not attribute to the webview, such as `navigator.sendBeacon()`, are all refused. Network access belongs to the Wasm component, under its fetch grants. Servo's privileged `navigator.servo` interface, which can change engine preferences, is not exposed to `about:blank` or `about:srcdoc` documents (a fork patch; see `crates/weft-servo-shell/SERVO_PIN.md`). Registers with the compositor as window type `application`. Exits when the appd session ends. ### weft-appd diff --git a/docs/building.md b/docs/building.md index 6b9427d..fca337a 100644 --- a/docs/building.md +++ b/docs/building.md @@ -63,7 +63,9 @@ python3 tests/frame/check_frame.py --host app --slow-style 3 `--host app` also requires the page on screen within two seconds of `weft-app-shell` printing `READY`; `--slow-style` delays a stylesheet that -reveals the page so premature readiness becomes visible. +reveals the page so premature readiness becomes visible. The stylesheet is a +file next to the page that the harness keeps from being opened with a file +lease, so the delay must stay below `/proc/sys/fs/lease-break-time`. Logs and the last capture are written to `target/frame-check`. @@ -85,6 +87,7 @@ same nested desktop and drive the demo apps with real keyboard input: python3 tests/frame/check_counter.py # Counter round trip through the session bridge python3 tests/frame/check_notes.py # Notes stores exactly what is typed, refuses stale saves python3 tests/frame/check_app_data.py # Notes data from the earlier layout is moved and kept +python3 tests/frame/check_confinement.py # an app page reaches only its UI files and its session bridge ``` ## Demo apps (wasm32-wasip2) diff --git a/infra/nixos/weft-packages.nix b/infra/nixos/weft-packages.nix index 2d9ba82..f3a7ffc 100644 --- a/infra/nixos/weft-packages.nix +++ b/infra/nixos/weft-packages.nix @@ -13,7 +13,7 @@ let # One hash per git source in Cargo.lock: the Servo fork and the Stylo fork # (keyed by its `selectors` crate). Every package vendors both, so both must # match the pinned revisions. Recompute them whenever a revision changes. - # The Servo hash is not yet known for f0bb1aa; a Nix build reports it. + # The Servo hash is not yet known for e5d9a51; a Nix build reports it. outputHashes = { "servo-0.0.1" = pkgs.lib.fakeHash; "selectors-0.36.0" = "13y6pa19j4w2zsxfhv6mrl03wsa0frazlsssbqkzpwci8k9gzl4i"; diff --git a/tests/frame/check_confinement.py b/tests/frame/check_confinement.py new file mode 100644 index 0000000..c484905 --- /dev/null +++ b/tests/frame/check_confinement.py @@ -0,0 +1,233 @@ +"""Check that an application page can reach only its own files and its bridge. + +The harness installs a test package, using the Counter demo's component and +the page in tests/frame/confinement, in a temporary store and launches it +through weft-appd with the real runtime and app shell on the nested desktop. +The page probes, and paints one band per probe: + +- an image from its own UI directory loads; +- the session bridge reaches the component, which answers; +- an image just outside its UI directory (../outside.png) fails to load; +- an image elsewhere on disk (a file: URL) fails to load; +- an image reached through a symbolic link in the UI directory fails to load; +- an image from a local HTTP server fails to load; +- a no-cors fetch from that server is rejected; +- a WebSocket to a local server that completes the handshake fails; +- a worker does not fetch from that server (Servo does not start workers + for file: pages, which also keeps them from fetching); +- an about:srcdoc frame has no navigator.servo, which could change engine + preferences. + +The page also imports a stylesheet, loads a font and sends a beacon to the +HTTP server, and frames an about:srcdoc document showing an image from it. + +Each refused probe would succeed without the policy: the images are valid, +the fetches accept an opaque response and the WebSocket server accepts the +upgrade. Every band must be green, and the HTTP server and the WebSocket +server must see no connection at all, so the refusals happen in the +renderer, not after a request left it. + +Requires Xvfb, xwd and ImageMagick's convert. +""" + +import argparse +import base64 +import hashlib +import http.server +import shutil +import socket +import struct +import sys +import tempfile +import threading +import time +import zlib +from pathlib import Path + +sys.dont_write_bytecode = True +from check_counter import AppdClient, free_port, read_endpoint # noqa: E402 +from session import ROOT, Desktop, SessionError, missing_tools, parse_ppm, pixel # noqa: E402 + +APP_ID = "org.weft.test.confinement" +PROBES = ["own-image", "bridge", "outside-image", "other-image", "linked-image", "http-image", + "http-fetch", "websocket", "worker-fetch", "srcdoc-internals"] +GREEN = (0, 192, 0) +# The app window's page area on the 1024x768 nested desktop. +PAGE_TOP, PAGE_HEIGHT, PAGE_X = 35, 600, 400 + + +def png(): + """A valid 1x1 PNG image.""" + def chunk(kind, data): + body = kind + data + return struct.pack(">I", len(data)) + body + struct.pack(">I", zlib.crc32(body)) + header = struct.pack(">IIBBBBB", 1, 1, 8, 2, 0, 0, 0) + pixels = zlib.compress(b"\x00\x00\x00\xff") + return (b"\x89PNG\r\n\x1a\n" + chunk(b"IHDR", header) + chunk(b"IDAT", pixels) + + chunk(b"IEND", b"")) + + +class Counting(http.server.BaseHTTPRequestHandler): + requests = [] + + def do_GET(self): + Counting.requests.append(f"{self.command} {self.path}") + body = png() + self.send_response(200) + self.send_header("Content-Type", "image/png") + self.send_header("Access-Control-Allow-Origin", "*") + self.send_header("Content-Length", str(len(body))) + self.end_headers() + self.wfile.write(body) + + do_POST = do_GET + + def log_message(self, *args): + pass + + +def websocket_server(connections, stop): + """A listener that completes WebSocket handshakes, so a WebSocket that + reaches it opens. Returns its port.""" + listener = socket.socket() + listener.bind(("127.0.0.1", 0)) + listener.listen() + listener.settimeout(0.2) + + def serve(): + while not stop.is_set(): + try: + connection = listener.accept()[0] + except OSError: + continue + connections.append(connection) + connection.settimeout(5) + try: + request = b"" + while b"\r\n\r\n" not in request: + chunk = connection.recv(4096) + if not chunk: + break + request += chunk + key = next((line.split(b":", 1)[1].strip() for line in request.split(b"\r\n") + if line.lower().startswith(b"sec-websocket-key:")), b"") + accept = base64.b64encode(hashlib.sha1( + key + b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11").digest()) + connection.sendall(b"HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\n" + b"Connection: Upgrade\r\nSec-WebSocket-Accept: " + accept + + b"\r\n\r\n") + except OSError: + pass + listener.close() + + threading.Thread(target=serve, daemon=True).start() + return listener.getsockname()[1] + + +def make_package(store, http_port, ws_port, other_dir): + package = store / APP_ID + (package / "ui").mkdir(parents=True) + (package / "wapp.toml").write_text( + f'[package]\nid = "{APP_ID}"\nname = "Confinement"\nversion = "0.1.0"\n' + '[runtime]\nmodule = "app.wasm"\n[ui]\nentry = "ui/index.html"\n') + shutil.copy(ROOT / "examples/org.weft.demo.counter/app.wasm", package / "app.wasm") + fixture = Path(__file__).parent / "confinement" + other = other_dir / "other.png" + page = (fixture / "index.html").read_text() + page = (page.replace("@HTTP@", f"http://127.0.0.1:{http_port}/") + .replace("@WS@", f"ws://127.0.0.1:{ws_port}/") + .replace("@OTHER_URL@", other.as_uri())) + (package / "ui/index.html").write_text(page) + (package / "ui/own.png").write_bytes(png()) + (package / "outside.png").write_bytes(png()) + other.write_bytes(png()) + (package / "ui/linked").symlink_to(other_dir) + + +def run(args, desktop, store, other_dir): + server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Counting) + threading.Thread(target=server.serve_forever, daemon=True).start() + stop = threading.Event() + connections = [] + ws_port = websocket_server(connections, stop) + try: + make_package(store, server.server_port, ws_port, other_dir) + t = Path(args.target) + desktop.launch_client("appd", [t / "weft-appd"], { + "WEFT_RUNTIME_BIN": str(t / "weft-runtime"), + "WEFT_APP_SHELL_BIN": str(t / "weft-app-shell"), + "WEFT_APP_STORE": str(store), + "WEFT_DISABLE_CGROUP": "1", + "WEFT_APPD_WS_PORT": str(free_port()), + }) + port, token = read_endpoint(desktop.runtime, 30) + appd = AppdClient(port, token) + appd.send({"type": "LAUNCH_APP", "app_id": APP_ID, "surface_id": 0}) + reply = appd.wait_for(lambda m: m.get("type") in ("APP_READY", "ERROR"), 120) + if reply.get("type") != "APP_READY": + raise AssertionError(f"the test app did not start: {reply}") + + deadline = time.monotonic() + 15 + while True: + width, _, pixels = parse_ppm(desktop.capture()) + colours = {} + for i, name in enumerate(PROBES): + y = PAGE_TOP + int((i + 0.5) * PAGE_HEIGHT / len(PROBES)) + colours[name] = pixel(width, pixels, PAGE_X, y) + if all(c == GREEN for c in colours.values()) or time.monotonic() > deadline: + break + time.sleep(0.5) + time.sleep(1) # let requests the page sent after the last band arrive + problems = [] + failed = [name for name, c in colours.items() if c != GREEN] + if failed: + problems.append(f"probes not as required: {failed}") + if Counting.requests or connections: + problems.append(f"requests left the renderer: HTTP {sorted(Counting.requests)}, " + f"{len(connections)} WebSocket") + if problems: + raise AssertionError("; ".join(problems)) + finally: + stop.set() + server.shutdown() + + +def main(argv=None): + parser = argparse.ArgumentParser(description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument("--compositor", type=Path, default=ROOT / "target/debug/weft-compositor") + parser.add_argument("--target", type=Path, default=ROOT / "target/debug", + help="directory with weft-appd, weft-runtime and weft-app-shell") + parser.add_argument("--output", type=Path, default=ROOT / "target/confinement-check") + args = parser.parse_args(argv) + + missing = missing_tools() + [str(p) for p in (args.compositor, args.target / "weft-appd", + args.target / "weft-runtime", + args.target / "weft-app-shell") + if not p.is_file()] + if missing: + print("missing: " + ", ".join(missing), file=sys.stderr) + return 2 + store = Path(tempfile.mkdtemp(prefix="weft-store-")) + other_dir = Path(tempfile.mkdtemp(prefix="weft-other-")) + try: + with Desktop(args.compositor, args.output, outputs=["appd.log", "confinement.ppm"]) \ + as desktop: + try: + run(args, desktop, store, other_dir) + except AssertionError: + (args.output / "confinement.ppm").write_bytes(desktop.capture()) + raise + except (AssertionError, SessionError, TimeoutError) as failure: + print(f"confinement check failed: {failure}", file=sys.stderr) + print(f"logs and capture in {args.output}", file=sys.stderr) + return 1 + finally: + shutil.rmtree(store, ignore_errors=True) + shutil.rmtree(other_dir, ignore_errors=True) + print("confinement check passed") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tests/frame/check_frame.py b/tests/frame/check_frame.py index 8fd89a0..742dc22 100644 --- a/tests/frame/check_frame.py +++ b/tests/frame/check_frame.py @@ -13,16 +13,19 @@ weft-app-shell for it. The host must print READY, and the page must be on screen within a short grace period after READY, because the compositor shows a presented frame slightly later. READY printed within that grace before the page is presented is therefore not detected. `--slow-style SECONDS` makes -early readiness observable: the page stays hidden until a stylesheet that a -local HTTP server delivers after the delay reveals it, so a host that reports +early readiness observable: the page stays hidden until a stylesheet next to it +reveals it, and the harness holds a file lease that keeps the stylesheet from +being opened until the delay has passed, so a host that reports READY before the document has loaded shows no page within the grace period. Requires Xvfb, xwd and ImageMagick's convert; see session.py. """ import argparse -import http.server +import fcntl +import os import shutil +import signal import sys import threading import time @@ -101,31 +104,42 @@ def install_app(store, page): return store -def slow_style_server(delay): - """Serve a stylesheet that reveals the page after `delay` seconds.""" - class Handler(http.server.BaseHTTPRequestHandler): - def do_GET(self): - time.sleep(delay) - body = b"body { visibility: visible; }" - self.send_response(200) - self.send_header("Content-Type", "text/css") - self.send_header("Content-Length", str(len(body))) - self.end_headers() - self.wfile.write(body) +def slow_style(directory, delay): + """Create `directory/reveal.css`, a stylesheet revealing the page, that + cannot be opened until `delay` seconds after the host first tries to. A + write lease makes another process's open() wait until the lease is + released, and the kernel signals the holder when an open() starts + waiting. The stylesheet is a local file next to the page, so an + application host confined to its UI directory may load it.""" + sheet = directory / "reveal.css" + sheet.write_text("body { visibility: visible; }", encoding="utf-8") + lease = os.open(sheet, os.O_WRONLY) + held = threading.Event() - def log_message(self, *args): - pass + def release(): + fcntl.fcntl(lease, fcntl.F_SETLEASE, fcntl.F_UNLCK) + os.close(lease) - server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Handler) - threading.Thread(target=server.serve_forever, daemon=True).start() - return server + def opening(_signal, _frame): + if not held.is_set(): + held.set() + timer = threading.Timer(delay, release) + timer.daemon = True + timer.start() + + signal.signal(signal.SIGIO, opening) + try: + fcntl.fcntl(lease, fcntl.F_SETLEASE, fcntl.F_WRLCK) + except OSError as error: + os.close(lease) + raise SessionError(f"cannot hold back {sheet} with a file lease: {error}") from error -def hidden_until_styled(page, destination, port): +def hidden_until_styled(page, destination): """Copy `page`, hiding its body until the delayed stylesheet loads.""" html = page.read_text(encoding="utf-8") - link = (f'\n' - f'\n') + link = ('\n' + '\n') if "" not in html: raise ValueError(f"{page} has no ") destination.write_text(html.replace("", link, 1), encoding="utf-8") @@ -149,6 +163,11 @@ def main(argv=None): parser.add_argument("--output", type=Path, default=ROOT / "target/frame-check", help="directory for logs and the captured screenshot") args = parser.parse_args(argv) + if args.slow_style: + # The kernel revokes a lease that is held longer than this. + limit = int(Path("/proc/sys/fs/lease-break-time").read_text()) + if not 0 < args.slow_style < limit: + parser.error(f"--slow-style must be between 0 and {limit} seconds") if args.shell is None: name = "weft-servo-shell" if args.host == "system" else "weft-app-shell" args.shell = ROOT / "target/debug" / name @@ -158,28 +177,26 @@ def main(argv=None): print("missing: " + ", ".join(missing), file=sys.stderr) return 2 - style_server = None try: with Desktop(args.compositor, args.output, outputs=["frame.ppm"]) as desktop: page = args.page if args.slow_style: - style_server = slow_style_server(args.slow_style) - page = hidden_until_styled(args.page, desktop.runtime / "page.html", - style_server.server_address[1]) + page = hidden_until_styled(args.page, desktop.runtime / "page.html") if args.host == "system": + if args.slow_style: + slow_style(desktop.runtime, args.slow_style) shell = desktop.launch_client( "shell", [args.shell], {"WEFT_SYSTEM_UI_HTML": str(page.resolve())}) else: store = install_app(desktop.runtime / "store", page) + if args.slow_style: + slow_style(store / APP_ID / "ui", args.slow_style) shell = desktop.launch_client( "shell", [args.shell, APP_ID, "1"], {"WEFT_APP_STORE": str(store)}) problems, screenshot = watch(desktop, shell, args) except SessionError as error: print(error, file=sys.stderr) return 1 - finally: - if style_server is not None: - style_server.shutdown() if screenshot is not None: (args.output / "frame.ppm").write_bytes(screenshot) diff --git a/tests/frame/confinement/index.html b/tests/frame/confinement/index.html new file mode 100644 index 0000000..51c55d1 --- /dev/null +++ b/tests/frame/confinement/index.html @@ -0,0 +1,114 @@ + + + + +confinement + + + + +
+
+
+
+
+
+
+
+
+
+probe + + + + +