Skip to content

Commit

Permalink
key[board]event args for Document#createEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnirp committed Nov 17, 2014
1 parent 397d813 commit aad124f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 43 deletions.
3 changes: 3 additions & 0 deletions components/script/dom/document.rs
Expand Up @@ -46,6 +46,7 @@ use dom::htmlhtmlelement::HTMLHtmlElement;
use dom::htmltitleelement::HTMLTitleElement;
use dom::location::Location;
use dom::mouseevent::MouseEvent;
use dom::keyboardevent::KeyboardEvent;
use dom::node::{Node, ElementNodeTypeId, DocumentNodeTypeId, NodeHelpers};
use dom::node::{CloneChildren, DoNotCloneChildren};
use dom::nodelist::NodeList;
Expand Down Expand Up @@ -693,6 +694,8 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
CustomEvent::new_uninitialized(&global::Window(*window)))),
"htmlevents" | "events" | "event" => Ok(Event::new_uninitialized(
&global::Window(*window))),
"keyboardevent" | "keyevents" => Ok(EventCast::from_temporary(
KeyboardEvent::new_uninitialized(*window))),
_ => Err(NotSupported)
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/keyboardevent.rs
Expand Up @@ -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(),
&global::Window(window),
KeyboardEventBinding::Wrap)
Expand Down
@@ -1,11 +1,5 @@
[EventTarget-dispatchEvent.html]
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).]
expected: FAIL
Expand Down
36 changes: 0 additions & 36 deletions tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini
@@ -1,41 +1,5 @@
[Document-createEvent.html]
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.]
expected: FAIL

Expand Down

5 comments on commit aad124f

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from Manishearth
at ajnirp@aad124f

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging wenderen/servo/doc-createevent-keyevents = aad124f into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wenderen/servo/doc-createevent-keyevents = aad124f merged ok, testing candidate = eeb11d6

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = eeb11d6

Please sign in to comment.