mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
constellation: Broadcast preference changes to all content processes (#38716)
Building on the preference observer work from #38649, we now automatically install an observer when multiprocess mode is enabled. This observer notifies the constellation of updated preferences, which in turn notifies each content process so the changes will be reflected into script/layout as expected. There's a unit test that verifies this works correctly by checking a preference-gated WebIDL property before and after the preference is toggled. Testing: New unit test added. Fixes: #35966 Depends on #38649. --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
61692b26c2
commit
ed6bf196c9
16 changed files with 191 additions and 60 deletions
|
@ -35,6 +35,7 @@ net_traits = { workspace = true }
|
|||
pixels = { path = "../../pixels" }
|
||||
profile_traits = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
servo_config = { path = "../../config" }
|
||||
servo_url = { path = "../../url" }
|
||||
strum = { workspace = true, features = ["derive"] }
|
||||
strum_macros = { workspace = true }
|
||||
|
|
|
@ -43,6 +43,7 @@ use net_traits::storage_thread::StorageType;
|
|||
use pixels::PixelFormat;
|
||||
use profile_traits::mem;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_config::prefs::PrefValue;
|
||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||
use strum_macros::IntoStaticStr;
|
||||
use style_traits::{CSSPixel, SpeculativePainter};
|
||||
|
@ -257,6 +258,8 @@ pub enum ScriptThreadMessage {
|
|||
EvaluateJavaScript(PipelineId, JavaScriptEvaluationId, String),
|
||||
/// A new batch of keys for the image cache for the specific pipeline.
|
||||
SendImageKeysBatch(PipelineId, Vec<ImageKey>),
|
||||
/// Preferences were updated in the parent process.
|
||||
PreferencesUpdated(Vec<(String, PrefValue)>),
|
||||
}
|
||||
|
||||
impl fmt::Debug for ScriptThreadMessage {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue