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
dd78fd09
Commit
dd78fd09
authored
Feb 22, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Set SCRIPTPROP_INVOKEVERSIONING based on document mode value.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
67de587f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
31 deletions
+21
-31
htmldoc.c
dlls/mshtml/htmldoc.c
+2
-3
htmlwindow.c
dlls/mshtml/htmlwindow.c
+1
-3
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-0
mutation.c
dlls/mshtml/mutation.c
+15
-4
script.c
dlls/mshtml/script.c
+1
-21
No files found.
dlls/mshtml/htmldoc.c
View file @
dd78fd09
...
...
@@ -5035,8 +5035,7 @@ static compat_mode_t HTMLDocumentNode_get_compat_mode(DispatchEx *dispex)
TRACE
(
"(%p) returning %u
\n
"
,
This
,
This
->
document_mode
);
This
->
document_mode_locked
=
TRUE
;
return
This
->
document_mode
;
return
lock_document_mode
(
This
);
}
static
nsISupports
*
HTMLDocumentNode_get_gecko_target
(
DispatchEx
*
dispex
)
...
...
@@ -5173,8 +5172,8 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_ob
compat_mode_t
parent_mode
=
window
->
base
.
outer_window
->
parent
->
base
.
inner_window
->
doc
->
document_mode
;
TRACE
(
"parent mode %u
\n
"
,
parent_mode
);
if
(
parent_mode
>=
COMPAT_MODE_IE9
)
{
doc
->
document_mode_locked
=
TRUE
;
doc
->
document_mode
=
parent_mode
;
lock_document_mode
(
doc
);
}
}
...
...
dlls/mshtml/htmlwindow.c
View file @
dd78fd09
...
...
@@ -3019,9 +3019,7 @@ static HRESULT HTMLWindow_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD
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
;
return
lock_document_mode
(
This
->
doc
);
}
static
nsISupports
*
HTMLWindow_get_gecko_target
(
DispatchEx
*
dispex
)
...
...
dlls/mshtml/mshtml_private.h
View file @
dd78fd09
...
...
@@ -898,6 +898,8 @@ void ConnectionPointContainer_Destroy(ConnectionPointContainer*) DECLSPEC_HIDDEN
HRESULT
create_nscontainer
(
HTMLDocumentObj
*
,
NSContainer
**
)
DECLSPEC_HIDDEN
;
void
NSContainer_Release
(
NSContainer
*
)
DECLSPEC_HIDDEN
;
compat_mode_t
lock_document_mode
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
void
init_mutation
(
nsIComponentManager
*
)
DECLSPEC_HIDDEN
;
void
init_document_mutation
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
void
release_document_mutation
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/mutation.c
View file @
dd78fd09
...
...
@@ -362,6 +362,18 @@ static nsresult run_insert_script(HTMLDocumentNode *doc, nsISupports *script_ifa
return
NS_OK
;
}
/*
* We may change document mode only in early stage of document lifetime.
* Later attempts will not have an effect.
*/
compat_mode_t
lock_document_mode
(
HTMLDocumentNode
*
doc
)
{
TRACE
(
"%p: %d
\n
"
,
doc
,
doc
->
document_mode
);
doc
->
document_mode_locked
=
TRUE
;
return
doc
->
document_mode
;
}
static
void
set_document_mode
(
HTMLDocumentNode
*
doc
,
compat_mode_t
document_mode
,
BOOL
lock
)
{
if
(
doc
->
document_mode_locked
)
{
...
...
@@ -371,9 +383,9 @@ static void set_document_mode(HTMLDocumentNode *doc, compat_mode_t document_mode
TRACE
(
"%p: %d
\n
"
,
doc
,
document_mode
);
if
(
lock
)
doc
->
document_mode_locked
=
TRUE
;
doc
->
document_mode
=
document_mode
;
if
(
lock
)
lock_document_mode
(
doc
);
}
static
BOOL
parse_ua_compatible
(
const
WCHAR
*
p
,
compat_mode_t
*
r
)
...
...
@@ -816,8 +828,7 @@ static void NSAPI nsDocumentObserver_AttemptToExecuteScript(nsIDocumentObserver
if
(
NS_SUCCEEDED
(
nsres
))
{
TRACE
(
"script node
\n
"
);
This
->
document_mode_locked
=
TRUE
;
lock_document_mode
(
This
);
add_script_runner
(
This
,
run_insert_script
,
(
nsISupports
*
)
nsscript
,
(
nsISupports
*
)
aParser
);
nsIDOMHTMLScriptElement_Release
(
nsscript
);
}
...
...
dlls/mshtml/script.c
View file @
dd78fd09
...
...
@@ -112,26 +112,6 @@ static void set_script_prop(ScriptHost *script_host, DWORD property, VARIANT *va
WARN
(
"SetProperty(%x) failed: %08x
\n
"
,
property
,
hres
);
}
static
BOOL
is_quirks_mode
(
HTMLDocumentNode
*
doc
)
{
const
WCHAR
*
compat_mode
;
nsAString
nsstr
;
nsresult
nsres
;
BOOL
ret
=
FALSE
;
static
const
WCHAR
BackCompatW
[]
=
{
'B'
,
'a'
,
'c'
,
'k'
,
'C'
,
'o'
,
'm'
,
'p'
,
'a'
,
't'
,
0
};
nsAString_Init
(
&
nsstr
,
NULL
);
nsres
=
nsIDOMHTMLDocument_GetCompatMode
(
doc
->
nsdoc
,
&
nsstr
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString_GetData
(
&
nsstr
,
&
compat_mode
);
if
(
!
strcmpW
(
compat_mode
,
BackCompatW
))
ret
=
TRUE
;
}
nsAString_Finish
(
&
nsstr
);
return
ret
;
}
static
BOOL
init_script_engine
(
ScriptHost
*
script_host
)
{
IObjectSafety
*
safety
;
...
...
@@ -170,7 +150,7 @@ static BOOL init_script_engine(ScriptHost *script_host)
return
FALSE
;
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
is_quirks_mode
(
script_host
->
window
->
doc
)
?
1
:
2
;
V_I4
(
&
var
)
=
lock_document_mode
(
script_host
->
window
->
doc
)
==
COMPAT_MODE_QUIRKS
?
1
:
2
;
set_script_prop
(
script_host
,
SCRIPTPROP_INVOKEVERSIONING
,
&
var
);
V_VT
(
&
var
)
=
VT_BOOL
;
...
...
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