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
0a288a2e
Commit
0a288a2e
authored
Oct 19, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Set current event target in fire_event_obj.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6dc67c42
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
htmlevent.c
dlls/mshtml/htmlevent.c
+8
-6
events.html
dlls/mshtml/tests/events.html
+16
-0
No files found.
dlls/mshtml/htmlevent.c
View file @
0a288a2e
...
...
@@ -812,7 +812,7 @@ static HTMLEventObj *create_event(void)
return
ret
;
}
static
HRESULT
set_event_info
(
HTMLEventObj
*
event
,
EventTarget
*
target
,
eventid_t
eid
,
HTMLDocumentNode
*
doc
,
nsIDOMEvent
*
nsevent
)
static
HRESULT
set_event_info
(
HTMLEventObj
*
event
,
eventid_t
eid
,
HTMLDocumentNode
*
doc
,
nsIDOMEvent
*
nsevent
)
{
event
->
type
=
event_info
+
eid
;
event
->
nsevent
=
nsevent
;
...
...
@@ -832,9 +832,6 @@ static HRESULT set_event_info(HTMLEventObj *event, EventTarget *target, eventid_
}
}
event
->
target
=
target
;
if
(
target
)
IDispatchEx_AddRef
(
&
target
->
dispex
.
IDispatchEx_iface
);
return
S_OK
;
}
...
...
@@ -1109,6 +1106,11 @@ static void fire_event_obj(EventTarget *event_target, eventid_t eid, HTMLEventOb
if
(
target_vtbl
&&
target_vtbl
->
set_current_event
)
prev_event
=
target_vtbl
->
set_current_event
(
&
event_target
->
dispex
,
event_obj
?
&
event_obj
->
IHTMLEventObj_iface
:
NULL
);
if
(
event_obj
)
{
event_obj
->
target
=
event_target
;
IDispatchEx_AddRef
(
&
event_target
->
dispex
.
IDispatchEx_iface
);
}
for
(
i
=
0
;
i
<
chain_cnt
;
i
++
)
{
call_event_handlers
(
event_obj
,
target_chain
[
i
],
eid
);
if
(
!
(
event_info
[
eid
].
flags
&
EVENT_BUBBLES
)
||
(
event_obj
&&
event_obj
->
cancel_bubble
))
...
...
@@ -1156,7 +1158,7 @@ void fire_event(HTMLDocumentNode *doc, eventid_t eid, BOOL set_event, EventTarge
if
(
!
event_obj
)
return
;
hres
=
set_event_info
(
event_obj
,
target
,
eid
,
doc
,
nsevent
);
hres
=
set_event_info
(
event_obj
,
eid
,
doc
,
nsevent
);
if
(
FAILED
(
hres
))
{
IHTMLEventObj_Release
(
&
event_obj
->
IHTMLEventObj_iface
);
return
;
...
...
@@ -1206,7 +1208,7 @@ HRESULT dispatch_event(HTMLDOMNode *node, const WCHAR *event_name, VARIANT *even
}
if
(
event_obj
)
{
hres
=
set_event_info
(
event_obj
,
&
node
->
event_target
,
eid
,
node
->
doc
,
NULL
);
hres
=
set_event_info
(
event_obj
,
eid
,
node
->
doc
,
NULL
);
if
(
SUCCEEDED
(
hres
))
fire_event_obj
(
&
node
->
event_target
,
eid
,
event_obj
);
...
...
dlls/mshtml/tests/events.html
View file @
0a288a2e
...
...
@@ -176,6 +176,21 @@ function test_body_events() {
ok
(
onclick_called
,
"onclick handler not invoked"
);
}
function
test_event_target
()
{
var
div
=
document
.
createElement
(
"div"
);
document
.
body
.
appendChild
(
div
);
var
last_event_arg
;
div
.
attachEvent
(
"onclick"
,
function
(
event_arg
)
{
ok
(
event_arg
.
srcElement
===
div
,
"srcElement != div"
);
last_event_arg
=
event_arg
;
});
div
.
click
();
with
(
todo_wine
)
ok
(
last_event_arg
.
srcElement
===
null
,
"srcElement != null"
);
}
window
.
onload
=
function
()
{
try
{
ok
(
inlscr_complete_called
,
"onreadystatechange not fired"
);
...
...
@@ -198,6 +213,7 @@ window.onload = function() {
test_insert_script
();
test_string_event_handler
();
test_body_events
();
test_event_target
();
}
catch
(
e
)
{
ok
(
false
,
"Got an exception: "
+
e
.
message
);
}
...
...
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