/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::EventBinding;
use dom::bindings::codegen::Bindings::EventBinding::{EventConstants, EventMethods};
use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, JSRef, Temporary};
use dom::bindings::trace::Traceable;
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::eventtarget::EventTarget;
use servo_util::str::DOMString;
use std::cell::{Cell, RefCell};
use time;
#[deriving(Encodable)]
pub enum EventPhase {
PhaseNone = EventConstants::NONE as int,
PhaseCapturing = EventConstants::CAPTURING_PHASE as int,
PhaseAtTarget = EventConstants::AT_TARGET as int,
PhaseBubbling = EventConstants::BUBBLING_PHASE as int,
}
#[deriving(PartialEq, Encodable)]
pub enum EventTypeId {
CustomEventTypeId,
HTMLEventTypeId,
KeyEventTypeId,
MessageEventTypeId,
MouseEventTypeId,
ProgressEventTypeId,
UIEventTypeId
}
#[deriving(Encodable)]
#[must_root]
pub struct Event {
pub type_id: EventTypeId,
reflector_: Reflector,
pub current_target: Cell