mirror of
https://github.com/servo/servo.git
synced 2025-06-08 00:23:30 +00:00
Add SimulateColorScheme command and script thread handling (#36253)
Implements Steps 2-3 of #35867: - Adds `SimulateColorScheme` to `DevtoolScriptControlMsg` for light/dark mode simulation. - Handles it in `ScriptThread` with `handle_theme_change` to toggle themes. Testing: This PR does not require testing because it only adds infrastructure (command and handler) but doesn’t yet integrate with devtools actors. Fixes: Part of #35867 (https://github.com/servo/servo/issues/35867) --------- Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
This commit is contained in:
parent
8b23801a24
commit
fab7bbcd38
4 changed files with 13 additions and 0 deletions
|
@ -2063,6 +2063,14 @@ impl ScriptThread {
|
|||
DevtoolScriptControlMsg::GetCssDatabase(reply) => {
|
||||
devtools::handle_get_css_database(reply)
|
||||
},
|
||||
DevtoolScriptControlMsg::SimulateColorScheme(id, theme) => {
|
||||
match documents.find_window(id) {
|
||||
Some(window) => {
|
||||
window.handle_theme_change(theme);
|
||||
},
|
||||
None => warn!("Message sent to closed pipeline {}.", id),
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue