mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Alphabetize document.createEvent
match
list.
Makes it easier to see what hasn't been implemented with regards to the spec.
This commit is contained in:
parent
8b69e73594
commit
17295dc566
1 changed files with 23 additions and 23 deletions
|
@ -2540,18 +2540,34 @@ impl DocumentMethods for Document {
|
||||||
fn CreateEvent(&self, mut interface: DOMString) -> Fallible<Root<Event>> {
|
fn CreateEvent(&self, mut interface: DOMString) -> Fallible<Root<Event>> {
|
||||||
interface.make_ascii_lowercase();
|
interface.make_ascii_lowercase();
|
||||||
match &*interface {
|
match &*interface {
|
||||||
"uievents" | "uievent" =>
|
"closeevent" =>
|
||||||
Ok(Root::upcast(UIEvent::new_uninitialized(&self.window))),
|
Ok(Root::upcast(CloseEvent::new_uninitialized(self.window.upcast()))),
|
||||||
"mouseevents" | "mouseevent" =>
|
|
||||||
Ok(Root::upcast(MouseEvent::new_uninitialized(&self.window))),
|
|
||||||
"customevent" =>
|
"customevent" =>
|
||||||
Ok(Root::upcast(CustomEvent::new_uninitialized(self.window.upcast()))),
|
Ok(Root::upcast(CustomEvent::new_uninitialized(self.window.upcast()))),
|
||||||
"htmlevents" | "events" | "event" | "svgevents" =>
|
"errorevent" =>
|
||||||
|
Ok(Root::upcast(ErrorEvent::new_uninitialized(self.window.upcast()))),
|
||||||
|
"events" | "event" | "htmlevents" | "svgevents" =>
|
||||||
Ok(Event::new_uninitialized(&self.window.upcast())),
|
Ok(Event::new_uninitialized(&self.window.upcast())),
|
||||||
|
"focusevent" =>
|
||||||
|
Ok(Root::upcast(FocusEvent::new_uninitialized(self.window.upcast()))),
|
||||||
|
"hashchangeevent" =>
|
||||||
|
Ok(Root::upcast(HashChangeEvent::new_uninitialized(&self.window.upcast()))),
|
||||||
"keyboardevent" =>
|
"keyboardevent" =>
|
||||||
Ok(Root::upcast(KeyboardEvent::new_uninitialized(&self.window))),
|
Ok(Root::upcast(KeyboardEvent::new_uninitialized(&self.window))),
|
||||||
"messageevent" =>
|
"messageevent" =>
|
||||||
Ok(Root::upcast(MessageEvent::new_uninitialized(self.window.upcast()))),
|
Ok(Root::upcast(MessageEvent::new_uninitialized(self.window.upcast()))),
|
||||||
|
"mouseevent" | "mouseevents" =>
|
||||||
|
Ok(Root::upcast(MouseEvent::new_uninitialized(&self.window))),
|
||||||
|
"pagetransitionevent" =>
|
||||||
|
Ok(Root::upcast(PageTransitionEvent::new_uninitialized(self.window.upcast()))),
|
||||||
|
"popstateevent" =>
|
||||||
|
Ok(Root::upcast(PopStateEvent::new_uninitialized(self.window.upcast()))),
|
||||||
|
"progressevent" =>
|
||||||
|
Ok(Root::upcast(ProgressEvent::new_uninitialized(self.window.upcast()))),
|
||||||
|
"storageevent" => {
|
||||||
|
let USVString(url) = self.URL();
|
||||||
|
Ok(Root::upcast(StorageEvent::new_uninitialized(&self.window, DOMString::from(url))))
|
||||||
|
},
|
||||||
"touchevent" =>
|
"touchevent" =>
|
||||||
Ok(Root::upcast(
|
Ok(Root::upcast(
|
||||||
TouchEvent::new_uninitialized(&self.window,
|
TouchEvent::new_uninitialized(&self.window,
|
||||||
|
@ -2560,26 +2576,10 @@ impl DocumentMethods for Document {
|
||||||
&TouchList::new(&self.window, &[]),
|
&TouchList::new(&self.window, &[]),
|
||||||
)
|
)
|
||||||
)),
|
)),
|
||||||
|
"uievent" | "uievents" =>
|
||||||
|
Ok(Root::upcast(UIEvent::new_uninitialized(&self.window))),
|
||||||
"webglcontextevent" =>
|
"webglcontextevent" =>
|
||||||
Ok(Root::upcast(WebGLContextEvent::new_uninitialized(&self.window))),
|
Ok(Root::upcast(WebGLContextEvent::new_uninitialized(&self.window))),
|
||||||
"storageevent" => {
|
|
||||||
let USVString(url) = self.URL();
|
|
||||||
Ok(Root::upcast(StorageEvent::new_uninitialized(&self.window, DOMString::from(url))))
|
|
||||||
},
|
|
||||||
"progressevent" =>
|
|
||||||
Ok(Root::upcast(ProgressEvent::new_uninitialized(self.window.upcast()))),
|
|
||||||
"focusevent" =>
|
|
||||||
Ok(Root::upcast(FocusEvent::new_uninitialized(self.window.upcast()))),
|
|
||||||
"errorevent" =>
|
|
||||||
Ok(Root::upcast(ErrorEvent::new_uninitialized(self.window.upcast()))),
|
|
||||||
"closeevent" =>
|
|
||||||
Ok(Root::upcast(CloseEvent::new_uninitialized(self.window.upcast()))),
|
|
||||||
"popstateevent" =>
|
|
||||||
Ok(Root::upcast(PopStateEvent::new_uninitialized(self.window.upcast()))),
|
|
||||||
"hashchangeevent" =>
|
|
||||||
Ok(Root::upcast(HashChangeEvent::new_uninitialized(&self.window.upcast()))),
|
|
||||||
"pagetransitionevent" =>
|
|
||||||
Ok(Root::upcast(PageTransitionEvent::new_uninitialized(self.window.upcast()))),
|
|
||||||
_ =>
|
_ =>
|
||||||
Err(Error::NotSupported),
|
Err(Error::NotSupported),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue