key[board]event args for Document#createEvent

This commit is contained in:
Rohan Prinja 2014-11-17 07:19:37 +05:30
parent 397d8138e7
commit aad124fce3
4 changed files with 4 additions and 43 deletions

View file

@ -46,6 +46,7 @@ use dom::htmlhtmlelement::HTMLHtmlElement;
use dom::htmltitleelement::HTMLTitleElement; use dom::htmltitleelement::HTMLTitleElement;
use dom::location::Location; use dom::location::Location;
use dom::mouseevent::MouseEvent; use dom::mouseevent::MouseEvent;
use dom::keyboardevent::KeyboardEvent;
use dom::node::{Node, ElementNodeTypeId, DocumentNodeTypeId, NodeHelpers}; use dom::node::{Node, ElementNodeTypeId, DocumentNodeTypeId, NodeHelpers};
use dom::node::{CloneChildren, DoNotCloneChildren}; use dom::node::{CloneChildren, DoNotCloneChildren};
use dom::nodelist::NodeList; use dom::nodelist::NodeList;
@ -693,6 +694,8 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
CustomEvent::new_uninitialized(&global::Window(*window)))), CustomEvent::new_uninitialized(&global::Window(*window)))),
"htmlevents" | "events" | "event" => Ok(Event::new_uninitialized( "htmlevents" | "events" | "event" => Ok(Event::new_uninitialized(
&global::Window(*window))), &global::Window(*window))),
"keyboardevent" | "keyevents" => Ok(EventCast::from_temporary(
KeyboardEvent::new_uninitialized(*window))),
_ => Err(NotSupported) _ => Err(NotSupported)
} }
} }

View file

@ -59,7 +59,7 @@ impl KeyboardEvent {
} }
} }
fn new_uninitialized(window: JSRef<Window>) -> Temporary<KeyboardEvent> { pub fn new_uninitialized(window: JSRef<Window>) -> Temporary<KeyboardEvent> {
reflect_dom_object(box KeyboardEvent::new_inherited(), reflect_dom_object(box KeyboardEvent::new_inherited(),
&global::Window(window), &global::Window(window),
KeyboardEventBinding::Wrap) KeyboardEventBinding::Wrap)

View file

@ -1,11 +1,5 @@
[EventTarget-dispatchEvent.html] [EventTarget-dispatchEvent.html]
type: testharness type: testharness
[If the event\'s initialized flag is not set, an InvalidStateError must be thrown (KeyboardEvent).]
expected: FAIL
[If the event\'s initialized flag is not set, an InvalidStateError must be thrown (KeyEvents).]
expected: FAIL
[If the event\'s initialized flag is not set, an InvalidStateError must be thrown (MessageEvent).] [If the event\'s initialized flag is not set, an InvalidStateError must be thrown (MessageEvent).]
expected: FAIL expected: FAIL

View file

@ -1,41 +1,5 @@
[Document-createEvent.html] [Document-createEvent.html]
type: testharness type: testharness
[KeyboardEvent should be an alias for KeyboardEvent.]
expected: FAIL
[createEvent(\'KeyboardEvent\') should be initialized correctly.]
expected: FAIL
[keyboardevent should be an alias for KeyboardEvent.]
expected: FAIL
[createEvent(\'keyboardevent\') should be initialized correctly.]
expected: FAIL
[KEYBOARDEVENT should be an alias for KeyboardEvent.]
expected: FAIL
[createEvent(\'KEYBOARDEVENT\') should be initialized correctly.]
expected: FAIL
[KeyEvents should be an alias for KeyboardEvent.]
expected: FAIL
[createEvent(\'KeyEvents\') should be initialized correctly.]
expected: FAIL
[keyevents should be an alias for KeyboardEvent.]
expected: FAIL
[createEvent(\'keyevents\') should be initialized correctly.]
expected: FAIL
[KEYEVENTS should be an alias for KeyboardEvent.]
expected: FAIL
[createEvent(\'KEYEVENTS\') should be initialized correctly.]
expected: FAIL
[MessageEvent should be an alias for MessageEvent.] [MessageEvent should be an alias for MessageEvent.]
expected: FAIL expected: FAIL