mirror of
https://github.com/servo/servo.git
synced 2025-07-31 03:00:29 +01:00
'closeevent' argument for Document::createEvent
fix alphabetical order delete unused tests
This commit is contained in:
parent
0558687d71
commit
dfaad2dab2
4 changed files with 10 additions and 30 deletions
|
@ -33,6 +33,12 @@ impl CloseEvent {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new_uninitialized(global: GlobalRef) -> Root<CloseEvent> {
|
||||
reflect_dom_object(box CloseEvent::new_inherited(false, 0, DOMString::new()),
|
||||
global,
|
||||
CloseEventBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn new(global: GlobalRef,
|
||||
type_: Atom,
|
||||
bubbles: EventBubbles,
|
||||
|
@ -66,6 +72,7 @@ impl CloseEvent {
|
|||
init.code,
|
||||
init.reason.clone()))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl CloseEventMethods for CloseEvent {
|
||||
|
|
|
@ -32,6 +32,7 @@ use dom::bindings::trace::RootedVec;
|
|||
use dom::bindings::xmlname::XMLName::InvalidXMLName;
|
||||
use dom::bindings::xmlname::{validate_and_extract, namespace_from_domstring, xml_name_type};
|
||||
use dom::browsingcontext::BrowsingContext;
|
||||
use dom::closeevent::CloseEvent;
|
||||
use dom::comment::Comment;
|
||||
use dom::customevent::CustomEvent;
|
||||
use dom::documentfragment::DocumentFragment;
|
||||
|
@ -2190,6 +2191,8 @@ impl DocumentMethods for Document {
|
|||
Ok(Root::upcast(FocusEvent::new_uninitialized(GlobalRef::Window(&self.window)))),
|
||||
"errorevent" =>
|
||||
Ok(Root::upcast(ErrorEvent::new_uninitialized(GlobalRef::Window(&self.window)))),
|
||||
"closeevent" =>
|
||||
Ok(Root::upcast(CloseEvent::new_uninitialized(GlobalRef::Window(&self.window)))),
|
||||
_ =>
|
||||
Err(Error::NotSupported),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue