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:
Jacek Caban 2016-07-05 22:48:04 +02:00 committed by Alexandre Julliard
parent 429e0dde69
commit 87f7aea1ca
2 changed files with 10 additions and 10 deletions

View File

@ -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 = {

View File

@ -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();
}