mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add mozbrowser events for location + title change.
This commit is contained in:
parent
da2231a8fa
commit
7163a3c580
6 changed files with 83 additions and 23 deletions
|
@ -24,6 +24,7 @@ use profile::time::TimeProfilerChan;
|
|||
use std::sync::mpsc::{Receiver, channel};
|
||||
use url::Url;
|
||||
use util::geometry::{PagePx, ViewportPx};
|
||||
use util::opts;
|
||||
|
||||
/// A uniquely-identifiable pipeline of script task, layout task, and paint task.
|
||||
pub struct Pipeline {
|
||||
|
@ -244,4 +245,18 @@ impl Pipeline {
|
|||
pub fn add_child(&mut self, frame_id: FrameId) {
|
||||
self.children.push(frame_id);
|
||||
}
|
||||
|
||||
pub fn trigger_mozbrowser_event(&self,
|
||||
subpage_id: SubpageId,
|
||||
event_name: String,
|
||||
event_detail: Option<String>) {
|
||||
assert!(opts::experimental_enabled());
|
||||
|
||||
let ScriptControlChan(ref script_channel) = self.script_chan;
|
||||
let event = ConstellationControlMsg::MozBrowserEvent(self.id,
|
||||
subpage_id,
|
||||
event_name,
|
||||
event_detail);
|
||||
script_channel.send(event).unwrap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue