Commit 2dcb37e5 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use nsIDOMWindowCollection::NamedItem in get_window_by_name.

parent a5354174
......@@ -360,6 +360,8 @@ HRESULT get_frame_by_name(HTMLOuterWindow *This, const WCHAR *name, BOOL deep, H
{
nsIDOMWindowCollection *nsframes;
HTMLOuterWindow *window = NULL;
nsIDOMWindow *nswindow;
nsAString name_str;
PRUint32 length, i;
nsresult nsres;
HRESULT hres = S_OK;
......@@ -370,12 +372,24 @@ HRESULT get_frame_by_name(HTMLOuterWindow *This, const WCHAR *name, BOOL deep, H
return E_FAIL;
}
nsAString_InitDepend(&name_str, name);
nsres = nsIDOMWindowCollection_NamedItem(nsframes, &name_str, &nswindow);
nsAString_Finish(&name_str);
if(NS_FAILED(nsres)) {
nsIDOMWindowCollection_Release(nsframes);
return E_FAIL;
}
if(nswindow) {
*ret = nswindow_to_window(nswindow);
return S_OK;
}
nsres = nsIDOMWindowCollection_GetLength(nsframes, &length);
assert(nsres == NS_OK);
for(i = 0; i < length && !window; ++i) {
HTMLOuterWindow *window_iter;
nsIDOMWindow *nswindow;
BSTR id;
nsres = nsIDOMWindowCollection_Item(nsframes, i, &nswindow);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment