diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 7d25e484aa3..66da66574f7 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -2186,6 +2186,8 @@ impl DocumentMethods for Document { Ok(Root::upcast(StorageEvent::new_uninitialized(&self.window, self.URL()))), "progressevent" => Ok(Root::upcast(ProgressEvent::new_uninitialized(&self.window))), + "focusevent" => + Ok(Root::upcast(FocusEvent::new_uninitialized(GlobalRef::Window(&self.window)))), _ => Err(Error::NotSupported), } diff --git a/components/script/dom/focusevent.rs b/components/script/dom/focusevent.rs index 84259749295..0b0048e1e98 100644 --- a/components/script/dom/focusevent.rs +++ b/components/script/dom/focusevent.rs @@ -31,6 +31,12 @@ impl FocusEvent { } } + pub fn new_uninitialized(global: GlobalRef) -> Root { + reflect_dom_object(box FocusEvent::new_inherited(), + global, + FocusEventBinding::Wrap) + } + pub fn new(window: &Window, type_: DOMString, can_bubble: EventBubbles, diff --git a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini b/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini index cf50ce94f65..0e01e60b441 100644 --- a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini +++ b/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini @@ -157,30 +157,6 @@ bug: https://github.com/servo/servo/issues/10738 expected: FAIL - [FocusEvent should be an alias for FocusEvent.] - bug: https://github.com/servo/servo/issues/10739 - expected: FAIL - - [createEvent('FocusEvent') should be initialized correctly.] - bug: https://github.com/servo/servo/issues/10739 - expected: FAIL - - [focusevent should be an alias for FocusEvent.] - bug: https://github.com/servo/servo/issues/10739 - expected: FAIL - - [createEvent('focusevent') should be initialized correctly.] - bug: https://github.com/servo/servo/issues/10739 - expected: FAIL - - [FOCUSEVENT should be an alias for FocusEvent.] - bug: https://github.com/servo/servo/issues/10739 - expected: FAIL - - [createEvent('FOCUSEVENT') should be initialized correctly.] - bug: https://github.com/servo/servo/issues/10739 - expected: FAIL - [HashChangeEvent should be an alias for HashChangeEvent.] expected: FAIL