mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Add a new RPC call for getting a child browsing context ID
This commit is contained in:
parent
847115ba04
commit
4383b3053b
2 changed files with 11 additions and 0 deletions
|
@ -1231,6 +1231,15 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
||||||
warn!("Sending reply to get parent info failed ({:?}).", e);
|
warn!("Sending reply to get parent info failed ({:?}).", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FromScriptMsg::GetChildBrowsingContextId(browsing_context_id, index, sender) => {
|
||||||
|
// We increment here because the 0th element is the parent browsing context itself
|
||||||
|
let result = self.all_descendant_browsing_contexts_iter(browsing_context_id)
|
||||||
|
.nth(index + 1)
|
||||||
|
.map(|bc| bc.id);
|
||||||
|
if let Err(e) = sender.send(result) {
|
||||||
|
warn!("Sending reply to get child browsing context ID failed ({:?}).", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
FromScriptMsg::RegisterServiceWorker(scope_things, scope) => {
|
FromScriptMsg::RegisterServiceWorker(scope_things, scope) => {
|
||||||
debug!("constellation got store registration scope message");
|
debug!("constellation got store registration scope message");
|
||||||
self.handle_register_serviceworker(scope_things, scope);
|
self.handle_register_serviceworker(scope_things, scope);
|
||||||
|
|
|
@ -90,6 +90,8 @@ pub enum ScriptMsg {
|
||||||
GetBrowsingContextId(PipelineId, IpcSender<Option<BrowsingContextId>>),
|
GetBrowsingContextId(PipelineId, IpcSender<Option<BrowsingContextId>>),
|
||||||
/// Get the parent info for a given pipeline.
|
/// Get the parent info for a given pipeline.
|
||||||
GetParentInfo(PipelineId, IpcSender<Option<PipelineId>>),
|
GetParentInfo(PipelineId, IpcSender<Option<PipelineId>>),
|
||||||
|
/// Get the nth child browsing context ID for a given browsing context, sorted in tree order.
|
||||||
|
GetChildBrowsingContextId(BrowsingContextId, usize, IpcSender<Option<BrowsingContextId>>),
|
||||||
/// <head> tag finished parsing
|
/// <head> tag finished parsing
|
||||||
HeadParsed,
|
HeadParsed,
|
||||||
/// All pending loads are complete, and the `load` event for this pipeline
|
/// All pending loads are complete, and the `load` event for this pipeline
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue