servoshell: Add button to toggle experimental web platform features. (#39125)

This makes it easier to experiment with the impact of experimental
features when browsing around in servoshell. The toggle is global and
causes all webviews to reload with the new preference values.

Testing: Manually tested; no UI testing for servoshell.

Not enabled:
<img width="317" height="82" alt="Screenshot 2025-09-03 at 9 34 30 PM"
src="https://github.com/user-attachments/assets/ca521ad5-ce1b-434e-a0c3-ea1b75d76d53"
/>

Enabled:
<img width="320" height="82" alt="Screenshot 2025-09-03 at 9 34 36 PM"
src="https://github.com/user-attachments/assets/7b6529b5-1055-4ae0-924a-96d57e115714"
/>

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-09-03 22:53:12 -04:00 committed by GitHub
parent 912b83b58f
commit aac6aa6c70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 2 deletions

View file

@ -119,6 +119,7 @@ impl App {
event_loop,
proxy,
self.initial_url.clone(),
&self.servoshell_preferences,
));
Rc::new(window)
},
@ -321,6 +322,12 @@ impl App {
focused_webview.reload();
}
},
MinibrowserEvent::ReloadAll => {
minibrowser.update_location_dirty(false);
for (_, webview) in state.webviews() {
webview.reload();
}
},
MinibrowserEvent::NewWebView => {
minibrowser.update_location_dirty(false);
state.create_and_focus_toplevel_webview(Url::parse("servo:newtab").unwrap());