Rename Event::default_prevented -> Event::canceled to better match spec (#2177)

This commit is contained in:
Manish Goregaokar 2014-04-19 16:02:14 +05:30
parent fa7bc7a686
commit a748e48f48

View file

@ -46,7 +46,7 @@ pub struct Event {
target: Option<JS<EventTarget>>, target: Option<JS<EventTarget>>,
type_: DOMString, type_: DOMString,
phase: EventPhase, phase: EventPhase,
default_prevented: bool, canceled: bool,
stop_propagation: bool, stop_propagation: bool,
stop_immediate: bool, stop_immediate: bool,
cancelable: bool, cancelable: bool,
@ -65,7 +65,7 @@ impl Event {
target: None, target: None,
phase: PhaseNone, phase: PhaseNone,
type_: ~"", type_: ~"",
default_prevented: false, canceled: false,
cancelable: true, cancelable: true,
bubbles: true, bubbles: true,
trusted: false, trusted: false,
@ -99,12 +99,12 @@ impl Event {
} }
pub fn DefaultPrevented(&self) -> bool { pub fn DefaultPrevented(&self) -> bool {
self.default_prevented self.canceled
} }
pub fn PreventDefault(&mut self) { pub fn PreventDefault(&mut self) {
if self.cancelable { if self.cancelable {
self.default_prevented = true self.canceled = true
} }
} }
@ -137,7 +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; self.canceled = false;
} }
pub fn IsTrusted(&self) -> bool { pub fn IsTrusted(&self) -> bool {