mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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:
parent
b8ab820e3c
commit
fdfaf7b15c
11 changed files with 97 additions and 92 deletions
|
@ -24,8 +24,8 @@ use cssparser::match_ignore_ascii_case;
|
|||
use devtools_traits::ScriptToDevtoolsControlMsg;
|
||||
use dom_struct::dom_struct;
|
||||
use embedder_traits::{
|
||||
ClipboardEventType, EmbedderMsg, MouseButton, MouseEventType, TouchEventType, TouchId,
|
||||
WheelDelta,
|
||||
ClipboardEventType, EmbedderMsg, LoadStatus, MouseButton, MouseEventType, TouchEventType,
|
||||
TouchId, WheelDelta,
|
||||
};
|
||||
use encoding_rs::{Encoding, UTF_8};
|
||||
use euclid::default::{Point2D, Rect, Size2D};
|
||||
|
@ -1032,13 +1032,19 @@ impl Document {
|
|||
match state {
|
||||
DocumentReadyState::Loading => {
|
||||
if self.window().is_top_level() {
|
||||
self.send_to_embedder(EmbedderMsg::LoadStart(self.webview_id()));
|
||||
self.send_to_embedder(EmbedderMsg::NotifyLoadStatusChanged(
|
||||
self.webview_id(),
|
||||
LoadStatus::Started,
|
||||
));
|
||||
self.send_to_embedder(EmbedderMsg::Status(self.webview_id(), None));
|
||||
}
|
||||
},
|
||||
DocumentReadyState::Complete => {
|
||||
if self.window().is_top_level() {
|
||||
self.send_to_embedder(EmbedderMsg::LoadComplete(self.webview_id()));
|
||||
self.send_to_embedder(EmbedderMsg::NotifyLoadStatusChanged(
|
||||
self.webview_id(),
|
||||
LoadStatus::Complete,
|
||||
));
|
||||
}
|
||||
update_with_current_instant(&self.dom_complete);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue