diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index f82188c7b86..746fc2a4cd8 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -70,6 +70,7 @@ use dom::nodelist::NodeList; use dom::processinginstruction::ProcessingInstruction; use dom::range::Range; use dom::servohtmlparser::{ParserRoot, ParserRef, MutNullableParserField}; +use dom::storageevent::StorageEvent; use dom::stylesheetlist::StyleSheetList; use dom::text::Text; use dom::touch::Touch; @@ -2171,6 +2172,8 @@ impl DocumentMethods for Document { )), "webglcontextevent" => Ok(Root::upcast(WebGLContextEvent::new_uninitialized(GlobalRef::Window(&self.window)))), + "storageevent" => + Ok(Root::upcast(StorageEvent::new_uninitialized(&self.window, self.URL()))), _ => Err(Error::NotSupported), } diff --git a/components/script/dom/storageevent.rs b/components/script/dom/storageevent.rs index 7d1f7520c4a..e3317a34b49 100644 --- a/components/script/dom/storageevent.rs +++ b/components/script/dom/storageevent.rs @@ -12,6 +12,7 @@ use dom::bindings::js::{JS, MutNullableHeap, Root, RootedReference}; use dom::bindings::reflector::reflect_dom_object; use dom::event::{Event, EventBubbles, EventCancelable}; use dom::storage::Storage; +use dom::window::Window; use string_cache::Atom; use util::str::DOMString; @@ -42,6 +43,13 @@ impl StorageEvent { } } + pub fn new_uninitialized(window: &Window, + url: DOMString) -> Root { + reflect_dom_object(box StorageEvent::new_inherited(None, None, None, url, None), + GlobalRef::Window(window), + StorageEventBinding::Wrap) + } + pub fn new(global: GlobalRef, type_: Atom, bubbles: EventBubbles, diff --git a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini b/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini index a2f2eb8eda8..f740c29439b 100644 --- a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini +++ b/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini @@ -277,30 +277,6 @@ bug: https://github.com/servo/servo/issues/10740 expected: FAIL - [StorageEvent should be an alias for StorageEvent.] - bug: https://github.com/servo/servo/issues/10736 - expected: FAIL - - [createEvent('StorageEvent') should be initialized correctly.] - bug: https://github.com/servo/servo/issues/10736 - expected: FAIL - - [storageevent should be an alias for StorageEvent.] - bug: https://github.com/servo/servo/issues/10736 - expected: FAIL - - [createEvent('storageevent') should be initialized correctly.] - bug: https://github.com/servo/servo/issues/10736 - expected: FAIL - - [STORAGEEVENT should be an alias for StorageEvent.] - bug: https://github.com/servo/servo/issues/10736 - expected: FAIL - - [createEvent('STORAGEEVENT') should be initialized correctly.] - bug: https://github.com/servo/servo/issues/10736 - expected: FAIL - [SVGZoomEvent should be an alias for SVGZoomEvent.] expected: FAIL