libservo: Combine LoadStart, HeadParsed, and LoadComplete` messages (#35260)

These will be a single method in the upcoming `WebView` delegate, so it
makes sense to also combine the internal message to match this. In
addition, since `LoadStatus` is now exposed to the API if there is ever
the need to add more statuses or to move to an event-based version, the
API is already set up for this.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-02-03 23:31:17 +01:00 committed by GitHub
parent b8ab820e3c
commit fdfaf7b15c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 97 additions and 92 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use servo::webrender_api::units::DeviceIntRect;
use servo::{InputMethodType, MediaSessionPlaybackState, PromptResult};
use servo::{InputMethodType, LoadStatus, MediaSessionPlaybackState, PromptResult};
/// Callbacks. Implemented by embedder. Called by Servo.
pub trait HostTrait {
@ -17,16 +17,16 @@ pub trait HostTrait {
fn prompt_input(&self, msg: String, default: String, trusted: bool) -> Option<String>;
/// Show context menu
fn show_context_menu(&self, title: Option<String>, items: Vec<String>);
/// Page starts loading.
/// "Reload button" should be disabled.
/// "Stop button" should be enabled.
/// Throbber starts spinning.
fn on_load_started(&self);
/// Page has loaded.
/// "Reload button" should be enabled.
/// "Stop button" should be disabled.
/// Throbber stops spinning.
fn on_load_ended(&self);
/// Notify that the load status of the page has changed.
/// Started:
/// - "Reload button" should be disabled.
/// - "Stop button" should be enabled.
/// - Throbber starts spinning.
/// Complete:
/// - "Reload button" should be enabled.
/// - "Stop button" should be disabled.
/// - Throbber stops spinning.
fn notify_load_status_changed(&self, load_status: LoadStatus);
/// Page title has changed.
fn on_title_changed(&self, title: Option<String>);
/// Allow Navigation.