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
c3bdda81
Commit
c3bdda81
authored
Sep 24, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use ActiveScript for JavaScript in file protocol documents.
parent
6906c2f1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
2 deletions
+67
-2
htmldoc.c
dlls/mshtml/htmldoc.c
+1
-0
mshtml_private.h
dlls/mshtml/mshtml_private.h
+7
-0
nsiface.idl
dlls/mshtml/nsiface.idl
+1
-0
persist.c
dlls/mshtml/persist.c
+8
-0
script.c
dlls/mshtml/script.c
+50
-2
No files found.
dlls/mshtml/htmldoc.c
View file @
c3bdda81
...
...
@@ -1603,6 +1603,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
ret
->
lpIDispatchExVtbl
=
&
DocDispatchExVtbl
;
ret
->
ref
=
0
;
ret
->
readystate
=
READYSTATE_UNINITIALIZED
;
ret
->
scriptmode
=
SCRIPTMODE_GECKO
;
list_init
(
&
ret
->
bindings
);
list_init
(
&
ret
->
script_hosts
);
...
...
dlls/mshtml/mshtml_private.h
View file @
c3bdda81
...
...
@@ -166,6 +166,11 @@ typedef enum {
EDITMODE
}
USERMODE
;
typedef
enum
{
SCRIPTMODE_GECKO
,
SCRIPTMODE_ACTIVESCRIPT
}
SCRIPTMODE
;
typedef
struct
{
const
IConnectionPointContainerVtbl
*
lpConnectionPointContainerVtbl
;
...
...
@@ -255,6 +260,7 @@ struct HTMLDocument {
DOCHOSTUIINFO
hostinfo
;
USERMODE
usermode
;
SCRIPTMODE
scriptmode
;
READYSTATE
readystate
;
BOOL
in_place_active
;
BOOL
ui_active
;
...
...
@@ -572,6 +578,7 @@ void release_script_hosts(HTMLDocument*);
void
connect_scripts
(
HTMLDocument
*
);
void
doc_insert_script
(
HTMLDocument
*
,
nsIDOMHTMLScriptElement
*
);
IDispatch
*
script_parse_event
(
HTMLDocument
*
,
LPCWSTR
);
void
set_script_mode
(
HTMLDocument
*
,
SCRIPTMODE
);
IHTMLElementCollection
*
create_all_collection
(
HTMLDOMNode
*
);
IHTMLElementCollection
*
create_collection_from_nodelist
(
HTMLDocument
*
,
IUnknown
*
,
nsIDOMNodeList
*
);
...
...
dlls/mshtml/nsiface.idl
View file @
c3bdda81
...
...
@@ -1377,6 +1377,7 @@ interface nsIWebBrowser : nsISupports
nsresult GetContentDOMWindow(nsIDOMWindow **aContentDOMWindow);
}
cpp_quote("#define SETUP_ALLOW_JAVASCRIPT 2")
cpp_quote("#define SETUP_IS_CHROME_WRAPPER 7")
[
...
...
dlls/mshtml/persist.c
View file @
c3bdda81
...
...
@@ -158,6 +158,12 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
return
ret
;
}
static
BOOL
use_gecko_script
(
LPCWSTR
url
)
{
static
const
WCHAR
fileW
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
};
return
strncmpiW
(
fileW
,
url
,
sizeof
(
fileW
)
/
sizeof
(
WCHAR
));
}
void
set_current_mon
(
HTMLDocument
*
This
,
IMoniker
*
mon
)
{
HRESULT
hres
;
...
...
@@ -181,6 +187,8 @@ void set_current_mon(HTMLDocument *This, IMoniker *mon)
hres
=
IMoniker_GetDisplayName
(
mon
,
NULL
,
NULL
,
&
This
->
url
);
if
(
FAILED
(
hres
))
WARN
(
"GetDisplayName failed: %08x
\n
"
,
hres
);
set_script_mode
(
This
,
use_gecko_script
(
This
->
url
)
?
SCRIPTMODE_GECKO
:
SCRIPTMODE_ACTIVESCRIPT
);
}
static
HRESULT
set_moniker
(
HTMLDocument
*
This
,
IMoniker
*
mon
,
IBindCtx
*
pibc
,
BOOL
*
bind_complete
)
...
...
dlls/mshtml/script.c
View file @
c3bdda81
...
...
@@ -712,8 +712,8 @@ static ScriptHost *get_script_host(HTMLDocument *doc, const GUID *guid)
{
ScriptHost
*
iter
;
if
(
IsEqualGUID
(
&
CLSID_JScript
,
guid
)
)
{
FIXM
E
(
"Ignoring JScript
\n
"
);
if
(
IsEqualGUID
(
&
CLSID_JScript
,
&
guid
)
&&
doc
->
scriptmode
!=
SCRIPTMODE_ACTIVESCRIPT
)
{
TRAC
E
(
"Ignoring JScript
\n
"
);
return
NULL
;
}
...
...
@@ -792,6 +792,54 @@ IDispatch *script_parse_event(HTMLDocument *doc, LPCWSTR text)
return
disp
;
}
static
BOOL
is_jscript_available
(
void
)
{
static
BOOL
available
,
checked
;
if
(
!
checked
)
{
IUnknown
*
unk
;
HRESULT
hres
=
CoGetClassObject
(
&
CLSID_JScript
,
CLSCTX_INPROC_SERVER
,
NULL
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
if
(
SUCCEEDED
(
hres
))
{
available
=
TRUE
;
IUnknown_Release
(
unk
);
}
else
{
available
=
FALSE
;
}
checked
=
TRUE
;
}
return
available
;
}
void
set_script_mode
(
HTMLDocument
*
doc
,
SCRIPTMODE
mode
)
{
nsIWebBrowserSetup
*
setup
;
nsresult
nsres
;
if
(
mode
==
SCRIPTMODE_ACTIVESCRIPT
&&
!
is_jscript_available
())
{
TRACE
(
"jscript.dll not available
\n
"
);
doc
->
scriptmode
=
SCRIPTMODE_GECKO
;
return
;
}
doc
->
scriptmode
=
mode
;
if
(
!
doc
->
nscontainer
||
!
doc
->
nscontainer
->
webbrowser
)
return
;
nsres
=
nsIWebBrowser_QueryInterface
(
doc
->
nscontainer
->
webbrowser
,
&
IID_nsIWebBrowserSetup
,
(
void
**
)
&
setup
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsres
=
nsIWebBrowserSetup_SetProperty
(
setup
,
SETUP_ALLOW_JAVASCRIPT
,
doc
->
scriptmode
==
SCRIPTMODE_GECKO
);
nsIWebBrowserSetup_Release
(
setup
);
}
if
(
NS_FAILED
(
nsres
))
ERR
(
"JavaScript setup failed: %08x
\n
"
,
nsres
);
}
void
release_script_hosts
(
HTMLDocument
*
doc
)
{
ScriptHost
*
iter
;
...
...
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