Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9fd64018
Commit
9fd64018
authored
Apr 29, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Pass proper JSContext to nsIDOMHTMLDocument::Write and Open.
parent
e2791cdf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
htmldoc.c
dlls/mshtml/htmldoc.c
+6
-3
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
mutation.c
dlls/mshtml/mutation.c
+17
-0
No files found.
dlls/mshtml/htmldoc.c
View file @
9fd64018
...
...
@@ -833,6 +833,7 @@ static HRESULT WINAPI HTMLDocument_get_nameProp(IHTMLDocument2 *iface, BSTR *p)
static
HRESULT
document_write
(
HTMLDocument
*
This
,
SAFEARRAY
*
psarray
,
BOOL
ln
)
{
VARIANT
*
var
,
tmp
;
JSContext
*
jsctx
;
nsAString
nsstr
;
ULONG
i
,
argc
;
nsresult
nsres
;
...
...
@@ -859,6 +860,7 @@ static HRESULT document_write(HTMLDocument *This, SAFEARRAY *psarray, BOOL ln)
V_VT
(
&
tmp
)
=
VT_EMPTY
;
jsctx
=
get_context_from_document
(
This
->
doc_node
->
nsdoc
);
argc
=
psarray
->
rgsabound
[
0
].
cElements
;
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
if
(
V_VT
(
var
+
i
)
==
VT_BSTR
)
{
...
...
@@ -873,9 +875,9 @@ static HRESULT document_write(HTMLDocument *This, SAFEARRAY *psarray, BOOL ln)
}
if
(
!
ln
||
i
!=
argc
-
1
)
nsres
=
nsIDOMHTMLDocument_Write
(
This
->
doc_node
->
nsdoc
,
&
nsstr
,
NULL
/* FIXME! */
);
nsres
=
nsIDOMHTMLDocument_Write
(
This
->
doc_node
->
nsdoc
,
&
nsstr
,
jsctx
);
else
nsres
=
nsIDOMHTMLDocument_Writeln
(
This
->
doc_node
->
nsdoc
,
&
nsstr
,
NULL
/* FIXME! */
);
nsres
=
nsIDOMHTMLDocument_Writeln
(
This
->
doc_node
->
nsdoc
,
&
nsstr
,
jsctx
);
nsAString_Finish
(
&
nsstr
);
if
(
V_VT
(
var
+
i
)
!=
VT_BSTR
)
VariantClear
(
&
tmp
);
...
...
@@ -930,7 +932,8 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
||
V_VT
(
&
features
)
!=
VT_ERROR
||
V_VT
(
&
replace
)
!=
VT_ERROR
)
FIXME
(
"unsupported args
\n
"
);
nsres
=
nsIDOMHTMLDocument_Open
(
This
->
doc_node
->
nsdoc
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
&
tmp
);
nsres
=
nsIDOMHTMLDocument_Open
(
This
->
doc_node
->
nsdoc
,
NULL
,
NULL
,
NULL
,
get_context_from_document
(
This
->
doc_node
->
nsdoc
),
0
,
&
tmp
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Open failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
...
...
dlls/mshtml/mshtml_private.h
View file @
9fd64018
...
...
@@ -781,6 +781,7 @@ void NSContainer_Release(NSContainer*) DECLSPEC_HIDDEN;
void
init_mutation
(
nsIComponentManager
*
)
DECLSPEC_HIDDEN
;
void
init_document_mutation
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
void
release_document_mutation
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
JSContext
*
get_context_from_document
(
nsIDOMHTMLDocument
*
)
DECLSPEC_HIDDEN
;
void
HTMLDocument_LockContainer
(
HTMLDocumentObj
*
,
BOOL
)
DECLSPEC_HIDDEN
;
void
show_context_menu
(
HTMLDocumentObj
*
,
DWORD
,
POINT
*
,
IDispatch
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/mutation.c
View file @
9fd64018
...
...
@@ -19,6 +19,7 @@
#include "config.h"
#include <stdarg.h>
#include <assert.h>
#define COBJMACROS
...
...
@@ -775,6 +776,22 @@ void release_document_mutation(HTMLDocumentNode *doc)
nsIDocument_Release
(
nsdoc
);
}
JSContext
*
get_context_from_document
(
nsIDOMHTMLDocument
*
nsdoc
)
{
nsIDocument
*
doc
;
JSContext
*
ctx
;
nsresult
nsres
;
nsres
=
nsIDOMHTMLDocument_QueryInterface
(
nsdoc
,
&
IID_nsIDocument
,
(
void
**
)
&
doc
);
assert
(
nsres
==
NS_OK
);
ctx
=
nsIContentUtils_GetContextFromDocument
(
content_utils
,
doc
);
nsIDocument_Release
(
doc
);
TRACE
(
"ret %p
\n
"
,
ctx
);
return
ctx
;
}
void
init_mutation
(
nsIComponentManager
*
component_manager
)
{
nsIFactory
*
factory
;
...
...
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