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
4940275d
Commit
4940275d
authored
Oct 22, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 22, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Set 'this' to window object for onload handlers.
parent
610ea94d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
16 deletions
+19
-16
htmlelem.c
dlls/mshtml/htmlelem.c
+1
-1
htmlevent.c
dlls/mshtml/htmlevent.c
+11
-9
htmlevent.h
dlls/mshtml/htmlevent.h
+1
-1
nsembed.c
dlls/mshtml/nsembed.c
+1
-1
nsevents.c
dlls/mshtml/nsevents.c
+2
-2
persist.c
dlls/mshtml/persist.c
+3
-2
No files found.
dlls/mshtml/htmlelem.c
View file @
4940275d
...
...
@@ -1664,7 +1664,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
.
nsnode
,
NULL
);
fire_event
(
This
->
node
.
doc
,
EVENTID_HELP
,
TRUE
,
This
->
node
.
nsnode
,
NULL
,
NULL
);
*
prevent_default
=
TRUE
;
}
...
...
dlls/mshtml/htmlevent.c
View file @
4940275d
...
...
@@ -1033,7 +1033,8 @@ static void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj,
}
}
static
void
fire_event_obj
(
HTMLDocumentNode
*
doc
,
eventid_t
eid
,
HTMLEventObj
*
event_obj
,
nsIDOMNode
*
target
)
static
void
fire_event_obj
(
HTMLDocumentNode
*
doc
,
eventid_t
eid
,
HTMLEventObj
*
event_obj
,
nsIDOMNode
*
target
,
IDispatch
*
script_this
)
{
IHTMLEventObj
*
prev_event
;
nsIDOMNode
*
parent
,
*
nsnode
;
...
...
@@ -1060,7 +1061,7 @@ static void fire_event_obj(HTMLDocumentNode *doc, eventid_t eid, HTMLEventObj *e
hres
=
get_node
(
doc
,
nsnode
,
FALSE
,
&
node
);
if
(
SUCCEEDED
(
hres
)
&&
node
)
{
call_event_handlers
(
doc
,
event_obj
,
*
get_node_event_target
(
node
),
node
->
cp_container
,
eid
,
(
IDispatch
*
)
&
node
->
IHTMLDOMNode_iface
);
node
->
cp_container
,
eid
,
script_this
?
script_this
:
(
IDispatch
*
)
&
node
->
IHTMLDOMNode_iface
);
node_release
(
node
);
}
...
...
@@ -1089,7 +1090,7 @@ static void fire_event_obj(HTMLDocumentNode *doc, eventid_t eid, HTMLEventObj *e
hres
=
get_node
(
doc
,
(
nsIDOMNode
*
)
nsbody
,
FALSE
,
&
node
);
if
(
SUCCEEDED
(
hres
)
&&
node
)
{
call_event_handlers
(
doc
,
event_obj
,
*
get_node_event_target
(
node
),
node
->
cp_container
,
eid
,
(
IDispatch
*
)
&
node
->
IHTMLDOMNode_iface
);
node
->
cp_container
,
eid
,
script_this
?
script_this
:
(
IDispatch
*
)
&
node
->
IHTMLDOMNode_iface
);
node_release
(
node
);
}
nsIDOMHTMLElement_Release
(
nsbody
);
...
...
@@ -1099,7 +1100,7 @@ static void fire_event_obj(HTMLDocumentNode *doc, eventid_t eid, HTMLEventObj *e
}
call_event_handlers
(
doc
,
event_obj
,
doc
->
node
.
event_target
,
&
doc
->
basedoc
.
cp_container
,
eid
,
(
IDispatch
*
)
&
doc
->
basedoc
.
IHTMLDocument2_iface
);
script_this
?
script_this
:
(
IDispatch
*
)
&
doc
->
basedoc
.
IHTMLDocument2_iface
);
break
;
default:
...
...
@@ -1148,7 +1149,8 @@ static void fire_event_obj(HTMLDocumentNode *doc, eventid_t eid, HTMLEventObj *e
}
}
void
fire_event
(
HTMLDocumentNode
*
doc
,
eventid_t
eid
,
BOOL
set_event
,
nsIDOMNode
*
target
,
nsIDOMEvent
*
nsevent
)
void
fire_event
(
HTMLDocumentNode
*
doc
,
eventid_t
eid
,
BOOL
set_event
,
nsIDOMNode
*
target
,
nsIDOMEvent
*
nsevent
,
IDispatch
*
script_this
)
{
HTMLEventObj
*
event_obj
=
NULL
;
HTMLDOMNode
*
node
;
...
...
@@ -1171,7 +1173,7 @@ void fire_event(HTMLDocumentNode *doc, eventid_t eid, BOOL set_event, nsIDOMNode
}
}
fire_event_obj
(
doc
,
eid
,
event_obj
,
target
);
fire_event_obj
(
doc
,
eid
,
event_obj
,
target
,
script_this
);
if
(
event_obj
)
IHTMLEventObj_Release
(
&
event_obj
->
IHTMLEventObj_iface
);
...
...
@@ -1216,7 +1218,7 @@ 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
);
fire_event_obj
(
node
->
doc
,
eid
,
event_obj
,
node
->
nsnode
,
NULL
);
IHTMLEventObj_Release
(
&
event_obj
->
IHTMLEventObj_iface
);
if
(
FAILED
(
hres
))
...
...
@@ -1227,7 +1229,7 @@ HRESULT dispatch_event(HTMLDOMNode *node, const WCHAR *event_name, VARIANT *even
return
E_NOTIMPL
;
}
fire_event
(
node
->
doc
,
eid
,
TRUE
,
node
->
nsnode
,
NULL
);
fire_event
(
node
->
doc
,
eid
,
TRUE
,
node
->
nsnode
,
NULL
,
NULL
);
}
*
cancelled
=
VARIANT_TRUE
;
/* FIXME */
...
...
@@ -1246,7 +1248,7 @@ HRESULT call_fire_event(HTMLDOMNode *node, eventid_t eid)
return
hres
;
}
fire_event
(
node
->
doc
,
eid
,
TRUE
,
node
->
nsnode
,
NULL
);
fire_event
(
node
->
doc
,
eid
,
TRUE
,
node
->
nsnode
,
NULL
,
NULL
);
return
S_OK
;
}
...
...
dlls/mshtml/htmlevent.h
View file @
4940275d
...
...
@@ -51,7 +51,7 @@ typedef enum {
eventid_t
str_to_eid
(
LPCWSTR
)
DECLSPEC_HIDDEN
;
void
check_event_attr
(
HTMLDocumentNode
*
,
nsIDOMElement
*
)
DECLSPEC_HIDDEN
;
void
release_event_target
(
event_target_t
*
)
DECLSPEC_HIDDEN
;
void
fire_event
(
HTMLDocumentNode
*
,
eventid_t
,
BOOL
,
nsIDOMNode
*
,
nsIDOMEvent
*
)
DECLSPEC_HIDDEN
;
void
fire_event
(
HTMLDocumentNode
*
,
eventid_t
,
BOOL
,
nsIDOMNode
*
,
nsIDOMEvent
*
,
IDispatch
*
)
DECLSPEC_HIDDEN
;
HRESULT
set_event_handler
(
event_target_t
**
,
nsIDOMNode
*
,
HTMLDocumentNode
*
,
eventid_t
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
get_event_handler
(
event_target_t
**
,
eventid_t
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
attach_event
(
event_target_t
**
,
nsIDOMNode
*
,
HTMLDocument
*
,
BSTR
,
IDispatch
*
,
VARIANT_BOOL
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/nsembed.c
View file @
4940275d
...
...
@@ -1418,7 +1418,7 @@ 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
);
fire_event
(
This
->
doc
->
basedoc
.
doc_node
/* FIXME */
,
EVENTID_CONTEXTMENU
,
TRUE
,
aNode
,
aEvent
,
NULL
);
nsres
=
nsIDOMEvent_QueryInterface
(
aEvent
,
&
IID_nsIDOMMouseEvent
,
(
void
**
)
&
event
);
if
(
NS_FAILED
(
nsres
))
{
...
...
dlls/mshtml/nsevents.c
View file @
4940275d
...
...
@@ -269,7 +269,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
nsIDOMHTMLDocument_GetBody
(
doc
->
nsdoc
,
&
nsbody
);
if
(
nsbody
)
{
fire_event
(
doc
,
EVENTID_LOAD
,
TRUE
,
(
nsIDOMNode
*
)
nsbody
,
event
);
fire_event
(
doc
,
EVENTID_LOAD
,
TRUE
,
(
nsIDOMNode
*
)
nsbody
,
event
,
(
IDispatch
*
)
&
doc
->
window
->
base
.
IDispatchEx_iface
);
nsIDOMHTMLElement_Release
(
nsbody
);
}
...
...
@@ -313,7 +313,7 @@ static nsresult NSAPI handle_htmlevent(nsIDOMEventListener *iface, nsIDOMEvent *
return
NS_OK
;
}
fire_event
(
doc
,
eid
,
TRUE
,
nsnode
,
event
);
fire_event
(
doc
,
eid
,
TRUE
,
nsnode
,
event
,
NULL
);
nsIDOMNode_Release
(
nsnode
);
...
...
dlls/mshtml/persist.c
View file @
4940275d
...
...
@@ -409,11 +409,12 @@ void set_ready_state(HTMLOuterWindow *window, READYSTATE readystate)
if
(
window
->
doc_obj
&&
window
->
doc_obj
->
basedoc
.
window
==
window
)
call_property_onchanged
(
&
window
->
doc_obj
->
basedoc
.
cp_propnotif
,
DISPID_READYSTATE
);
fire_event
(
window
->
base
.
inner_window
->
doc
,
EVENTID_READYSTATECHANGE
,
FALSE
,
window
->
base
.
inner_window
->
doc
->
node
.
nsnode
,
NULL
);
fire_event
(
window
->
base
.
inner_window
->
doc
,
EVENTID_READYSTATECHANGE
,
FALSE
,
window
->
base
.
inner_window
->
doc
->
node
.
nsnode
,
NULL
,
NULL
);
if
(
window
->
frame_element
)
fire_event
(
window
->
frame_element
->
element
.
node
.
doc
,
EVENTID_READYSTATECHANGE
,
TRUE
,
window
->
frame_element
->
element
.
node
.
nsnode
,
NULL
);
TRUE
,
window
->
frame_element
->
element
.
node
.
nsnode
,
NULL
,
NULL
);
}
static
HRESULT
get_doc_string
(
HTMLDocumentNode
*
This
,
char
**
str
)
...
...
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