Module: wine Branch: master Commit: ef5fe7386039202259f08aceb27e88b6e9ebf0d7 URL: https://gitlab.winehq.org/wine/wine/-/commit/ef5fe7386039202259f08aceb27e88b...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Jul 11 14:05:27 2024 +0200
mshtml: Use host object script bindings for Attr class.
---
dlls/mshtml/htmlattr.c | 6 ++++-- dlls/mshtml/htmldoc.c | 2 +- dlls/mshtml/htmlelem.c | 2 +- dlls/mshtml/mshtml_private.h | 2 +- dlls/mshtml/tests/documentmode.js | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/htmlattr.c b/dlls/mshtml/htmlattr.c index b9d3f82e84c..4f58926d237 100644 --- a/dlls/mshtml/htmlattr.c +++ b/dlls/mshtml/htmlattr.c @@ -422,7 +422,8 @@ HTMLDOMAttribute *unsafe_impl_from_IHTMLDOMAttribute(IHTMLDOMAttribute *iface) return iface->lpVtbl == &HTMLDOMAttributeVtbl ? impl_from_IHTMLDOMAttribute(iface) : NULL; }
-HRESULT HTMLDOMAttribute_Create(const WCHAR *name, HTMLElement *elem, DISPID dispid, compat_mode_t compat_mode, HTMLDOMAttribute **attr) +HRESULT HTMLDOMAttribute_Create(const WCHAR *name, HTMLElement *elem, DISPID dispid, + HTMLDocumentNode *doc, HTMLDOMAttribute **attr) { HTMLAttributeCollection *col; HTMLDOMAttribute *ret; @@ -437,7 +438,8 @@ HRESULT HTMLDOMAttribute_Create(const WCHAR *name, HTMLElement *elem, DISPID dis ret->dispid = dispid; ret->elem = elem;
- init_dispatch(&ret->dispex, &HTMLDOMAttribute_dispex, NULL, compat_mode); + init_dispatch(&ret->dispex, &HTMLDOMAttribute_dispex, doc->script_global, + dispex_compat_mode(&doc->script_global->event_target.dispex));
/* For attributes attached to an element, (elem,dispid) pair should be valid used for its operation. */ if(elem) { diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 0ed6b1d6710..ca76318c1b3 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -3015,7 +3015,7 @@ static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
- hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, dispex_compat_mode(&This->node.event_target.dispex), &attr); + hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, This, &attr); if(FAILED(hres)) return hres;
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 581b50ee822..470b718523b 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -7615,7 +7615,7 @@ static inline HRESULT get_domattr(HTMLAttributeCollection *This, DISPID id, LONG }
if(!*attr) { - hres = HTMLDOMAttribute_Create(NULL, This->elem, id, dispex_compat_mode(&This->elem->node.event_target.dispex), attr); + hres = HTMLDOMAttribute_Create(NULL, This->elem, id, This->elem->node.doc, attr); if(FAILED(hres)) return hres; } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index e41b4fd592c..2bd0887d735 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1208,7 +1208,7 @@ typedef struct {
HTMLDOMAttribute *unsafe_impl_from_IHTMLDOMAttribute(IHTMLDOMAttribute*);
-HRESULT HTMLDOMAttribute_Create(const WCHAR*,HTMLElement*,DISPID,compat_mode_t,HTMLDOMAttribute**); +HRESULT HTMLDOMAttribute_Create(const WCHAR*,HTMLElement*,DISPID,HTMLDocumentNode*,HTMLDOMAttribute**);
HRESULT HTMLElement_Create(HTMLDocumentNode*,nsIDOMNode*,BOOL,HTMLElement**); HRESULT HTMLCommentElement_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLElement**); diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 3d592e9c47d..2fd940737c9 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -292,7 +292,7 @@ sync_test("builtin_toString", function() { } if(!localStorage) win_skip("localStorage is buggy and not available, skipping");
- test("attribute", document.createAttribute("class"), "Attr", null, true); + test("attribute", document.createAttribute("class"), "Attr"); if(false /* todo_wine */) test("attributes", e.attributes, "NamedNodeMap"); test("childNodes", document.body.childNodes, "NodeList", null, true); if(clientRects) test("clientRect", clientRects[0], "ClientRect", null, true);