Add embedder event for preferred color scheme and respond to it in the LayoutThread (#34532)

* respond to winit platform theme changed event and send it to the layout thread

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* refactoring viewport and theme change handling functions based on feedback

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* fixing issues reported by test-tidy

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* update stylo in order to use color_scheme function on Device

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

---------

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>
Co-authored-by: lazypassion <25536767+lazypassion@users.noreply.github.com>
This commit is contained in:
arthmis 2024-12-12 01:17:02 -05:00 committed by GitHub
parent dfcbb18a8b
commit 26f61103d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 144 additions and 43 deletions

32
Cargo.lock generated
View file

@ -1617,7 +1617,7 @@ dependencies = [
[[package]]
name = "dom"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#35e0fa29e93a7e85f44d4ad0610748634f7979b5"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#098f1bef3e231bbf86038c0a2b1ddc31031dc422"
dependencies = [
"bitflags 2.6.0",
"malloc_size_of",
@ -1867,7 +1867,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
dependencies = [
"libc",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@ -4076,7 +4076,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
dependencies = [
"cfg-if",
"windows-targets 0.52.6",
"windows-targets 0.48.5",
]
[[package]]
@ -4248,7 +4248,7 @@ dependencies = [
[[package]]
name = "malloc_size_of"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#35e0fa29e93a7e85f44d4ad0610748634f7979b5"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#098f1bef3e231bbf86038c0a2b1ddc31031dc422"
dependencies = [
"app_units",
"cssparser",
@ -6198,7 +6198,7 @@ dependencies = [
[[package]]
name = "selectors"
version = "0.26.0"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#35e0fa29e93a7e85f44d4ad0610748634f7979b5"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#098f1bef3e231bbf86038c0a2b1ddc31031dc422"
dependencies = [
"bitflags 2.6.0",
"cssparser",
@ -6486,7 +6486,7 @@ dependencies = [
[[package]]
name = "servo_arc"
version = "0.4.0"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#35e0fa29e93a7e85f44d4ad0610748634f7979b5"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#098f1bef3e231bbf86038c0a2b1ddc31031dc422"
dependencies = [
"serde",
"stable_deref_trait",
@ -6495,7 +6495,7 @@ dependencies = [
[[package]]
name = "servo_atoms"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#35e0fa29e93a7e85f44d4ad0610748634f7979b5"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#098f1bef3e231bbf86038c0a2b1ddc31031dc422"
dependencies = [
"string_cache",
"string_cache_codegen",
@ -6868,7 +6868,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "static_prefs"
version = "0.1.0"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#35e0fa29e93a7e85f44d4ad0610748634f7979b5"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#098f1bef3e231bbf86038c0a2b1ddc31031dc422"
[[package]]
name = "strck"
@ -6927,7 +6927,7 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "style"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#35e0fa29e93a7e85f44d4ad0610748634f7979b5"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#098f1bef3e231bbf86038c0a2b1ddc31031dc422"
dependencies = [
"app_units",
"arrayvec",
@ -6985,7 +6985,7 @@ dependencies = [
[[package]]
name = "style_config"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#35e0fa29e93a7e85f44d4ad0610748634f7979b5"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#098f1bef3e231bbf86038c0a2b1ddc31031dc422"
dependencies = [
"lazy_static",
]
@ -6993,7 +6993,7 @@ dependencies = [
[[package]]
name = "style_derive"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#35e0fa29e93a7e85f44d4ad0610748634f7979b5"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#098f1bef3e231bbf86038c0a2b1ddc31031dc422"
dependencies = [
"darling",
"proc-macro2",
@ -7023,7 +7023,7 @@ dependencies = [
[[package]]
name = "style_traits"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#35e0fa29e93a7e85f44d4ad0610748634f7979b5"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#098f1bef3e231bbf86038c0a2b1ddc31031dc422"
dependencies = [
"app_units",
"bitflags 2.6.0",
@ -7177,7 +7177,7 @@ dependencies = [
"fastrand",
"once_cell",
"rustix",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@ -7386,7 +7386,7 @@ dependencies = [
[[package]]
name = "to_shmem"
version = "0.1.0"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#35e0fa29e93a7e85f44d4ad0610748634f7979b5"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#098f1bef3e231bbf86038c0a2b1ddc31031dc422"
dependencies = [
"cssparser",
"servo_arc",
@ -7399,7 +7399,7 @@ dependencies = [
[[package]]
name = "to_shmem_derive"
version = "0.1.0"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#35e0fa29e93a7e85f44d4ad0610748634f7979b5"
source = "git+https://github.com/servo/stylo?branch=2024-12-04#098f1bef3e231bbf86038c0a2b1ddc31031dc422"
dependencies = [
"darling",
"proc-macro2",
@ -8451,7 +8451,7 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [
"windows-sys 0.59.0",
"windows-sys 0.48.0",
]
[[package]]