Module: wine Branch: master Commit: 847a743f2ce36f347999940bbc410665ee6df0d7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=847a743f2ce36f347999940bbc...
Author: Jacek Caban jacek@codeweavers.com Date: Sun Nov 1 19:20:53 2009 +0100
mshtml: Added fdexNameCaseInsensitive support.
---
dlls/mshtml/dispex.c | 14 ++++++++------ dlls/mshtml/tests/dom.c | 5 +++-- 2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index a8ce088..0a0f6c6 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -368,11 +368,13 @@ static inline dispex_dynamic_data_t *get_dynamic_data(DispatchEx *This, BOOL all : (This->dynamic_data = heap_alloc_zero(sizeof(dispex_dynamic_data_t))); }
-static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, BOOL alloc, dynamic_prop_t **ret) +static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, DWORD flags, dynamic_prop_t **ret) { - dispex_dynamic_data_t *data = get_dynamic_data(This, alloc); + const BOOL alloc = flags & fdexNameEnsure; + dispex_dynamic_data_t *data; unsigned i;
+ data = get_dynamic_data(This, alloc); if(!data) { if(alloc) return E_OUTOFMEMORY; @@ -382,7 +384,7 @@ static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, BOOL alloc, }
for(i=0; i < data->prop_cnt; i++) { - if(!strcmpW(data->props[i].name, name)) { + if(flags & fdexNameCaseInsensitive ? !strcmpiW(data->props[i].name, name) : !strcmpW(data->props[i].name, name)) { *ret = data->props+i; return S_OK; } @@ -418,7 +420,7 @@ HRESULT dispex_get_dprop_ref(DispatchEx *This, const WCHAR *name, BOOL alloc, VA dynamic_prop_t *prop; HRESULT hres;
- hres = get_dynamic_prop(This, name, alloc, &prop); + hres = get_dynamic_prop(This, name, alloc ? fdexNameEnsure : 0, &prop); if(FAILED(hres)) return hres;
@@ -746,7 +748,7 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
- if(grfdex & ~(fdexNameCaseSensitive|fdexNameEnsure|fdexNameImplicit|FDEX_VERSION_MASK)) + if(grfdex & ~(fdexNameCaseSensitive|fdexNameCaseInsensitive|fdexNameEnsure|fdexNameImplicit|FDEX_VERSION_MASK)) FIXME("Unsupported grfdex %x\n", grfdex);
data = get_dispex_data(This); @@ -782,7 +784,7 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW return hres; }
- hres = get_dynamic_prop(This, bstrName, grfdex&fdexNameEnsure, &dprop); + hres = get_dynamic_prop(This, bstrName, grfdex, &dprop); if(FAILED(hres)) return hres;
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index be3022b..97ad221 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -939,8 +939,9 @@ static void test_get_set_attr(IHTMLDocument2 *doc) bstr = a2bstr("newattribute"); hres = IHTMLElement_getAttribute(elem, bstr, 0, &val); ok(hres == S_OK, "getAttribute failed: %08x\n", hres); - todo_wine ok(V_VT(&val) == VT_BOOL, "variant type should have been VT_BOOL (0x%x), was: 0x%x\n", VT_BOOL, V_VT(&val)); - todo_wine ok(V_BOOL(&val) == VARIANT_TRUE, "variant value should have been VARIANT_TRUE (0x%x), was %d\n", VARIANT_TRUE, V_BOOL(&val)); + ok(V_VT(&val) == VT_BOOL, "variant type should have been VT_BOOL (0x%x), was: 0x%x\n", VT_BOOL, V_VT(&val)); + ok(V_BOOL(&val) == VARIANT_TRUE, "variant value should have been VARIANT_TRUE (0x%x), was %d\n", + VARIANT_TRUE, V_BOOL(&val)); VariantClear(&val); SysFreeString(bstr);