Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c0f96a40
Commit
c0f96a40
authored
Dec 05, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IDOMEvent::get_timeStamp implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d2213e20
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
4 deletions
+57
-4
dispex.c
dlls/mshtml/dispex.c
+2
-1
htmlevent.c
dlls/mshtml/htmlevent.c
+14
-2
htmlevent.h
dlls/mshtml/htmlevent.h
+1
-0
events.js
dlls/mshtml/tests/events.js
+40
-1
No files found.
dlls/mshtml/dispex.c
View file @
c0f96a40
...
@@ -219,7 +219,8 @@ HRESULT get_class_typeinfo(const CLSID *clsid, ITypeInfo **typeinfo)
...
@@ -219,7 +219,8 @@ HRESULT get_class_typeinfo(const CLSID *clsid, ITypeInfo **typeinfo)
CASE_VT(VT_VARIANT, VARIANT, *); \
CASE_VT(VT_VARIANT, VARIANT, *); \
CASE_VT(VT_PTR, void*, V_BYREF); \
CASE_VT(VT_PTR, void*, V_BYREF); \
CASE_VT(VT_UNKNOWN, IUnknown*, V_UNKNOWN); \
CASE_VT(VT_UNKNOWN, IUnknown*, V_UNKNOWN); \
CASE_VT(VT_DISPATCH, IDispatch*, V_DISPATCH)
CASE_VT(VT_DISPATCH, IDispatch*, V_DISPATCH); \
CASE_VT(VT_UI8, ULONGLONG, V_UI8)
static
BOOL
is_arg_type_supported
(
VARTYPE
vt
)
static
BOOL
is_arg_type_supported
(
VARTYPE
vt
)
{
{
...
...
dlls/mshtml/htmlevent.c
View file @
c0f96a40
...
@@ -1054,8 +1054,11 @@ static HRESULT WINAPI DOMEvent_get_target(IDOMEvent *iface, IEventTarget **p)
...
@@ -1054,8 +1054,11 @@ static HRESULT WINAPI DOMEvent_get_target(IDOMEvent *iface, IEventTarget **p)
static
HRESULT
WINAPI
DOMEvent_get_timeStamp
(
IDOMEvent
*
iface
,
ULONGLONG
*
p
)
static
HRESULT
WINAPI
DOMEvent_get_timeStamp
(
IDOMEvent
*
iface
,
ULONGLONG
*
p
)
{
{
DOMEvent
*
This
=
impl_from_IDOMEvent
(
iface
);
DOMEvent
*
This
=
impl_from_IDOMEvent
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
*
p
=
This
->
time_stamp
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
DOMEvent_get_type
(
IDOMEvent
*
iface
,
BSTR
*
p
)
static
HRESULT
WINAPI
DOMEvent_get_type
(
IDOMEvent
*
iface
,
BSTR
*
p
)
...
@@ -1208,6 +1211,10 @@ static dispex_static_data_t DOMEvent_dispex = {
...
@@ -1208,6 +1211,10 @@ static dispex_static_data_t DOMEvent_dispex = {
static
DOMEvent
*
alloc_event
(
nsIDOMEvent
*
nsevent
,
eventid_t
event_id
)
static
DOMEvent
*
alloc_event
(
nsIDOMEvent
*
nsevent
,
eventid_t
event_id
)
{
{
DOMEvent
*
event
;
DOMEvent
*
event
;
FILETIME
time
;
/* 1601 to 1970 is 369 years plus 89 leap days */
const
ULONGLONG
time_epoch
=
(
ULONGLONG
)(
369
*
365
+
89
)
*
86400
*
1000
;
event
=
heap_alloc_zero
(
sizeof
(
*
event
));
event
=
heap_alloc_zero
(
sizeof
(
*
event
));
if
(
!
event
)
if
(
!
event
)
...
@@ -1227,6 +1234,11 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent, eventid_t event_id)
...
@@ -1227,6 +1234,11 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent, eventid_t event_id)
event
->
cancelable
=
(
event_info
[
event_id
].
flags
&
EVENT_CANCELABLE
)
!=
0
;
event
->
cancelable
=
(
event_info
[
event_id
].
flags
&
EVENT_CANCELABLE
)
!=
0
;
}
}
nsIDOMEvent_AddRef
(
event
->
nsevent
=
nsevent
);
nsIDOMEvent_AddRef
(
event
->
nsevent
=
nsevent
);
GetSystemTimeAsFileTime
(
&
time
);
event
->
time_stamp
=
(((
ULONGLONG
)
time
.
dwHighDateTime
<<
32
)
+
time
.
dwLowDateTime
)
/
10000
-
time_epoch
;
return
event
;
return
event
;
}
}
...
...
dlls/mshtml/htmlevent.h
View file @
c0f96a40
...
@@ -67,6 +67,7 @@ typedef struct {
...
@@ -67,6 +67,7 @@ typedef struct {
WCHAR
*
type
;
WCHAR
*
type
;
EventTarget
*
target
;
EventTarget
*
target
;
EventTarget
*
current_target
;
EventTarget
*
current_target
;
ULONGLONG
time_stamp
;
BOOL
bubbles
;
BOOL
bubbles
;
BOOL
cancelable
;
BOOL
cancelable
;
BOOL
prevent_default
;
BOOL
prevent_default
;
...
...
dlls/mshtml/tests/events.js
View file @
c0f96a40
...
@@ -295,10 +295,10 @@ function test_prevent_default() {
...
@@ -295,10 +295,10 @@ function test_prevent_default() {
var
calls
;
var
calls
;
div
.
addEventListener
(
"click"
,
function
(
e
)
{
div
.
addEventListener
(
"click"
,
function
(
e
)
{
calls
+=
"div,"
;
ok
(
e
.
defaultPrevented
===
false
,
"e.defaultPrevented = "
+
e
.
defaultPrevented
);
ok
(
e
.
defaultPrevented
===
false
,
"e.defaultPrevented = "
+
e
.
defaultPrevented
);
e
.
preventDefault
();
e
.
preventDefault
();
ok
(
e
.
defaultPrevented
===
e
.
cancelable
,
"e.defaultPrevented = "
+
e
.
defaultPrevented
);
ok
(
e
.
defaultPrevented
===
e
.
cancelable
,
"e.defaultPrevented = "
+
e
.
defaultPrevented
);
calls
+=
"div,"
;
},
true
);
},
true
);
a
.
addEventListener
(
"click"
,
function
(
e
)
{
a
.
addEventListener
(
"click"
,
function
(
e
)
{
...
@@ -551,6 +551,44 @@ function test_recursive_dispatch() {
...
@@ -551,6 +551,44 @@ function test_recursive_dispatch() {
next_test
();
next_test
();
}
}
function
test_time_stamp
()
{
document
.
body
.
innerHTML
=
'<div></div>'
;
var
elem
=
document
.
body
.
firstChild
;
var
calls
,
last_time_stamp
;
elem
.
onclick
=
function
(
event
)
{
ok
(
event
.
timeStamp
===
last_time_stamp
,
"timeStamp = "
+
event
.
timeStamp
);
calls
++
;
}
var
e
=
document
.
createEvent
(
"Event"
);
ok
(
typeof
(
e
.
timeStamp
)
===
"number"
,
"typeof(timeStamp) = "
+
typeof
(
e
.
timeStamp
));
ok
(
e
.
timeStamp
>
0
,
"timeStamp = "
+
e
.
timeStamp
);
var
now
=
(
new
Date
()).
getTime
();
last_time_stamp
=
e
.
timeStamp
;
ok
(
Math
.
abs
(
now
-
last_time_stamp
)
<
3
,
"timeStamp "
+
last_time_stamp
+
" != now "
+
now
);
e
.
initEvent
(
"click"
,
true
,
true
);
ok
(
e
.
timeStamp
===
last_time_stamp
,
"timeStamp = "
+
e
.
timeStamp
);
calls
=
0
;
elem
.
dispatchEvent
(
e
);
ok
(
calls
===
1
,
"calls = "
+
calls
);
ok
(
e
.
timeStamp
===
last_time_stamp
,
"timeStamp = "
+
e
.
timeStamp
);
elem
.
onclick
=
function
(
event
)
{
ok
(
event
.
timeStamp
>
0
,
"timeStamp = "
+
event
.
timeStamp
);
trace
(
"timestamp "
+
event
.
timeStamp
);
calls
++
;
}
calls
=
0
;
elem
.
click
();
ok
(
calls
===
1
,
"calls = "
+
calls
);
next_test
();
}
var
tests
=
[
var
tests
=
[
test_content_loaded
,
test_content_loaded
,
test_add_remove_listener
,
test_add_remove_listener
,
...
@@ -563,5 +601,6 @@ var tests = [
...
@@ -563,5 +601,6 @@ var tests = [
test_current_target
,
test_current_target
,
test_dispatch_event
,
test_dispatch_event
,
test_recursive_dispatch
,
test_recursive_dispatch
,
test_time_stamp
,
test_listener_order
test_listener_order
];
];
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment