mshtml: Initialize attribute object with compatibility mode.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-03-11 20:39:54 +01:00 committed by Alexandre Julliard
parent 131d2d2ef3
commit 5a813f6f6e
1 changed files with 3 additions and 2 deletions

View File

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