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
1dc502c5
Commit
1dc502c5
authored
Apr 04, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Pass node as an object to fire_event.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b692aad3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
34 deletions
+39
-34
htmlelem.c
dlls/mshtml/htmlelem.c
+1
-1
htmlevent.c
dlls/mshtml/htmlevent.c
+10
-16
htmlevent.h
dlls/mshtml/htmlevent.h
+1
-1
nsembed.c
dlls/mshtml/nsembed.c
+6
-9
nsevents.c
dlls/mshtml/nsevents.c
+17
-3
persist.c
dlls/mshtml/persist.c
+2
-2
script.c
dlls/mshtml/script.c
+2
-2
No files found.
dlls/mshtml/htmlelem.c
View file @
1dc502c5
...
...
@@ -4112,7 +4112,7 @@ HRESULT HTMLElement_handle_event(HTMLDOMNode *iface, DWORD eid, nsIDOMEvent *eve
switch
(
code
)
{
case
VK_F1
:
/* DOM_VK_F1 */
TRACE
(
"F1 pressed
\n
"
);
fire_event
(
This
->
node
.
doc
,
EVENTID_HELP
,
TRUE
,
This
->
node
.
ns
node
,
NULL
,
NULL
);
fire_event
(
This
->
node
.
doc
,
EVENTID_HELP
,
TRUE
,
&
This
->
node
,
NULL
,
NULL
);
*
prevent_default
=
TRUE
;
}
...
...
dlls/mshtml/htmlevent.c
View file @
1dc502c5
...
...
@@ -1085,7 +1085,7 @@ void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj, EventTa
}
static
void
fire_event_obj
(
HTMLDocumentNode
*
doc
,
eventid_t
eid
,
HTMLEventObj
*
event_obj
,
nsI
DOMNode
*
target
,
IDispatch
*
script_this
)
HTML
DOMNode
*
target
,
IDispatch
*
script_this
)
{
IHTMLEventObj
*
prev_event
;
nsIDOMNode
*
parent
,
*
nsnode
;
...
...
@@ -1109,8 +1109,8 @@ static void fire_event_obj(HTMLDocumentNode *doc, eventid_t eid, HTMLEventObj *e
prev_event
=
window
->
event
;
window
->
event
=
event_obj
?
&
event_obj
->
IHTMLEventObj_iface
:
NULL
;
nsIDOMNode_GetNodeType
(
target
,
&
node_type
);
nsnode
=
target
;
nsIDOMNode_GetNodeType
(
target
->
nsnode
,
&
node_type
);
nsnode
=
target
->
nsnode
;
nsIDOMNode_AddRef
(
nsnode
);
switch
(
node_type
)
{
...
...
@@ -1173,8 +1173,8 @@ static void fire_event_obj(HTMLDocumentNode *doc, eventid_t eid, HTMLEventObj *e
window
->
event
=
prev_event
;
if
(
!
prevent_default
&&
(
event_info
[
eid
].
flags
&
EVENT_HASDEFAULTHANDLERS
))
{
ns
IDOMNode_AddRef
(
target
)
;
ns
node
=
target
;
ns
node
=
target
->
nsnode
;
ns
IDOMNode_AddRef
(
nsnode
)
;
do
{
hres
=
get_node
(
doc
,
nsnode
,
TRUE
,
&
node
);
...
...
@@ -1209,24 +1209,18 @@ static void fire_event_obj(HTMLDocumentNode *doc, eventid_t eid, HTMLEventObj *e
htmldoc_release
(
&
doc
->
basedoc
);
}
void
fire_event
(
HTMLDocumentNode
*
doc
,
eventid_t
eid
,
BOOL
set_event
,
nsI
DOMNode
*
target
,
nsIDOMEvent
*
nsevent
,
void
fire_event
(
HTMLDocumentNode
*
doc
,
eventid_t
eid
,
BOOL
set_event
,
HTML
DOMNode
*
target
,
nsIDOMEvent
*
nsevent
,
IDispatch
*
script_this
)
{
HTMLEventObj
*
event_obj
=
NULL
;
HTMLDOMNode
*
node
;
HRESULT
hres
;
if
(
set_event
)
{
hres
=
get_node
(
doc
,
target
,
TRUE
,
&
node
);
if
(
FAILED
(
hres
))
return
;
event_obj
=
create_event
();
node_release
(
node
);
if
(
!
event_obj
)
return
;
hres
=
set_event_info
(
event_obj
,
node
,
eid
,
nsevent
);
hres
=
set_event_info
(
event_obj
,
target
,
eid
,
nsevent
);
if
(
FAILED
(
hres
))
{
IHTMLEventObj_Release
(
&
event_obj
->
IHTMLEventObj_iface
);
return
;
...
...
@@ -1278,13 +1272,13 @@ HRESULT dispatch_event(HTMLDOMNode *node, const WCHAR *event_name, VARIANT *even
if
(
event_obj
)
{
hres
=
set_event_info
(
event_obj
,
node
,
eid
,
NULL
);
if
(
SUCCEEDED
(
hres
))
fire_event_obj
(
node
->
doc
,
eid
,
event_obj
,
node
->
nsnode
,
NULL
);
fire_event_obj
(
node
->
doc
,
eid
,
event_obj
,
node
,
NULL
);
IHTMLEventObj_Release
(
&
event_obj
->
IHTMLEventObj_iface
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
fire_event
(
node
->
doc
,
eid
,
TRUE
,
node
->
nsnode
,
NULL
,
NULL
);
fire_event
(
node
->
doc
,
eid
,
TRUE
,
node
,
NULL
,
NULL
);
}
*
cancelled
=
VARIANT_TRUE
;
/* FIXME */
...
...
@@ -1303,7 +1297,7 @@ HRESULT call_fire_event(HTMLDOMNode *node, eventid_t eid)
return
hres
;
}
fire_event
(
node
->
doc
,
eid
,
TRUE
,
node
->
nsnode
,
NULL
,
NULL
);
fire_event
(
node
->
doc
,
eid
,
TRUE
,
node
,
NULL
,
NULL
);
return
S_OK
;
}
...
...
dlls/mshtml/htmlevent.h
View file @
1dc502c5
...
...
@@ -53,7 +53,7 @@ typedef enum {
eventid_t
str_to_eid
(
LPCWSTR
)
DECLSPEC_HIDDEN
;
void
check_event_attr
(
HTMLDocumentNode
*
,
nsIDOMHTMLElement
*
)
DECLSPEC_HIDDEN
;
void
release_event_target
(
event_target_t
*
)
DECLSPEC_HIDDEN
;
void
fire_event
(
HTMLDocumentNode
*
,
eventid_t
,
BOOL
,
nsI
DOMNode
*
,
nsIDOMEvent
*
,
IDispatch
*
)
DECLSPEC_HIDDEN
;
void
fire_event
(
HTMLDocumentNode
*
,
eventid_t
,
BOOL
,
HTML
DOMNode
*
,
nsIDOMEvent
*
,
IDispatch
*
)
DECLSPEC_HIDDEN
;
HRESULT
set_event_handler
(
EventTarget
*
,
eventid_t
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
get_event_handler
(
EventTarget
*
,
eventid_t
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
attach_event
(
EventTarget
*
,
BSTR
,
IDispatch
*
,
VARIANT_BOOL
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/nsembed.c
View file @
1dc502c5
...
...
@@ -1462,13 +1462,14 @@ static nsresult NSAPI nsContextMenuListener_OnShowContextMenu(nsIContextMenuList
TRACE
(
"(%p)->(%08x %p %p)
\n
"
,
This
,
aContextFlags
,
aEvent
,
aNode
);
fire_event
(
This
->
doc
->
basedoc
.
doc_node
/* FIXME */
,
EVENTID_CONTEXTMENU
,
TRUE
,
aNode
,
aEvent
,
NULL
);
hres
=
get_node
(
This
->
doc
->
basedoc
.
doc_node
,
aNode
,
TRUE
,
&
node
);
if
(
FAILED
(
hres
))
return
NS_ERROR_FAILURE
;
fire_event
(
This
->
doc
->
basedoc
.
doc_node
/* FIXME */
,
EVENTID_CONTEXTMENU
,
TRUE
,
node
,
aEvent
,
NULL
);
nsres
=
nsIDOMEvent_QueryInterface
(
aEvent
,
&
IID_nsIDOMMouseEvent
,
(
void
**
)
&
event
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMMouseEvent interface: %08x
\n
"
,
nsres
);
return
nsres
;
}
assert
(
NS_SUCCEEDED
(
nsres
));
nsIDOMMouseEvent_GetScreenX
(
event
,
&
pt
.
x
);
nsIDOMMouseEvent_GetScreenY
(
event
,
&
pt
.
y
);
...
...
@@ -1506,10 +1507,6 @@ static nsresult NSAPI nsContextMenuListener_OnShowContextMenu(nsIContextMenuList
FIXME
(
"aContextFlags=%08x
\n
"
,
aContextFlags
);
};
hres
=
get_node
(
This
->
doc
->
basedoc
.
doc_node
,
aNode
,
TRUE
,
&
node
);
if
(
FAILED
(
hres
))
return
NS_ERROR_FAILURE
;
show_context_menu
(
This
->
doc
,
dwID
,
&
pt
,
(
IDispatch
*
)
&
node
->
IHTMLDOMNode_iface
);
node_release
(
node
);
return
NS_OK
;
...
...
dlls/mshtml/nsevents.c
View file @
1dc502c5
...
...
@@ -273,8 +273,16 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
nsres
=
nsIDOMHTMLDocument_GetBody
(
doc
->
nsdoc
,
&
nsbody
);
if
(
NS_SUCCEEDED
(
nsres
)
&&
nsbody
)
{
fire_event
(
doc
,
EVENTID_LOAD
,
TRUE
,
(
nsIDOMNode
*
)
nsbody
,
event
,
(
IDispatch
*
)
&
doc
->
window
->
base
.
IDispatchEx_iface
);
HTMLDOMNode
*
node
;
HRESULT
hres
;
hres
=
get_node
(
doc
,
(
nsIDOMNode
*
)
nsbody
,
TRUE
,
&
node
);
nsIDOMHTMLElement_Release
(
nsbody
);
if
(
SUCCEEDED
(
hres
))
{
fire_event
(
doc
,
EVENTID_LOAD
,
TRUE
,
node
,
event
,
(
IDispatch
*
)
&
doc
->
window
->
base
.
IDispatchEx_iface
);
node_release
(
node
);
}
}
}
else
{
ERR
(
"NULL nsdoc
\n
"
);
...
...
@@ -293,8 +301,10 @@ static nsresult NSAPI handle_htmlevent(nsIDOMEventListener *iface, nsIDOMEvent *
nsIDOMEventTarget
*
event_target
;
nsIDOMNode
*
nsnode
;
nsAString
type_str
;
HTMLDOMNode
*
node
;
eventid_t
eid
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"%p
\n
"
,
This
->
This
);
...
...
@@ -322,10 +332,14 @@ static nsresult NSAPI handle_htmlevent(nsIDOMEventListener *iface, nsIDOMEvent *
return
NS_OK
;
}
fire_event
(
doc
,
eid
,
TRUE
,
nsnode
,
event
,
NULL
);
hres
=
get_node
(
doc
,
nsnode
,
TRUE
,
&
node
);
nsIDOMNode_Release
(
nsnode
);
if
(
FAILED
(
hres
))
return
NS_OK
;
fire_event
(
doc
,
eid
,
TRUE
,
node
,
event
,
NULL
);
node_release
(
node
);
return
NS_OK
;
}
...
...
dlls/mshtml/persist.c
View file @
1dc502c5
...
...
@@ -448,11 +448,11 @@ static void notif_readystate(HTMLOuterWindow *window)
call_property_onchanged
(
&
window
->
doc_obj
->
basedoc
.
cp_container
,
DISPID_READYSTATE
);
fire_event
(
window
->
base
.
inner_window
->
doc
,
EVENTID_READYSTATECHANGE
,
FALSE
,
window
->
base
.
inner_window
->
doc
->
node
.
ns
node
,
NULL
,
NULL
);
&
window
->
base
.
inner_window
->
doc
->
node
,
NULL
,
NULL
);
if
(
window
->
frame_element
)
fire_event
(
window
->
frame_element
->
element
.
node
.
doc
,
EVENTID_READYSTATECHANGE
,
TRUE
,
window
->
frame_element
->
element
.
node
.
ns
node
,
NULL
,
NULL
);
TRUE
,
&
window
->
frame_element
->
element
.
node
,
NULL
,
NULL
);
}
typedef
struct
{
...
...
dlls/mshtml/script.c
View file @
1dc502c5
...
...
@@ -735,7 +735,7 @@ static void fire_readystatechange_proc(task_t *_task)
return
;
task
->
elem
->
pending_readystatechange_event
=
FALSE
;
fire_event
(
task
->
elem
->
element
.
node
.
doc
,
EVENTID_READYSTATECHANGE
,
FALSE
,
task
->
elem
->
element
.
node
.
ns
node
,
NULL
,
NULL
);
fire_event
(
task
->
elem
->
element
.
node
.
doc
,
EVENTID_READYSTATECHANGE
,
FALSE
,
&
task
->
elem
->
element
.
node
,
NULL
,
NULL
);
}
static
void
fire_readystatechange_task_destr
(
task_t
*
_task
)
...
...
@@ -771,7 +771,7 @@ static void set_script_elem_readystate(HTMLScriptElement *script_elem, READYSTAT
}
else
{
script_elem
->
pending_readystatechange_event
=
FALSE
;
fire_event
(
script_elem
->
element
.
node
.
doc
,
EVENTID_READYSTATECHANGE
,
FALSE
,
script_elem
->
element
.
node
.
ns
node
,
NULL
,
NULL
);
&
script_elem
->
element
.
node
,
NULL
,
NULL
);
}
}
}
...
...
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