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
5711c85a
Commit
5711c85a
authored
Feb 05, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Expose IDOMMouseEvent to scripts.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
05b0c8f7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
2 deletions
+78
-2
htmlevent.c
dlls/mshtml/htmlevent.c
+15
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-0
events.js
dlls/mshtml/tests/events.js
+61
-1
No files found.
dlls/mshtml/htmlevent.c
View file @
5711c85a
...
@@ -1586,6 +1586,18 @@ static dispex_static_data_t DOMEvent_dispex = {
...
@@ -1586,6 +1586,18 @@ static dispex_static_data_t DOMEvent_dispex = {
DOMEvent_iface_tids
DOMEvent_iface_tids
};
};
static
const
tid_t
DOMMouseEvent_iface_tids
[]
=
{
IDOMEvent_tid
,
IDOMMouseEvent_tid
,
0
};
static
dispex_static_data_t
DOMMouseEvent_dispex
=
{
NULL
,
DispDOMMouseEvent_tid
,
DOMMouseEvent_iface_tids
};
static
DOMEvent
*
alloc_event
(
nsIDOMEvent
*
nsevent
,
eventid_t
event_id
)
static
DOMEvent
*
alloc_event
(
nsIDOMEvent
*
nsevent
,
eventid_t
event_id
)
{
{
dispex_static_data_t
*
dispex_data
=
&
DOMEvent_dispex
;
dispex_static_data_t
*
dispex_data
=
&
DOMEvent_dispex
;
...
@@ -1620,7 +1632,9 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent, eventid_t event_id)
...
@@ -1620,7 +1632,9 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent, eventid_t event_id)
-
time_epoch
;
-
time_epoch
;
nsres
=
nsIDOMEvent_QueryInterface
(
nsevent
,
&
IID_nsIDOMMouseEvent
,
(
void
**
)
&
event
->
mouse_event
);
nsres
=
nsIDOMEvent_QueryInterface
(
nsevent
,
&
IID_nsIDOMMouseEvent
,
(
void
**
)
&
event
->
mouse_event
);
if
(
NS_FAILED
(
nsres
))
if
(
NS_SUCCEEDED
(
nsres
))
dispex_data
=
&
DOMMouseEvent_dispex
;
else
event
->
mouse_event
=
NULL
;
event
->
mouse_event
=
NULL
;
init_dispex
(
&
event
->
dispex
,
(
IUnknown
*
)
&
event
->
IDOMEvent_iface
,
dispex_data
);
init_dispex
(
&
event
->
dispex
,
(
IUnknown
*
)
&
event
->
IDOMEvent_iface
,
dispex_data
);
...
...
dlls/mshtml/mshtml_private.h
View file @
5711c85a
...
@@ -81,6 +81,7 @@ typedef struct EventTarget EventTarget;
...
@@ -81,6 +81,7 @@ typedef struct EventTarget EventTarget;
XDIID(DispCPlugins) \
XDIID(DispCPlugins) \
XDIID(DispDOMChildrenCollection) \
XDIID(DispDOMChildrenCollection) \
XDIID(DispDOMEvent) \
XDIID(DispDOMEvent) \
XDIID(DispDOMMouseEvent) \
XDIID(DispHTMLAnchorElement) \
XDIID(DispHTMLAnchorElement) \
XDIID(DispHTMLAreaElement) \
XDIID(DispHTMLAreaElement) \
XDIID(DispHTMLAttributeCollection) \
XDIID(DispHTMLAttributeCollection) \
...
@@ -128,6 +129,7 @@ typedef struct EventTarget EventTarget;
...
@@ -128,6 +129,7 @@ typedef struct EventTarget EventTarget;
XDIID(HTMLDocumentEvents) \
XDIID(HTMLDocumentEvents) \
XDIID(HTMLElementEvents2) \
XDIID(HTMLElementEvents2) \
XIID(IDOMEvent) \
XIID(IDOMEvent) \
XIID(IDOMMouseEvent) \
XIID(IDocumentEvent) \
XIID(IDocumentEvent) \
XIID(IDocumentSelector) \
XIID(IDocumentSelector) \
XIID(IElementSelector) \
XIID(IElementSelector) \
...
...
dlls/mshtml/tests/events.js
View file @
5711c85a
...
@@ -592,6 +592,65 @@ function test_time_stamp() {
...
@@ -592,6 +592,65 @@ function test_time_stamp() {
next_test
();
next_test
();
}
}
function
test_mouse_event
()
{
var
e
;
e
=
document
.
createEvent
(
"MouseEvent"
);
ok
(
e
.
screenX
===
0
,
"screenX = "
+
e
.
screenX
);
ok
(
e
.
screenY
===
0
,
"screenY = "
+
e
.
screenY
);
ok
(
e
.
clientX
===
0
,
"clientX = "
+
e
.
clientX
);
ok
(
e
.
clientY
===
0
,
"clientY = "
+
e
.
clientY
);
ok
(
e
.
ctrlKey
===
false
,
"ctrlKey = "
+
e
.
ctrlKey
);
ok
(
e
.
altKey
===
false
,
"altKey = "
+
e
.
altKey
);
ok
(
e
.
shiftKey
===
false
,
"shiftKey = "
+
e
.
shiftKey
);
ok
(
e
.
metaKey
===
false
,
"metaKey = "
+
e
.
metaKey
);
ok
(
e
.
button
===
0
,
"button = "
+
e
.
button
);
e
.
initMouseEvent
(
"test"
,
true
,
true
,
window
,
1
,
2
,
3
,
4
,
5
,
false
,
false
,
false
,
false
,
1
,
document
);
ok
(
e
.
type
===
"test"
,
"type = "
+
e
.
type
);
ok
(
e
.
cancelable
===
true
,
"cancelable = "
+
e
.
cancelable
);
ok
(
e
.
bubbles
===
true
,
"bubbles = "
+
e
.
bubbles
);
ok
(
e
.
screenX
===
2
,
"screenX = "
+
e
.
screenX
);
ok
(
e
.
screenY
===
3
,
"screenY = "
+
e
.
screenY
);
ok
(
e
.
clientX
===
4
,
"clientX = "
+
e
.
clientX
);
ok
(
e
.
clientY
===
5
,
"clientY = "
+
e
.
clientY
);
ok
(
e
.
ctrlKey
===
false
,
"ctrlKey = "
+
e
.
ctrlKey
);
ok
(
e
.
altKey
===
false
,
"altKey = "
+
e
.
altKey
);
ok
(
e
.
shiftKey
===
false
,
"shiftKey = "
+
e
.
shiftKey
);
ok
(
e
.
metaKey
===
false
,
"metaKey = "
+
e
.
metaKey
);
ok
(
e
.
button
===
1
,
"button = "
+
e
.
button
);
e
.
initMouseEvent
(
"test"
,
false
,
false
,
window
,
9
,
8
,
7
,
6
,
5
,
true
,
true
,
true
,
true
,
127
,
document
);
ok
(
e
.
type
===
"test"
,
"type = "
+
e
.
type
);
ok
(
e
.
cancelable
===
false
,
"cancelable = "
+
e
.
cancelable
);
ok
(
e
.
bubbles
===
false
,
"bubbles = "
+
e
.
bubbles
);
ok
(
e
.
screenX
===
8
,
"screenX = "
+
e
.
screenX
);
ok
(
e
.
screenY
===
7
,
"screenY = "
+
e
.
screenY
);
ok
(
e
.
clientX
===
6
,
"clientX = "
+
e
.
clientX
);
ok
(
e
.
clientY
===
5
,
"clientY = "
+
e
.
clientY
);
ok
(
e
.
ctrlKey
===
true
,
"ctrlKey = "
+
e
.
ctrlKey
);
ok
(
e
.
altKey
===
true
,
"altKey = "
+
e
.
altKey
);
ok
(
e
.
shiftKey
===
true
,
"shiftKey = "
+
e
.
shiftKey
);
ok
(
e
.
metaKey
===
true
,
"metaKey = "
+
e
.
metaKey
);
ok
(
e
.
button
===
127
,
"button = "
+
e
.
button
);
e
.
initEvent
(
"testevent"
,
true
,
true
);
ok
(
e
.
type
===
"testevent"
,
"type = "
+
e
.
type
);
ok
(
e
.
cancelable
===
true
,
"cancelable = "
+
e
.
cancelable
);
ok
(
e
.
bubbles
===
true
,
"bubbles = "
+
e
.
bubbles
);
ok
(
e
.
screenX
===
8
,
"screenX = "
+
e
.
screenX
);
ok
(
e
.
screenY
===
7
,
"screenY = "
+
e
.
screenY
);
ok
(
e
.
clientX
===
6
,
"clientX = "
+
e
.
clientX
);
ok
(
e
.
clientY
===
5
,
"clientY = "
+
e
.
clientY
);
ok
(
e
.
ctrlKey
===
true
,
"ctrlKey = "
+
e
.
ctrlKey
);
ok
(
e
.
altKey
===
true
,
"altKey = "
+
e
.
altKey
);
ok
(
e
.
shiftKey
===
true
,
"shiftKey = "
+
e
.
shiftKey
);
ok
(
e
.
metaKey
===
true
,
"metaKey = "
+
e
.
metaKey
);
ok
(
e
.
button
===
127
,
"button = "
+
e
.
button
);
next_test
();
}
var
tests
=
[
var
tests
=
[
test_content_loaded
,
test_content_loaded
,
test_add_remove_listener
,
test_add_remove_listener
,
...
@@ -605,5 +664,6 @@ var tests = [
...
@@ -605,5 +664,6 @@ var tests = [
test_dispatch_event
,
test_dispatch_event
,
test_recursive_dispatch
,
test_recursive_dispatch
,
test_time_stamp
,
test_time_stamp
,
test_listener_order
test_listener_order
,
test_mouse_event
];
];
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