Commit 87f7aea1 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Reimplement IHTMLDocument5::get_compatMode based on document mode.

parent 429e0dde
......@@ -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;
TRACE("(%p)->(%p)\n", This, p);
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};
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
TRACE("(%p)->(%p)\n", This, p);
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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment