mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Process colorSchemeSimulation in TargetConfigurationActor (#36297)
Implements Steps 1,4&6 of https://github.com/servo/servo/issues/35867: - Adds `pub simulate_color_scheme` to `BrowsingContextActor` using `script_chan`. - Processes `colorSchemeSimulation` flag in `TargetConfigurationActor`’s `updateConfiguration`. - Routes `colorSchemeSimulation` from `RootActor` via `TabDescriptorActor` to `BrowsingContextActor`. Testing: Compiles and lints clean. Fixes: https://github.com/servo/servo/issues/35867 --------- Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
This commit is contained in:
parent
9d07416163
commit
fab5e02972
3 changed files with 44 additions and 7 deletions
|
@ -11,8 +11,11 @@ use std::collections::HashMap;
|
|||
use std::net::TcpStream;
|
||||
|
||||
use base::id::PipelineId;
|
||||
use devtools_traits::DevtoolScriptControlMsg::{self, GetCssDatabase, WantsLiveNotifications};
|
||||
use devtools_traits::DevtoolScriptControlMsg::{
|
||||
self, GetCssDatabase, SimulateColorScheme, WantsLiveNotifications,
|
||||
};
|
||||
use devtools_traits::{DevtoolsPageInfo, NavigationState};
|
||||
use embedder_traits::Theme;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
|
@ -352,4 +355,10 @@ impl BrowsingContextActor {
|
|||
let _ = stream.write_json_packet(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn simulate_color_scheme(&self, theme: Theme) -> Result<(), ()> {
|
||||
self.script_chan
|
||||
.send(SimulateColorScheme(self.active_pipeline_id.get(), theme))
|
||||
.map_err(|_| ())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue