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
cab7ce59
Commit
cab7ce59
authored
Nov 14, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Nov 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Expose IEventTarget on HTMLDocumentObj and forward it to the doc node.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
7359226a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
0 deletions
+69
-0
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
oleobj.c
dlls/mshtml/oleobj.c
+55
-0
doc_with_prop.html
dlls/mshtml/tests/doc_with_prop.html
+3
-0
doc_with_prop_ie9.html
dlls/mshtml/tests/doc_with_prop_ie9.html
+4
-0
events.c
dlls/mshtml/tests/events.c
+0
-0
rsrc.rc
dlls/mshtml/tests/rsrc.rc
+6
-0
No files found.
dlls/mshtml/mshtml_private.h
View file @
cab7ce59
...
...
@@ -677,6 +677,7 @@ struct HTMLDocumentObj {
IObjectSafety
IObjectSafety_iface
;
IServiceProvider
IServiceProvider_iface
;
ITargetContainer
ITargetContainer_iface
;
IEventTarget
IEventTarget_iface
;
IWindowForBindingUI
IWindowForBindingUI_iface
;
...
...
dlls/mshtml/oleobj.c
View file @
cab7ce59
...
...
@@ -3238,6 +3238,52 @@ static const IDocumentRangeVtbl DocObjDocumentRangeVtbl = {
DocObjDocumentRange_createRange
};
/**********************************************************
* IEventTarget implementation
*/
static
inline
HTMLDocumentObj
*
impl_from_IEventTarget
(
IEventTarget
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLDocumentObj
,
IEventTarget_iface
);
}
HTMLDOCUMENTOBJ_IDISPATCH_METHODS
(
EventTarget
)
static
HRESULT
WINAPI
DocObjEventTarget_addEventListener
(
IEventTarget
*
iface
,
BSTR
type
,
IDispatch
*
listener
,
VARIANT_BOOL
capture
)
{
HTMLDocumentObj
*
This
=
impl_from_IEventTarget
(
iface
);
return
IEventTarget_addEventListener
(
&
This
->
doc_node
->
node
.
event_target
.
IEventTarget_iface
,
type
,
listener
,
capture
);
}
static
HRESULT
WINAPI
DocObjEventTarget_removeEventListener
(
IEventTarget
*
iface
,
BSTR
type
,
IDispatch
*
listener
,
VARIANT_BOOL
capture
)
{
HTMLDocumentObj
*
This
=
impl_from_IEventTarget
(
iface
);
return
IEventTarget_removeEventListener
(
&
This
->
doc_node
->
node
.
event_target
.
IEventTarget_iface
,
type
,
listener
,
capture
);
}
static
HRESULT
WINAPI
DocObjEventTarget_dispatchEvent
(
IEventTarget
*
iface
,
IDOMEvent
*
event_iface
,
VARIANT_BOOL
*
result
)
{
HTMLDocumentObj
*
This
=
impl_from_IEventTarget
(
iface
);
return
IEventTarget_dispatchEvent
(
&
This
->
doc_node
->
node
.
event_target
.
IEventTarget_iface
,
event_iface
,
result
);
}
static
const
IEventTargetVtbl
DocObjEventTargetVtbl
=
{
DocObjEventTarget_QueryInterface
,
DocObjEventTarget_AddRef
,
DocObjEventTarget_Release
,
DocObjEventTarget_GetTypeInfoCount
,
DocObjEventTarget_GetTypeInfo
,
DocObjEventTarget_GetIDsOfNames
,
DocObjEventTarget_Invoke
,
DocObjEventTarget_addEventListener
,
DocObjEventTarget_removeEventListener
,
DocObjEventTarget_dispatchEvent
};
static
inline
HTMLDocumentObj
*
impl_from_IUnknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLDocumentObj
,
IUnknown_inner
);
...
...
@@ -3339,6 +3385,14 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii
*
ppv
=
&
This
->
ITargetContainer_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IConnectionPointContainer
,
riid
))
{
*
ppv
=
&
This
->
cp_container
.
IConnectionPointContainer_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IEventTarget
,
riid
))
{
/* IEventTarget is conditionally exposed. This breaks COM rules when
it changes its compat mode, but it is how native works (see tests). */
if
(
!
This
->
doc_node
||
dispex_compat_mode
(
&
This
->
doc_node
->
node
.
event_target
.
dispex
)
<
COMPAT_MODE_IE9
)
{
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
*
ppv
=
&
This
->
IEventTarget_iface
;
}
else
if
(
IsEqualGUID
(
&
CLSID_CMarkup
,
riid
))
{
FIXME
(
"(%p)->(CLSID_CMarkup %p)
\n
"
,
This
,
ppv
);
*
ppv
=
NULL
;
...
...
@@ -3734,6 +3788,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
doc
->
IMarkupContainer_iface
.
lpVtbl
=
&
DocObjMarkupContainerVtbl
;
doc
->
IDisplayServices_iface
.
lpVtbl
=
&
DocObjDisplayServicesVtbl
;
doc
->
IDocumentRange_iface
.
lpVtbl
=
&
DocObjDocumentRangeVtbl
;
doc
->
IEventTarget_iface
.
lpVtbl
=
&
DocObjEventTargetVtbl
;
doc
->
outer_unk
=
outer
?
outer
:
&
doc
->
IUnknown_inner
;
...
...
dlls/mshtml/tests/doc_with_prop.html
0 → 100644
View file @
cab7ce59
<html>
<script
type=
"text/javascript"
>
document
.
prop
=
137
;
</script>
</html>
dlls/mshtml/tests/doc_with_prop_ie9.html
0 → 100644
View file @
cab7ce59
<html><head>
<meta
http-equiv=
"x-ua-compatible"
content=
"IE=9"
/>
<script
type=
"text/javascript"
>
document
.
prop
=
137
;
</script>
</head></html>
dlls/mshtml/tests/events.c
View file @
cab7ce59
This diff is collapsed.
Click to expand it.
dlls/mshtml/tests/rsrc.rc
View file @
cab7ce59
...
...
@@ -73,6 +73,12 @@ blank2.html HTML "blank.html"
/* @makedep: blank.html */
123 HTML "blank.html"
/* @makedep: doc_with_prop.html */
doc_with_prop.html HTML "doc_with_prop.html"
/* @makedep: doc_with_prop_ie9.html */
doc_with_prop_ie9.html HTML "doc_with_prop_ie9.html"
/* For res: protocol test: */
/* @makedep: jstest.html */
...
...
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