From 2cb6972d1400f1661cf75e6959a58dca89ba6977 Mon Sep 17 00:00:00 2001 From: Axel Solis Trompler Date: Fri, 23 Oct 2015 15:30:26 +0200 Subject: [PATCH] Implement document.createEvent(TouchEvent) --- components/script/dom/document.rs | 2 ++ .../events/EventTarget-dispatchEvent.html.ini | 5 ----- .../dom/nodes/Document-createEvent.html.ini | 20 ------------------- 3 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 tests/wpt/metadata/dom/events/EventTarget-dispatchEvent.html.ini delete mode 100644 tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index e8c23b5994c..09f6d12396a 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -1395,6 +1395,8 @@ impl DocumentMethods for Document { Ok(Root::upcast(KeyboardEvent::new_uninitialized(&self.window))), "messageevent" => Ok(Root::upcast(MessageEvent::new_uninitialized(GlobalRef::Window(&self.window)))), + "touchevent" => + Ok(Root::upcast(TouchEvent::new_uninitialized(&self.window, &TouchList::new(&self.window, &[]), &TouchList::new(&self.window, &[]), &TouchList::new(&self.window, &[])))), _ => Err(Error::NotSupported), } diff --git a/tests/wpt/metadata/dom/events/EventTarget-dispatchEvent.html.ini b/tests/wpt/metadata/dom/events/EventTarget-dispatchEvent.html.ini deleted file mode 100644 index 145a811d5ce..00000000000 --- a/tests/wpt/metadata/dom/events/EventTarget-dispatchEvent.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[EventTarget-dispatchEvent.html] - type: testharness - [If the event's initialized flag is not set, an InvalidStateError must be thrown (TouchEvent).] - expected: FAIL - diff --git a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini b/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini deleted file mode 100644 index 8baea229efe..00000000000 --- a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini +++ /dev/null @@ -1,20 +0,0 @@ -[Document-createEvent.html] - type: testharness - [TouchEvent should be an alias for TouchEvent.] - expected: FAIL - - [createEvent('TouchEvent') should be initialized correctly.] - expected: FAIL - - [touchevent should be an alias for TouchEvent.] - expected: FAIL - - [createEvent('touchevent') should be initialized correctly.] - expected: FAIL - - [TOUCHEVENT should be an alias for TouchEvent.] - expected: FAIL - - [createEvent('TOUCHEVENT') should be initialized correctly.] - expected: FAIL -