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
bda4b35a
Commit
bda4b35a
authored
Jul 05, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Store compatibility mode provided by meta element.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fc42ccc3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
118 additions
and
6 deletions
+118
-6
mshtml_private.h
dlls/mshtml/mshtml_private.h
+13
-0
mutation.c
dlls/mshtml/mutation.c
+88
-6
nsiface.idl
dlls/mshtml/nsiface.idl
+17
-0
No files found.
dlls/mshtml/mshtml_private.h
View file @
bda4b35a
...
...
@@ -229,6 +229,18 @@ TID_LIST
LAST_tid
}
tid_t
;
typedef
enum
{
COMPAT_MODE_QUIRKS
,
COMPAT_MODE_IE7
,
COMPAT_MODE_IE8
,
COMPAT_MODE_IE9
,
COMPAT_MODE_IE10
,
COMPAT_MODE_IE11
}
compat_mode_t
;
#define COMPAT_MODE_CNT (COMPAT_MODE_IE11+1)
#define COMPAT_MODE_NONE COMPAT_MODE_QUIRKS
typedef
struct
dispex_data_t
dispex_data_t
;
typedef
struct
dispex_dynamic_data_t
dispex_dynamic_data_t
;
...
...
@@ -775,6 +787,7 @@ struct HTMLDocumentNode {
LONG
ref
;
compat_mode_t
document_mode
;
HTMLInnerWindow
*
window
;
nsIDOMHTMLDocument
*
nsdoc
;
...
...
dlls/mshtml/mutation.c
View file @
bda4b35a
...
...
@@ -361,6 +361,79 @@ static nsresult run_insert_script(HTMLDocumentNode *doc, nsISupports *script_ifa
return
NS_OK
;
}
static
void
set_document_mode
(
HTMLDocumentNode
*
doc
,
compat_mode_t
document_mode
)
{
TRACE
(
"%p: %d
\n
"
,
doc
,
document_mode
);
doc
->
document_mode
=
document_mode
;
}
static
BOOL
parse_ua_compatible
(
const
WCHAR
*
p
,
compat_mode_t
*
r
)
{
int
v
=
0
;
if
(
p
[
0
]
!=
'I'
||
p
[
1
]
!=
'E'
||
p
[
2
]
!=
'='
)
return
FALSE
;
p
+=
3
;
while
(
'0'
<=
*
p
&&
*
p
<=
'9'
)
v
=
v
*
10
+
*
(
p
++
)
-
'0'
;
if
(
*
p
||
!
v
)
return
FALSE
;
switch
(
v
){
case
7
:
*
r
=
COMPAT_MODE_IE7
;
break
;
case
8
:
*
r
=
COMPAT_MODE_IE8
;
break
;
case
9
:
*
r
=
COMPAT_MODE_IE9
;
break
;
case
10
:
*
r
=
COMPAT_MODE_IE10
;
break
;
default:
*
r
=
v
<
7
?
COMPAT_MODE_QUIRKS
:
COMPAT_MODE_IE11
;
}
return
TRUE
;
}
static
void
process_meta_element
(
HTMLDocumentNode
*
doc
,
nsIDOMHTMLMetaElement
*
meta_element
)
{
nsAString
http_equiv_str
,
content_str
;
nsresult
nsres
;
static
const
WCHAR
x_ua_compatibleW
[]
=
{
'x'
,
'-'
,
'u'
,
'a'
,
'-'
,
'c'
,
'o'
,
'm'
,
'p'
,
'a'
,
't'
,
'i'
,
'b'
,
'l'
,
'e'
,
0
};
nsAString_Init
(
&
http_equiv_str
,
NULL
);
nsAString_Init
(
&
content_str
,
NULL
);
nsres
=
nsIDOMHTMLMetaElement_GetHttpEquiv
(
meta_element
,
&
http_equiv_str
);
if
(
NS_SUCCEEDED
(
nsres
))
nsres
=
nsIDOMHTMLMetaElement_GetContent
(
meta_element
,
&
content_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
const
PRUnichar
*
http_equiv
,
*
content
;
nsAString_GetData
(
&
http_equiv_str
,
&
http_equiv
);
nsAString_GetData
(
&
content_str
,
&
content
);
TRACE
(
"%s: %s
\n
"
,
debugstr_w
(
http_equiv
),
debugstr_w
(
content
));
if
(
!
strcmpiW
(
http_equiv
,
x_ua_compatibleW
))
{
compat_mode_t
document_mode
;
if
(
parse_ua_compatible
(
content
,
&
document_mode
))
set_document_mode
(
doc
,
document_mode
);
else
FIXME
(
"Unsupported document mode %s
\n
"
,
debugstr_w
(
content
));
}
}
nsAString_Finish
(
&
http_equiv_str
);
nsAString_Finish
(
&
content_str
);
}
typedef
struct
nsRunnable
nsRunnable
;
typedef
nsresult
(
*
runnable_proc_t
)(
HTMLDocumentNode
*
,
nsISupports
*
,
nsISupports
*
);
...
...
@@ -640,18 +713,13 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
nsIDOMHTMLIFrameElement
*
nsiframe
;
nsIDOMHTMLFrameElement
*
nsframe
;
nsIDOMHTMLScriptElement
*
nsscript
;
nsIDOMHTMLMetaElement
*
nsmeta
;
nsIDOMHTMLElement
*
nselem
;
nsIDOMComment
*
nscomment
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
aDocument
,
aContent
);
nsres
=
nsIContent_QueryInterface
(
aContent
,
&
IID_nsIDOMHTMLElement
,
(
void
**
)
&
nselem
);
if
(
NS_SUCCEEDED
(
nsres
))
{
check_event_attr
(
This
,
nselem
);
nsIDOMHTMLElement_Release
(
nselem
);
}
nsres
=
nsIContent_QueryInterface
(
aContent
,
&
IID_nsIDOMComment
,
(
void
**
)
&
nscomment
);
if
(
NS_SUCCEEDED
(
nsres
))
{
TRACE
(
"comment node
\n
"
);
...
...
@@ -661,6 +729,13 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
return
;
}
nsres
=
nsIContent_QueryInterface
(
aContent
,
&
IID_nsIDOMHTMLElement
,
(
void
**
)
&
nselem
);
if
(
NS_FAILED
(
nsres
))
return
;
check_event_attr
(
This
,
nselem
);
nsIDOMHTMLElement_Release
(
nselem
);
nsres
=
nsIContent_QueryInterface
(
aContent
,
&
IID_nsIDOMHTMLIFrameElement
,
(
void
**
)
&
nsiframe
);
if
(
NS_SUCCEEDED
(
nsres
))
{
TRACE
(
"iframe node
\n
"
);
...
...
@@ -695,6 +770,13 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
add_script_runner
(
This
,
run_insert_script
,
(
nsISupports
*
)
nsscript
,
NULL
);
IHTMLScriptElement_Release
(
&
script_elem
->
IHTMLScriptElement_iface
);
return
;
}
nsres
=
nsIContent_QueryInterface
(
aContent
,
&
IID_nsIDOMHTMLMetaElement
,
(
void
**
)
&
nsmeta
);
if
(
NS_SUCCEEDED
(
nsres
))
{
process_meta_element
(
This
,
nsmeta
);
nsIDOMHTMLMetaElement_Release
(
nsmeta
);
}
}
...
...
dlls/mshtml/nsiface.idl
View file @
bda4b35a
...
...
@@ -1146,6 +1146,23 @@ interface nsIDOMHTMLHeadElement : nsISupports
[
object,
uuid(2a3f789e-0667-464f-a8d7-6f58513443d9),
local
]
interface nsIDOMHTMLMetaElement : nsISupports
{
nsresult GetContent(nsAString *aContent);
nsresult SetContent(const nsAString *aContent);
nsresult GetHttpEquiv(nsAString *aHttpEquiv);
nsresult SetHttpEquiv(const nsAString *aHttpEquiv);
nsresult GetName(nsAString *aName);
nsresult SetName(const nsAString *aName);
nsresult GetScheme(nsAString *aScheme);
nsresult SetScheme(const nsAString *aScheme);
}
[
object,
uuid(4109a2d2-e7af-445d-bb72-c7c9b875f35e),
local
]
...
...
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