mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Fix most defaultPrevented test failures (#2172)
This commit is contained in:
parent
c7976b1e87
commit
fa7bc7a686
2 changed files with 6 additions and 4 deletions
|
@ -363,10 +363,11 @@ impl Document {
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-document-createevent
|
// http://dom.spec.whatwg.org/#dom-document-createevent
|
||||||
pub fn CreateEvent(&self, interface: DOMString) -> Fallible<JS<Event>> {
|
pub fn CreateEvent(&self, interface: DOMString) -> Fallible<JS<Event>> {
|
||||||
match interface.as_slice() {
|
match interface.to_ascii_lower().as_slice() {
|
||||||
"UIEvents" => Ok(EventCast::from(&UIEvent::new(&self.window))),
|
// FIXME: Implement CustomEvent (http://dom.spec.whatwg.org/#customevent)
|
||||||
"MouseEvents" => Ok(EventCast::from(&MouseEvent::new(&self.window))),
|
"uievents" | "uievent" => Ok(EventCast::from(&UIEvent::new(&self.window))),
|
||||||
"HTMLEvents" => Ok(Event::new(&self.window)),
|
"mouseevents" | "mouseevent" => Ok(EventCast::from(&MouseEvent::new(&self.window))),
|
||||||
|
"htmlevents" | "events" | "event" => Ok(Event::new(&self.window)),
|
||||||
_ => Err(NotSupported)
|
_ => Err(NotSupported)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,6 +137,7 @@ impl Event {
|
||||||
self.cancelable = cancelable;
|
self.cancelable = cancelable;
|
||||||
self.bubbles = bubbles;
|
self.bubbles = bubbles;
|
||||||
self.initialized = true;
|
self.initialized = true;
|
||||||
|
self.default_prevented = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn IsTrusted(&self) -> bool {
|
pub fn IsTrusted(&self) -> bool {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue