From 5a813f6f6e15bb00dcb64dde7907b08098d52d60 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 11 Mar 2021 20:39:54 +0100 Subject: [PATCH] mshtml: Initialize attribute object with compatibility mode. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/htmlattr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlattr.c b/dlls/mshtml/htmlattr.c index 61c6455027a..8e72c9a8045 100644 --- a/dlls/mshtml/htmlattr.c +++ b/dlls/mshtml/htmlattr.c @@ -497,6 +497,7 @@ HTMLDOMAttribute *unsafe_impl_from_IHTMLDOMAttribute(IHTMLDOMAttribute *iface) HRESULT HTMLDOMAttribute_Create(const WCHAR *name, HTMLElement *elem, DISPID dispid, HTMLDOMAttribute **attr) { + compat_mode_t compat_mode = elem ? dispex_compat_mode(&elem->node.event_target.dispex) : COMPAT_MODE_QUIRKS; HTMLAttributeCollection *col; HTMLDOMAttribute *ret; HRESULT hres; @@ -511,8 +512,8 @@ HRESULT HTMLDOMAttribute_Create(const WCHAR *name, HTMLElement *elem, DISPID dis ret->dispid = dispid; ret->elem = elem; - init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLDOMAttribute_iface, - &HTMLDOMAttribute_dispex); + init_dispex_with_compat_mode(&ret->dispex, (IUnknown*)&ret->IHTMLDOMAttribute_iface, + &HTMLDOMAttribute_dispex, compat_mode); /* For attributes attached to an element, (elem,dispid) pair should be valid used for its operation. */ if(elem) {