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
1366b33c
Commit
1366b33c
authored
Nov 01, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Expose IEventTarget to scripts.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0c0dd3d5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
3 deletions
+67
-3
htmlevent.c
dlls/mshtml/htmlevent.c
+6
-0
htmlnode.c
dlls/mshtml/htmlnode.c
+2
-0
htmlwindow.c
dlls/mshtml/htmlwindow.c
+10
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-0
documentmode.js
dlls/mshtml/tests/documentmode.js
+44
-0
xmlhttprequest.c
dlls/mshtml/xmlhttprequest.c
+3
-2
No files found.
dlls/mshtml/htmlevent.c
View file @
1366b33c
...
...
@@ -2205,6 +2205,12 @@ HRESULT EventTarget_QI(EventTarget *event_target, REFIID riid, void **ppv)
return
E_NOINTERFACE
;
}
void
EventTarget_init_dispex_info
(
dispex_data_t
*
dispex_info
,
compat_mode_t
compat_mode
)
{
if
(
compat_mode
>=
COMPAT_MODE_IE9
)
dispex_info_add_interface
(
dispex_info
,
IEventTarget_tid
,
NULL
);
}
static
int
event_id_cmp
(
const
void
*
key
,
const
struct
wine_rb_entry
*
entry
)
{
return
(
INT_PTR
)
key
-
WINE_RB_ENTRY_VALUE
(
entry
,
listener_container_t
,
entry
)
->
event_id
;
...
...
dlls/mshtml/htmlnode.c
View file @
1366b33c
...
...
@@ -1425,6 +1425,8 @@ void HTMLDOMNode_init_dispex_info(dispex_data_t *info, compat_mode_t mode)
{
if
(
mode
>=
COMPAT_MODE_IE9
)
dispex_info_add_interface
(
info
,
IHTMLDOMNode3_tid
,
NULL
);
EventTarget_init_dispex_info
(
info
,
mode
);
}
static
const
cpc_entry_t
HTMLDOMNode_cpc
[]
=
{{
NULL
}};
...
...
dlls/mshtml/htmlwindow.c
View file @
1366b33c
...
...
@@ -3016,6 +3016,14 @@ static HRESULT HTMLWindow_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD
return
hres
;
}
static
compat_mode_t
HTMLWindow_get_compat_mode
(
DispatchEx
*
dispex
)
{
HTMLInnerWindow
*
This
=
impl_from_DispatchEx
(
dispex
);
This
->
doc
->
document_mode_locked
=
TRUE
;
return
This
->
doc
->
document_mode
;
}
static
void
HTMLWindow_bind_event
(
DispatchEx
*
dispex
,
eventid_t
eid
)
{
HTMLInnerWindow
*
This
=
impl_from_DispatchEx
(
dispex
);
...
...
@@ -3025,6 +3033,7 @@ static void HTMLWindow_bind_event(DispatchEx *dispex, eventid_t eid)
static
void
HTMLWindow_init_dispex_info
(
dispex_data_t
*
info
,
compat_mode_t
compat_mode
)
{
dispex_info_add_interface
(
info
,
IHTMLWindow5_tid
,
NULL
);
EventTarget_init_dispex_info
(
info
,
compat_mode
);
}
static
IHTMLEventObj
*
HTMLWindow_set_current_event
(
DispatchEx
*
dispex
,
IHTMLEventObj
*
event
)
...
...
@@ -3038,7 +3047,7 @@ static const event_target_vtbl_t HTMLWindow_event_target_vtbl = {
NULL
,
NULL
,
HTMLWindow_invoke
,
NULL
,
HTMLWindow_get_compat_mode
,
NULL
},
HTMLWindow_bind_event
,
...
...
dlls/mshtml/mshtml_private.h
View file @
1366b33c
...
...
@@ -129,6 +129,7 @@ typedef struct EventTarget EventTarget;
XIID(IDocumentSelector) \
XIID(IElementSelector) \
XIID(IElementTraversal) \
XIID(IEventTarget) \
XIID(IHTMLAnchorElement) \
XIID(IHTMLAreaElement) \
XIID(IHTMLAttributeCollection) \
...
...
@@ -1041,6 +1042,7 @@ void HTMLFrameBase_Init(HTMLFrameBase*,HTMLDocumentNode*,nsIDOMHTMLElement*,disp
void
EventTarget_Init
(
EventTarget
*
,
IUnknown
*
,
dispex_static_data_t
*
,
compat_mode_t
)
DECLSPEC_HIDDEN
;
HRESULT
EventTarget_QI
(
EventTarget
*
,
REFIID
,
void
**
)
DECLSPEC_HIDDEN
;
void
EventTarget_init_dispex_info
(
dispex_data_t
*
,
compat_mode_t
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLDOMNode_QI
(
HTMLDOMNode
*
,
REFIID
,
void
**
)
DECLSPEC_HIDDEN
;
void
HTMLDOMNode_destructor
(
HTMLDOMNode
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/tests/documentmode.js
View file @
1366b33c
...
...
@@ -38,6 +38,9 @@ function test_elem_props() {
test_exposed
(
"onsubmit"
,
v
>=
9
);
test_exposed
(
"getElementsByClassName"
,
v
>=
9
);
test_exposed
(
"removeAttributeNS"
,
v
>=
9
);
test_exposed
(
"addEventListener"
,
v
>=
9
);
test_exposed
(
"removeEventListener"
,
v
>=
9
);
test_exposed
(
"dispatchEvent"
,
v
>=
9
);
next_test
();
}
...
...
@@ -56,6 +59,9 @@ function test_doc_props() {
test_exposed
(
"prefix"
,
v
>=
9
);
test_exposed
(
"defaultView"
,
v
>=
9
);
test_exposed
(
"head"
,
v
>=
9
);
test_exposed
(
"addEventListener"
,
v
>=
9
);
test_exposed
(
"removeEventListener"
,
v
>=
9
);
test_exposed
(
"dispatchEvent"
,
v
>=
9
);
test_exposed
(
"parentWindow"
,
true
);
if
(
v
>=
9
)
ok
(
document
.
defaultView
===
document
.
parentWindow
,
"defaultView != parentWindow"
);
...
...
@@ -63,6 +69,42 @@ function test_doc_props() {
next_test
();
}
function
test_window_props
()
{
function
test_exposed
(
prop
,
expect
)
{
if
(
expect
)
ok
(
prop
in
window
,
prop
+
" not found in window."
);
else
ok
(
!
(
prop
in
window
),
prop
+
" found in window."
);
}
var
v
=
document
.
documentMode
;
test_exposed
(
"addEventListener"
,
v
>=
9
);
test_exposed
(
"removeEventListener"
,
v
>=
9
);
test_exposed
(
"dispatchEvent"
,
v
>=
9
);
next_test
();
}
function
test_xhr_props
()
{
var
xhr
=
new
XMLHttpRequest
();
function
test_exposed
(
prop
,
expect
)
{
if
(
expect
)
ok
(
prop
in
xhr
,
prop
+
" not found in XMLHttpRequest."
);
else
ok
(
!
(
prop
in
xhr
),
prop
+
" found in XMLHttpRequest."
);
}
var
v
=
document
.
documentMode
;
test_exposed
(
"addEventListener"
,
v
>=
9
);
test_exposed
(
"removeEventListener"
,
v
>=
9
);
test_exposed
(
"dispatchEvent"
,
v
>=
9
);
next_test
();
}
function
test_elem_by_id
()
{
document
.
body
.
innerHTML
=
'<form id="testid" name="testname"></form>'
;
...
...
@@ -156,6 +198,8 @@ var tests = [
test_iframe_doc_mode
,
test_elem_props
,
test_doc_props
,
test_window_props
,
test_xhr_props
,
test_elem_by_id
,
test_conditional_comments
];
dlls/mshtml/xmlhttprequest.c
View file @
1366b33c
...
...
@@ -785,7 +785,8 @@ static const tid_t HTMLXMLHttpRequest_iface_tids[] = {
static
dispex_static_data_t
HTMLXMLHttpRequest_dispex
=
{
&
HTMLXMLHttpRequest_event_target_vtbl
.
dispex_vtbl
,
DispHTMLXMLHttpRequest_tid
,
HTMLXMLHttpRequest_iface_tids
HTMLXMLHttpRequest_iface_tids
,
EventTarget_init_dispex_info
};
...
...
@@ -898,7 +899,7 @@ static HRESULT WINAPI HTMLXMLHttpRequestFactory_create(IHTMLXMLHttpRequestFactor
ret
->
IHTMLXMLHttpRequest_iface
.
lpVtbl
=
&
HTMLXMLHttpRequestVtbl
;
ret
->
IProvideClassInfo2_iface
.
lpVtbl
=
&
ProvideClassInfo2Vtbl
;
EventTarget_Init
(
&
ret
->
event_target
,
(
IUnknown
*
)
&
ret
->
IHTMLXMLHttpRequest_iface
,
&
HTMLXMLHttpRequest_dispex
,
COMPAT_MODE_NONE
);
&
HTMLXMLHttpRequest_dispex
,
This
->
window
->
doc
->
document_mode
);
ret
->
ref
=
1
;
*
p
=
&
ret
->
IHTMLXMLHttpRequest_iface
;
...
...
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