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
361f9a30
Commit
361f9a30
authored
Oct 27, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Moved event_vector to HTMLDocumentNode.
parent
d52f41ba
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
20 deletions
+21
-20
htmldoc.c
dlls/mshtml/htmldoc.c
+1
-0
htmlevent.c
dlls/mshtml/htmlevent.c
+12
-11
htmlevent.h
dlls/mshtml/htmlevent.h
+3
-3
htmlwindow.c
dlls/mshtml/htmlwindow.c
+0
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-2
nsevents.c
dlls/mshtml/nsevents.c
+3
-3
No files found.
dlls/mshtml/htmldoc.c
View file @
361f9a30
...
@@ -1777,6 +1777,7 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
...
@@ -1777,6 +1777,7 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
nsIDOMHTMLDocument_Release
(
This
->
nsdoc
);
nsIDOMHTMLDocument_Release
(
This
->
nsdoc
);
}
}
heap_free
(
This
->
event_vector
);
destroy_htmldoc
(
&
This
->
basedoc
);
destroy_htmldoc
(
&
This
->
basedoc
);
}
}
...
...
dlls/mshtml/htmlevent.c
View file @
361f9a30
...
@@ -921,7 +921,8 @@ static BOOL alloc_handler_vector(event_target_t *event_target, eventid_t eid, in
...
@@ -921,7 +921,8 @@ static BOOL alloc_handler_vector(event_target_t *event_target, eventid_t eid, in
return
TRUE
;
return
TRUE
;
}
}
static
HRESULT
set_event_handler_disp
(
event_target_t
**
event_target_ptr
,
HTMLWindow
*
window
,
eventid_t
eid
,
IDispatch
*
disp
)
static
HRESULT
set_event_handler_disp
(
event_target_t
**
event_target_ptr
,
HTMLDocumentNode
*
doc
,
eventid_t
eid
,
IDispatch
*
disp
)
{
{
event_target_t
*
event_target
;
event_target_t
*
event_target
;
...
@@ -940,23 +941,23 @@ static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLWin
...
@@ -940,23 +941,23 @@ static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLWin
return
S_OK
;
return
S_OK
;
IDispatch_AddRef
(
disp
);
IDispatch_AddRef
(
disp
);
if
(
window
->
nswindow
&&
(
event_info
[
eid
].
flags
&
EVENT_DEFAULTLISTENER
))
{
if
(
doc
->
nsdoc
&&
(
event_info
[
eid
].
flags
&
EVENT_DEFAULTLISTENER
))
{
if
(
!
window
->
event_vector
)
{
if
(
!
doc
->
event_vector
)
{
window
->
event_vector
=
heap_alloc_zero
(
EVENTID_LAST
*
sizeof
(
BOOL
));
doc
->
event_vector
=
heap_alloc_zero
(
EVENTID_LAST
*
sizeof
(
BOOL
));
if
(
!
window
->
event_vector
)
if
(
!
doc
->
event_vector
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
if
(
!
window
->
event_vector
[
eid
])
{
if
(
!
doc
->
event_vector
[
eid
])
{
window
->
event_vector
[
eid
]
=
TRUE
;
doc
->
event_vector
[
eid
]
=
TRUE
;
add_nsevent_listener
(
window
,
event_info
[
eid
].
name
);
add_nsevent_listener
(
doc
,
event_info
[
eid
].
name
);
}
}
}
}
return
S_OK
;
return
S_OK
;
}
}
HRESULT
set_event_handler
(
event_target_t
**
event_target
,
HTMLDocument
*
doc
,
eventid_t
eid
,
VARIANT
*
var
)
HRESULT
set_event_handler
(
event_target_t
**
event_target
,
HTMLDocument
Node
*
doc
,
eventid_t
eid
,
VARIANT
*
var
)
{
{
switch
(
V_VT
(
var
))
{
switch
(
V_VT
(
var
))
{
case
VT_NULL
:
case
VT_NULL
:
...
@@ -967,7 +968,7 @@ HRESULT set_event_handler(event_target_t **event_target, HTMLDocument *doc, even
...
@@ -967,7 +968,7 @@ HRESULT set_event_handler(event_target_t **event_target, HTMLDocument *doc, even
break
;
break
;
case
VT_DISPATCH
:
case
VT_DISPATCH
:
return
set_event_handler_disp
(
event_target
,
doc
->
window
,
eid
,
V_DISPATCH
(
var
));
return
set_event_handler_disp
(
event_target
,
doc
,
eid
,
V_DISPATCH
(
var
));
default:
default:
FIXME
(
"not supported vt=%d
\n
"
,
V_VT
(
var
));
FIXME
(
"not supported vt=%d
\n
"
,
V_VT
(
var
));
...
@@ -1048,7 +1049,7 @@ void check_event_attr(HTMLDocumentNode *doc, nsIDOMElement *nselem)
...
@@ -1048,7 +1049,7 @@ void check_event_attr(HTMLDocumentNode *doc, nsIDOMElement *nselem)
disp
=
script_parse_event
(
doc
->
basedoc
.
window
,
attr_value
);
disp
=
script_parse_event
(
doc
->
basedoc
.
window
,
attr_value
);
if
(
disp
)
{
if
(
disp
)
{
node
=
get_node
(
doc
,
(
nsIDOMNode
*
)
nselem
,
TRUE
);
node
=
get_node
(
doc
,
(
nsIDOMNode
*
)
nselem
,
TRUE
);
set_event_handler_disp
(
get_node_event_target
(
node
),
node
->
doc
->
basedoc
.
window
,
i
,
disp
);
set_event_handler_disp
(
get_node_event_target
(
node
),
node
->
doc
,
i
,
disp
);
IDispatch_Release
(
disp
);
IDispatch_Release
(
disp
);
}
}
}
}
...
...
dlls/mshtml/htmlevent.h
View file @
361f9a30
...
@@ -42,7 +42,7 @@ eventid_t str_to_eid(LPCWSTR);
...
@@ -42,7 +42,7 @@ eventid_t str_to_eid(LPCWSTR);
void
check_event_attr
(
HTMLDocumentNode
*
,
nsIDOMElement
*
);
void
check_event_attr
(
HTMLDocumentNode
*
,
nsIDOMElement
*
);
void
release_event_target
(
event_target_t
*
);
void
release_event_target
(
event_target_t
*
);
void
fire_event
(
HTMLDocumentNode
*
,
eventid_t
,
nsIDOMNode
*
,
nsIDOMEvent
*
);
void
fire_event
(
HTMLDocumentNode
*
,
eventid_t
,
nsIDOMNode
*
,
nsIDOMEvent
*
);
HRESULT
set_event_handler
(
event_target_t
**
,
HTMLDocument
*
,
eventid_t
,
VARIANT
*
);
HRESULT
set_event_handler
(
event_target_t
**
,
HTMLDocument
Node
*
,
eventid_t
,
VARIANT
*
);
HRESULT
get_event_handler
(
event_target_t
**
,
eventid_t
,
VARIANT
*
);
HRESULT
get_event_handler
(
event_target_t
**
,
eventid_t
,
VARIANT
*
);
HRESULT
attach_event
(
event_target_t
**
,
HTMLDocument
*
,
BSTR
,
IDispatch
*
,
VARIANT_BOOL
*
);
HRESULT
attach_event
(
event_target_t
**
,
HTMLDocument
*
,
BSTR
,
IDispatch
*
,
VARIANT_BOOL
*
);
HRESULT
dispatch_event
(
HTMLDOMNode
*
,
const
WCHAR
*
,
VARIANT
*
,
VARIANT_BOOL
*
);
HRESULT
dispatch_event
(
HTMLDOMNode
*
,
const
WCHAR
*
,
VARIANT
*
,
VARIANT_BOOL
*
);
...
@@ -55,7 +55,7 @@ static inline event_target_t **get_node_event_target(HTMLDOMNode *node)
...
@@ -55,7 +55,7 @@ static inline event_target_t **get_node_event_target(HTMLDOMNode *node)
static
inline
HRESULT
set_node_event
(
HTMLDOMNode
*
node
,
eventid_t
eid
,
VARIANT
*
var
)
static
inline
HRESULT
set_node_event
(
HTMLDOMNode
*
node
,
eventid_t
eid
,
VARIANT
*
var
)
{
{
return
set_event_handler
(
get_node_event_target
(
node
),
&
node
->
doc
->
base
doc
,
eid
,
var
);
return
set_event_handler
(
get_node_event_target
(
node
),
node
->
doc
,
eid
,
var
);
}
}
static
inline
HRESULT
get_node_event
(
HTMLDOMNode
*
node
,
eventid_t
eid
,
VARIANT
*
var
)
static
inline
HRESULT
get_node_event
(
HTMLDOMNode
*
node
,
eventid_t
eid
,
VARIANT
*
var
)
...
@@ -75,7 +75,7 @@ static inline HRESULT get_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *v
...
@@ -75,7 +75,7 @@ static inline HRESULT get_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *v
static
inline
HRESULT
set_window_event
(
HTMLWindow
*
window
,
eventid_t
eid
,
VARIANT
*
var
)
static
inline
HRESULT
set_window_event
(
HTMLWindow
*
window
,
eventid_t
eid
,
VARIANT
*
var
)
{
{
return
set_event_handler
(
&
window
->
event_target
,
&
window
->
doc_obj
->
base
doc
,
eid
,
var
);
return
set_event_handler
(
&
window
->
event_target
,
window
->
doc
,
eid
,
var
);
}
}
static
inline
HRESULT
get_window_event
(
HTMLWindow
*
window
,
eventid_t
eid
,
VARIANT
*
var
)
static
inline
HRESULT
get_window_event
(
HTMLWindow
*
window
,
eventid_t
eid
,
VARIANT
*
var
)
...
...
dlls/mshtml/htmlwindow.c
View file @
361f9a30
...
@@ -189,7 +189,6 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
...
@@ -189,7 +189,6 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
windowref_release
(
This
->
window_ref
);
windowref_release
(
This
->
window_ref
);
heap_free
(
This
->
global_props
);
heap_free
(
This
->
global_props
);
heap_free
(
This
->
event_vector
);
release_script_hosts
(
This
);
release_script_hosts
(
This
);
list_remove
(
&
This
->
entry
);
list_remove
(
&
This
->
entry
);
release_dispex
(
&
This
->
dispex
);
release_dispex
(
&
This
->
dispex
);
...
...
dlls/mshtml/mshtml_private.h
View file @
361f9a30
...
@@ -226,7 +226,6 @@ struct HTMLWindow {
...
@@ -226,7 +226,6 @@ struct HTMLWindow {
event_target_t
*
event_target
;
event_target_t
*
event_target
;
IHTMLEventObj
*
event
;
IHTMLEventObj
*
event
;
BOOL
*
event_vector
;
SCRIPTMODE
scriptmode
;
SCRIPTMODE
scriptmode
;
struct
list
script_hosts
;
struct
list
script_hosts
;
...
@@ -487,6 +486,7 @@ struct HTMLDocumentNode {
...
@@ -487,6 +486,7 @@ struct HTMLDocumentNode {
IInternetSecurityManager
*
secmgr
;
IInternetSecurityManager
*
secmgr
;
nsDocumentEventListener
*
nsevent_listener
;
nsDocumentEventListener
*
nsevent_listener
;
BOOL
*
event_vector
;
mutation_queue_t
*
mutation_queue
;
mutation_queue_t
*
mutation_queue
;
mutation_queue_t
*
mutation_queue_tail
;
mutation_queue_t
*
mutation_queue_tail
;
...
@@ -652,7 +652,7 @@ nsresult get_nsinterface(nsISupports*,REFIID,void**);
...
@@ -652,7 +652,7 @@ nsresult get_nsinterface(nsISupports*,REFIID,void**);
void
init_nsevents
(
HTMLDocumentNode
*
);
void
init_nsevents
(
HTMLDocumentNode
*
);
void
release_nsevents
(
HTMLDocumentNode
*
);
void
release_nsevents
(
HTMLDocumentNode
*
);
void
add_nsevent_listener
(
HTML
Window
*
,
LPCWSTR
);
void
add_nsevent_listener
(
HTML
DocumentNode
*
,
LPCWSTR
);
void
set_window_bscallback
(
HTMLWindow
*
,
nsChannelBSC
*
);
void
set_window_bscallback
(
HTMLWindow
*
,
nsChannelBSC
*
);
void
set_current_mon
(
HTMLWindow
*
,
IMoniker
*
);
void
set_current_mon
(
HTMLWindow
*
,
IMoniker
*
);
...
...
dlls/mshtml/nsevents.c
View file @
361f9a30
...
@@ -282,18 +282,18 @@ static void init_listener(nsEventListener *This, nsDocumentEventListener *listen
...
@@ -282,18 +282,18 @@ static void init_listener(nsEventListener *This, nsDocumentEventListener *listen
This
->
This
=
listener
;
This
->
This
=
listener
;
}
}
void
add_nsevent_listener
(
HTML
Window
*
window
,
LPCWSTR
type
)
void
add_nsevent_listener
(
HTML
DocumentNode
*
doc
,
LPCWSTR
type
)
{
{
nsIDOMEventTarget
*
target
;
nsIDOMEventTarget
*
target
;
nsresult
nsres
;
nsresult
nsres
;
nsres
=
nsIDOMWindow_QueryInterface
(
window
->
nswindow
,
&
IID_nsIDOMEventTarget
,
(
void
**
)
&
target
);
nsres
=
nsIDOMWindow_QueryInterface
(
doc
->
basedoc
.
window
->
nswindow
,
&
IID_nsIDOMEventTarget
,
(
void
**
)
&
target
);
if
(
NS_FAILED
(
nsres
))
{
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMEventTarget interface: %08x
\n
"
,
nsres
);
ERR
(
"Could not get nsIDOMEventTarget interface: %08x
\n
"
,
nsres
);
return
;
return
;
}
}
init_event
(
target
,
type
,
NSEVENTLIST
(
&
window
->
doc
->
nsevent_listener
->
htmlevent_listener
),
TRUE
);
init_event
(
target
,
type
,
NSEVENTLIST
(
&
doc
->
nsevent_listener
->
htmlevent_listener
),
TRUE
);
nsIDOMEventTarget_Release
(
target
);
nsIDOMEventTarget_Release
(
target
);
}
}
...
...
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