Support document.createElement("beforeunloadevent")

This commit is contained in:
Anthony Ramine 2017-01-21 01:34:27 +01:00
parent 7b4050ea10
commit 03d79185ff
3 changed files with 3 additions and 21 deletions

View file

@ -7,6 +7,7 @@ use devtools_traits::ScriptToDevtoolsControlMsg;
use document_loader::{DocumentLoader, LoadType};
use dom::activation::{ActivationSource, synthetic_click_activation};
use dom::attr::Attr;
use dom::beforeunloadevent::BeforeUnloadEvent;
use dom::bindings::callback::ExceptionHandling;
use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::DOMRectBinding::DOMRectMethods;
@ -2603,6 +2604,8 @@ impl DocumentMethods for Document {
fn CreateEvent(&self, mut interface: DOMString) -> Fallible<Root<Event>> {
interface.make_ascii_lowercase();
match &*interface {
"beforeunloadevent" =>
Ok(Root::upcast(BeforeUnloadEvent::new_uninitialized(&self.window))),
"closeevent" =>
Ok(Root::upcast(CloseEvent::new_uninitialized(self.window.upcast()))),
"customevent" =>

View file

@ -3,9 +3,6 @@
[If the event's initialized flag is not set, an InvalidStateError must be thrown (AnimationEvent).]
expected: FAIL
[If the event's initialized flag is not set, an InvalidStateError must be thrown (BeforeUnloadEvent).]
expected: FAIL
[If the event's initialized flag is not set, an InvalidStateError must be thrown (CompositionEvent).]
expected: FAIL

View file

@ -19,24 +19,6 @@
[createEvent('ANIMATIONEVENT') should be initialized correctly.]
expected: FAIL
[BeforeUnloadEvent should be an alias for BeforeUnloadEvent.]
expected: FAIL
[createEvent('BeforeUnloadEvent') should be initialized correctly.]
expected: FAIL
[beforeunloadevent should be an alias for BeforeUnloadEvent.]
expected: FAIL
[createEvent('beforeunloadevent') should be initialized correctly.]
expected: FAIL
[BEFOREUNLOADEVENT should be an alias for BeforeUnloadEvent.]
expected: FAIL
[createEvent('BEFOREUNLOADEVENT') should be initialized correctly.]
expected: FAIL
[CompositionEvent should be an alias for CompositionEvent.]
expected: FAIL