mirror of
https://github.com/reactos/wine.git
synced 2024-11-30 23:20:56 +00:00
mshtml: Reimplement IHTMLDocument5::get_compatMode based on document mode.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
429e0dde69
commit
87f7aea1ca
@ -2947,19 +2947,14 @@ static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface
|
||||
static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p)
|
||||
{
|
||||
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
||||
nsAString mode_str;
|
||||
nsresult nsres;
|
||||
|
||||
static const WCHAR BackCompatW[] = {'B','a','c','k','C','o','m','p','a','t',0};
|
||||
static const WCHAR CSS1CompatW[] = {'C','S','S','1','C','o','m','p','a','t',0};
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!This->doc_node->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsAString_Init(&mode_str, NULL);
|
||||
nsres = nsIDOMHTMLDocument_GetCompatMode(This->doc_node->nsdoc, &mode_str);
|
||||
return return_nsstr(nsres, &mode_str, p);
|
||||
*p = SysAllocString(This->doc_node->document_mode == COMPAT_MODE_QUIRKS ? BackCompatW : CSS1CompatW);
|
||||
return *p ? S_OK : E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {
|
||||
|
@ -29,6 +29,11 @@ function test_doc_mode() {
|
||||
|
||||
ok(opt === document.documentMode, "documentMode = " + document.documentMode);
|
||||
|
||||
if(document.documentMode > 5)
|
||||
ok(document.compatMode === "CSS1Compat", "document.compatMode = " + document.compatMode);
|
||||
else
|
||||
ok(document.compatMode === "BackCompat", "document.compatMode = " + document.compatMode);
|
||||
|
||||
next_test();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user