mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
auto merge of #2275 : gsingh93/servo/master, r=Ms2ger
Timestamp should return the time the event was created, not 0. This fixes three test cases in dom/events/Event-constructors.html. This is my first pull request, let me know if there are any issues.
This commit is contained in:
commit
14063b242e
2 changed files with 6 additions and 1 deletions
|
@ -13,6 +13,8 @@ use servo_util::str::DOMString;
|
||||||
|
|
||||||
use geom::point::Point2D;
|
use geom::point::Point2D;
|
||||||
|
|
||||||
|
use time;
|
||||||
|
|
||||||
pub enum Event_ {
|
pub enum Event_ {
|
||||||
ResizeEvent(uint, uint),
|
ResizeEvent(uint, uint),
|
||||||
ReflowEvent,
|
ReflowEvent,
|
||||||
|
@ -54,6 +56,7 @@ pub struct Event {
|
||||||
pub trusted: bool,
|
pub trusted: bool,
|
||||||
pub dispatching: bool,
|
pub dispatching: bool,
|
||||||
pub initialized: bool,
|
pub initialized: bool,
|
||||||
|
pub timestamp: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Event {
|
impl Event {
|
||||||
|
@ -73,6 +76,7 @@ impl Event {
|
||||||
stop_propagation: false,
|
stop_propagation: false,
|
||||||
stop_immediate: false,
|
stop_immediate: false,
|
||||||
initialized: false,
|
initialized: false,
|
||||||
|
timestamp: time::get_time().sec as u64,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +130,7 @@ impl Event {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn TimeStamp(&self) -> u64 {
|
pub fn TimeStamp(&self) -> u64 {
|
||||||
0
|
self.timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn InitEvent(&mut self,
|
pub fn InitEvent(&mut self,
|
||||||
|
|
|
@ -24,6 +24,7 @@ extern crate js;
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
extern crate native;
|
extern crate native;
|
||||||
extern crate serialize;
|
extern crate serialize;
|
||||||
|
extern crate time;
|
||||||
#[phase(syntax)]
|
#[phase(syntax)]
|
||||||
extern crate servo_macros = "macros";
|
extern crate servo_macros = "macros";
|
||||||
extern crate servo_net = "net";
|
extern crate servo_net = "net";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue