From 667b3f0dff825e38a295dff1b8329fd3467ac436 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 1 Mar 2018 19:17:59 +0100 Subject: [PATCH] mshtml: Use IE8 compatibility mode for documents in standards mode in internet zone. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/mutation.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 555a99bdaf4..1144b473765 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -803,9 +803,27 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface, nsIDOMDocumentType *nsdoctype; nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMDocumentType, (void**)&nsdoctype); if(NS_SUCCEEDED(nsres)) { + compat_mode_t mode = COMPAT_MODE_IE7; + TRACE("doctype node\n"); - /* FIXME: We should set it to something higher for internet zone. */ - set_document_mode(This, COMPAT_MODE_IE7, FALSE); + + if(This->window && This->window->base.outer_window) { + HTMLOuterWindow *window = This->window->base.outer_window; + DWORD zone; + HRESULT hres; + + /* + * Internet URL zone is treated differently. Native defaults to latest supported + * mode. We default to IE8. Ideally, we'd sync that with version used for IE=edge + * X-UA-Compatible version, allow configuration and default to higher version + * (once it's well supported). + */ + hres = IInternetSecurityManager_MapUrlToZone(window->secmgr, window->url, &zone, 0); + if(SUCCEEDED(hres) && zone == URLZONE_INTERNET) + mode = COMPAT_MODE_IE8; + } + + set_document_mode(This, mode, FALSE); nsIDOMDocumentType_Release(nsdoctype); } } -- 2.11.4.GIT