Skip to content

Commit

Permalink
libservo: update stylo preferences in multiprocess mode.
Browse files Browse the repository at this point in the history
When servo is run in multiprocess mode, the content process receives
the preferences via IPC from the main process. However, currently
these preferences are only used to update  Servo's own preferences by
explictly calling Preference::set_all(). This doesn't ensure that
stylo's copy of preferences is also updated.

This change replaces the call to `Preference::set_all()` with
call to `add_user_prefs` which does ensure both Servo's and Stylos'
preferences are updated.

Fixes servo#34660.


Signed-off-by: Mukilan Thiyagarajan <[email protected]>
  • Loading branch information
mukilan committed Dec 17, 2024
1 parent 60d8d5a commit b4fbc66
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions components/servo/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1209,9 +1209,7 @@ pub fn run_content_process(token: String) {

let unprivileged_content = unprivileged_content_receiver.recv().unwrap();
opts::set_options(unprivileged_content.opts());
prefs::pref_map()
.set_all(unprivileged_content.prefs())
.expect("Failed to set preferences");
prefs::add_user_prefs(unprivileged_content.prefs());

// Enter the sandbox if necessary.
if opts::get().sandbox {
Expand Down

0 comments on commit b4fbc66

Please sign in to comment.