aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/document.rs3
-rw-r--r--components/script/dom/keyboardevent.rs2
-rw-r--r--tests/wpt/metadata/dom/events/EventTarget-dispatchEvent.html.ini6
-rw-r--r--tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini36
4 files changed, 4 insertions, 43 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 2b8632fd7c1..7e282c4992d 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -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;
@@ -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)
}
}
diff --git a/components/script/dom/keyboardevent.rs b/components/script/dom/keyboardevent.rs
index b48a3295299..787cedc857f 100644
--- a/components/script/dom/keyboardevent.rs
+++ b/components/script/dom/keyboardevent.rs
@@ -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)
diff --git a/tests/wpt/metadata/dom/events/EventTarget-dispatchEvent.html.ini b/tests/wpt/metadata/dom/events/EventTarget-dispatchEvent.html.ini
index 823e47a3e90..cd9c31f59ac 100644
--- a/tests/wpt/metadata/dom/events/EventTarget-dispatchEvent.html.ini
+++ b/tests/wpt/metadata/dom/events/EventTarget-dispatchEvent.html.ini
@@ -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
diff --git a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini b/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini
index ae1c9323e64..90869a4c6d9 100644
--- a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini
+++ b/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