Update WebView variants of ConstellationMsg (#32163)

* Add ConstellationMsg::WebViewOpened

* Remove unused variants

* Send the message on first webview as well
This commit is contained in:
Ngo Iok Ui (Wu Yu Wei) 2024-04-29 16:59:52 +09:00 committed by GitHub
parent 1d6be62454
commit 74897c3851
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 63 deletions

View file

@ -369,6 +369,10 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
},
)
.expect("Infallible with a new WebViewManager");
let msg = ConstellationMsg::WebViewOpened(top_level_browsing_context_id);
if let Err(e) = state.constellation_chan.send(msg) {
warn!("Sending event to constellation failed ({:?}).", e);
}
webviews
.show(top_level_browsing_context_id)
.expect("Infallible due to add");
@ -1183,6 +1187,10 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
error!("{webview_id}: Creating webview that already exists");
return;
}
let msg = ConstellationMsg::WebViewOpened(top_level_browsing_context_id);
if let Err(e) = self.constellation_chan.send(msg) {
warn!("Sending event to constellation failed ({:?}).", e);
}
}
self.send_root_pipeline_display_list();