On 10/11/2021 17:29, Jacek Caban wrote:
Hi Gabriel,
On 11/9/21 10:00 PM, Gabriel Ivăncescu wrote:
--- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -6516,7 +6516,10 @@ static HRESULT HTMLElement_populate_props(DispatchEx *dispex) } else V_BSTR(&value) = NULL; - IHTMLElement_setAttribute(&This->IHTMLElement_iface, name, value, 0); + hres = IDispatchEx_GetDispID(&dispex->IDispatchEx_iface, name, fdexNameEnsure | fdexNameCaseInsensitive, &id); + if(SUCCEEDED(hres)) + set_elem_attr_value_by_dispid(This, id, &value);
While this is probably the right thing for compat modes <IE9, later modes should not really need it. They should not expose attributes as JS properties, see the attached test. I think that entire HTMLElement_populate_props should be no-op on IE9+. That means that current attributes collection will not work for those cases, but AFICS it's already broken. The right fix for attributes collection would be to have its variant based on something like nsIDOMMozNamedAttrMap.
Thanks,
Jacek
Ah, thanks for noticing, I'll just exit early on IE9+ then. This gives me more reasons to attempt to fix it at some point since already had the issue with toString exposed as an attribute...