avm2: `event.eventPhase` is enumerated from 1

This commit is contained in:
David Wendt 2020-12-18 23:45:41 -05:00 committed by Mike Welsh
parent 87ff679898
commit 8efaed40a0
2 changed files with 7 additions and 4 deletions

View File

@ -25,9 +25,9 @@ pub enum EventPhase {
impl Into<u32> for EventPhase {
fn into(self) -> u32 {
match self {
Self::Capturing => 0,
Self::AtTarget => 1,
Self::Bubbling => 2,
Self::Capturing => 1,
Self::AtTarget => 2,
Self::Bubbling => 3,
}
}
}

View File

@ -108,7 +108,10 @@ impl<'gc> TObject<'gc> for EventObject<'gc> {
mc,
format!(
"[Event type=\"{}\" bubbles={} cancelable={} eventPhase={}]",
event_type, bubbles, cancelable, phase
event_type,
bubbles,
cancelable,
phase - 1
),
)
.into())