mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Allow window elements as well as iframes to the the target of mozbrowser events.
This commit is contained in:
parent
fa432a5a34
commit
72aa4f2f62
8 changed files with 162 additions and 152 deletions
|
@ -28,7 +28,9 @@ use dom::crypto::Crypto;
|
|||
use dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration};
|
||||
use dom::document::Document;
|
||||
use dom::element::Element;
|
||||
use dom::event::Event;
|
||||
use dom::eventtarget::EventTarget;
|
||||
use dom::htmliframeelement::build_mozbrowser_custom_event;
|
||||
use dom::location::Location;
|
||||
use dom::navigator::Navigator;
|
||||
use dom::node::{Node, from_untrusted_node_address, window_from_node};
|
||||
|
@ -63,7 +65,7 @@ use script_runtime::{ScriptChan, ScriptPort, maybe_take_panic_result};
|
|||
use script_thread::SendableMainThreadScriptChan;
|
||||
use script_thread::{MainThreadScriptChan, MainThreadScriptMsg, RunnableWrapper};
|
||||
use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
|
||||
use script_traits::{ConstellationControlMsg, UntrustedNodeAddress};
|
||||
use script_traits::{ConstellationControlMsg, MozBrowserEvent, UntrustedNodeAddress};
|
||||
use script_traits::{DocumentState, MsDuration, TimerEvent, TimerEventId};
|
||||
use script_traits::{ScriptMsg as ConstellationMsg, TimerEventRequest, TimerSource, WindowSizeData};
|
||||
use std::ascii::AsciiExt;
|
||||
|
@ -1594,6 +1596,13 @@ impl Window {
|
|||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn dispatch_mozbrowser_event(&self, event: MozBrowserEvent) {
|
||||
assert!(PREFS.is_mozbrowser_enabled());
|
||||
let custom_event = build_mozbrowser_custom_event(&self, event);
|
||||
custom_event.upcast::<Event>().fire(self.upcast());
|
||||
}
|
||||
}
|
||||
|
||||
impl Window {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue