mirror of
https://github.com/servo/servo.git
synced 2025-06-25 01:24:37 +01:00
Rename Event::default_prevented -> Event::canceled to better match spec (#2177)
This commit is contained in:
parent
fa7bc7a686
commit
a748e48f48
1 changed files with 5 additions and 5 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue